Update project structure and build process

This commit is contained in:
Juan Pablo Civile
2025-05-13 11:10:08 -03:00
parent 124e9fa1bc
commit d9f3e925a4
277 changed files with 15321 additions and 930 deletions

35
libwallet/network.go Executable file
View File

@@ -0,0 +1,35 @@
package libwallet
import (
"github.com/btcsuite/btcd/chaincfg"
)
// Network has the parameters for operating in a given Bitcoin network
type Network struct {
network *chaincfg.Params
}
// Mainnet returns an instance of the Bitcoin Main Network
func Mainnet() *Network {
return &Network{network: &chaincfg.MainNetParams}
}
// Testnet returns an instance of the Bitcoin Test Network
func Testnet() *Network {
return &Network{network: &chaincfg.TestNet3Params}
}
// Regtest returns an instance of the Bitcoin Regression Network
func Regtest() *Network {
return &Network{network: &chaincfg.RegressionNetParams}
}
// Name returns the Network's name
func (n *Network) Name() string {
return n.network.Name
}
// ToParams returns the chaincfg.Params associated with this network (only available via Go code)
func (n *Network) ToParams() *chaincfg.Params {
return n.network
}