Documentation
¶
Index ¶
- type AddressInfo
- type BlockHeader
- type BlockStatus
- type ChainStats
- type Client
- func (c *Client) SendPostRequest(endpoint string, headers map[string]string, body interface{}, ...) error
- func (c *Client) SendRequest(endpoint string, headers map[string]string, result interface{}) error
- func (c *Client) SendRequestForBinary(endpoint string, headers map[string]string) ([]byte, error)
- type FeeHistogram
- type MempoolInfo
- type MempoolStatus
- type MerkleProof
- type ScripthashInfo
- type Status
- type Transaction
- type Utxo
- type Vin
- type Vout
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressInfo ¶
type AddressInfo struct { Address string `json:"address"` MempoolStatus `json:"mempool_stats"` ChainStats `json:"chain_stats"` }
type BlockHeader ¶
type BlockHeader struct { ID string `json:"id"` Height uint64 `json:"height"` Version int `json:"version"` Timestamp int64 `json:"timestamp"` Bits int `json:"bits"` Nonce int64 `json:"nonce"` Difficulty float64 `json:"difficulty"` MerkleRoot string `json:"merkle_root"` TxCount uint64 `json:"tx_count"` Size int `json:"size"` Weight int `json:"weight"` PreviousBlockHash string `json:"previousblockhash"` Mediantime int64 `json:"mediantime"` }
type BlockStatus ¶
type ChainStats ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client struct represents the client to interact with the API
func (*Client) SendPostRequest ¶
func (c *Client) SendPostRequest(endpoint string, headers map[string]string, body interface{}, result interface{}) error
SendPostRequest sends an HTTP POST request and parses the response
func (*Client) SendRequest ¶
SendRequest sends an HTTP request and parses the response
type FeeHistogram ¶
FeeHistogram represents a fee rate and corresponding virtual size
func (*FeeHistogram) UnmarshalJSON ¶
func (fh *FeeHistogram) UnmarshalJSON(data []byte) error
UnmarshalJSON custom unmarshals a FeeHistogram from a JSON array
type MempoolInfo ¶
type MempoolInfo struct { Count int `json:"count"` Vsize int `json:"vsize"` TotalFee int `json:"total_fee"` FeeHistogram []FeeHistogram `json:"fee_histogram"` }
type MempoolStatus ¶
type MerkleProof ¶
type ScripthashInfo ¶
type ScripthashInfo struct { MempoolStatus `json:"mempool_stats"` ChainStats `json:"chain_stats"` Scripthash string `json:"scripthash"` }
type Status ¶
type Status struct { Confirmed bool `json:"confirmed"` BlockHeight int `json:"block_height"` BlockHash string `json:"block_hash"` BlockTime int64 `json:"block_time"` }
Status 表示tx或者utxo的状态
type Transaction ¶
type Vin ¶
type Vin struct { TxID string `json:"txid"` Vout int `json:"vout"` IsCoinbase bool `json:"is_coinbase"` ScriptSig string `json:"scriptsig,omitempty"` ScriptSigAsm string `json:"scriptsig_asm,omitempty"` InnerRedeemScriptAsm string `json:"inner_redeemscript_asm,omitempty"` InnerWitnessScriptAsm string `json:"inner_witnessscript_asm,omitempty"` Sequence int `json:"sequence"` Witness []string `json:"witness"` Prevout *Vout `json:"prevout"` }
Click to show internal directories.
Click to hide internal directories.