bch

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2018 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

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) AddressToOutputScript

func (p *BCashParser) AddressToOutputScript(address string) ([]byte, error)

AddressToOutputScript converts bitcoin address to ScriptPubKey

func (*BCashParser) GetAddrIDFromAddress

func (p *BCashParser) GetAddrIDFromAddress(address string) ([]byte, error)

GetAddrIDFromAddress 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) (float64, 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) 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