Documentation ¶
Index ¶
- type Client
- func (c *Client) BatchGetMempoolEntry(txids []string) ([]*btcjson.GetMempoolEntryResult, []error, error)
- func (c *Client) BatchGetRawTransactionVerbose(txids []string) ([]*btcjson.TxRawResult, []error, error)
- func (c *Client) Call(result any, method string, args ...interface{}) error
- func (c *Client) CreateWallet(name string) error
- func (c *Client) GetBlockCount() (int64, error)
- func (c *Client) GetBlockHash(height int64) (string, error)
- func (c *Client) GetBlockStats(hash string) (*btcjson.GetBlockStatsResult, error)
- func (c *Client) GetBlockVerbose(hash string) (*btcjson.GetBlockVerboseResult, error)
- func (c *Client) GetBlockVerboseTxs(hash string) (*btcjson.GetBlockVerboseTxResult, error)
- func (c *Client) GetMempoolEntry(txid string) (*btcjson.GetMempoolEntryResult, error)
- func (c *Client) GetNetworkInfo() (*btcjson.GetNetworkInfoResult, error)
- func (c *Client) GetRawMempool() ([]string, error)
- func (c *Client) GetRawTransaction(txid string) (string, error)
- func (c *Client) GetRawTransactionVerbose(txid string) (*btcjson.TxRawResult, error)
- func (c *Client) ImportAddress(address string) error
- func (c *Client) ImportAddressRescan(address string) error
- func (c *Client) ListUnspent(address string) ([]btcjson.ListUnspentResult, error)
- func (c *Client) SendRawTransaction(tx SerializableTx, maxFeeParam any) (string, error)
- type SerializableTx
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
}
Client represents a client connection to a UTXO daemon. Internally this uses the Ethereum JSON-RPC 2.0 implementation, which allows batching and connection reuse.
func (*Client) BatchGetMempoolEntry ¶
func (c *Client) BatchGetMempoolEntry(txids []string) ([]*btcjson.GetMempoolEntryResult, []error, error)
BatchGetMempoolEntry returns mempool data for the given transactions.
func (*Client) BatchGetRawTransactionVerbose ¶
func (c *Client) BatchGetRawTransactionVerbose(txids []string) ([]*btcjson.TxRawResult, []error, error)
BatchGetRawTransactionVerbose returns a raw transaction for given transaction ids.
func (*Client) CreateWallet ¶
CreateWallet creates a new wallet.
func (*Client) GetBlockCount ¶
GetBlockCount returns the number of blocks in the longest block chain.
func (*Client) GetBlockHash ¶
GetBlockHash returns the hash of the block in best-block-chain at the given height.
func (*Client) GetBlockStats ¶
func (c *Client) GetBlockStats(hash string) (*btcjson.GetBlockStatsResult, error)
GetBlockStats returns statistics about the block at the given hash.
func (*Client) GetBlockVerbose ¶
func (c *Client) GetBlockVerbose(hash string) (*btcjson.GetBlockVerboseResult, error)
GetBlockVerbose returns information about the block with verbosity 1.
func (*Client) GetBlockVerboseTxs ¶
func (c *Client) GetBlockVerboseTxs(hash string) (*btcjson.GetBlockVerboseTxResult, error)
GetBlockVerbose returns information about the block with verbosity 2.
func (*Client) GetMempoolEntry ¶
func (c *Client) GetMempoolEntry(txid string) (*btcjson.GetMempoolEntryResult, error)
GetMempoolEntry returns mempool data for the given transaction.
func (*Client) GetNetworkInfo ¶
func (c *Client) GetNetworkInfo() (*btcjson.GetNetworkInfoResult, error)
func (*Client) GetRawMempool ¶
GetRawMempool returns all transaction ids in the mempool.
func (*Client) GetRawTransaction ¶
GetRawTransaction returns a raw transaction string for the transaction id.
func (*Client) GetRawTransactionVerbose ¶
func (c *Client) GetRawTransactionVerbose(txid string) (*btcjson.TxRawResult, error)
GetRawTransactionVerbose returns a raw transaction for the transaction id.
func (*Client) ImportAddress ¶
ImportAddress imports the address with no rescan.
func (*Client) ImportAddressRescan ¶
ImportAddressRescan imports the address with rescan.
func (*Client) ListUnspent ¶
func (c *Client) ListUnspent(address string) ([]btcjson.ListUnspentResult, error)
ListUnspent returns all unspent outputs with between min and max confirmations.
func (*Client) SendRawTransaction ¶
func (c *Client) SendRawTransaction(tx SerializableTx, maxFeeParam any) (string, error)
SendRawTransaction serializes and sends the transaction. The maxFeeParam differs in type between chains - ensure the correct variant is used.