trezarcoin

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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainnetMagic wire.BitcoinNet = 0xfddbefe4
)

magic numbers

Variables

View Source
var (
	MainNetParams chaincfg.Params
)

chain parameters

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

GetChainParams returns network parameters

func NewTrezarcoinRPC

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

NewTrezarcoinRPC returns new TrezarcoinRPC instance.

Types

type TrezarcoinParser

type TrezarcoinParser struct {
	*btc.BitcoinLikeParser
	// contains filtered or unexported fields
}

TrezarcoinParser handle

func NewTrezarcoinParser

func NewTrezarcoinParser(params *chaincfg.Params, c *btc.Configuration) *TrezarcoinParser

NewTrezarcoinParser returns new TrezarcoinParser instance

func (*TrezarcoinParser) PackTx

func (p *TrezarcoinParser) PackTx(tx *bchain.Tx, height uint32, blockTime int64) ([]byte, error)

PackTx packs transaction to byte array using protobuf

func (*TrezarcoinParser) UnpackTx

func (p *TrezarcoinParser) UnpackTx(buf []byte) (*bchain.Tx, uint32, error)

UnpackTx unpacks transaction from protobuf byte array

type TrezarcoinRPC

type TrezarcoinRPC struct {
	*btc.BitcoinRPC
}

TrezarcoinRPC is an interface to JSON-RPC bitcoind service.

func (*TrezarcoinRPC) GetBlock

func (f *TrezarcoinRPC) GetBlock(hash string, height uint32) (*bchain.Block, error)

GetBlock returns block with given hash.

func (*TrezarcoinRPC) GetMempoolEntry

func (f *TrezarcoinRPC) GetMempoolEntry(txid string) (*bchain.MempoolEntry, error)

GetMempoolEntry returns mempool data for given transaction

func (*TrezarcoinRPC) GetTransactionForMempool

func (f *TrezarcoinRPC) GetTransactionForMempool(txid string) (*bchain.Tx, error)

GetTransactionForMempool returns a transaction by the transaction ID. It could be optimized for mempool, i.e. without block time and confirmations

func (*TrezarcoinRPC) Initialize

func (b *TrezarcoinRPC) Initialize() error

Initialize initializes TrezarcoinRPC instance.

Jump to

Keyboard shortcuts

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