Documentation
¶
Index ¶
- Variables
- type ClientOptions
- type NativeClient
- func (client *NativeClient) EstimateFeeLegacy(ctx context.Context, numBlocks int64) (float64, error)
- func (client *NativeClient) EstimateGas(ctx context.Context) (xc.AmountBlockchain, error)
- func (client *NativeClient) EstimateSmartFee(ctx context.Context, numBlocks int64) (float64, error)
- func (client *NativeClient) FetchBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
- func (client *NativeClient) FetchDecimals(ctx context.Context, contract xc.ContractAddress) (int, error)
- func (client *NativeClient) FetchLegacyTxInfo(ctx context.Context, txHash xc.TxHash) (xc.LegacyTxInfo, error)
- func (client *NativeClient) FetchLegacyTxInput(ctx context.Context, from xc.Address, to xc.Address) (xc.TxInput, error)
- func (client *NativeClient) FetchNativeBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
- func (client *NativeClient) FetchTransferInput(ctx context.Context, args xcbuilder.TransferArgs) (xc.TxInput, error)
- func (client *NativeClient) FetchTxInfo(ctx context.Context, txHashStr xc.TxHash) (xclient.TxInfo, error)
- func (client *NativeClient) GetWalletInfo(ctx context.Context) (float64, error)
- func (client *NativeClient) LatestBlock(ctx context.Context) (uint64, error)
- func (client *NativeClient) Output(ctx context.Context, outpoint tx_input.Outpoint) (tx_input.Output, uint64, error)
- func (client *NativeClient) SubmitTx(ctx context.Context, txInput xc.Tx) error
- func (client *NativeClient) UnspentOutputs(ctx context.Context, minConf, maxConf int64, addr xc.Address) ([]tx_input.Output, error)
- func (txBuilder *NativeClient) WithAddressDecoder(decoder address.AddressDecoder) address.WithAddressDecoder
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // default timeout for client DefaultClientTimeout = time.Minute // default retry period for failed connections DefaultClientTimeoutRetry = 10 * time.Second // default host to connect to rpc node DefaultClientHost = "http://0.0.0.0:18443" // default user for rpc connection DefaultClientUser = "user" // default password for rpc connection DefaultClientPassword = "password" // default auth header for rpc connection DefaultClientAuthHeader = "" )
Functions ¶
This section is empty.
Types ¶
type ClientOptions ¶
type ClientOptions struct { Timeout time.Duration TimeoutRetry time.Duration Host string User string Password string AuthHeader string AuthHeaderValue string Chaincfg *chaincfg.Params }
ClientOptions are used to parameterise the behaviour of the Client.
func DefaultClientOptions ¶
func DefaultClientOptions() ClientOptions
type NativeClient ¶
Client for Bitcoin
func NewNativeClient ¶
func NewNativeClient(cfgI xc.ITask) (*NativeClient, error)
NewClient returns a new Bitcoin Client
func (*NativeClient) EstimateFeeLegacy ¶
func (client *NativeClient) EstimateFeeLegacy(ctx context.Context, numBlocks int64) (float64, error)
Older version of estimating fee for some forks of BTC (e.g. BCH).
func (*NativeClient) EstimateGas ¶
func (client *NativeClient) EstimateGas(ctx context.Context) (xc.AmountBlockchain, error)
func (*NativeClient) EstimateSmartFee ¶
Latest way to estimate fees on BTC
func (*NativeClient) FetchBalance ¶
func (client *NativeClient) FetchBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
func (*NativeClient) FetchDecimals ¶
func (client *NativeClient) FetchDecimals(ctx context.Context, contract xc.ContractAddress) (int, error)
func (*NativeClient) FetchLegacyTxInfo ¶
func (client *NativeClient) FetchLegacyTxInfo(ctx context.Context, txHash xc.TxHash) (xc.LegacyTxInfo, error)
FetchLegacyTxInfo returns tx info for a Bitcoin tx
func (*NativeClient) FetchLegacyTxInput ¶
func (*NativeClient) FetchNativeBalance ¶
func (client *NativeClient) FetchNativeBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
func (*NativeClient) FetchTransferInput ¶
func (client *NativeClient) FetchTransferInput(ctx context.Context, args xcbuilder.TransferArgs) (xc.TxInput, error)
FetchTransferInput returns tx input for a Bitcoin tx
func (*NativeClient) FetchTxInfo ¶
func (*NativeClient) GetWalletInfo ¶
func (client *NativeClient) GetWalletInfo(ctx context.Context) (float64, error)
func (*NativeClient) LatestBlock ¶
func (client *NativeClient) LatestBlock(ctx context.Context) (uint64, error)
LatestBlock returns the height of the longest blockchain.
func (*NativeClient) Output ¶
func (client *NativeClient) Output(ctx context.Context, outpoint tx_input.Outpoint) (tx_input.Output, uint64, error)
Output associated with an outpoint, and its number of confirmations.
func (*NativeClient) UnspentOutputs ¶
func (client *NativeClient) UnspentOutputs(ctx context.Context, minConf, maxConf int64, addr xc.Address) ([]tx_input.Output, error)
UnspentOutputs spendable by the given address.
func (*NativeClient) WithAddressDecoder ¶
func (txBuilder *NativeClient) WithAddressDecoder(decoder address.AddressDecoder) address.WithAddressDecoder
Click to show internal directories.
Click to hide internal directories.