bch

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2019 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var (
	// MainNetParams are parser parameters for mainnet
	MainNetParams chaincfg.Params
	// TestNetParams are parser parameters for testnet
	TestNetParams chaincfg.Params
	// RegtestParams are parser parameters for regtest
	RegtestParams chaincfg.Params
)

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

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

func (b *BCashRPC) EstimateFee(blocks int) (big.Int, error)

EstimateFee returns fee estimation

func (*BCashRPC) EstimateSmartFee

func (b *BCashRPC) EstimateSmartFee(blocks int, conservative bool) (big.Int, error)

EstimateSmartFee returns fee estimation

func (*BCashRPC) GetBlock

func (b *BCashRPC) GetBlock(hash string, height uint32) (*bchain.Block, error)

GetBlock returns block with given hash.

func (*BCashRPC) GetBlockFull

func (b *BCashRPC) GetBlockFull(hash string) (*bchain.Block, error)

GetBlockFull returns block with given hash.

func (*BCashRPC) GetBlockInfo added in v0.1.0

func (b *BCashRPC) GetBlockInfo(hash string) (*bchain.BlockInfo, error)

GetBlockInfo returns extended header (more info than in bchain.BlockHeader) with a list of txids

func (*BCashRPC) GetBlockRaw

func (b *BCashRPC) GetBlockRaw(hash string) ([]byte, error)

GetBlockRaw returns block with given hash as bytes.

func (*BCashRPC) Initialize

func (b *BCashRPC) Initialize() error

Initialize initializes BCashRPC instance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL