Documentation ¶
Index ¶
- Constants
- func CheckRPCStatus(client interfaces.BTCRPCClient, tssAddress btcutil.Address) (time.Time, error)
- func GetBlockHeightByHash(rpcClient interfaces.BTCRPCClient, hash string) (int64, error)
- func GetRawTxByHash(rpcClient interfaces.BTCRPCClient, txID string) (*btcutil.Tx, error)
- func GetRawTxResult(rpcClient interfaces.BTCRPCClient, hash *chainhash.Hash, ...) (btcjson.TxRawResult, error)
- func GetTransactionFeeAndRate(rpcClient interfaces.BTCRPCClient, rawResult *btcjson.TxRawResult) (int64, int64, error)
- func GetTxResultByHash(rpcClient interfaces.BTCRPCClient, txID string) (*chainhash.Hash, *btcjson.GetTransactionResult, error)
- func NewRPCClient(btcConfig config.BTCConfig) (*rpcclient.Client, error)
Constants ¶
View Source
const ( // RPCAlertLatency is the default threshold for RPC latency to be considered unhealthy and trigger an alert. // Bitcoin block time is 10 minutes, 1200s (20 minutes) is a reasonable threshold for Bitcoin RPCAlertLatency = time.Duration(1200) * time.Second )
Variables ¶
This section is empty.
Functions ¶
func CheckRPCStatus ¶
func CheckRPCStatus(client interfaces.BTCRPCClient, tssAddress btcutil.Address) (time.Time, error)
CheckRPCStatus checks the RPC status of the bitcoin chain
func GetBlockHeightByHash ¶
func GetBlockHeightByHash( rpcClient interfaces.BTCRPCClient, hash string, ) (int64, error)
GetBlockHeightByHash gets the block height by block hash
func GetRawTxByHash ¶
func GetRawTxByHash(rpcClient interfaces.BTCRPCClient, txID string) (*btcutil.Tx, error)
GetTXRawResultByHash gets the raw transaction by hash
func GetRawTxResult ¶
func GetRawTxResult( rpcClient interfaces.BTCRPCClient, hash *chainhash.Hash, res *btcjson.GetTransactionResult, ) (btcjson.TxRawResult, error)
GetRawTxResult gets the raw tx result
func GetTransactionFeeAndRate ¶
func GetTransactionFeeAndRate(rpcClient interfaces.BTCRPCClient, rawResult *btcjson.TxRawResult) (int64, int64, error)
GetTransactionFeeAndRate gets the transaction fee and rate for a given tx result
func GetTxResultByHash ¶
func GetTxResultByHash( rpcClient interfaces.BTCRPCClient, txID string, ) (*chainhash.Hash, *btcjson.GetTransactionResult, error)
GetTxResultByHash gets the transaction result by hash
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.