Documentation ¶
Index ¶
- Constants
- Variables
- func GetChainParams(chain string) *chaincfg.Params
- func NewBCashRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error)
- type AddressFormat
- type BCashParser
- type BCashRPC
- func (b *BCashRPC) EstimateFee(blocks int) (big.Int, error)
- func (b *BCashRPC) EstimateSmartFee(blocks int, conservative bool) (big.Int, error)
- func (b *BCashRPC) GetBlock(hash string, height uint32) (*bchain.Block, error)
- func (b *BCashRPC) GetBlockFull(hash string) (*bchain.Block, error)
- func (b *BCashRPC) GetBlockInfo(hash string) (*bchain.BlockInfo, error)
- func (b *BCashRPC) GetBlockRaw(hash string) ([]byte, error)
- func (b *BCashRPC) Initialize() error
Constants ¶
const ( // MainNetPrefix is CashAddr prefix for mainnet MainNetPrefix = "bitcoincash:" // TestNetPrefix is CashAddr prefix for testnet TestNetPrefix = "bchtest:" // RegTestPrefix is CashAddr prefix for regtest RegTestPrefix = "bchreg:" )
Variables ¶
Functions ¶
func GetChainParams ¶
GetChainParams contains network parameters for the main Bitcoin Cash network, the regression test Bitcoin Cash network, the test Bitcoin Cash network and the simulation test Bitcoin Cash network, in this order
func NewBCashRPC ¶
func NewBCashRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error)
NewBCashRPC returns new BCashRPC instance.
Types ¶
type AddressFormat ¶
type AddressFormat = uint8
AddressFormat type is used to specify different formats of address
const ( // Legacy AddressFormat is the same as Bitcoin Legacy AddressFormat = iota // CashAddr AddressFormat is new Bitcoin Cash standard CashAddr )
type BCashParser ¶
type BCashParser struct { *btc.BitcoinParser AddressFormat AddressFormat }
BCashParser handle
func NewBCashParser ¶
func NewBCashParser(params *chaincfg.Params, c *btc.Configuration) (*BCashParser, error)
NewBCashParser returns new BCashParser instance
func (*BCashParser) GetAddrDescFromAddress ¶ added in v0.1.0
func (p *BCashParser) GetAddrDescFromAddress(address string) (bchain.AddressDescriptor, error)
GetAddrDescFromAddress returns internal address representation of given address
type BCashRPC ¶
type BCashRPC struct {
*btc.BitcoinRPC
}
BCashRPC is an interface to JSON-RPC bitcoind service.
func (*BCashRPC) EstimateFee ¶ added in v0.2.2
EstimateFee returns fee estimation
func (*BCashRPC) EstimateSmartFee ¶
EstimateSmartFee returns fee estimation
func (*BCashRPC) GetBlockFull ¶
GetBlockFull returns block with given hash.
func (*BCashRPC) GetBlockInfo ¶ added in v0.1.0
GetBlockInfo returns extended header (more info than in bchain.BlockHeader) with a list of txids
func (*BCashRPC) GetBlockRaw ¶
GetBlockRaw returns block with given hash as bytes.
func (*BCashRPC) Initialize ¶
Initialize initializes BCashRPC instance.