Documentation
¶
Index ¶
- type Block
- type Client
- func (client *Client) GetBlockByHeight(ctx context.Context, height int32) (*Block, error)
- func (client *Client) GetBlockHashByHeight(ctx context.Context, height int32) (types.Bytes, error)
- func (client *Client) GetBlocksHeight(ctx context.Context) (int32, error)
- func (client *Client) GetInfo(ctx context.Context, height int32) (*Block, error)
- func (client *Client) GetMempool(ctx context.Context) ([]SingleTransaction, error)
- func (client *Client) GetTxByTxid(ctx context.Context, txid string) (*SingleTransaction, error)
- type MyAddress
- type SingleTransaction
- type SingleTxInput
- type SingleTxOutput
- type Transaction
- type TxInput
- type TxOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { Hash types.Bytes `json:"hash"` PrevBlockHash types.Bytes `json:"previousblockhash"` Height int32 `json:"height"` Weight int32 `json:"weight"` Size int64 `json:"size"` Version int32 `json:"version"` HashMerkleRoot types.Bytes `json:"merkleRoot"` WitnessRoot types.Bytes `json:"witnessRoot"` TreeRoot types.Bytes `json:"treeRoot"` ReservedRoot types.Bytes `json:"reservedRoot"` Mask types.Bytes `json:"mask"` Time int32 `json:"time"` Bits types.Bytes `json:"bits"` Difficulty float64 `json:"difficulty"` Chainwork types.Bytes `json:"chainwork"` Nonce int64 `json:"nonce"` ExtraNonce types.Bytes `json:"extraNonce"` Transactions []Transaction `json:"tx"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetBlockByHeight ¶
func (*Client) GetBlockHashByHeight ¶
func (*Client) GetBlocksHeight ¶
func (*Client) GetMempool ¶
func (client *Client) GetMempool(ctx context.Context) ([]SingleTransaction, error)
func (*Client) GetTxByTxid ¶
type SingleTransaction ¶
type SingleTransaction struct { Txid types.Bytes `json:"hash"` WitnessTx types.Bytes `json:"witnessHash"` Fee int64 `json:"fee"` Rate int64 `json:"rate"` BlockHash types.Bytes `json:"blockHash"` IndexBlock int32 `json:"index"` Version int32 `json:"version"` Locktime int64 `json:"locktime"` Size int64 `json:"size"` TxInputs []SingleTxInput `json:"inputs"` TxOutputs []SingleTxOutput `json:"outputs"` }
there is a need for additonal type, because the default node field names are different in different methods
type SingleTxInput ¶
type SingleTxInput struct { MyHashPrevout struct { Hash types.Bytes `json:"hash"` IndexPrevout int64 `json:"index"` } `json:"prevout"` Sequence int64 `json:"sequence"` }
func (*SingleTxInput) HashPrevout ¶
func (txInput *SingleTxInput) HashPrevout() types.Bytes
type SingleTxOutput ¶
type Transaction ¶
type Transaction struct { Txid types.Bytes `json:"txid"` WitnessTx types.Bytes `json:"hash"` Fee int64 `json:"fee"` Rate int64 `json:"rate"` BlockHash types.Bytes `json:"blockHash"` IndexBlock int32 `json:"index"` Version int32 `json:"version"` Locktime int64 `json:"locktime"` Size int64 `json:"size"` TxInputs []TxInput `json:"vin"` TxOutputs []TxOutput `json:"vout"` }
Click to show internal directories.
Click to hide internal directories.