Skip to content

Commit 7a09394

Browse files
authored
Merge pull request #33 from icon-project/feat/custom-network
feat(stacks): add custom network configuration
2 parents e2a0f49 + 64f4539 commit 7a09394

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pkg/stacks/network.go

+16
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@ func NewStacksTestnet() *StacksNetwork {
2727
}
2828
}
2929

30+
func NewStacksLocalnet() *StacksNetwork {
31+
return &StacksNetwork{
32+
CoreAPIURL: "http://localhost:3999", // Default Stacks local node API port
33+
Version: TransactionVersionTestnet,
34+
ChainID: ChainIDTestnet,
35+
}
36+
}
37+
38+
func NewStacksCustomNetwork(coreAPIURL string, version TransactionVersion, chainID ChainID) *StacksNetwork {
39+
return &StacksNetwork{
40+
CoreAPIURL: coreAPIURL,
41+
Version: version,
42+
ChainID: chainID,
43+
}
44+
}
45+
3046
func (n *StacksNetwork) GetAccountAPIURL(address string) string {
3147
return fmt.Sprintf("%s/v2/accounts/%s?proof=0", n.CoreAPIURL, address)
3248
}

0 commit comments

Comments
 (0)