Documentation
¶
Overview ¶
Package mempoolspace 提供mempool.space REST API客户端
mempool.space 原生数据结构定义
Index ¶
- type Client
- func (c *Client) AddressGetBalance(ctx context.Context, addr string) (int64, int64, error)
- func (c *Client) AddressGetUTXOs(ctx context.Context, addr string) ([]UTXODTO, error)
- func (c *Client) EstimateFeeRate(ctx context.Context, targetBlocks int) (*FeeRateDTO, error)
- func (c *Client) TxBroadcast(ctx context.Context, rawtx []byte) (string, error)
- func (c *Client) TxGetRaw(ctx context.Context, txid string) ([]byte, error)
- type FeeRateDTO
- type TxDTO
- type UTXODTO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddressGetBalance ¶
获取地址余额
func (*Client) AddressGetUTXOs ¶
获取地址 UTXO
func (*Client) EstimateFeeRate ¶
估算交易费率
func (*Client) TxBroadcast ¶
广播交易,返回交易ID
type FeeRateDTO ¶
type FeeRateDTO struct {
FastestFee float64 `json:"fastestFee"`
HalfHourFee float64 `json:"halfHourFee"`
HourFee float64 `json:"hourFee"`
}
估算交易费率数据结构
type TxDTO ¶
type TxDTO struct {
Txid string `json:"txid"`
Version int32 `json:"version"`
Locktime uint32 `json:"locktime"`
Weight int64 `json:"weight"`
Size int64 `json:"size"`
Vin []struct {
Txid string `json:"txid"`
Vout uint32 `json:"vout"`
Sequence uint32 `json:"sequence"`
Scriptsig string `json:"scriptsig"`
Witness []string `json:"witness"`
} `json:"vin"`
Vout []struct {
Value int64 `json:"value"` // sats
ScriptPubKey string `json:"scriptpubkey"`
ScriptType string `json:"scriptpubkey_type"`
Address string `json:"scriptpubkey_address"`
} `json:"vout"`
}
从mempool.space获取到的交易数据结构
Click to show internal directories.
Click to hide internal directories.