bch

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MainNetPrefix = "bitcoincash:"
	TestNetPrefix = "bchtest:"
	RegTestPrefix = "bchreg:"
)

Variables

View Source
var (
	MainNetParams chaincfg.Params
	TestNetParams chaincfg.Params
	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
const (
	Legacy AddressFormat = iota
	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) 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