Documentation ¶
Index ¶
- Variables
- func BCHAddrtoBTCAddr(bchAddr bchutil.Address, net *chaincfg.Params) (btcutil.Address, error)
- func BTCAddrToBCHAddr(btcAddr btcutil.Address, net *chaincfg.Params) (bchutil.Address, error)
- func DecodeCashAddress(addr string, net *chaincfg.Params) (btcutil.Address, error)
- func EncodeCashAddress(btcAddr btcutil.Address, net *chaincfg.Params) (string, error)
- func RecodeCashAddress(addr string, net *chaincfg.Params) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UnitInfo = dex.UnitInfo{ AtomicUnit: "Sats", Conventional: dex.Denomination{ Unit: "BCH", ConversionFactor: 1e8, }, } // MainNetParams are the clone parameters for mainnet. MainNetParams = btc.ReadCloneParams(&btc.CloneParams{ Name: "mainnet", PubKeyHashAddrID: 0x00, ScriptHashAddrID: 0x05, Bech32HRPSegwit: "bitcoincash", CoinbaseMaturity: 100, Net: 0xe8f3e1e3, GenesisHash: mustHash("000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"), }) // TestNet4Params are the clone parameters for testnet4. TestNet4Params = btc.ReadCloneParams(&btc.CloneParams{ Name: "testnet4", PubKeyHashAddrID: 0x6f, ScriptHashAddrID: 0xc4, Bech32HRPSegwit: "bchtest", CoinbaseMaturity: 100, Net: 0xafdab7e2, GenesisHash: mustHash("000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943"), }) // RegressionNetParams are the clone parameters for simnet. RegressionNetParams = btc.ReadCloneParams(&btc.CloneParams{ Name: "regtest", PubKeyHashAddrID: 0x6f, ScriptHashAddrID: 0xc4, Bech32HRPSegwit: "bchreg", CoinbaseMaturity: 100, Net: 0xee87f733, GenesisHash: mustHash("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"), }) )
Functions ¶
func BCHAddrtoBTCAddr ¶ added in v0.6.0
func BTCAddrToBCHAddr ¶ added in v0.6.0
func DecodeCashAddress ¶
DecodeCashAddress decodes a Cash Address string into a btcutil.Address that the BTC backend can use internally.
func EncodeCashAddress ¶ added in v0.5.0
EncodeCashAddress converts a btcutil.Address that the BTC backend into a Cash Address string. For example, if a pkScript was decoded to a btcutil.Address, the correct address string would not be from the Address' String method, but from EncodeCashAddress. This is more direct than doing RecodeCashAddress(addr.String()), which needlessly decodes the string.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.