Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) CreateEncryptedWallet(ctx context.Context, passphrase string) error
- func (c *Client) CreateEncryptedWalletAsync(ctx context.Context, passphrase string) FutureCreateEncryptedWalletResult
- func (c *Client) CreateRawTransaction(ctx context.Context, inputs []btcjson.TransactionInput, ...) (*wire.MsgTx, error)
- func (c *Client) CreateRawTransactionAsync(ctx context.Context, inputs []btcjson.TransactionInput, ...) FutureCreateRawTransactionResult
- func (c *Client) DebugLevel(ctx context.Context, levelSpec string) (string, error)
- func (c *Client) DebugLevelAsync(ctx context.Context, levelSpec string) FutureDebugLevelResult
- func (c *Client) DecodeRawTransaction(ctx context.Context, serializedTx []byte) (*btcjson.TxRawResult, error)
- func (c *Client) DecodeRawTransactionAsync(ctx context.Context, serializedTx []byte) FutureDecodeRawTransactionResult
- func (c *Client) DecodeScript(ctx context.Context, serializedScript []byte) (*btcjson.DecodeScriptResult, error)
- func (c *Client) DecodeScriptAsync(ctx context.Context, serializedScript []byte) FutureDecodeScriptResult
- func (c *Client) EstimateFee(ctx context.Context, numBlocks int64) (float64, error)
- func (c *Client) EstimateFeeAsync(ctx context.Context, numBlocks int64) FutureEstimateFeeResult
- func (c *Client) ExportWatchingWallet(ctx context.Context, account string) ([]byte, []byte, error)
- func (c *Client) ExportWatchingWalletAsync(ctx context.Context, account string) FutureExportWatchingWalletResult
- func (c *Client) GetBestBlock(ctx context.Context) (*chainhash.Hash, int32, error)
- func (c *Client) GetBestBlockAsync(ctx context.Context) FutureGetBestBlockResult
- func (c *Client) GetBestBlockHash(ctx context.Context) (*chainhash.Hash, error)
- func (c *Client) GetBestBlockHashAsync(ctx context.Context) FutureGetBestBlockHashResult
- func (c *Client) GetBlock(ctx context.Context, blockHash *chainhash.Hash) (*wire.MsgBlock, error)
- func (c *Client) GetBlockAsync(ctx context.Context, blockHash *chainhash.Hash) FutureGetBlockResult
- func (c *Client) GetBlockChainInfo(ctx context.Context) (*btcjson.GetBlockChainInfoResult, error)
- func (c *Client) GetBlockChainInfoAsync(ctx context.Context) FutureGetBlockChainInfoResult
- func (c *Client) GetBlockCount(ctx context.Context) (int64, error)
- func (c *Client) GetBlockCountAsync(ctx context.Context) FutureGetBlockCountResult
- func (c *Client) GetBlockHash(ctx context.Context, blockHeight int64) (*chainhash.Hash, error)
- func (c *Client) GetBlockHashAsync(ctx context.Context, blockHeight int64) FutureGetBlockHashResult
- func (c *Client) GetBlockHeader(ctx context.Context, blockHash *chainhash.Hash) (*wire.BlockHeader, error)
- func (c *Client) GetBlockHeaderAsync(ctx context.Context, blockHash *chainhash.Hash) FutureGetBlockHeaderResult
- func (c *Client) GetBlockHeaderVerbose(ctx context.Context, blockHash *chainhash.Hash) (*btcjson.GetBlockHeaderVerboseResult, error)
- func (c *Client) GetBlockHeaderVerboseAsync(ctx context.Context, blockHash *chainhash.Hash) FutureGetBlockHeaderVerboseResult
- func (c *Client) GetBlockVerbose(ctx context.Context, blockHash *chainhash.Hash) (*btcjson.GetBlockVerboseResult, error)
- func (c *Client) GetBlockVerboseAsync(ctx context.Context, blockHash *chainhash.Hash) FutureGetBlockVerboseResult
- func (c *Client) GetBlockVerboseTx(ctx context.Context, blockHash *chainhash.Hash) (*btcjson.GetBlockVerboseResult, error)
- func (c *Client) GetBlockVerboseTxAsync(ctx context.Context, blockHash *chainhash.Hash) FutureGetBlockVerboseResult
- func (c *Client) GetCFilter(ctx context.Context, blockHash *chainhash.Hash, filterType wire.FilterType) (*wire.MsgCFilter, error)
- func (c *Client) GetCFilterAsync(ctx context.Context, blockHash *chainhash.Hash, filterType wire.FilterType) FutureGetCFilterResult
- func (c *Client) GetCFilterHeader(ctx context.Context, blockHash *chainhash.Hash, filterType wire.FilterType) (*wire.MsgCFHeaders, error)
- func (c *Client) GetCFilterHeaderAsync(ctx context.Context, blockHash *chainhash.Hash, filterType wire.FilterType) FutureGetCFilterHeaderResult
- func (c *Client) GetCurrentNet(ctx context.Context) (wire.BitcoinNet, error)
- func (c *Client) GetCurrentNetAsync(ctx context.Context) FutureGetCurrentNetResult
- func (c *Client) GetDifficulty(ctx context.Context) (float64, error)
- func (c *Client) GetDifficultyAsync(ctx context.Context) FutureGetDifficultyResult
- func (c *Client) GetHeaders(ctx context.Context, blockLocators []chainhash.Hash, hashStop *chainhash.Hash) ([]wire.BlockHeader, error)
- func (c *Client) GetHeadersAsync(ctx context.Context, blockLocators []chainhash.Hash, hashStop *chainhash.Hash) FutureGetHeadersResult
- func (c *Client) GetMempoolEntry(ctx context.Context, txHash string) (*btcjson.GetMempoolEntryResult, error)
- func (c *Client) GetMempoolEntryAsync(ctx context.Context, txHash string) FutureGetMempoolEntryResult
- func (c *Client) GetRawMempool(ctx context.Context) ([]*chainhash.Hash, error)
- func (c *Client) GetRawMempoolAsync(ctx context.Context) FutureGetRawMempoolResult
- func (c *Client) GetRawMempoolVerbose(ctx context.Context) (map[string]btcjson.GetRawMempoolVerboseResult, error)
- func (c *Client) GetRawMempoolVerboseAsync(ctx context.Context) FutureGetRawMempoolVerboseResult
- func (c *Client) GetRawTransaction(ctx context.Context, txHash *chainhash.Hash) (*bchutil.Tx, error)
- func (c *Client) GetRawTransactionAsync(ctx context.Context, txHash *chainhash.Hash) FutureGetRawTransactionResult
- func (c *Client) GetRawTransactionVerbose(ctx context.Context, txHash *chainhash.Hash) (*btcjson.TxRawResult, error)
- func (c *Client) GetRawTransactionVerboseAsync(ctx context.Context, txHash *chainhash.Hash) FutureGetRawTransactionVerboseResult
- func (c *Client) GetTxOut(ctx context.Context, txHash *chainhash.Hash, index uint32, mempool bool) (*btcjson.GetTxOutResult, error)
- func (c *Client) GetTxOutAsync(ctx context.Context, txHash *chainhash.Hash, index uint32, mempool bool) FutureGetTxOutResult
- func (c *Client) InvalidateBlock(ctx context.Context, blockHash *chainhash.Hash) error
- func (c *Client) InvalidateBlockAsync(ctx context.Context, blockHash *chainhash.Hash) FutureInvalidateBlockResult
- func (c *Client) ListAddressTransactions(ctx context.Context, addresses []bchutil.Address, account string) ([]btcjson.ListTransactionsResult, error)
- func (c *Client) ListAddressTransactionsAsync(ctx context.Context, addresses []bchutil.Address, account string) FutureListAddressTransactionsResult
- func (c *Client) NextID() uint64
- func (c *Client) RawRequest(ctx context.Context, method string, params []json.RawMessage) (json.RawMessage, error)
- func (c *Client) RawRequestAsync(ctx context.Context, method string, params []json.RawMessage) FutureRawResult
- func (c *Client) RescanBlocks(ctx context.Context, blockHashes []chainhash.Hash) ([]btcjson.RescannedBlock, error)
- func (c *Client) RescanBlocksAsync(ctx context.Context, blockHashes []chainhash.Hash) FutureRescanBlocksResult
- func (c *Client) SearchRawTransactions(ctx context.Context, address bchutil.Address, skip, count int, reverse bool, ...) ([]*wire.MsgTx, error)
- func (c *Client) SearchRawTransactionsAsync(ctx context.Context, address bchutil.Address, skip, count int, reverse bool, ...) FutureSearchRawTransactionsResult
- func (c *Client) SearchRawTransactionsVerbose(ctx context.Context, address bchutil.Address, skip, count int, ...) ([]*btcjson.SearchRawTransactionsResult, error)
- func (c *Client) SearchRawTransactionsVerboseAsync(ctx context.Context, address bchutil.Address, skip, count int, ...) FutureSearchRawTransactionsVerboseResult
- func (c *Client) SendRawTransaction(ctx context.Context, tx *wire.MsgTx, allowHighFees bool) (*chainhash.Hash, error)
- func (c *Client) SendRawTransactionAsync(ctx context.Context, tx *wire.MsgTx, allowHighFees bool) FutureSendRawTransactionResult
- func (c *Client) SessionAsync(ctx context.Context) FutureSessionResult
- func (c *Client) Shutdown()
- func (c *Client) SignRawTransaction(ctx context.Context, tx *wire.MsgTx) (*wire.MsgTx, bool, error)
- func (c *Client) SignRawTransaction2(ctx context.Context, tx *wire.MsgTx, inputs []btcjson.RawTxInput) (*wire.MsgTx, bool, error)
- func (c *Client) SignRawTransaction2Async(ctx context.Context, tx *wire.MsgTx, inputs []btcjson.RawTxInput) FutureSignRawTransactionResult
- func (c *Client) SignRawTransaction3(ctx context.Context, tx *wire.MsgTx, inputs []btcjson.RawTxInput, ...) (*wire.MsgTx, bool, error)
- func (c *Client) SignRawTransaction3Async(ctx context.Context, tx *wire.MsgTx, inputs []btcjson.RawTxInput, ...) FutureSignRawTransactionResult
- func (c *Client) SignRawTransaction4(ctx context.Context, tx *wire.MsgTx, inputs []btcjson.RawTxInput, ...) (*wire.MsgTx, bool, error)
- func (c *Client) SignRawTransaction4Async(ctx context.Context, tx *wire.MsgTx, inputs []btcjson.RawTxInput, ...) FutureSignRawTransactionResult
- func (c *Client) SignRawTransactionAsync(ctx context.Context, tx *wire.MsgTx) FutureSignRawTransactionResult
- func (c *Client) VerifyChain(ctx context.Context) (bool, error)
- func (c *Client) VerifyChainAsync(ctx context.Context) FutureVerifyChainResult
- func (c *Client) VerifyChainBlocks(ctx context.Context, checkLevel, numBlocks int32) (bool, error)
- func (c *Client) VerifyChainBlocksAsync(ctx context.Context, checkLevel, numBlocks int32) FutureVerifyChainResult
- func (c *Client) VerifyChainLevel(ctx context.Context, checkLevel int32) (bool, error)
- func (c *Client) VerifyChainLevelAsync(ctx context.Context, checkLevel int32) FutureVerifyChainResult
- func (c *Client) Version(ctx context.Context) (map[string]btcjson.VersionResult, error)
- func (c *Client) VersionAsync(ctx context.Context) FutureVersionResult
- func (c *Client) WaitForShutdown()
- type ConnConfig
- type FutureCreateEncryptedWalletResult
- type FutureCreateRawTransactionResult
- type FutureDebugLevelResult
- type FutureDecodeRawTransactionResult
- type FutureDecodeScriptResult
- type FutureEstimateFeeResult
- type FutureExportWatchingWalletResult
- type FutureGetBestBlockHashResult
- type FutureGetBestBlockResult
- type FutureGetBlockChainInfoResult
- type FutureGetBlockCountResult
- type FutureGetBlockHashResult
- type FutureGetBlockHeaderResult
- type FutureGetBlockHeaderVerboseResult
- type FutureGetBlockResult
- type FutureGetBlockVerboseResult
- type FutureGetCFilterHeaderResult
- type FutureGetCFilterResult
- type FutureGetCurrentNetResult
- type FutureGetDifficultyResult
- type FutureGetHeadersResult
- type FutureGetMempoolEntryResult
- type FutureGetRawMempoolResult
- type FutureGetRawMempoolVerboseResult
- type FutureGetRawTransactionResult
- type FutureGetRawTransactionVerboseResult
- type FutureGetTxOutResult
- type FutureInvalidateBlockResult
- type FutureListAddressTransactionsResult
- type FutureRawResult
- type FutureRescanBlocksResult
- type FutureSearchRawTransactionsResult
- type FutureSearchRawTransactionsVerboseResult
- type FutureSendRawTransactionResult
- type FutureSessionResult
- type FutureSignRawTransactionResult
- type FutureVerifyChainResult
- type FutureVersionResult
- type SigHashType
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidAuth is an error to describe the condition where the client // is either unable to authenticate or the specified endpoint is // incorrect. ErrInvalidAuth = errors.New("authentication failure") // ErrInvalidEndpoint is an error to describe the condition where the // websocket handshake failed with the specified endpoint. ErrInvalidEndpoint = errors.New("the endpoint either does not support " + "websockets or does not exist") // ErrClientNotConnected is an error to describe the condition where a // websocket client has been created, but the connection was never // established. This condition differs from ErrClientDisconnect, which // represents an established connection that was lost. ErrClientNotConnected = errors.New("the client was never connected") // ErrClientDisconnect is an error to describe the condition where the // client has been disconnected from the RPC server. When the // DisableAutoReconnect option is not set, any outstanding futures // when a client disconnect occurs will return this error as will // any new requests. ErrClientDisconnect = errors.New("the client has been disconnected") // ErrClientShutdown is an error to describe the condition where the // client is either already shutdown, or in the process of shutting // down. Any outstanding futures when a client shutdown occurs will // return this error as will any new requests. ErrClientShutdown = errors.New("the client has been shutdown") // ErrNotWebsocketClient is an error to describe the condition of // calling a Client method intended for a websocket client when the // client has been configured to run in HTTP POST mode instead. ErrNotWebsocketClient = errors.New("client is not configured for " + "websockets") // ErrClientAlreadyConnected is an error to describe the condition where // a new client connection cannot be established due to a websocket // client having already connected to the RPC server. ErrClientAlreadyConnected = errors.New("websocket client has already " + "connected") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a Bitcoin RPC client which allows easy access to the various RPC methods available on a Bitcoin RPC server. Each of the wrapper functions handle the details of converting the passed and return types to and from the underlying JSON types which are required for the JSON-RPC invocations
The client provides each RPC in both synchronous (blocking) and asynchronous (non-blocking) forms. The asynchronous forms are based on the concept of futures where they return an instance of a type that promises to deliver the result of the invocation at some future time. Invoking the Receive method on the returned future will block until the result is available if it's not already.
func New ¶
func New(config *ConnConfig) (*Client, error)
New creates a new RPC client based on the provided connection configuration details. The notification handlers parameter may be nil if you are not interested in receiving notifications and will be ignored if the configuration is set to run in HTTP POST mode.
func (*Client) CreateEncryptedWallet ¶
CreateEncryptedWallet requests the creation of an encrypted wallet. Wallets managed by btcwallet are only written to disk with encrypted private keys, and generating wallets on the fly is impossible as it requires user input for the encryption passphrase. This RPC specifies the passphrase and instructs the wallet creation. This may error if a wallet is already opened, or the new wallet cannot be written to disk.
NOTE: This is a btcwallet extension.
func (*Client) CreateEncryptedWalletAsync ¶
func (c *Client) CreateEncryptedWalletAsync(ctx context.Context, passphrase string) FutureCreateEncryptedWalletResult
CreateEncryptedWalletAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See CreateEncryptedWallet for the blocking version and more details.
NOTE: This is a btcwallet extension.
func (*Client) CreateRawTransaction ¶
func (c *Client) CreateRawTransaction(ctx context.Context, inputs []btcjson.TransactionInput, amounts map[bchutil.Address]bchutil.Amount, lockTime *int64) (*wire.MsgTx, error)
CreateRawTransaction returns a new transaction spending the provided inputs and sending to the provided addresses.
func (*Client) CreateRawTransactionAsync ¶
func (c *Client) CreateRawTransactionAsync(ctx context.Context, inputs []btcjson.TransactionInput, amounts map[bchutil.Address]bchutil.Amount, lockTime *int64) FutureCreateRawTransactionResult
CreateRawTransactionAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See CreateRawTransaction for the blocking version and more details.
func (*Client) DebugLevel ¶
DebugLevel dynamically sets the debug logging level to the passed level specification.
The levelspec can be either a debug level or of the form:
<subsystem>=<level>,<subsystem2>=<level2>,...
Additionally, the special keyword 'show' can be used to get a list of the available subsystems.
NOTE: This is a btcd extension.
func (*Client) DebugLevelAsync ¶
func (c *Client) DebugLevelAsync(ctx context.Context, levelSpec string) FutureDebugLevelResult
DebugLevelAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See DebugLevel for the blocking version and more details.
NOTE: This is a btcd extension.
func (*Client) DecodeRawTransaction ¶
func (c *Client) DecodeRawTransaction(ctx context.Context, serializedTx []byte) (*btcjson.TxRawResult, error)
DecodeRawTransaction returns information about a transaction given its serialized bytes.
func (*Client) DecodeRawTransactionAsync ¶
func (c *Client) DecodeRawTransactionAsync(ctx context.Context, serializedTx []byte) FutureDecodeRawTransactionResult
DecodeRawTransactionAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See DecodeRawTransaction for the blocking version and more details.
func (*Client) DecodeScript ¶
func (c *Client) DecodeScript(ctx context.Context, serializedScript []byte) (*btcjson.DecodeScriptResult, error)
DecodeScript returns information about a script given its serialized bytes.
func (*Client) DecodeScriptAsync ¶
func (c *Client) DecodeScriptAsync(ctx context.Context, serializedScript []byte) FutureDecodeScriptResult
DecodeScriptAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See DecodeScript for the blocking version and more details.
func (*Client) EstimateFee ¶
EstimateFee provides an estimated fee in bitcoins per kilobyte.
func (*Client) EstimateFeeAsync ¶
func (c *Client) EstimateFeeAsync(ctx context.Context, numBlocks int64) FutureEstimateFeeResult
EstimateFeeAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See EstimateFee for the blocking version and more details.
func (*Client) ExportWatchingWallet ¶
ExportWatchingWallet returns the raw bytes for a watching-only version of wallet.bin and tx.bin, respectively, for the specified account that can be used by btcwallet to enable a wallet which does not have the private keys necessary to spend funds.
NOTE: This is a btcwallet extension.
func (*Client) ExportWatchingWalletAsync ¶
func (c *Client) ExportWatchingWalletAsync(ctx context.Context, account string) FutureExportWatchingWalletResult
ExportWatchingWalletAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See ExportWatchingWallet for the blocking version and more details.
NOTE: This is a btcwallet extension.
func (*Client) GetBestBlock ¶
GetBestBlock returns the hash and height of the block in the longest (best) chain.
NOTE: This is a btcd extension.
func (*Client) GetBestBlockAsync ¶
func (c *Client) GetBestBlockAsync(ctx context.Context) FutureGetBestBlockResult
GetBestBlockAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetBestBlock for the blocking version and more details.
NOTE: This is a btcd extension.
func (*Client) GetBestBlockHash ¶
GetBestBlockHash returns the hash of the best block in the longest block chain.
func (*Client) GetBestBlockHashAsync ¶
func (c *Client) GetBestBlockHashAsync(ctx context.Context) FutureGetBestBlockHashResult
GetBestBlockHashAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetBestBlockHash for the blocking version and more details.
func (*Client) GetBlock ¶
GetBlock returns a raw block from the server given its hash.
See GetBlockVerbose to retrieve a data structure with information about the block instead.
func (*Client) GetBlockAsync ¶
GetBlockAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetBlock for the blocking version and more details.
func (*Client) GetBlockChainInfo ¶
GetBlockChainInfo returns information related to the processing state of various chain-specific details such as the current difficulty from the tip of the main chain.
func (*Client) GetBlockChainInfoAsync ¶
func (c *Client) GetBlockChainInfoAsync(ctx context.Context) FutureGetBlockChainInfoResult
GetBlockChainInfoAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetBlockChainInfo for the blocking version and more details.
func (*Client) GetBlockCount ¶
GetBlockCount returns the number of blocks in the longest block chain.
func (*Client) GetBlockCountAsync ¶
func (c *Client) GetBlockCountAsync(ctx context.Context) FutureGetBlockCountResult
GetBlockCountAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetBlockCount for the blocking version and more details.
func (*Client) GetBlockHash ¶
GetBlockHash returns the hash of the block in the best block chain at the given height.
func (*Client) GetBlockHashAsync ¶
func (c *Client) GetBlockHashAsync(ctx context.Context, blockHeight int64) FutureGetBlockHashResult
GetBlockHashAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetBlockHash for the blocking version and more details.
func (*Client) GetBlockHeader ¶
func (c *Client) GetBlockHeader(ctx context.Context, blockHash *chainhash.Hash) (*wire.BlockHeader, error)
GetBlockHeader returns the blockheader from the server given its hash.
See GetBlockHeaderVerbose to retrieve a data structure with information about the block instead.
func (*Client) GetBlockHeaderAsync ¶
func (c *Client) GetBlockHeaderAsync(ctx context.Context, blockHash *chainhash.Hash) FutureGetBlockHeaderResult
GetBlockHeaderAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetBlockHeader for the blocking version and more details.
func (*Client) GetBlockHeaderVerbose ¶
func (c *Client) GetBlockHeaderVerbose(ctx context.Context, blockHash *chainhash.Hash) (*btcjson.GetBlockHeaderVerboseResult, error)
GetBlockHeaderVerbose returns a data structure with information about the blockheader from the server given its hash.
See GetBlockHeader to retrieve a blockheader instead.
func (*Client) GetBlockHeaderVerboseAsync ¶
func (c *Client) GetBlockHeaderVerboseAsync(ctx context.Context, blockHash *chainhash.Hash) FutureGetBlockHeaderVerboseResult
GetBlockHeaderVerboseAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetBlockHeader for the blocking version and more details.
func (*Client) GetBlockVerbose ¶
func (c *Client) GetBlockVerbose(ctx context.Context, blockHash *chainhash.Hash) (*btcjson.GetBlockVerboseResult, error)
GetBlockVerbose returns a data structure from the server with information about a block given its hash.
See GetBlockVerboseTx to retrieve transaction data structures as well. See GetBlock to retrieve a raw block instead.
func (*Client) GetBlockVerboseAsync ¶
func (c *Client) GetBlockVerboseAsync(ctx context.Context, blockHash *chainhash.Hash) FutureGetBlockVerboseResult
GetBlockVerboseAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetBlockVerbose for the blocking version and more details.
func (*Client) GetBlockVerboseTx ¶
func (c *Client) GetBlockVerboseTx(ctx context.Context, blockHash *chainhash.Hash) (*btcjson.GetBlockVerboseResult, error)
GetBlockVerboseTx returns a data structure from the server with information about a block and its transactions given its hash.
See GetBlockVerbose if only transaction hashes are preferred. See GetBlock to retrieve a raw block instead.
func (*Client) GetBlockVerboseTxAsync ¶
func (c *Client) GetBlockVerboseTxAsync(ctx context.Context, blockHash *chainhash.Hash) FutureGetBlockVerboseResult
GetBlockVerboseTxAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetBlockVerboseTx or the blocking version and more details.
func (*Client) GetCFilter ¶
func (c *Client) GetCFilter(ctx context.Context, blockHash *chainhash.Hash, filterType wire.FilterType) (*wire.MsgCFilter, error)
GetCFilter returns a raw filter from the server given its block hash.
func (*Client) GetCFilterAsync ¶
func (c *Client) GetCFilterAsync(ctx context.Context, blockHash *chainhash.Hash, filterType wire.FilterType) FutureGetCFilterResult
GetCFilterAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetCFilter for the blocking version and more details.
func (*Client) GetCFilterHeader ¶
func (c *Client) GetCFilterHeader(ctx context.Context, blockHash *chainhash.Hash, filterType wire.FilterType) (*wire.MsgCFHeaders, error)
GetCFilterHeader returns a raw filter header from the server given its block hash.
func (*Client) GetCFilterHeaderAsync ¶
func (c *Client) GetCFilterHeaderAsync(ctx context.Context, blockHash *chainhash.Hash, filterType wire.FilterType) FutureGetCFilterHeaderResult
GetCFilterHeaderAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetCFilterHeader for the blocking version and more details.
func (*Client) GetCurrentNet ¶
GetCurrentNet returns the network the server is running on.
NOTE: This is a btcd extension.
func (*Client) GetCurrentNetAsync ¶
func (c *Client) GetCurrentNetAsync(ctx context.Context) FutureGetCurrentNetResult
GetCurrentNetAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetCurrentNet for the blocking version and more details.
NOTE: This is a btcd extension.
func (*Client) GetDifficulty ¶
GetDifficulty returns the proof-of-work difficulty as a multiple of the minimum difficulty.
func (*Client) GetDifficultyAsync ¶
func (c *Client) GetDifficultyAsync(ctx context.Context) FutureGetDifficultyResult
GetDifficultyAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetDifficulty for the blocking version and more details.
func (*Client) GetHeaders ¶
func (c *Client) GetHeaders(ctx context.Context, blockLocators []chainhash.Hash, hashStop *chainhash.Hash) ([]wire.BlockHeader, error)
GetHeaders mimics the wire protocol getheaders and headers messages by returning all headers on the main chain after the first known block in the locators, up until a block hash matches hashStop.
NOTE: This is a btcsuite extension ported from github.com/decred/dcrrpcclient.
func (*Client) GetHeadersAsync ¶
func (c *Client) GetHeadersAsync(ctx context.Context, blockLocators []chainhash.Hash, hashStop *chainhash.Hash) FutureGetHeadersResult
GetHeadersAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetHeaders for the blocking version and more details.
NOTE: This is a btcsuite extension ported from github.com/decred/dcrrpcclient.
func (*Client) GetMempoolEntry ¶
func (c *Client) GetMempoolEntry(ctx context.Context, txHash string) (*btcjson.GetMempoolEntryResult, error)
GetMempoolEntry returns a data structure with information about the transaction in the memory pool given its hash.
func (*Client) GetMempoolEntryAsync ¶
func (c *Client) GetMempoolEntryAsync(ctx context.Context, txHash string) FutureGetMempoolEntryResult
GetMempoolEntryAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetMempoolEntry for the blocking version and more details.
func (*Client) GetRawMempool ¶
GetRawMempool returns the hashes of all transactions in the memory pool.
See GetRawMempoolVerbose to retrieve data structures with information about the transactions instead.
func (*Client) GetRawMempoolAsync ¶
func (c *Client) GetRawMempoolAsync(ctx context.Context) FutureGetRawMempoolResult
GetRawMempoolAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetRawMempool for the blocking version and more details.
func (*Client) GetRawMempoolVerbose ¶
func (c *Client) GetRawMempoolVerbose(ctx context.Context) (map[string]btcjson.GetRawMempoolVerboseResult, error)
GetRawMempoolVerbose returns a map of transaction hashes to an associated data structure with information about the transaction for all transactions in the memory pool.
See GetRawMempool to retrieve only the transaction hashes instead.
func (*Client) GetRawMempoolVerboseAsync ¶
func (c *Client) GetRawMempoolVerboseAsync(ctx context.Context) FutureGetRawMempoolVerboseResult
GetRawMempoolVerboseAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetRawMempoolVerbose for the blocking version and more details.
func (*Client) GetRawTransaction ¶
func (c *Client) GetRawTransaction(ctx context.Context, txHash *chainhash.Hash) (*bchutil.Tx, error)
GetRawTransaction returns a transaction given its hash.
See GetRawTransactionVerbose to obtain additional information about the transaction.
func (*Client) GetRawTransactionAsync ¶
func (c *Client) GetRawTransactionAsync(ctx context.Context, txHash *chainhash.Hash) FutureGetRawTransactionResult
GetRawTransactionAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetRawTransaction for the blocking version and more details.
func (*Client) GetRawTransactionVerbose ¶
func (c *Client) GetRawTransactionVerbose(ctx context.Context, txHash *chainhash.Hash) (*btcjson.TxRawResult, error)
GetRawTransactionVerbose returns information about a transaction given its hash.
See GetRawTransaction to obtain only the transaction already deserialized.
func (*Client) GetRawTransactionVerboseAsync ¶
func (c *Client) GetRawTransactionVerboseAsync(ctx context.Context, txHash *chainhash.Hash) FutureGetRawTransactionVerboseResult
GetRawTransactionVerboseAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetRawTransactionVerbose for the blocking version and more details.
func (*Client) GetTxOut ¶
func (c *Client) GetTxOut(ctx context.Context, txHash *chainhash.Hash, index uint32, mempool bool) (*btcjson.GetTxOutResult, error)
GetTxOut returns the transaction output info if it's unspent and nil, otherwise.
func (*Client) GetTxOutAsync ¶
func (c *Client) GetTxOutAsync(ctx context.Context, txHash *chainhash.Hash, index uint32, mempool bool) FutureGetTxOutResult
GetTxOutAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See GetTxOut for the blocking version and more details.
func (*Client) InvalidateBlock ¶
InvalidateBlock invalidates a specific block.
func (*Client) InvalidateBlockAsync ¶
func (c *Client) InvalidateBlockAsync(ctx context.Context, blockHash *chainhash.Hash) FutureInvalidateBlockResult
InvalidateBlockAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See InvalidateBlock for the blocking version and more details.
func (*Client) ListAddressTransactions ¶
func (c *Client) ListAddressTransactions(ctx context.Context, addresses []bchutil.Address, account string) ([]btcjson.ListTransactionsResult, error)
ListAddressTransactions returns information about all transactions associated with the provided addresses.
NOTE: This is a btcwallet extension.
func (*Client) ListAddressTransactionsAsync ¶
func (c *Client) ListAddressTransactionsAsync(ctx context.Context, addresses []bchutil.Address, account string) FutureListAddressTransactionsResult
ListAddressTransactionsAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See ListAddressTransactions for the blocking version and more details.
NOTE: This is a btcd extension.
func (*Client) NextID ¶
NextID returns the next id to be used when sending a JSON-RPC message. This ID allows responses to be associated with particular requests per the JSON-RPC specification. Typically the consumer of the client does not need to call this function, however, if a custom request is being created and used this function should be used to ensure the ID is unique amongst all requests being made.
func (*Client) RawRequest ¶
func (c *Client) RawRequest(ctx context.Context, method string, params []json.RawMessage) (json.RawMessage, error)
RawRequest allows the caller to send a raw or custom request to the server. This method may be used to send and receive requests and responses for requests that are not handled by this client package, or to proxy partially unmarshaled requests to another JSON-RPC server if a request cannot be handled directly.
func (*Client) RawRequestAsync ¶
func (c *Client) RawRequestAsync(ctx context.Context, method string, params []json.RawMessage) FutureRawResult
RawRequestAsync returns an instance of a type that can be used to get the result of a custom RPC request at some future time by invoking the Receive function on the returned instance.
See RawRequest for the blocking version and more details.
func (*Client) RescanBlocks ¶
func (c *Client) RescanBlocks(ctx context.Context, blockHashes []chainhash.Hash) ([]btcjson.RescannedBlock, error)
RescanBlocks rescans the blocks identified by blockHashes, in order, using the client's loaded transaction filter. The blocks do not need to be on the main chain, but they do need to be adjacent to each other.
NOTE: This is a btcsuite extension ported from github.com/decred/dcrrpcclient.
func (*Client) RescanBlocksAsync ¶
func (c *Client) RescanBlocksAsync(ctx context.Context, blockHashes []chainhash.Hash) FutureRescanBlocksResult
RescanBlocksAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See RescanBlocks for the blocking version and more details.
NOTE: This is a btcsuite extension ported from github.com/decred/dcrrpcclient.
func (*Client) SearchRawTransactions ¶
func (c *Client) SearchRawTransactions(ctx context.Context, address bchutil.Address, skip, count int, reverse bool, filterAddrs []string) ([]*wire.MsgTx, error)
SearchRawTransactions returns transactions that involve the passed address.
NOTE: Chain servers do not typically provide this capability unless it has specifically been enabled.
See SearchRawTransactionsVerbose to retrieve a list of data structures with information about the transactions instead of the transactions themselves.
func (*Client) SearchRawTransactionsAsync ¶
func (c *Client) SearchRawTransactionsAsync(ctx context.Context, address bchutil.Address, skip, count int, reverse bool, filterAddrs []string) FutureSearchRawTransactionsResult
SearchRawTransactionsAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See SearchRawTransactions for the blocking version and more details.
func (*Client) SearchRawTransactionsVerbose ¶
func (c *Client) SearchRawTransactionsVerbose(ctx context.Context, address bchutil.Address, skip, count int, includePrevOut, reverse bool, filterAddrs []string) ([]*btcjson.SearchRawTransactionsResult, error)
SearchRawTransactionsVerbose returns a list of data structures that describe transactions which involve the passed address.
NOTE: Chain servers do not typically provide this capability unless it has specifically been enabled.
See SearchRawTransactions to retrieve a list of raw transactions instead.
func (*Client) SearchRawTransactionsVerboseAsync ¶
func (c *Client) SearchRawTransactionsVerboseAsync(ctx context.Context, address bchutil.Address, skip, count int, includePrevOut, reverse bool, filterAddrs *[]string) FutureSearchRawTransactionsVerboseResult
SearchRawTransactionsVerboseAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See SearchRawTransactionsVerbose for the blocking version and more details.
func (*Client) SendRawTransaction ¶
func (c *Client) SendRawTransaction(ctx context.Context, tx *wire.MsgTx, allowHighFees bool) (*chainhash.Hash, error)
SendRawTransaction submits the encoded transaction to the server which will then relay it to the network.
func (*Client) SendRawTransactionAsync ¶
func (c *Client) SendRawTransactionAsync(ctx context.Context, tx *wire.MsgTx, allowHighFees bool) FutureSendRawTransactionResult
SendRawTransactionAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See SendRawTransaction for the blocking version and more details.
func (*Client) SessionAsync ¶
func (c *Client) SessionAsync(ctx context.Context) FutureSessionResult
SessionAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See Session for the blocking version and more details.
NOTE: This is a btcsuite extension.
func (*Client) Shutdown ¶
func (c *Client) Shutdown()
Shutdown shuts down the client by disconnecting any connections associated with the client and, when automatic reconnect is enabled, preventing future attempts to reconnect. It also stops all goroutines.
func (*Client) SignRawTransaction ¶
SignRawTransaction signs inputs for the passed transaction and returns the signed transaction as well as whether or not all inputs are now signed.
This function assumes the RPC server already knows the input transactions and private keys for the passed transaction which needs to be signed and uses the default signature hash type. Use one of the SignRawTransaction# variants to specify that information if needed.
func (*Client) SignRawTransaction2 ¶
func (c *Client) SignRawTransaction2(ctx context.Context, tx *wire.MsgTx, inputs []btcjson.RawTxInput) (*wire.MsgTx, bool, error)
SignRawTransaction2 signs inputs for the passed transaction given the list of information about the input transactions needed to perform the signing process.
This only input transactions that need to be specified are ones the RPC server does not already know. Already known input transactions will be merged with the specified transactions.
See SignRawTransaction if the RPC server already knows the input transactions.
func (*Client) SignRawTransaction2Async ¶
func (c *Client) SignRawTransaction2Async(ctx context.Context, tx *wire.MsgTx, inputs []btcjson.RawTxInput) FutureSignRawTransactionResult
SignRawTransaction2Async returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See SignRawTransaction2 for the blocking version and more details.
func (*Client) SignRawTransaction3 ¶
func (c *Client) SignRawTransaction3(ctx context.Context, tx *wire.MsgTx, inputs []btcjson.RawTxInput, privKeysWIF []string) (*wire.MsgTx, bool, error)
SignRawTransaction3 signs inputs for the passed transaction given the list of information about extra input transactions and a list of private keys needed to perform the signing process. The private keys must be in wallet import format (WIF).
This only input transactions that need to be specified are ones the RPC server does not already know. Already known input transactions will be merged with the specified transactions. This means the list of transaction inputs can be nil if the RPC server already knows them all.
NOTE: Unlike the merging functionality of the input transactions, ONLY the specified private keys will be used, so even if the server already knows some of the private keys, they will NOT be used.
See SignRawTransaction if the RPC server already knows the input transactions and private keys or SignRawTransaction2 if it already knows the private keys.
func (*Client) SignRawTransaction3Async ¶
func (c *Client) SignRawTransaction3Async(ctx context.Context, tx *wire.MsgTx, inputs []btcjson.RawTxInput, privKeysWIF []string) FutureSignRawTransactionResult
SignRawTransaction3Async returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See SignRawTransaction3 for the blocking version and more details.
func (*Client) SignRawTransaction4 ¶
func (c *Client) SignRawTransaction4(ctx context.Context, tx *wire.MsgTx, inputs []btcjson.RawTxInput, privKeysWIF []string, hashType SigHashType) (*wire.MsgTx, bool, error)
SignRawTransaction4 signs inputs for the passed transaction using the the specified signature hash type given the list of information about extra input transactions and a potential list of private keys needed to perform the signing process. The private keys, if specified, must be in wallet import format (WIF).
The only input transactions that need to be specified are ones the RPC server does not already know. This means the list of transaction inputs can be nil if the RPC server already knows them all.
NOTE: Unlike the merging functionality of the input transactions, ONLY the specified private keys will be used, so even if the server already knows some of the private keys, they will NOT be used. The list of private keys can be nil in which case any private keys the RPC server knows will be used.
This function should only used if a non-default signature hash type is desired. Otherwise, see SignRawTransaction if the RPC server already knows the input transactions and private keys, SignRawTransaction2 if it already knows the private keys, or SignRawTransaction3 if it does not know both.
func (*Client) SignRawTransaction4Async ¶
func (c *Client) SignRawTransaction4Async(ctx context.Context, tx *wire.MsgTx, inputs []btcjson.RawTxInput, privKeysWIF []string, hashType SigHashType) FutureSignRawTransactionResult
SignRawTransaction4Async returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See SignRawTransaction4 for the blocking version and more details.
func (*Client) SignRawTransactionAsync ¶
func (c *Client) SignRawTransactionAsync(ctx context.Context, tx *wire.MsgTx) FutureSignRawTransactionResult
SignRawTransactionAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See SignRawTransaction for the blocking version and more details.
func (*Client) VerifyChain ¶
VerifyChain requests the server to verify the block chain database using the default check level and number of blocks to verify.
See VerifyChainLevel and VerifyChainBlocks to override the defaults.
func (*Client) VerifyChainAsync ¶
func (c *Client) VerifyChainAsync(ctx context.Context) FutureVerifyChainResult
VerifyChainAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See VerifyChain for the blocking version and more details.
func (*Client) VerifyChainBlocks ¶
VerifyChainBlocks requests the server to verify the block chain database using the passed check level and number of blocks to verify.
The check level controls how thorough the verification is with higher numbers increasing the amount of checks done as consequently how long the verification takes.
The number of blocks refers to the number of blocks from the end of the current longest chain.
See VerifyChain and VerifyChainLevel to use defaults.
func (*Client) VerifyChainBlocksAsync ¶
func (c *Client) VerifyChainBlocksAsync(ctx context.Context, checkLevel, numBlocks int32) FutureVerifyChainResult
VerifyChainBlocksAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See VerifyChainBlocks for the blocking version and more details.
func (*Client) VerifyChainLevel ¶
VerifyChainLevel requests the server to verify the block chain database using the passed check level and default number of blocks to verify.
The check level controls how thorough the verification is with higher numbers increasing the amount of checks done as consequently how long the verification takes.
See VerifyChain to use the default check level and VerifyChainBlocks to override the number of blocks to verify.
func (*Client) VerifyChainLevelAsync ¶
func (c *Client) VerifyChainLevelAsync(ctx context.Context, checkLevel int32) FutureVerifyChainResult
VerifyChainLevelAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See VerifyChainLevel for the blocking version and more details.
func (*Client) Version ¶
Version returns information about the server's JSON-RPC API versions.
NOTE: This is a btcsuite extension ported from github.com/decred/dcrrpcclient.
func (*Client) VersionAsync ¶
func (c *Client) VersionAsync(ctx context.Context) FutureVersionResult
VersionAsync returns an instance of a type that can be used to get the result of the RPC at some future time by invoking the Receive function on the returned instance.
See Version for the blocking version and more details.
NOTE: This is a btcsuite extension ported from github.com/decred/dcrrpcclient.
func (*Client) WaitForShutdown ¶
func (c *Client) WaitForShutdown()
WaitForShutdown blocks until the client goroutines are stopped and the connection is closed.
type ConnConfig ¶
type ConnConfig struct { // Host is the IP address and port of the RPC server you want to connect // to. Host string // Endpoint is the websocket endpoint on the RPC server. This is // typically "ws". Endpoint string // User is the username to use to authenticate to the RPC server. User string // Pass is the passphrase to use to authenticate to the RPC server. Pass string // DisableTLS specifies whether transport layer security should be // disabled. It is recommended to always use TLS if the RPC server // supports it as otherwise your username and password is sent across // the wire in cleartext. DisableTLS bool // Certificates are the bytes for a PEM-encoded certificate chain used // for the TLS connection. It has no effect if the DisableTLS parameter // is true. Certificates []byte // Proxy specifies to connect through a SOCKS 5 proxy server. It may // be an empty string if a proxy is not required. Proxy string // ProxyUser is an optional username to use for the proxy server if it // requires authentication. It has no effect if the Proxy parameter // is not set. ProxyUser string // ProxyPass is an optional password to use for the proxy server if it // requires authentication. It has no effect if the Proxy parameter // is not set. ProxyPass string // DisableAutoReconnect specifies the client should not automatically // try to reconnect to the server when it has been disconnected. DisableAutoReconnect bool // HTTPPostMode instructs the client to run using multiple independent // connections issuing HTTP POST requests instead of using the default // of websockets. Websockets are generally preferred as some of the // features of the client such notifications only work with websockets, // however, not all servers support the websocket extensions, so this // flag can be set to true to use basic HTTP POST requests instead. HTTPPostMode bool // EnableBCInfoHacks is an option provided to enable compatibility hacks // when connecting to blockchain.info RPC server EnableBCInfoHacks bool FilterID string ChangeAddress string }
ConnConfig describes the connection configuration parameters for the client. This
type FutureCreateEncryptedWalletResult ¶
type FutureCreateEncryptedWalletResult chan *response
FutureCreateEncryptedWalletResult is a future promise to deliver the error result of a CreateEncryptedWalletAsync RPC invocation.
func (FutureCreateEncryptedWalletResult) Receive ¶
func (r FutureCreateEncryptedWalletResult) Receive() error
Receive waits for and returns the error response promised by the future.
type FutureCreateRawTransactionResult ¶
type FutureCreateRawTransactionResult chan *response
FutureCreateRawTransactionResult is a future promise to deliver the result of a CreateRawTransactionAsync RPC invocation (or an applicable error).
type FutureDebugLevelResult ¶
type FutureDebugLevelResult chan *response
FutureDebugLevelResult is a future promise to deliver the result of a DebugLevelAsync RPC invocation (or an applicable error).
func (FutureDebugLevelResult) Receive ¶
func (r FutureDebugLevelResult) Receive() (string, error)
Receive waits for the response promised by the future and returns the result of setting the debug logging level to the passed level specification or the list of of the available subsystems for the special keyword 'show'.
type FutureDecodeRawTransactionResult ¶
type FutureDecodeRawTransactionResult chan *response
FutureDecodeRawTransactionResult is a future promise to deliver the result of a DecodeRawTransactionAsync RPC invocation (or an applicable error).
func (FutureDecodeRawTransactionResult) Receive ¶
func (r FutureDecodeRawTransactionResult) Receive() (*btcjson.TxRawResult, error)
Receive waits for the response promised by the future and returns information about a transaction given its serialized bytes.
type FutureDecodeScriptResult ¶
type FutureDecodeScriptResult chan *response
FutureDecodeScriptResult is a future promise to deliver the result of a DecodeScriptAsync RPC invocation (or an applicable error).
func (FutureDecodeScriptResult) Receive ¶
func (r FutureDecodeScriptResult) Receive() (*btcjson.DecodeScriptResult, error)
Receive waits for the response promised by the future and returns information about a script given its serialized bytes.
type FutureEstimateFeeResult ¶
type FutureEstimateFeeResult chan *response
FutureEstimateFeeResult is a future promise to deliver the result of a EstimateFeeAsync RPC invocation (or an applicable error).
func (FutureEstimateFeeResult) Receive ¶
func (r FutureEstimateFeeResult) Receive() (float64, error)
Receive waits for the response promised by the future and returns the info provided by the server.
type FutureExportWatchingWalletResult ¶
type FutureExportWatchingWalletResult chan *response
FutureExportWatchingWalletResult is a future promise to deliver the result of an ExportWatchingWalletAsync RPC invocation (or an applicable error).
type FutureGetBestBlockHashResult ¶
type FutureGetBestBlockHashResult chan *response
FutureGetBestBlockHashResult is a future promise to deliver the result of a GetBestBlockAsync RPC invocation (or an applicable error).
type FutureGetBestBlockResult ¶
type FutureGetBestBlockResult chan *response
FutureGetBestBlockResult is a future promise to deliver the result of a GetBestBlockAsync RPC invocation (or an applicable error).
type FutureGetBlockChainInfoResult ¶
type FutureGetBlockChainInfoResult chan *response
FutureGetBlockChainInfoResult is a promise to deliver the result of a GetBlockChainInfoAsync RPC invocation (or an applicable error).
func (FutureGetBlockChainInfoResult) Receive ¶
func (r FutureGetBlockChainInfoResult) Receive() (*btcjson.GetBlockChainInfoResult, error)
Receive waits for the response promised by the future and returns chain info result provided by the server.
type FutureGetBlockCountResult ¶
type FutureGetBlockCountResult chan *response
FutureGetBlockCountResult is a future promise to deliver the result of a GetBlockCountAsync RPC invocation (or an applicable error).
func (FutureGetBlockCountResult) Receive ¶
func (r FutureGetBlockCountResult) Receive() (int64, error)
Receive waits for the response promised by the future and returns the number of blocks in the longest block chain.
type FutureGetBlockHashResult ¶
type FutureGetBlockHashResult chan *response
FutureGetBlockHashResult is a future promise to deliver the result of a GetBlockHashAsync RPC invocation (or an applicable error).
type FutureGetBlockHeaderResult ¶
type FutureGetBlockHeaderResult chan *response
FutureGetBlockHeaderResult is a future promise to deliver the result of a GetBlockHeaderAsync RPC invocation (or an applicable error).
func (FutureGetBlockHeaderResult) Receive ¶
func (r FutureGetBlockHeaderResult) Receive() (*wire.BlockHeader, error)
Receive waits for the response promised by the future and returns the blockheader requested from the server given its hash.
type FutureGetBlockHeaderVerboseResult ¶
type FutureGetBlockHeaderVerboseResult chan *response
FutureGetBlockHeaderVerboseResult is a future promise to deliver the result of a GetBlockAsync RPC invocation (or an applicable error).
func (FutureGetBlockHeaderVerboseResult) Receive ¶
func (r FutureGetBlockHeaderVerboseResult) Receive() (*btcjson.GetBlockHeaderVerboseResult, error)
Receive waits for the response promised by the future and returns the data structure of the blockheader requested from the server given its hash.
type FutureGetBlockResult ¶
type FutureGetBlockResult chan *response
FutureGetBlockResult is a future promise to deliver the result of a GetBlockAsync RPC invocation (or an applicable error).
type FutureGetBlockVerboseResult ¶
type FutureGetBlockVerboseResult chan *response
FutureGetBlockVerboseResult is a future promise to deliver the result of a GetBlockVerboseAsync RPC invocation (or an applicable error).
func (FutureGetBlockVerboseResult) Receive ¶
func (r FutureGetBlockVerboseResult) Receive() (*btcjson.GetBlockVerboseResult, error)
Receive waits for the response promised by the future and returns the data structure from the server with information about the requested block.
type FutureGetCFilterHeaderResult ¶
type FutureGetCFilterHeaderResult chan *response
FutureGetCFilterHeaderResult is a future promise to deliver the result of a GetCFilterHeaderAsync RPC invocation (or an applicable error).
func (FutureGetCFilterHeaderResult) Receive ¶
func (r FutureGetCFilterHeaderResult) Receive() (*wire.MsgCFHeaders, error)
Receive waits for the response promised by the future and returns the raw filter header requested from the server given its block hash.
type FutureGetCFilterResult ¶
type FutureGetCFilterResult chan *response
FutureGetCFilterResult is a future promise to deliver the result of a GetCFilterAsync RPC invocation (or an applicable error).
func (FutureGetCFilterResult) Receive ¶
func (r FutureGetCFilterResult) Receive() (*wire.MsgCFilter, error)
Receive waits for the response promised by the future and returns the raw filter requested from the server given its block hash.
type FutureGetCurrentNetResult ¶
type FutureGetCurrentNetResult chan *response
FutureGetCurrentNetResult is a future promise to deliver the result of a GetCurrentNetAsync RPC invocation (or an applicable error).
func (FutureGetCurrentNetResult) Receive ¶
func (r FutureGetCurrentNetResult) Receive() (wire.BitcoinNet, error)
Receive waits for the response promised by the future and returns the network the server is running on.
type FutureGetDifficultyResult ¶
type FutureGetDifficultyResult chan *response
FutureGetDifficultyResult is a future promise to deliver the result of a GetDifficultyAsync RPC invocation (or an applicable error).
func (FutureGetDifficultyResult) Receive ¶
func (r FutureGetDifficultyResult) Receive() (float64, error)
Receive waits for the response promised by the future and returns the proof-of-work difficulty as a multiple of the minimum difficulty.
type FutureGetHeadersResult ¶
type FutureGetHeadersResult chan *response
FutureGetHeadersResult is a future promise to deliver the result of a getheaders RPC invocation (or an applicable error).
NOTE: This is a btcsuite extension ported from github.com/decred/dcrrpcclient.
func (FutureGetHeadersResult) Receive ¶
func (r FutureGetHeadersResult) Receive() ([]wire.BlockHeader, error)
Receive waits for the response promised by the future and returns the getheaders result.
NOTE: This is a btcsuite extension ported from github.com/decred/dcrrpcclient.
type FutureGetMempoolEntryResult ¶
type FutureGetMempoolEntryResult chan *response
FutureGetMempoolEntryResult is a future promise to deliver the result of a GetMempoolEntryAsync RPC invocation (or an applicable error).
func (FutureGetMempoolEntryResult) Receive ¶
func (r FutureGetMempoolEntryResult) Receive() (*btcjson.GetMempoolEntryResult, error)
Receive waits for the response promised by the future and returns a data structure with information about the transaction in the memory pool given its hash.
type FutureGetRawMempoolResult ¶
type FutureGetRawMempoolResult chan *response
FutureGetRawMempoolResult is a future promise to deliver the result of a GetRawMempoolAsync RPC invocation (or an applicable error).
type FutureGetRawMempoolVerboseResult ¶
type FutureGetRawMempoolVerboseResult chan *response
FutureGetRawMempoolVerboseResult is a future promise to deliver the result of a GetRawMempoolVerboseAsync RPC invocation (or an applicable error).
func (FutureGetRawMempoolVerboseResult) Receive ¶
func (r FutureGetRawMempoolVerboseResult) Receive() (map[string]btcjson.GetRawMempoolVerboseResult, error)
Receive waits for the response promised by the future and returns a map of transaction hashes to an associated data structure with information about the transaction for all transactions in the memory pool.
type FutureGetRawTransactionResult ¶
type FutureGetRawTransactionResult chan *response
FutureGetRawTransactionResult is a future promise to deliver the result of a GetRawTransactionAsync RPC invocation (or an applicable error).
type FutureGetRawTransactionVerboseResult ¶
type FutureGetRawTransactionVerboseResult chan *response
FutureGetRawTransactionVerboseResult is a future promise to deliver the result of a GetRawTransactionVerboseAsync RPC invocation (or an applicable error).
func (FutureGetRawTransactionVerboseResult) Receive ¶
func (r FutureGetRawTransactionVerboseResult) Receive() (*btcjson.TxRawResult, error)
Receive waits for the response promised by the future and returns information about a transaction given its hash.
type FutureGetTxOutResult ¶
type FutureGetTxOutResult chan *response
FutureGetTxOutResult is a future promise to deliver the result of a GetTxOutAsync RPC invocation (or an applicable error).
func (FutureGetTxOutResult) Receive ¶
func (r FutureGetTxOutResult) Receive() (*btcjson.GetTxOutResult, error)
Receive waits for the response promised by the future and returns a transaction given its hash.
type FutureInvalidateBlockResult ¶
type FutureInvalidateBlockResult chan *response
FutureInvalidateBlockResult is a future promise to deliver the result of a InvalidateBlockAsync RPC invocation (or an applicable error).
func (FutureInvalidateBlockResult) Receive ¶
func (r FutureInvalidateBlockResult) Receive() error
Receive waits for the response promised by the future and returns the raw block requested from the server given its hash.
type FutureListAddressTransactionsResult ¶
type FutureListAddressTransactionsResult chan *response
FutureListAddressTransactionsResult is a future promise to deliver the result of a ListAddressTransactionsAsync RPC invocation (or an applicable error).
func (FutureListAddressTransactionsResult) Receive ¶
func (r FutureListAddressTransactionsResult) Receive() ([]btcjson.ListTransactionsResult, error)
Receive waits for the response promised by the future and returns information about all transactions associated with the provided addresses.
type FutureRawResult ¶
type FutureRawResult chan *response
FutureRawResult is a future promise to deliver the result of a RawRequest RPC invocation (or an applicable error).
func (FutureRawResult) Receive ¶
func (r FutureRawResult) Receive() (json.RawMessage, error)
Receive waits for the response promised by the future and returns the raw response, or an error if the request was unsuccessful.
type FutureRescanBlocksResult ¶
type FutureRescanBlocksResult chan *response
FutureRescanBlocksResult is a future promise to deliver the result of a RescanBlocksAsync RPC invocation (or an applicable error).
NOTE: This is a btcsuite extension ported from github.com/decred/dcrrpcclient.
func (FutureRescanBlocksResult) Receive ¶
func (r FutureRescanBlocksResult) Receive() ([]btcjson.RescannedBlock, error)
Receive waits for the response promised by the future and returns the discovered rescanblocks data.
NOTE: This is a btcsuite extension ported from github.com/decred/dcrrpcclient.
type FutureSearchRawTransactionsResult ¶
type FutureSearchRawTransactionsResult chan *response
FutureSearchRawTransactionsResult is a future promise to deliver the result of the SearchRawTransactionsAsync RPC invocation (or an applicable error).
type FutureSearchRawTransactionsVerboseResult ¶
type FutureSearchRawTransactionsVerboseResult chan *response
FutureSearchRawTransactionsVerboseResult is a future promise to deliver the result of the SearchRawTransactionsVerboseAsync RPC invocation (or an applicable error).
func (FutureSearchRawTransactionsVerboseResult) Receive ¶
func (r FutureSearchRawTransactionsVerboseResult) Receive() ([]*btcjson.SearchRawTransactionsResult, error)
Receive waits for the response promised by the future and returns the found raw transactions.
type FutureSendRawTransactionResult ¶
type FutureSendRawTransactionResult chan *response
FutureSendRawTransactionResult is a future promise to deliver the result of a SendRawTransactionAsync RPC invocation (or an applicable error).
type FutureSessionResult ¶
type FutureSessionResult chan *response
FutureSessionResult is a future promise to deliver the result of a SessionAsync RPC invocation (or an applicable error).
func (FutureSessionResult) Receive ¶
func (r FutureSessionResult) Receive() (*btcjson.SessionResult, error)
Receive waits for the response promised by the future and returns the session result.
type FutureSignRawTransactionResult ¶
type FutureSignRawTransactionResult chan *response
FutureSignRawTransactionResult is a future promise to deliver the result of one of the SignRawTransactionAsync family of RPC invocations (or an applicable error).
type FutureVerifyChainResult ¶
type FutureVerifyChainResult chan *response
FutureVerifyChainResult is a future promise to deliver the result of a VerifyChainAsync, VerifyChainLevelAsyncRPC, or VerifyChainBlocksAsync invocation (or an applicable error).
func (FutureVerifyChainResult) Receive ¶
func (r FutureVerifyChainResult) Receive() (bool, error)
Receive waits for the response promised by the future and returns whether or not the chain verified based on the check level and number of blocks to verify specified in the original call.
type FutureVersionResult ¶
type FutureVersionResult chan *response
FutureVersionResult is a future promise to deliver the result of a version RPC invocation (or an applicable error).
NOTE: This is a btcsuite extension ported from github.com/decred/dcrrpcclient.
func (FutureVersionResult) Receive ¶
func (r FutureVersionResult) Receive() (map[string]btcjson.VersionResult, error)
Receive waits for the response promised by the future and returns the version result.
NOTE: This is a btcsuite extension ported from github.com/decred/dcrrpcclient.
type SigHashType ¶
type SigHashType string
SigHashType enumerates the available signature hashing types that the SignRawTransaction function accepts.
const ( // SigHashAll indicates ALL of the outputs should be signed. SigHashAll SigHashType = "ALL" // SigHashNone indicates NONE of the outputs should be signed. This // can be thought of as specifying the signer does not care where the // bitcoins go. SigHashNone SigHashType = "NONE" // SigHashSingle indicates that a SINGLE output should be signed. This // can be thought of specifying the signer only cares about where ONE of // the outputs goes, but not any of the others. SigHashSingle SigHashType = "SINGLE" // SigHashAllAnyoneCanPay indicates that signer does not care where the // other inputs to the transaction come from, so it allows other people // to add inputs. In addition, it uses the SigHashAll signing method // for outputs. SigHashAllAnyoneCanPay SigHashType = "ALL|ANYONECANPAY" // SigHashNoneAnyoneCanPay indicates that signer does not care where the // other inputs to the transaction come from, so it allows other people // to add inputs. In addition, it uses the SigHashNone signing method // for outputs. SigHashNoneAnyoneCanPay SigHashType = "NONE|ANYONECANPAY" // SigHashSingleAnyoneCanPay indicates that signer does not care where // the other inputs to the transaction come from, so it allows other // people to add inputs. In addition, it uses the SigHashSingle signing // method for outputs. SigHashSingleAnyoneCanPay SigHashType = "SINGLE|ANYONECANPAY" )
Constants used to indicate the signature hash type for SignRawTransaction.
func (SigHashType) String ¶
func (s SigHashType) String() string
String returns the SighHashType in human-readable form.