liquid

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MainnetMagic is mainnet network constant
	MainnetMagic wire.BitcoinNet = 0xdab5bffa
)

Variables

View Source
var (
	// MainNetParams are parser parameters for mainnet
	MainNetParams chaincfg.Params
)

Functions

func GetChainParams

func GetChainParams(chain string) *chaincfg.Params

GetChainParams contains network parameters for the main GameCredits network, and the test GameCredits network

func NewLiquidRPC

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

NewLiquidRPC returns new LiquidRPC instance.

Types

type LiquidParser

type LiquidParser struct {
	*btc.BitcoinParser
	// contains filtered or unexported fields
}

LiquidParser handle

func NewLiquidParser

func NewLiquidParser(params *chaincfg.Params, c *btc.Configuration) *LiquidParser

NewLiquidParser returns new LiquidParser instance

func (*LiquidParser) GetAddrDescForUnknownInput

func (p *LiquidParser) GetAddrDescForUnknownInput(tx *bchain.Tx, input int) bchain.AddressDescriptor

GetAddrDescForUnknownInput processes inputs that were not found in txAddresses - they are bitcoin transactions create a special script for the input in the form OP_INVALIDOPCODE <txid> <vout varint>

func (*LiquidParser) PackTx

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

PackTx packs transaction to byte array using protobuf

func (*LiquidParser) UnpackTx

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

UnpackTx unpacks transaction from protobuf byte array

type LiquidRPC

type LiquidRPC struct {
	*btc.BitcoinRPC
}

LiquidRPC is an interface to JSON-RPC bitcoind service.

func (*LiquidRPC) GetBlock

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

GetBlock returns block with given hash.

func (*LiquidRPC) GetMempoolEntry

func (b *LiquidRPC) GetMempoolEntry(txid string) (*bchain.MempoolEntry, error)

GetMempoolEntry returns mempool data for given transaction

func (*LiquidRPC) GetTransactionForMempool

func (b *LiquidRPC) 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 (*LiquidRPC) Initialize

func (b *LiquidRPC) Initialize() error

Initialize initializes GameCreditsRPC instance.

Jump to

Keyboard shortcuts

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