ecash

package
v0.0.0-...-fae8f5a Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MainNetPrefix is CashAddr prefix for mainnet
	MainNetPrefix = "ecash:"
	// TestNetPrefix is CashAddr prefix for testnet
	TestNetPrefix = "ectest:"
	// RegTestPrefix is CashAddr prefix for regtest
	RegTestPrefix = "ecreg:"
)

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 eCash network, the regression test eCash network, the test eCash network and the simulation test eCash network, in this order

func NewECashRPC

func NewECashRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error)

NewECashRPC returns new ECashRPC 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 eCash standard
	CashAddr
)

type ECashParser

type ECashParser struct {
	*btc.BitcoinLikeParser
	AddressFormat AddressFormat
}

ECashParser handle

func NewECashParser

func NewECashParser(params *chaincfg.Params, c *btc.Configuration) (*ECashParser, error)

NewECashParser returns new ECashParser instance

func (*ECashParser) GetAddrDescFromAddress

func (p *ECashParser) GetAddrDescFromAddress(address string) (bchain.AddressDescriptor, error)

GetAddrDescFromAddress returns internal address representation of given address

type ECashRPC

type ECashRPC struct {
	*btc.BitcoinRPC
}

ECashRPC is an interface to JSON-RPC bitcoind service.

func (*ECashRPC) EstimateFee

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

EstimateFee returns fee estimation

func (*ECashRPC) EstimateSmartFee

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

EstimateSmartFee returns fee estimation

func (*ECashRPC) GetBlock

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

GetBlock returns block with given hash.

func (*ECashRPC) GetBlockBytes

func (b *ECashRPC) GetBlockBytes(hash string) ([]byte, error)

GetBlockBytes returns block with given hash as bytes

func (*ECashRPC) GetBlockFull

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

GetBlockFull returns block with given hash.

func (*ECashRPC) GetBlockInfo

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

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

func (*ECashRPC) GetBlockRaw

func (b *ECashRPC) GetBlockRaw(hash string) (string, error)

GetBlockRaw returns block with given hash as bytes.

func (*ECashRPC) Initialize

func (b *ECashRPC) Initialize() error

Initialize initializes ECashRPC instance.

Jump to

Keyboard shortcuts

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