bitcoin

package
v0.0.0-...-505baef Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const ChainName = "Bitcoin"

Variables

This section is empty.

Functions

func NewChainAdaptor

func NewChainAdaptor(conf *config.Config) (chain.IChainAdaptor, error)

Types

type BcClient

type BcClient struct {
	// contains filtered or unexported fields
}

func NewBlockChainClient

func NewBlockChainClient(url string) (*BcClient, error)

func (*BcClient) GetAccountBalance

func (c *BcClient) GetAccountBalance(address string) (string, error)

func (*BcClient) GetAccountUtxo

func (c *BcClient) GetAccountUtxo(address string) ([]types.UnspentOutput, error)

func (*BcClient) GetTransactionsByAddress

func (c *BcClient) GetTransactionsByAddress(address, pageSize, page string) (*types.Transaction, error)

func (*BcClient) GetTransactionsByHash

func (c *BcClient) GetTransactionsByHash(txHash string) (*types.TxsItem, error)

type ChainAdaptor

type ChainAdaptor struct {
	// contains filtered or unexported fields
}

func (*ChainAdaptor) BuildSignedTransaction

func (c *ChainAdaptor) BuildSignedTransaction(req *utxo.SignedTransactionRequest) (*utxo.SignedTransactionResponse, error)

func (*ChainAdaptor) CalcSignHashes

func (c *ChainAdaptor) CalcSignHashes(Vins []*utxo.Vin, Vouts []*utxo.Vout) ([][]byte, []byte, error)

func (*ChainAdaptor) ConvertAddress

func (*ChainAdaptor) CreateUnSignTransaction

func (c *ChainAdaptor) CreateUnSignTransaction(req *utxo.UnSignTransactionRequest) (*utxo.UnSignTransactionResponse, error)

func (*ChainAdaptor) DecodeTransaction

func (*ChainAdaptor) DecodeTx

func (c *ChainAdaptor) DecodeTx(txData []byte, vins []*utxo.Vin, sign bool) (*DecodeTxRes, error)

func (*ChainAdaptor) DecodeVins

func (c *ChainAdaptor) DecodeVins(msgTx wire.MsgTx, offline bool, vins []*utxo.Vin, sign bool) ([]*utxo.Vin, *big.Int, error)

func (*ChainAdaptor) DecodeVouts

func (c *ChainAdaptor) DecodeVouts(msgTx wire.MsgTx) ([]*utxo.Vout, *big.Int, error)

func (*ChainAdaptor) GetAccount

func (c *ChainAdaptor) GetAccount(req *utxo.AccountRequest) (*utxo.AccountResponse, error)

func (*ChainAdaptor) GetBlockByHash

func (c *ChainAdaptor) GetBlockByHash(req *utxo.BlockHashRequest) (*utxo.BlockResponse, error)

func (*ChainAdaptor) GetBlockByNumber

func (c *ChainAdaptor) GetBlockByNumber(req *utxo.BlockNumberRequest) (*utxo.BlockResponse, error)

func (*ChainAdaptor) GetBlockHeaderByHash

func (c *ChainAdaptor) GetBlockHeaderByHash(req *utxo.BlockHeaderHashRequest) (*utxo.BlockHeaderResponse, error)

func (*ChainAdaptor) GetBlockHeaderByNumber

func (c *ChainAdaptor) GetBlockHeaderByNumber(req *utxo.BlockHeaderNumberRequest) (*utxo.BlockHeaderResponse, error)

func (*ChainAdaptor) GetFee

func (c *ChainAdaptor) GetFee(req *utxo.FeeRequest) (*utxo.FeeResponse, error)

func (*ChainAdaptor) GetSupportChains

func (c *ChainAdaptor) GetSupportChains(req *utxo.SupportChainsRequest) (*utxo.SupportChainsResponse, error)

func (*ChainAdaptor) GetTxByAddress

func (c *ChainAdaptor) GetTxByAddress(req *utxo.TxAddressRequest) (*utxo.TxAddressResponse, error)

func (*ChainAdaptor) GetTxByHash

func (c *ChainAdaptor) GetTxByHash(req *utxo.TxHashRequest) (*utxo.TxHashResponse, error)

func (*ChainAdaptor) GetUnspentOutputs

func (*ChainAdaptor) GetVin

func (c *ChainAdaptor) GetVin(offline bool, vins []*utxo.Vin, index int, in *wire.TxIn) (*utxo.Vin, error)

func (*ChainAdaptor) SendTx

func (*ChainAdaptor) ValidAddress

func (*ChainAdaptor) VerifySign

func (c *ChainAdaptor) VerifySign(vin *utxo.Vin, msgTx wire.MsgTx, index int) error

func (*ChainAdaptor) VerifySignedTransaction

func (c *ChainAdaptor) VerifySignedTransaction(req *utxo.VerifyTransactionRequest) (*utxo.VerifyTransactionResponse, error)

type DecodeTxRes

type DecodeTxRes struct {
	Hash       string
	SignHashes [][]byte
	Vins       []*utxo.Vin
	Vouts      []*utxo.Vout
	CostFee    *big.Int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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