31 lines
714 B
Go
Raw Normal View History

2019-10-01 12:22:30 -03:00
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
}