Documentation ¶
Overview ¶
Package rpcclient implements a websocket-enabled Decred JSON-RPC client.
Overview ¶
This client provides a robust and easy to use client for interfacing with a Decred RPC server that uses a mostly btcd/bitcoin core style Decred JSON-RPC API. This client has been tested with dcrd (https://github.com/decred/dcrd) and dcrwallet (https://github.com/decred/dcrwallet).
In addition to the compatible standard HTTP POST JSON-RPC API, dcrd and dcrwallet provide a websocket interface that is more efficient than the standard HTTP POST method of accessing RPC. The section below discusses the differences between HTTP POST and websockets.
By default, this client assumes the RPC server supports websockets and has TLS enabled. In practice, this currently means it assumes you are talking to dcrd or dcrwallet by default. However, configuration options are provided to fall back to HTTP POST and disable TLS to support talking with inferior bitcoin core style RPC servers.
Websockets vs HTTP POST ¶
In HTTP POST-based JSON-RPC, every request creates a new HTTP connection, issues the call, waits for the response, and closes the connection. This adds quite a bit of overhead to every call and lacks flexibility for features such as notifications.
In contrast, the websocket-based JSON-RPC interface provided by dcrd and dcrwallet only uses a single connection that remains open and allows asynchronous bi-directional communication.
The websocket interface supports all of the same commands as HTTP POST, but they can be invoked without having to go through a connect/disconnect cycle for every call. In addition, the websocket interface provides other nice features such as the ability to register for asynchronous notifications of various events.
Synchronous vs Asynchronous API ¶
The client provides both a synchronous (blocking) and asynchronous API.
The synchronous (blocking) API is typically sufficient for most use cases. It works by issuing the RPC and blocking until the response is received. This allows straightforward code where you have the response as soon as the function returns.
The asynchronous API works on the concept of futures. When you invoke the async version of a command, it will quickly return an instance of a type that promises to provide the result of the RPC at some future time. In the background, the RPC call is issued and the result is stored in the returned instance. Invoking the Receive method on the returned instance will either return the result immediately if it has already arrived, or block until it has. This is useful since it provides the caller with greater control over concurrency.
Notifications ¶
The first important part of notifications is to realize that they will only work when connected via websockets. This should intuitively make sense because HTTP POST mode does not keep a connection open!
All notifications provided by dcrd require registration to opt-in. For example, if you want to be notified when funds are received by a set of addresses, you register the addresses via the NotifyReceived (or NotifyReceivedAsync) function.
Notification Handlers ¶
Notifications are exposed by the client through the use of callback handlers which are setup via a NotificationHandlers instance that is specified by the caller when creating the client.
It is important that these notification handlers complete quickly since they are intentionally in the main read loop and will block further reads until they complete. This provides the caller with the flexibility to decide what to do when notifications are coming in faster than they are being handled.
In particular this means issuing a blocking RPC call from a callback handler will cause a deadlock as more server responses won't be read until the callback returns, but the callback would be waiting for a response. Thus, any additional RPCs must be issued an a completely decoupled manner.
Automatic Reconnection ¶
By default, when running in websockets mode, this client will automatically keep trying to reconnect to the RPC server should the connection be lost. There is a back-off in between each connection attempt until it reaches one try per minute. Once a connection is re-established, all previously registered notifications are automatically re-registered and any in-flight commands are re-issued. This means from the caller's perspective, the request simply takes longer to complete.
The caller may invoke the Shutdown method on the client to force the client to cease reconnect attempts and return ErrClientShutdown for all outstanding commands.
The automatic reconnection can be disabled by setting the DisableAutoReconnect flag to true in the connection config when creating the client.
Minor RPC Server Differences and Chain/Wallet Separation
Some of the commands are extensions specific to a particular RPC server. For example, the DebugLevel call is an extension only provided by dcrd (and dcrwallet passthrough). Therefore if you call one of these commands against an RPC server that doesn't provide them, you will get an unimplemented error from the server. An effort has been made to call out which commmands are extensions in their documentation.
Also, it is important to realize that dcrd intentionally separates the wallet functionality into a separate process named dcrwallet. This means if you are connected to the dcrd RPC server directly, only the RPCs which are related to chain services will be available. Depending on your application, you might only need chain-related RPCs. In contrast, dcrwallet provides pass through treatment for chain-related RPCs, so it supports them in addition to wallet-related RPCs.
Errors ¶
There are 3 categories of errors that will be returned throughout this package:
- Errors related to the client connection such as authentication, endpoint, disconnect, and shutdown
- Errors that occur before communicating with the remote RPC server such as command creation and marshaling errors or issues talking to the remote server
- Errors returned from the remote RPC server like unimplemented commands, nonexistent requested blocks and transactions, malformed data, and incorrect networks
The first category of errors are typically one of ErrInvalidAuth, ErrInvalidEndpoint, ErrClientDisconnect, or ErrClientShutdown.
NOTE: The ErrClientDisconnect will not be returned unless the DisableAutoReconnect flag is set since the client automatically handles reconnect by default as previously described.
The second category of errors typically indicates a programmer error and as such the type can vary, but usually will be best handled by simply showing/logging it.
The third category of errors, that is errors returned by the server, can be detected by type asserting the error in a *dcrjson.RPCError. For example, to detect if a command is unimplemented by the remote RPC server:
amount, err := client.GetBalance("") if err != nil { if jerr, ok := err.(*dcrjson.RPCError); ok { switch jerr.Code { case dcrjson.ErrRPCUnimplemented: // Handle not implemented error // Handle other specific errors you care about } } // Log or otherwise handle the error knowing it was not one returned // from the remote RPC server. }
Example Usage ¶
The following full-blown client examples are in the examples directory:
- dcrdwebsockets Connects to a dcrd RPC server using TLS-secured websockets, registers for block connected and block disconnected notifications, and gets the current block count
- dcrwalletwebsockets Connects to a dcrwallet RPC server using TLS-secured websockets, registers for notifications about changes to account balances, and gets a list of unspent transaction outputs (utxos) the wallet can sign
Index ¶
- Variables
- func DisableLog()deprecated
- func UseLogger(logger slog.Logger)
- type AddNodeCommand
- type Client
- func (c *Client) AccountAddressIndex(account string, branch uint32) (int, error)
- func (c *Client) AccountAddressIndexAsync(account string, branch uint32) FutureAccountAddressIndexResult
- func (c *Client) AccountSyncAddressIndex(account string, branch uint32, index int) error
- func (c *Client) AccountSyncAddressIndexAsync(account string, branch uint32, index int) FutureAccountSyncAddressIndexResult
- func (c *Client) AddMultisigAddress(requiredSigs int, addresses []dcrutil.Address, account string) (dcrutil.Address, error)
- func (c *Client) AddMultisigAddressAsync(requiredSigs int, addresses []dcrutil.Address, account string) FutureAddMultisigAddressResult
- func (c *Client) AddNode(host string, command AddNodeCommand) error
- func (c *Client) AddNodeAsync(host string, command AddNodeCommand) FutureAddNodeResult
- func (c *Client) AddTicket(ticket *dcrutil.Tx) error
- func (c *Client) AddTicketAsync(rawHex string) FutureAddTicketResult
- func (c *Client) Connect(ctx context.Context, retry bool) error
- func (c *Client) CreateEncryptedWallet(passphrase string) error
- func (c *Client) CreateEncryptedWalletAsync(passphrase string) FutureCreateEncryptedWalletResult
- func (c *Client) CreateMultisig(requiredSigs int, addresses []dcrutil.Address) (*walletjson.CreateMultiSigResult, error)
- func (c *Client) CreateMultisigAsync(requiredSigs int, addresses []dcrutil.Address) FutureCreateMultisigResult
- func (c *Client) CreateNewAccount(account string) error
- func (c *Client) CreateNewAccountAsync(account string) FutureCreateNewAccountResult
- func (c *Client) CreateRawSSRtx(inputs []dcrjson.TransactionInput, fee dcrutil.Amount) (*wire.MsgTx, error)
- func (c *Client) CreateRawSSRtxAsync(inputs []dcrjson.TransactionInput, fee dcrutil.Amount) FutureCreateRawSSRtxResult
- func (c *Client) CreateRawSStx(inputs []dcrjson.SStxInput, amount map[dcrutil.Address]dcrutil.Amount, ...) (*wire.MsgTx, error)
- func (c *Client) CreateRawSStxAsync(inputs []dcrjson.SStxInput, amount map[dcrutil.Address]dcrutil.Amount, ...) FutureCreateRawSStxResult
- func (c *Client) CreateRawTransaction(inputs []dcrjson.TransactionInput, amounts map[dcrutil.Address]dcrutil.Amount, ...) (*wire.MsgTx, error)
- func (c *Client) CreateRawTransactionAsync(inputs []dcrjson.TransactionInput, amounts map[dcrutil.Address]dcrutil.Amount, ...) FutureCreateRawTransactionResult
- func (c *Client) DebugLevel(levelSpec string) (string, error)
- func (c *Client) DebugLevelAsync(levelSpec string) FutureDebugLevelResult
- func (c *Client) DecodeRawTransaction(serializedTx []byte) (*dcrjson.TxRawResult, error)
- func (c *Client) DecodeRawTransactionAsync(serializedTx []byte) FutureDecodeRawTransactionResult
- func (c *Client) Disconnect()
- func (c *Client) Disconnected() bool
- func (c *Client) DumpPrivKey(address dcrutil.Address) (*dcrutil.WIF, error)
- func (c *Client) DumpPrivKeyAsync(address dcrutil.Address) FutureDumpPrivKeyResult
- func (c *Client) EstimateSmartFee(confirmations int64, mode dcrjson.EstimateSmartFeeMode) (float64, error)
- func (c *Client) EstimateSmartFeeAsync(confirmations int64, mode dcrjson.EstimateSmartFeeMode) FutureEstimateSmartFeeResult
- func (c *Client) EstimateStakeDiff(tickets *uint32) (*dcrjson.EstimateStakeDiffResult, error)
- func (c *Client) EstimateStakeDiffAsync(tickets *uint32) FutureEstimateStakeDiffResult
- func (c *Client) ExistsAddress(address dcrutil.Address) (bool, error)
- func (c *Client) ExistsAddressAsync(address dcrutil.Address) FutureExistsAddressResult
- func (c *Client) ExistsAddresses(addresses []dcrutil.Address) (string, error)
- func (c *Client) ExistsAddressesAsync(addresses []dcrutil.Address) FutureExistsAddressesResult
- func (c *Client) ExistsExpiredTickets(hashes []*chainhash.Hash) (string, error)
- func (c *Client) ExistsExpiredTicketsAsync(hashes []*chainhash.Hash) FutureExistsExpiredTicketsResult
- func (c *Client) ExistsLiveTicket(hash *chainhash.Hash) (bool, error)
- func (c *Client) ExistsLiveTicketAsync(hash *chainhash.Hash) FutureExistsLiveTicketResult
- func (c *Client) ExistsLiveTickets(hashes []*chainhash.Hash) (string, error)
- func (c *Client) ExistsLiveTicketsAsync(hashes []*chainhash.Hash) FutureExistsLiveTicketsResult
- func (c *Client) ExistsMempoolTxs(hashes []*chainhash.Hash) (string, error)
- func (c *Client) ExistsMempoolTxsAsync(hashes []*chainhash.Hash) FutureExistsMempoolTxsResult
- func (c *Client) ExistsMissedTickets(hashes []*chainhash.Hash) (string, error)
- func (c *Client) ExistsMissedTicketsAsync(hashes []*chainhash.Hash) FutureExistsMissedTicketsResult
- func (c *Client) ExportWatchingWallet(account string) ([]byte, []byte, error)
- func (c *Client) ExportWatchingWalletAsync(account string) FutureExportWatchingWalletResult
- func (c *Client) FundRawTransaction(rawhex string, fundAccount string, ...) (*walletjson.FundRawTransactionResult, error)
- func (c *Client) FundRawTransactionAsync(rawhex string, fundAccount string, ...) FutureFundRawTransactionResult
- func (c *Client) Generate(numBlocks uint32) ([]*chainhash.Hash, error)
- func (c *Client) GenerateAsync(numBlocks uint32) FutureGenerateResult
- func (c *Client) GenerateVote(blockHash *chainhash.Hash, height int64, sstxHash *chainhash.Hash, ...) (*walletjson.GenerateVoteResult, error)
- func (c *Client) GenerateVoteAsync(blockHash *chainhash.Hash, height int64, sstxHash *chainhash.Hash, ...) FutureGenerateVoteResult
- func (c *Client) GetAccount(address dcrutil.Address) (string, error)
- func (c *Client) GetAccountAddress(account string) (dcrutil.Address, error)
- func (c *Client) GetAccountAddressAsync(account string) FutureGetAccountAddressResult
- func (c *Client) GetAccountAsync(address dcrutil.Address) FutureGetAccountResult
- func (c *Client) GetAddedNodeInfo(peer string) ([]dcrjson.GetAddedNodeInfoResult, error)
- func (c *Client) GetAddedNodeInfoAsync(peer string) FutureGetAddedNodeInfoResult
- func (c *Client) GetAddedNodeInfoNoDNS(peer string) ([]string, error)
- func (c *Client) GetAddedNodeInfoNoDNSAsync(peer string) FutureGetAddedNodeInfoNoDNSResult
- func (c *Client) GetAddressesByAccount(account string) ([]dcrutil.Address, error)
- func (c *Client) GetAddressesByAccountAsync(account string) FutureGetAddressesByAccountResult
- func (c *Client) GetBalance(account string) (*walletjson.GetBalanceResult, error)
- func (c *Client) GetBalanceAsync(account string) FutureGetBalanceResult
- func (c *Client) GetBalanceMinConf(account string, minConfirms int) (*walletjson.GetBalanceResult, error)
- func (c *Client) GetBalanceMinConfAsync(account string, minConfirms int) FutureGetBalanceResult
- func (c *Client) GetBestBlock() (*chainhash.Hash, int64, error)
- func (c *Client) GetBestBlockAsync() FutureGetBestBlockResult
- func (c *Client) GetBestBlockHash() (*chainhash.Hash, error)
- func (c *Client) GetBestBlockHashAsync() FutureGetBestBlockHashResult
- func (c *Client) GetBlock(blockHash *chainhash.Hash) (*wire.MsgBlock, error)
- func (c *Client) GetBlockAsync(blockHash *chainhash.Hash) FutureGetBlockResult
- func (c *Client) GetBlockChainInfo() (*dcrjson.GetBlockChainInfoResult, error)
- func (c *Client) GetBlockChainInfoAsync() FutureGetBlockChainInfoResult
- func (c *Client) GetBlockCount() (int64, error)
- func (c *Client) GetBlockCountAsync() FutureGetBlockCountResult
- func (c *Client) GetBlockHash(blockHeight int64) (*chainhash.Hash, error)
- func (c *Client) GetBlockHashAsync(blockHeight int64) FutureGetBlockHashResult
- func (c *Client) GetBlockHeader(hash *chainhash.Hash) (*wire.BlockHeader, error)
- func (c *Client) GetBlockHeaderAsync(hash *chainhash.Hash) FutureGetBlockHeaderResult
- func (c *Client) GetBlockHeaderVerbose(hash *chainhash.Hash) (*dcrjson.GetBlockHeaderVerboseResult, error)
- func (c *Client) GetBlockHeaderVerboseAsync(hash *chainhash.Hash) FutureGetBlockHeaderVerboseResult
- func (c *Client) GetBlockSubsidy(height int64, voters uint16) (*dcrjson.GetBlockSubsidyResult, error)
- func (c *Client) GetBlockSubsidyAsync(height int64, voters uint16) FutureGetBlockSubsidyResult
- func (c *Client) GetBlockTemplate(req *dcrjson.TemplateRequest) (*dcrjson.GetBlockTemplateResult, error)
- func (c *Client) GetBlockTemplateAsync(req *dcrjson.TemplateRequest) FutureGetBlockTemplate
- func (c *Client) GetBlockVerbose(blockHash *chainhash.Hash, verboseTx bool) (*dcrjson.GetBlockVerboseResult, error)
- func (c *Client) GetBlockVerboseAsync(blockHash *chainhash.Hash, verboseTx bool) FutureGetBlockVerboseResult
- func (c *Client) GetCFilter(blockHash *chainhash.Hash, filterType wire.FilterType) (*gcs.Filter, error)
- func (c *Client) GetCFilterAsync(blockHash *chainhash.Hash, filterType wire.FilterType) FutureGetCFilterResult
- func (c *Client) GetCFilterHeader(blockHash *chainhash.Hash, filterType wire.FilterType) (*chainhash.Hash, error)
- func (c *Client) GetCFilterHeaderAsync(blockHash *chainhash.Hash, filterType wire.FilterType) FutureGetCFilterHeaderResult
- func (c *Client) GetChainTips() ([]dcrjson.GetChainTipsResult, error)
- func (c *Client) GetChainTipsAsync() FutureGetChainTipsResult
- func (c *Client) GetCoinSupply() (dcrutil.Amount, error)
- func (c *Client) GetCoinSupplyAsync() FutureGetCoinSupplyResult
- func (c *Client) GetConnectionCount() (int64, error)
- func (c *Client) GetConnectionCountAsync() FutureGetConnectionCountResult
- func (c *Client) GetCurrentNet() (wire.CurrencyNet, error)
- func (c *Client) GetCurrentNetAsync() FutureGetCurrentNetResult
- func (c *Client) GetDifficulty() (float64, error)
- func (c *Client) GetDifficultyAsync() FutureGetDifficultyResult
- func (c *Client) GetGenerate() (bool, error)
- func (c *Client) GetGenerateAsync() FutureGetGenerateResult
- func (c *Client) GetHashesPerSec() (int64, error)
- func (c *Client) GetHashesPerSecAsync() FutureGetHashesPerSecResult
- func (c *Client) GetHeaders(blockLocators []*chainhash.Hash, hashStop *chainhash.Hash) (*dcrjson.GetHeadersResult, error)
- func (c *Client) GetHeadersAsync(blockLocators []*chainhash.Hash, hashStop *chainhash.Hash) FutureGetHeadersResult
- func (c *Client) GetInfo() (*walletjson.InfoWalletResult, error)
- func (c *Client) GetInfoAsync() FutureGetInfoResult
- func (c *Client) GetMasterPubkey(account string, net hdkeychain.NetworkParams) (*hdkeychain.ExtendedKey, error)
- func (c *Client) GetMasterPubkeyAsync(account string) FutureGetMasterPubkeyResult
- func (c *Client) GetMiningInfo() (*dcrjson.GetMiningInfoResult, error)
- func (c *Client) GetMiningInfoAsync() FutureGetMiningInfoResult
- func (c *Client) GetNetTotals() (*dcrjson.GetNetTotalsResult, error)
- func (c *Client) GetNetTotalsAsync() FutureGetNetTotalsResult
- func (c *Client) GetNetworkHashPS() (int64, error)
- func (c *Client) GetNetworkHashPS2(blocks int) (int64, error)
- func (c *Client) GetNetworkHashPS2Async(blocks int) FutureGetNetworkHashPS
- func (c *Client) GetNetworkHashPS3(blocks, height int) (int64, error)
- func (c *Client) GetNetworkHashPS3Async(blocks, height int) FutureGetNetworkHashPS
- func (c *Client) GetNetworkHashPSAsync() FutureGetNetworkHashPS
- func (c *Client) GetNewAddress(account string) (dcrutil.Address, error)
- func (c *Client) GetNewAddressAsync(account string) FutureGetNewAddressResult
- func (c *Client) GetNewAddressGapPolicy(account string, gapPolicy GapPolicy) (dcrutil.Address, error)
- func (c *Client) GetNewAddressGapPolicyAsync(account string, gapPolicy GapPolicy) FutureGetNewAddressResult
- func (c *Client) GetPeerInfo() ([]dcrjson.GetPeerInfoResult, error)
- func (c *Client) GetPeerInfoAsync() FutureGetPeerInfoResult
- func (c *Client) GetRawChangeAddress(account string) (dcrutil.Address, error)
- func (c *Client) GetRawChangeAddressAsync(account string) FutureGetRawChangeAddressResult
- func (c *Client) GetRawMempool(txType dcrjson.GetRawMempoolTxTypeCmd) ([]*chainhash.Hash, error)
- func (c *Client) GetRawMempoolAsync(txType dcrjson.GetRawMempoolTxTypeCmd) FutureGetRawMempoolResult
- func (c *Client) GetRawMempoolVerbose(txType dcrjson.GetRawMempoolTxTypeCmd) (map[string]dcrjson.GetRawMempoolVerboseResult, error)
- func (c *Client) GetRawMempoolVerboseAsync(txType dcrjson.GetRawMempoolTxTypeCmd) FutureGetRawMempoolVerboseResult
- func (c *Client) GetRawTransaction(txHash *chainhash.Hash) (*dcrutil.Tx, error)
- func (c *Client) GetRawTransactionAsync(txHash *chainhash.Hash) FutureGetRawTransactionResult
- func (c *Client) GetRawTransactionVerbose(txHash *chainhash.Hash) (*dcrjson.TxRawResult, error)
- func (c *Client) GetRawTransactionVerboseAsync(txHash *chainhash.Hash) FutureGetRawTransactionVerboseResult
- func (c *Client) GetReceivedByAccount(account string) (dcrutil.Amount, error)
- func (c *Client) GetReceivedByAccountAsync(account string) FutureGetReceivedByAccountResult
- func (c *Client) GetReceivedByAccountMinConf(account string, minConfirms int) (dcrutil.Amount, error)
- func (c *Client) GetReceivedByAccountMinConfAsync(account string, minConfirms int) FutureGetReceivedByAccountResult
- func (c *Client) GetReceivedByAddress(address dcrutil.Address) (dcrutil.Amount, error)
- func (c *Client) GetReceivedByAddressAsync(address dcrutil.Address) FutureGetReceivedByAddressResult
- func (c *Client) GetReceivedByAddressMinConf(address dcrutil.Address, minConfirms int) (dcrutil.Amount, error)
- func (c *Client) GetReceivedByAddressMinConfAsync(address dcrutil.Address, minConfirms int) FutureGetReceivedByAddressResult
- func (c *Client) GetStakeDifficulty() (*dcrjson.GetStakeDifficultyResult, error)
- func (c *Client) GetStakeDifficultyAsync() FutureGetStakeDifficultyResult
- func (c *Client) GetStakeInfo() (*walletjson.GetStakeInfoResult, error)
- func (c *Client) GetStakeInfoAsync() FutureGetStakeInfoResult
- func (c *Client) GetStakeVersionInfo(count int32) (*dcrjson.GetStakeVersionInfoResult, error)
- func (c *Client) GetStakeVersionInfoAsync(count int32) FutureGetStakeVersionInfoResult
- func (c *Client) GetStakeVersions(hash string, count int32) (*dcrjson.GetStakeVersionsResult, error)
- func (c *Client) GetStakeVersionsAsync(hash string, count int32) FutureGetStakeVersionsResult
- func (c *Client) GetTicketPoolValue() (dcrutil.Amount, error)
- func (c *Client) GetTicketPoolValueAsync() FutureGetTicketPoolValueResult
- func (c *Client) GetTickets(includeImmature bool) ([]*chainhash.Hash, error)
- func (c *Client) GetTicketsAsync(includeImmature bool) FutureGetTicketsResult
- func (c *Client) GetTransaction(txHash *chainhash.Hash) (*walletjson.GetTransactionResult, error)
- func (c *Client) GetTransactionAsync(txHash *chainhash.Hash) FutureGetTransactionResult
- func (c *Client) GetTxOut(txHash *chainhash.Hash, index uint32, mempool bool) (*dcrjson.GetTxOutResult, error)
- func (c *Client) GetTxOutAsync(txHash *chainhash.Hash, index uint32, mempool bool) FutureGetTxOutResult
- func (c *Client) GetUnconfirmedBalance(account string) (dcrutil.Amount, error)
- func (c *Client) GetUnconfirmedBalanceAsync(account string) FutureGetUnconfirmedBalanceResult
- func (c *Client) GetVoteChoices() (*walletjson.GetVoteChoicesResult, error)
- func (c *Client) GetVoteChoicesAsync() FutureGetVoteChoicesResult
- func (c *Client) GetVoteInfo(version uint32) (*dcrjson.GetVoteInfoResult, error)
- func (c *Client) GetVoteInfoAsync(version uint32) FutureGetVoteInfoResult
- func (c *Client) GetWork() (*dcrjson.GetWorkResult, error)
- func (c *Client) GetWorkAsync() FutureGetWork
- func (c *Client) GetWorkSubmit(data string) (bool, error)
- func (c *Client) GetWorkSubmitAsync(data string) FutureGetWorkSubmit
- func (c *Client) ImportPrivKey(privKeyWIF *dcrutil.WIF) error
- func (c *Client) ImportPrivKeyAsync(privKeyWIF *dcrutil.WIF) FutureImportPrivKeyResult
- func (c *Client) ImportPrivKeyLabel(privKeyWIF *dcrutil.WIF, label string) error
- func (c *Client) ImportPrivKeyLabelAsync(privKeyWIF *dcrutil.WIF, label string) FutureImportPrivKeyResult
- func (c *Client) ImportPrivKeyRescan(privKeyWIF *dcrutil.WIF, label string, rescan bool) error
- func (c *Client) ImportPrivKeyRescanAsync(privKeyWIF *dcrutil.WIF, label string, rescan bool) FutureImportPrivKeyResult
- func (c *Client) ImportPrivKeyRescanFrom(privKeyWIF *dcrutil.WIF, label string, rescan bool, scanFrom int) error
- func (c *Client) ImportPrivKeyRescanFromAsync(privKeyWIF *dcrutil.WIF, label string, rescan bool, scanFrom int) FutureImportPrivKeyResult
- func (c *Client) ImportScript(script []byte) error
- func (c *Client) ImportScriptAsync(script []byte) FutureImportScriptResult
- func (c *Client) ImportScriptRescan(script []byte, rescan bool) error
- func (c *Client) ImportScriptRescanAsync(script []byte, rescan bool) FutureImportScriptResult
- func (c *Client) ImportScriptRescanFrom(script []byte, rescan bool, scanFrom int) error
- func (c *Client) ImportScriptRescanFromAsync(script []byte, rescan bool, scanFrom int) FutureImportScriptResult
- func (c *Client) KeyPoolRefill() error
- func (c *Client) KeyPoolRefillAsync() FutureKeyPoolRefillResult
- func (c *Client) KeyPoolRefillSize(newSize uint) error
- func (c *Client) KeyPoolRefillSizeAsync(newSize uint) FutureKeyPoolRefillResult
- func (c *Client) ListAccounts() (map[string]dcrutil.Amount, error)
- func (c *Client) ListAccountsAsync() FutureListAccountsResult
- func (c *Client) ListAccountsMinConf(minConfirms int) (map[string]dcrutil.Amount, error)
- func (c *Client) ListAccountsMinConfAsync(minConfirms int) FutureListAccountsResult
- func (c *Client) ListAddressTransactions(addresses []dcrutil.Address, account string) ([]walletjson.ListTransactionsResult, error)
- func (c *Client) ListAddressTransactionsAsync(addresses []dcrutil.Address, account string) FutureListAddressTransactionsResult
- func (c *Client) ListLockUnspent() ([]*wire.OutPoint, error)
- func (c *Client) ListLockUnspentAsync() FutureListLockUnspentResult
- func (c *Client) ListReceivedByAccount() ([]walletjson.ListReceivedByAccountResult, error)
- func (c *Client) ListReceivedByAccountAsync() FutureListReceivedByAccountResult
- func (c *Client) ListReceivedByAccountIncludeEmpty(minConfirms int, includeEmpty bool) ([]walletjson.ListReceivedByAccountResult, error)
- func (c *Client) ListReceivedByAccountIncludeEmptyAsync(minConfirms int, includeEmpty bool) FutureListReceivedByAccountResult
- func (c *Client) ListReceivedByAccountMinConf(minConfirms int) ([]walletjson.ListReceivedByAccountResult, error)
- func (c *Client) ListReceivedByAccountMinConfAsync(minConfirms int) FutureListReceivedByAccountResult
- func (c *Client) ListReceivedByAddress() ([]walletjson.ListReceivedByAddressResult, error)
- func (c *Client) ListReceivedByAddressAsync() FutureListReceivedByAddressResult
- func (c *Client) ListReceivedByAddressIncludeEmpty(minConfirms int, includeEmpty bool) ([]walletjson.ListReceivedByAddressResult, error)
- func (c *Client) ListReceivedByAddressIncludeEmptyAsync(minConfirms int, includeEmpty bool) FutureListReceivedByAddressResult
- func (c *Client) ListReceivedByAddressMinConf(minConfirms int) ([]walletjson.ListReceivedByAddressResult, error)
- func (c *Client) ListReceivedByAddressMinConfAsync(minConfirms int) FutureListReceivedByAddressResult
- func (c *Client) ListScripts() ([][]byte, error)
- func (c *Client) ListScriptsAsync() FutureListScriptsResult
- func (c *Client) ListSinceBlock(blockHash *chainhash.Hash) (*walletjson.ListSinceBlockResult, error)
- func (c *Client) ListSinceBlockAsync(blockHash *chainhash.Hash) FutureListSinceBlockResult
- func (c *Client) ListSinceBlockMinConf(blockHash *chainhash.Hash, minConfirms int) (*walletjson.ListSinceBlockResult, error)
- func (c *Client) ListSinceBlockMinConfAsync(blockHash *chainhash.Hash, minConfirms int) FutureListSinceBlockResult
- func (c *Client) ListTransactions(account string) ([]walletjson.ListTransactionsResult, error)
- func (c *Client) ListTransactionsAsync(account string) FutureListTransactionsResult
- func (c *Client) ListTransactionsCount(account string, count int) ([]walletjson.ListTransactionsResult, error)
- func (c *Client) ListTransactionsCountAsync(account string, count int) FutureListTransactionsResult
- func (c *Client) ListTransactionsCountFrom(account string, count, from int) ([]walletjson.ListTransactionsResult, error)
- func (c *Client) ListTransactionsCountFromAsync(account string, count, from int) FutureListTransactionsResult
- func (c *Client) ListUnspent() ([]walletjson.ListUnspentResult, error)
- func (c *Client) ListUnspentAsync() FutureListUnspentResult
- func (c *Client) ListUnspentMin(minConf int) ([]walletjson.ListUnspentResult, error)
- func (c *Client) ListUnspentMinAsync(minConf int) FutureListUnspentResult
- func (c *Client) ListUnspentMinMax(minConf, maxConf int) ([]walletjson.ListUnspentResult, error)
- func (c *Client) ListUnspentMinMaxAddresses(minConf, maxConf int, addrs []dcrutil.Address) ([]walletjson.ListUnspentResult, error)
- func (c *Client) ListUnspentMinMaxAddressesAsync(minConf, maxConf int, addrs []dcrutil.Address) FutureListUnspentResult
- func (c *Client) ListUnspentMinMaxAsync(minConf, maxConf int) FutureListUnspentResult
- func (c *Client) LiveTickets() ([]*chainhash.Hash, error)
- func (c *Client) LiveTicketsAsync() FutureLiveTicketsResult
- func (c *Client) LoadTxFilter(reload bool, addresses []dcrutil.Address, outPoints []wire.OutPoint) error
- func (c *Client) LoadTxFilterAsync(reload bool, addresses []dcrutil.Address, outPoints []wire.OutPoint) FutureLoadTxFilterResult
- func (c *Client) LockUnspent(unlock bool, ops []*wire.OutPoint) error
- func (c *Client) LockUnspentAsync(unlock bool, ops []*wire.OutPoint) FutureLockUnspentResult
- func (c *Client) MissedTickets() ([]*chainhash.Hash, error)
- func (c *Client) MissedTicketsAsync() FutureMissedTicketsResult
- func (c *Client) NextID() uint64
- func (c *Client) NotifyBlocks() error
- func (c *Client) NotifyBlocksAsync() FutureNotifyBlocksResult
- func (c *Client) NotifyNewTickets() error
- func (c *Client) NotifyNewTicketsAsync() FutureNotifyNewTicketsResult
- func (c *Client) NotifyNewTransactions(verbose bool) error
- func (c *Client) NotifyNewTransactionsAsync(verbose bool) FutureNotifyNewTransactionsResult
- func (c *Client) NotifySpentAndMissedTickets() error
- func (c *Client) NotifySpentAndMissedTicketsAsync() FutureNotifySpentAndMissedTicketsResult
- func (c *Client) NotifyStakeDifficulty() error
- func (c *Client) NotifyStakeDifficultyAsync() FutureNotifyStakeDifficultyResult
- func (c *Client) NotifyWinningTickets() error
- func (c *Client) NotifyWinningTicketsAsync() FutureNotifyWinningTicketsResult
- func (c *Client) Ping() error
- func (c *Client) PingAsync() FuturePingResult
- func (c *Client) PurchaseTicket(fromAccount string, spendLimit dcrutil.Amount, minConf *int, ...) ([]*chainhash.Hash, error)
- func (c *Client) PurchaseTicketAsync(fromAccount string, spendLimit dcrutil.Amount, minConf *int, ...) FuturePurchaseTicketResult
- func (c *Client) RawRequest(method string, params []json.RawMessage) (json.RawMessage, error)
- func (c *Client) RawRequestAsync(method string, params []json.RawMessage) FutureRawResult
- func (c *Client) RenameAccount(oldAccount, newAccount string) error
- func (c *Client) RenameAccountAsync(oldAccount, newAccount string) FutureRenameAccountResult
- func (c *Client) Rescan(blockHashes []chainhash.Hash) (*dcrjson.RescanResult, error)
- func (c *Client) RescanAsync(blockHashes []chainhash.Hash) FutureRescanResult
- func (c *Client) RevokeTickets() error
- func (c *Client) RevokeTicketsAsync() FutureRevokeTicketsResult
- func (c *Client) SearchRawTransactions(address dcrutil.Address, skip, count int, reverse bool, filterAddrs []string) ([]*wire.MsgTx, error)
- func (c *Client) SearchRawTransactionsAsync(address dcrutil.Address, skip, count int, reverse bool, filterAddrs []string) FutureSearchRawTransactionsResult
- func (c *Client) SearchRawTransactionsVerbose(address dcrutil.Address, skip, count int, includePrevOut bool, reverse bool, ...) ([]*dcrjson.SearchRawTransactionsResult, error)
- func (c *Client) SearchRawTransactionsVerboseAsync(address dcrutil.Address, skip, count int, includePrevOut bool, reverse bool, ...) FutureSearchRawTransactionsVerboseResult
- func (c *Client) SendFrom(fromAccount string, toAddress dcrutil.Address, amount dcrutil.Amount) (*chainhash.Hash, error)
- func (c *Client) SendFromAsync(fromAccount string, toAddress dcrutil.Address, amount dcrutil.Amount) FutureSendFromResult
- func (c *Client) SendFromComment(fromAccount string, toAddress dcrutil.Address, amount dcrutil.Amount, ...) (*chainhash.Hash, error)
- func (c *Client) SendFromCommentAsync(fromAccount string, toAddress dcrutil.Address, amount dcrutil.Amount, ...) FutureSendFromResult
- func (c *Client) SendFromMinConf(fromAccount string, toAddress dcrutil.Address, amount dcrutil.Amount, ...) (*chainhash.Hash, error)
- func (c *Client) SendFromMinConfAsync(fromAccount string, toAddress dcrutil.Address, amount dcrutil.Amount, ...) FutureSendFromResult
- func (c *Client) SendMany(fromAccount string, amounts map[dcrutil.Address]dcrutil.Amount) (*chainhash.Hash, error)
- func (c *Client) SendManyAsync(fromAccount string, amounts map[dcrutil.Address]dcrutil.Amount) FutureSendManyResult
- func (c *Client) SendManyComment(fromAccount string, amounts map[dcrutil.Address]dcrutil.Amount, ...) (*chainhash.Hash, error)
- func (c *Client) SendManyCommentAsync(fromAccount string, amounts map[dcrutil.Address]dcrutil.Amount, ...) FutureSendManyResult
- func (c *Client) SendManyMinConf(fromAccount string, amounts map[dcrutil.Address]dcrutil.Amount, ...) (*chainhash.Hash, error)
- func (c *Client) SendManyMinConfAsync(fromAccount string, amounts map[dcrutil.Address]dcrutil.Amount, ...) FutureSendManyResult
- func (c *Client) SendRawTransaction(tx *wire.MsgTx, allowHighFees bool) (*chainhash.Hash, error)
- func (c *Client) SendRawTransactionAsync(tx *wire.MsgTx, allowHighFees bool) FutureSendRawTransactionResult
- func (c *Client) SendToAddress(address dcrutil.Address, amount dcrutil.Amount) (*chainhash.Hash, error)
- func (c *Client) SendToAddressAsync(address dcrutil.Address, amount dcrutil.Amount) FutureSendToAddressResult
- func (c *Client) SendToAddressComment(address dcrutil.Address, amount dcrutil.Amount, comment, commentTo string) (*chainhash.Hash, error)
- func (c *Client) SendToAddressCommentAsync(address dcrutil.Address, amount dcrutil.Amount, comment, commentTo string) FutureSendToAddressResult
- func (c *Client) Session() (*dcrjson.SessionResult, error)
- func (c *Client) SessionAsync() FutureSessionResult
- func (c *Client) SetGenerate(enable bool, numCPUs int) error
- func (c *Client) SetGenerateAsync(enable bool, numCPUs int) FutureSetGenerateResult
- func (c *Client) SetTicketFee(fee dcrutil.Amount) error
- func (c *Client) SetTicketFeeAsync(fee dcrutil.Amount) FutureSetTicketFeeResult
- func (c *Client) SetTxFee(fee dcrutil.Amount) error
- func (c *Client) SetTxFeeAsync(fee dcrutil.Amount) FutureSetTxFeeResult
- func (c *Client) SetVoteChoice(agendaID, choiceID string) error
- func (c *Client) SetVoteChoiceAsync(agendaID, choiceID string) FutureSetVoteChoiceResult
- func (c *Client) Shutdown()
- func (c *Client) SignMessage(address dcrutil.Address, message string) (string, error)
- func (c *Client) SignMessageAsync(address dcrutil.Address, message string) FutureSignMessageResult
- func (c *Client) SignRawSSGenTx(tx *wire.MsgTx) (*wire.MsgTx, bool, error)
- func (c *Client) SignRawSSGenTxAsync(tx *wire.MsgTx) FutureSignRawTransactionResult
- func (c *Client) SignRawTransaction(tx *wire.MsgTx) (*wire.MsgTx, bool, error)
- func (c *Client) SignRawTransaction2(tx *wire.MsgTx, inputs []walletjson.RawTxInput) (*wire.MsgTx, bool, error)
- func (c *Client) SignRawTransaction2Async(tx *wire.MsgTx, inputs []walletjson.RawTxInput) FutureSignRawTransactionResult
- func (c *Client) SignRawTransaction3(tx *wire.MsgTx, inputs []walletjson.RawTxInput, privKeysWIF []string) (*wire.MsgTx, bool, error)
- func (c *Client) SignRawTransaction3Async(tx *wire.MsgTx, inputs []walletjson.RawTxInput, privKeysWIF []string) FutureSignRawTransactionResult
- func (c *Client) SignRawTransaction4(tx *wire.MsgTx, inputs []walletjson.RawTxInput, privKeysWIF []string, ...) (*wire.MsgTx, bool, error)
- func (c *Client) SignRawTransaction4Async(tx *wire.MsgTx, inputs []walletjson.RawTxInput, privKeysWIF []string, ...) FutureSignRawTransactionResult
- func (c *Client) SignRawTransactionAsync(tx *wire.MsgTx) FutureSignRawTransactionResult
- func (c *Client) StakePoolUserInfo(addr dcrutil.Address) (*walletjson.StakePoolUserInfoResult, error)
- func (c *Client) StakePoolUserInfoAsync(addr dcrutil.Address) FutureStakePoolUserInfoResult
- func (c *Client) String() string
- func (c *Client) SubmitBlock(block *dcrutil.Block, options *dcrjson.SubmitBlockOptions) error
- func (c *Client) SubmitBlockAsync(block *dcrutil.Block, options *dcrjson.SubmitBlockOptions) FutureSubmitBlockResult
- func (c *Client) TicketFeeInfo(blocks *uint32, windows *uint32) (*dcrjson.TicketFeeInfoResult, error)
- func (c *Client) TicketFeeInfoAsync(blocks *uint32, windows *uint32) FutureTicketFeeInfoResult
- func (c *Client) TicketVWAP(start *uint32, end *uint32) (dcrutil.Amount, error)
- func (c *Client) TicketVWAPAsync(start *uint32, end *uint32) FutureTicketVWAPResult
- func (c *Client) TicketsForAddress(addr dcrutil.Address) (*dcrjson.TicketsForAddressResult, error)
- func (c *Client) TicketsForAddressAsync(addr dcrutil.Address) FutureTicketsForAddressResult
- func (c *Client) TxFeeInfo(blocks *uint32, start *uint32, end *uint32) (*dcrjson.TxFeeInfoResult, error)
- func (c *Client) TxFeeInfoAsync(blocks *uint32, start *uint32, end *uint32) FutureTxFeeInfoResult
- func (c *Client) ValidateAddress(address dcrutil.Address) (*walletjson.ValidateAddressWalletResult, error)
- func (c *Client) ValidateAddressAsync(address dcrutil.Address) FutureValidateAddressResult
- func (c *Client) VerifyChain() (bool, error)
- func (c *Client) VerifyChainAsync() FutureVerifyChainResult
- func (c *Client) VerifyChainBlocks(checkLevel, numBlocks int64) (bool, error)
- func (c *Client) VerifyChainBlocksAsync(checkLevel, numBlocks int64) FutureVerifyChainResult
- func (c *Client) VerifyChainLevel(checkLevel int64) (bool, error)
- func (c *Client) VerifyChainLevelAsync(checkLevel int64) FutureVerifyChainResult
- func (c *Client) VerifyMessage(address dcrutil.Address, signature, message string) (bool, error)
- func (c *Client) VerifyMessageAsync(address dcrutil.Address, signature, message string) FutureVerifyMessageResult
- func (c *Client) Version() (map[string]dcrjson.VersionResult, error)
- func (c *Client) VersionAsync() FutureVersionResult
- func (c *Client) WaitForShutdown()
- func (c *Client) WalletInfo() (*walletjson.WalletInfoResult, error)
- func (c *Client) WalletInfoAsync() FutureWalletInfoResult
- func (c *Client) WalletLock() error
- func (c *Client) WalletLockAsync() FutureWalletLockResult
- func (c *Client) WalletPassphrase(passphrase string, timeoutSecs int64) error
- func (c *Client) WalletPassphraseChange(old, new string) error
- func (c *Client) WalletPassphraseChangeAsync(old, new string) FutureWalletPassphraseChangeResult
- type ConnConfig
- type FutureAccountAddressIndexResult
- type FutureAccountSyncAddressIndexResult
- type FutureAddMultisigAddressResult
- type FutureAddNodeResult
- type FutureAddTicketResult
- type FutureCreateEncryptedWalletResult
- type FutureCreateMultisigResult
- type FutureCreateNewAccountResult
- type FutureCreateRawSSRtxResult
- type FutureCreateRawSStxResult
- type FutureCreateRawTransactionResult
- type FutureDebugLevelResult
- type FutureDecodeRawTransactionResult
- type FutureDumpPrivKeyResult
- type FutureEstimateSmartFeeResult
- type FutureEstimateStakeDiffResult
- type FutureExistsAddressResult
- type FutureExistsAddressesResult
- type FutureExistsExpiredTicketsResult
- type FutureExistsLiveTicketResult
- type FutureExistsLiveTicketsResult
- type FutureExistsMempoolTxsResult
- type FutureExistsMissedTicketsResult
- type FutureExportWatchingWalletResult
- type FutureFundRawTransactionResult
- type FutureGenerateResult
- type FutureGenerateVoteResult
- type FutureGetAccountAddressResult
- type FutureGetAccountResult
- type FutureGetAddedNodeInfoNoDNSResult
- type FutureGetAddedNodeInfoResult
- type FutureGetAddressesByAccountResult
- type FutureGetBalanceResult
- type FutureGetBestBlockHashResult
- type FutureGetBestBlockResult
- type FutureGetBlockChainInfoResult
- type FutureGetBlockCountResult
- type FutureGetBlockHashResult
- type FutureGetBlockHeaderResult
- type FutureGetBlockHeaderVerboseResult
- type FutureGetBlockResult
- type FutureGetBlockSubsidyResult
- type FutureGetBlockTemplate
- type FutureGetBlockVerboseResult
- type FutureGetCFilterHeaderResult
- type FutureGetCFilterResult
- type FutureGetChainTipsResult
- type FutureGetCoinSupplyResult
- type FutureGetConnectionCountResult
- type FutureGetCurrentNetResult
- type FutureGetDifficultyResult
- type FutureGetGenerateResult
- type FutureGetHashesPerSecResult
- type FutureGetHeadersResult
- type FutureGetInfoResult
- type FutureGetMasterPubkeyResult
- type FutureGetMiningInfoResult
- type FutureGetNetTotalsResult
- type FutureGetNetworkHashPS
- type FutureGetNewAddressResult
- type FutureGetPeerInfoResult
- type FutureGetRawChangeAddressResult
- type FutureGetRawMempoolResult
- type FutureGetRawMempoolVerboseResult
- type FutureGetRawTransactionResult
- type FutureGetRawTransactionVerboseResult
- type FutureGetReceivedByAccountResult
- type FutureGetReceivedByAddressResult
- type FutureGetStakeDifficultyResult
- type FutureGetStakeInfoResult
- type FutureGetStakeVersionInfoResult
- type FutureGetStakeVersionsResult
- type FutureGetTicketPoolValueResult
- type FutureGetTicketsResult
- type FutureGetTransactionResult
- type FutureGetTxOutResult
- type FutureGetUnconfirmedBalanceResult
- type FutureGetVoteChoicesResult
- type FutureGetVoteInfoResult
- type FutureGetWork
- type FutureGetWorkSubmit
- type FutureImportPrivKeyResult
- type FutureImportScriptResult
- type FutureKeyPoolRefillResult
- type FutureListAccountsResult
- type FutureListAddressTransactionsResult
- type FutureListLockUnspentResult
- type FutureListReceivedByAccountResult
- type FutureListReceivedByAddressResult
- type FutureListScriptsResult
- type FutureListSinceBlockResult
- type FutureListTransactionsResult
- type FutureListUnspentResult
- type FutureLiveTicketsResult
- type FutureLoadTxFilterResult
- type FutureLockUnspentResult
- type FutureMissedTicketsResult
- type FutureMoveResult
- type FutureNotifyBlocksResult
- type FutureNotifyNewTicketsResult
- type FutureNotifyNewTransactionsResult
- type FutureNotifySpentAndMissedTicketsResult
- type FutureNotifyStakeDifficultyResult
- type FutureNotifyWinningTicketsResult
- type FuturePingResult
- type FuturePurchaseTicketResult
- type FutureRawResult
- type FutureRenameAccountResult
- type FutureRescanResult
- type FutureRevokeTicketsResult
- type FutureSearchRawTransactionsResult
- type FutureSearchRawTransactionsVerboseResult
- type FutureSendFromResult
- type FutureSendManyResult
- type FutureSendRawTransactionResult
- type FutureSendToAddressResult
- type FutureSessionResult
- type FutureSetGenerateResult
- type FutureSetTicketFeeResult
- type FutureSetTxFeeResult
- type FutureSetVoteChoiceResult
- type FutureSignMessageResult
- type FutureSignRawTransactionResult
- type FutureStakePoolUserInfoResult
- type FutureSubmitBlockResult
- type FutureTicketFeeInfoResult
- type FutureTicketVWAPResult
- type FutureTicketsForAddressResult
- type FutureTxFeeInfoResult
- type FutureValidateAddressResult
- type FutureVerifyChainResult
- type FutureVerifyMessageResult
- type FutureVersionResult
- type FutureWalletInfoResult
- type FutureWalletLockResult
- type FutureWalletPassphraseChangeResult
- type GapPolicy
- type NotificationHandlers
- type SStxCommitOut
- 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") )
var ( // ErrWebsocketsRequired is an error to describe the condition where the // caller is trying to use a websocket-only feature, such as requesting // notifications or other websocket requests when the client is // configured to run in HTTP POST mode. ErrWebsocketsRequired = errors.New("a websocket connection is required " + "to use this feature") )
Functions ¶
func DisableLog
deprecated
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.
Deprecated: Use UseLogger(slog.Disabled) instead.
Types ¶
type AddNodeCommand ¶
type AddNodeCommand string
AddNodeCommand enumerates the available commands that the AddNode function accepts.
const ( // ANAdd indicates the specified host should be added as a persistent // peer. ANAdd AddNodeCommand = "add" // ANRemove indicates the specified peer should be removed. ANRemove AddNodeCommand = "remove" // ANOneTry indicates the specified host should try to connect once, // but it should not be made persistent. ANOneTry AddNodeCommand = "onetry" )
Constants used to indicate the command for the AddNode function.
func (AddNodeCommand) String ¶
func (cmd AddNodeCommand) String() string
String returns the AddNodeCommand in human-readable form.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a Decred RPC client which allows easy access to the various RPC methods available on a Decred 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, ntfnHandlers *NotificationHandlers) (*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) AccountAddressIndex ¶
AccountAddressIndex returns the address index for a given account's branch.
func (*Client) AccountAddressIndexAsync ¶
func (c *Client) AccountAddressIndexAsync(account string, branch uint32) FutureAccountAddressIndexResult
AccountAddressIndexAsync 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 AccountAddressIndex for the blocking version and more details.
func (*Client) AccountSyncAddressIndex ¶
AccountSyncAddressIndex synchronizes an account branch to the passed address index.
func (*Client) AccountSyncAddressIndexAsync ¶
func (c *Client) AccountSyncAddressIndexAsync(account string, branch uint32, index int) FutureAccountSyncAddressIndexResult
AccountSyncAddressIndexAsync 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 AccountSyncAddressIndex for the blocking version and more details.
func (*Client) AddMultisigAddress ¶
func (c *Client) AddMultisigAddress(requiredSigs int, addresses []dcrutil.Address, account string) (dcrutil.Address, error)
AddMultisigAddress adds a multisignature address that requires the specified number of signatures for the provided addresses to the wallet.
func (*Client) AddMultisigAddressAsync ¶
func (c *Client) AddMultisigAddressAsync(requiredSigs int, addresses []dcrutil.Address, account string) FutureAddMultisigAddressResult
AddMultisigAddressAsync 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 AddMultisigAddress for the blocking version and more details.
func (*Client) AddNode ¶
func (c *Client) AddNode(host string, command AddNodeCommand) error
AddNode attempts to perform the passed command on the passed persistent peer. For example, it can be used to add or a remove a persistent peer, or to do a one time connection to a peer.
It may not be used to remove non-persistent peers.
func (*Client) AddNodeAsync ¶
func (c *Client) AddNodeAsync(host string, command AddNodeCommand) FutureAddNodeResult
AddNodeAsync 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 AddNode for the blocking version and more details.
func (*Client) AddTicket ¶
AddTicket manually adds a new ticket to the wallet stake manager. This is used to override normal security settings to insert tickets which would not otherwise be added to the wallet.
func (*Client) AddTicketAsync ¶
func (c *Client) AddTicketAsync(rawHex string) FutureAddTicketResult
AddTicketAsync 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 AddTicket for the blocking version and more details.
func (*Client) Connect ¶
Connect establishes the initial websocket connection. This is necessary when a client was created after setting the DisableConnectOnNew field of the Config struct.
If the connection fails and retry is true, this method will continue to try reconnections with backoff until the context is done.
This method will error if the client is not configured for websockets, if the connection has already been established, or if none of the connection attempts were successful.
func (*Client) CreateEncryptedWallet ¶
CreateEncryptedWallet requests the creation of an encrypted wallet. Wallets managed by dcrwallet 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 dcrwallet extension.
func (*Client) CreateEncryptedWalletAsync ¶
func (c *Client) CreateEncryptedWalletAsync(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 dcrwallet extension.
func (*Client) CreateMultisig ¶
func (c *Client) CreateMultisig(requiredSigs int, addresses []dcrutil.Address) (*walletjson.CreateMultiSigResult, error)
CreateMultisig creates a multisignature address that requires the specified number of signatures for the provided addresses and returns the multisignature address and script needed to redeem it.
func (*Client) CreateMultisigAsync ¶
func (c *Client) CreateMultisigAsync(requiredSigs int, addresses []dcrutil.Address) FutureCreateMultisigResult
CreateMultisigAsync 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 CreateMultisig for the blocking version and more details.
func (*Client) CreateNewAccount ¶
CreateNewAccount creates a new wallet account.
func (*Client) CreateNewAccountAsync ¶
func (c *Client) CreateNewAccountAsync(account string) FutureCreateNewAccountResult
CreateNewAccountAsync 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 CreateNewAccount for the blocking version and more details.
func (*Client) CreateRawSSRtx ¶
func (c *Client) CreateRawSSRtx(inputs []dcrjson.TransactionInput, fee dcrutil.Amount) (*wire.MsgTx, error)
CreateRawSSRtx returns a new SSR transactionm (revoking an sstx).
func (*Client) CreateRawSSRtxAsync ¶
func (c *Client) CreateRawSSRtxAsync(inputs []dcrjson.TransactionInput, fee dcrutil.Amount) FutureCreateRawSSRtxResult
CreateRawSSRtxAsync 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 CreateRawSSRtx for the blocking version and more details.
func (*Client) CreateRawSStx ¶
func (c *Client) CreateRawSStx(inputs []dcrjson.SStxInput, amount map[dcrutil.Address]dcrutil.Amount, couts []SStxCommitOut) (*wire.MsgTx, error)
CreateRawSStx returns a new transaction spending the provided inputs and sending to the provided addresses.
func (*Client) CreateRawSStxAsync ¶
func (c *Client) CreateRawSStxAsync(inputs []dcrjson.SStxInput, amount map[dcrutil.Address]dcrutil.Amount, couts []SStxCommitOut) FutureCreateRawSStxResult
CreateRawSStxAsync 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 CreateRawSStx for the blocking version and more details.
func (*Client) CreateRawTransaction ¶
func (c *Client) CreateRawTransaction(inputs []dcrjson.TransactionInput, amounts map[dcrutil.Address]dcrutil.Amount, lockTime *int64, expiry *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(inputs []dcrjson.TransactionInput, amounts map[dcrutil.Address]dcrutil.Amount, lockTime *int64, expiry *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 dcrd extension.
func (*Client) DebugLevelAsync ¶
func (c *Client) DebugLevelAsync(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 dcrd extension.
func (*Client) DecodeRawTransaction ¶
DecodeRawTransaction returns information about a transaction given its serialized bytes.
func (*Client) DecodeRawTransactionAsync ¶
func (c *Client) DecodeRawTransactionAsync(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) Disconnect ¶
func (c *Client) Disconnect()
Disconnect disconnects the current websocket associated with the client. The connection will automatically be re-established unless the client was created with the DisableAutoReconnect flag.
This function has no effect when the client is running in HTTP POST mode.
func (*Client) Disconnected ¶
Disconnected returns whether or not the server is disconnected. If a websocket client was created but never connected, this also returns false.
func (*Client) DumpPrivKey ¶
DumpPrivKey gets the private key corresponding to the passed address encoded in the wallet import format (WIF).
NOTE: This function requires to the wallet to be unlocked. See the WalletPassphrase function for more details.
func (*Client) DumpPrivKeyAsync ¶
func (c *Client) DumpPrivKeyAsync(address dcrutil.Address) FutureDumpPrivKeyResult
DumpPrivKeyAsync 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 DumpPrivKey for the blocking version and more details.
func (*Client) EstimateSmartFee ¶ added in v2.1.0
func (c *Client) EstimateSmartFee(confirmations int64, mode dcrjson.EstimateSmartFeeMode) (float64, error)
EstimateSmartFee returns an estimation of a transaction fee rate (in dcr/KB) that new transactions should pay if they desire to be mined in up to 'confirmations' blocks.
The mode parameter (roughly) selects the different thresholds for accepting an estimation as reasonable, allowing users to select different trade-offs between probability of the transaction being mined in the given target confirmation range and minimization of fees paid.
As of 2019-01, only the default conservative mode is supported by dcrd.
func (*Client) EstimateSmartFeeAsync ¶ added in v2.1.0
func (c *Client) EstimateSmartFeeAsync(confirmations int64, mode dcrjson.EstimateSmartFeeMode) FutureEstimateSmartFeeResult
EstimateSmartFeeAsync 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 EstimateSmartFee for the blocking version and more details.
func (*Client) EstimateStakeDiff ¶
EstimateStakeDiff returns the minimum, maximum, and expected next stake difficulty.
NOTE: This is a dcrd extension.
func (*Client) EstimateStakeDiffAsync ¶
func (c *Client) EstimateStakeDiffAsync(tickets *uint32) FutureEstimateStakeDiffResult
EstimateStakeDiffAsync 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 EstimateStakeDiff for the blocking version and more details.
NOTE: This is a dcrd extension.
func (*Client) ExistsAddress ¶
ExistsAddress returns information about whether or not an address has been used on the main chain or in mempool.
NOTE: This is a dcrd extension.
func (*Client) ExistsAddressAsync ¶
func (c *Client) ExistsAddressAsync(address dcrutil.Address) FutureExistsAddressResult
ExistsAddressAsync 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.
func (*Client) ExistsAddresses ¶
ExistsAddresses returns information about whether or not an address exists in the blockchain or memory pool.
NOTE: This is a dcrd extension.
func (*Client) ExistsAddressesAsync ¶
func (c *Client) ExistsAddressesAsync(addresses []dcrutil.Address) FutureExistsAddressesResult
ExistsAddressesAsync 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.
func (*Client) ExistsExpiredTickets ¶
ExistsExpiredTickets returns information about whether or not a ticket hash exists in the expired ticket database.
NOTE: This is a dcrd extension.
func (*Client) ExistsExpiredTicketsAsync ¶
func (c *Client) ExistsExpiredTicketsAsync(hashes []*chainhash.Hash) FutureExistsExpiredTicketsResult
ExistsExpiredTicketsAsync 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.
func (*Client) ExistsLiveTicket ¶
ExistsLiveTicket returns information about whether or not a ticket hash exists in the live ticket database.
NOTE: This is a dcrd extension.
func (*Client) ExistsLiveTicketAsync ¶
func (c *Client) ExistsLiveTicketAsync(hash *chainhash.Hash) FutureExistsLiveTicketResult
ExistsLiveTicketAsync 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.
func (*Client) ExistsLiveTickets ¶
ExistsLiveTickets returns information about whether or not a ticket hash exists in the live ticket database.
NOTE: This is a dcrd extension.
func (*Client) ExistsLiveTicketsAsync ¶
func (c *Client) ExistsLiveTicketsAsync(hashes []*chainhash.Hash) FutureExistsLiveTicketsResult
ExistsLiveTicketsAsync 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.
func (*Client) ExistsMempoolTxs ¶
ExistsMempoolTxs returns information about whether or not a ticket hash exists in the live ticket database.
NOTE: This is a dcrd extension.
func (*Client) ExistsMempoolTxsAsync ¶
func (c *Client) ExistsMempoolTxsAsync(hashes []*chainhash.Hash) FutureExistsMempoolTxsResult
ExistsMempoolTxsAsync 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.
func (*Client) ExistsMissedTickets ¶
ExistsMissedTickets returns a hex-encoded bitset describing whether or not ticket hashes exists in the missed ticket database.
func (*Client) ExistsMissedTicketsAsync ¶
func (c *Client) ExistsMissedTicketsAsync(hashes []*chainhash.Hash) FutureExistsMissedTicketsResult
ExistsMissedTicketsAsync 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.
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 dcrwallet to enable a wallet which does not have the private keys necessary to spend funds.
NOTE: This is a dcrwallet extension.
func (*Client) ExportWatchingWalletAsync ¶
func (c *Client) ExportWatchingWalletAsync(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 dcrwallet extension.
func (*Client) FundRawTransaction ¶
func (c *Client) FundRawTransaction(rawhex string, fundAccount string, options walletjson.FundRawTransactionOptions) (*walletjson.FundRawTransactionResult, error)
FundRawTransaction Add inputs to a transaction until it has enough in value to meet its out value.
func (*Client) FundRawTransactionAsync ¶
func (c *Client) FundRawTransactionAsync(rawhex string, fundAccount string, options walletjson.FundRawTransactionOptions) FutureFundRawTransactionResult
FundRawTransactionAsync 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 FundRawTransaction for the blocking version and more details.
func (*Client) GenerateAsync ¶
func (c *Client) GenerateAsync(numBlocks uint32) FutureGenerateResult
GenerateAsync 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 Generate for the blocking version and more details.
func (*Client) GenerateVote ¶
func (c *Client) GenerateVote(blockHash *chainhash.Hash, height int64, sstxHash *chainhash.Hash, voteBits uint16, voteBitsExt string) (*walletjson.GenerateVoteResult, error)
GenerateVote returns hex of an SSGen.
func (*Client) GenerateVoteAsync ¶
func (c *Client) GenerateVoteAsync(blockHash *chainhash.Hash, height int64, sstxHash *chainhash.Hash, voteBits uint16, voteBitsExt string) FutureGenerateVoteResult
GenerateVoteAsync 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 GenerateVote for the blocking version and more details.
func (*Client) GetAccount ¶
GetAccount returns the account associated with the passed address.
func (*Client) GetAccountAddress ¶
GetAccountAddress returns the current Decred address for receiving payments to the specified account.
func (*Client) GetAccountAddressAsync ¶
func (c *Client) GetAccountAddressAsync(account string) FutureGetAccountAddressResult
GetAccountAddressAsync 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 GetAccountAddress for the blocking version and more details.
func (*Client) GetAccountAsync ¶
func (c *Client) GetAccountAsync(address dcrutil.Address) FutureGetAccountResult
GetAccountAsync 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 GetAccount for the blocking version and more details.
func (*Client) GetAddedNodeInfo ¶
GetAddedNodeInfo returns information about manually added (persistent) peers.
See GetAddedNodeInfoNoDNS to retrieve only a list of the added (persistent) peers.
func (*Client) GetAddedNodeInfoAsync ¶
func (c *Client) GetAddedNodeInfoAsync(peer string) FutureGetAddedNodeInfoResult
GetAddedNodeInfoAsync 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 GetAddedNodeInfo for the blocking version and more details.
func (*Client) GetAddedNodeInfoNoDNS ¶
GetAddedNodeInfoNoDNS returns a list of manually added (persistent) peers. This works by setting the dns flag to false in the underlying RPC.
See GetAddedNodeInfo to obtain more information about each added (persistent) peer.
func (*Client) GetAddedNodeInfoNoDNSAsync ¶
func (c *Client) GetAddedNodeInfoNoDNSAsync(peer string) FutureGetAddedNodeInfoNoDNSResult
GetAddedNodeInfoNoDNSAsync 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 GetAddedNodeInfoNoDNS for the blocking version and more details.
func (*Client) GetAddressesByAccount ¶
GetAddressesByAccount returns the list of addresses associated with the passed account.
func (*Client) GetAddressesByAccountAsync ¶
func (c *Client) GetAddressesByAccountAsync(account string) FutureGetAddressesByAccountResult
GetAddressesByAccountAsync 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 GetAddressesByAccount for the blocking version and more details.
func (*Client) GetBalance ¶
func (c *Client) GetBalance(account string) (*walletjson.GetBalanceResult, error)
GetBalance returns the available balance from the server for the specified account using the default number of minimum confirmations. The account may be "*" for all accounts.
See GetBalanceMinConf to override the minimum number of confirmations.
func (*Client) GetBalanceAsync ¶
func (c *Client) GetBalanceAsync(account string) FutureGetBalanceResult
GetBalanceAsync 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 GetBalance for the blocking version and more details.
func (*Client) GetBalanceMinConf ¶
func (c *Client) GetBalanceMinConf(account string, minConfirms int) (*walletjson.GetBalanceResult, error)
GetBalanceMinConf returns the available balance from the server for the specified account using the specified number of minimum confirmations. The account may be "*" for all accounts.
See GetBalance to use the default minimum number of confirmations.
func (*Client) GetBalanceMinConfAsync ¶
func (c *Client) GetBalanceMinConfAsync(account string, minConfirms int) FutureGetBalanceResult
GetBalanceMinConfAsync 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 GetBalanceMinConf for the blocking version and more details.
func (*Client) GetBestBlock ¶
GetBestBlock returns the hash and height of the block in the longest (best) chain.
NOTE: This is a dcrd extension.
func (*Client) GetBestBlockAsync ¶
func (c *Client) GetBestBlockAsync() 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 dcrd extension.
func (*Client) GetBestBlockHash ¶
GetBestBlockHash returns the hash of the best block in the longest block chain.
func (*Client) GetBestBlockHashAsync ¶
func (c *Client) GetBestBlockHashAsync() 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 ¶
func (c *Client) GetBlockAsync(blockHash *chainhash.Hash) FutureGetBlockResult
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 about the current state of the block chain.
func (*Client) GetBlockChainInfoAsync ¶
func (c *Client) GetBlockChainInfoAsync() 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() 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(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 ¶
GetBlockHeader returns the hash of the block in the best block chain at the given height.
func (*Client) GetBlockHeaderAsync ¶
func (c *Client) GetBlockHeaderAsync(hash *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(hash *chainhash.Hash) (*dcrjson.GetBlockHeaderVerboseResult, error)
GetBlockHeaderVerbose returns a data structure of the block header from the server given its hash.
See GetBlockHeader to retrieve a raw block header instead.
func (*Client) GetBlockHeaderVerboseAsync ¶
func (c *Client) GetBlockHeaderVerboseAsync(hash *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 GetBlockHeaderVerbose for the blocking version and more details.
func (*Client) GetBlockSubsidy ¶
func (c *Client) GetBlockSubsidy(height int64, voters uint16) (*dcrjson.GetBlockSubsidyResult, error)
GetBlockSubsidy returns a data structure of the block subsidy from the server given its height and number of voters.
func (*Client) GetBlockSubsidyAsync ¶
func (c *Client) GetBlockSubsidyAsync(height int64, voters uint16) FutureGetBlockSubsidyResult
GetBlockSubsidyAsync 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 GetBlockSubsidy for the blocking version and more details.
func (*Client) GetBlockTemplate ¶
func (c *Client) GetBlockTemplate(req *dcrjson.TemplateRequest) (*dcrjson.GetBlockTemplateResult, error)
GetBlockTemplate returns a block template to work on.
See SubmitBlock to submit the found solution.
func (*Client) GetBlockTemplateAsync ¶
func (c *Client) GetBlockTemplateAsync(req *dcrjson.TemplateRequest) FutureGetBlockTemplate
GetBlockTemplateAsync 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 on the returned instance.
See GetBlockTemplate for the blocking version and more details.
func (*Client) GetBlockVerbose ¶
func (c *Client) GetBlockVerbose(blockHash *chainhash.Hash, verboseTx bool) (*dcrjson.GetBlockVerboseResult, error)
GetBlockVerbose returns a data structure from the server with information about a block given its hash.
See GetBlock to retrieve a raw block instead.
func (*Client) GetBlockVerboseAsync ¶
func (c *Client) GetBlockVerboseAsync(blockHash *chainhash.Hash, verboseTx bool) 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) GetCFilter ¶
func (c *Client) GetCFilter(blockHash *chainhash.Hash, filterType wire.FilterType) (*gcs.Filter, error)
GetCFilter returns the committed filter of type filterType for a block.
func (*Client) GetCFilterAsync ¶
func (c *Client) GetCFilterAsync(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(blockHash *chainhash.Hash, filterType wire.FilterType) (*chainhash.Hash, error)
GetCFilterHeader returns the committed filter header hash of type filterType for a block.
func (*Client) GetCFilterHeaderAsync ¶
func (c *Client) GetCFilterHeaderAsync(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) GetChainTips ¶
GetChainTips returns all known tips in the block tree.
func (*Client) GetChainTipsAsync ¶
func (c *Client) GetChainTipsAsync() FutureGetChainTipsResult
GetChainTipsAsync 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 GetChainTips for the blocking version and more details.
func (*Client) GetCoinSupply ¶
GetCoinSupply returns the current coin supply
func (*Client) GetCoinSupplyAsync ¶
func (c *Client) GetCoinSupplyAsync() FutureGetCoinSupplyResult
GetCoinSupplyAsync 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 GetCoinSupply for the blocking version and more details.
func (*Client) GetConnectionCount ¶
GetConnectionCount returns the number of active connections to other peers.
func (*Client) GetConnectionCountAsync ¶
func (c *Client) GetConnectionCountAsync() FutureGetConnectionCountResult
GetConnectionCountAsync 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 GetConnectionCount for the blocking version and more details.
func (*Client) GetCurrentNet ¶
func (c *Client) GetCurrentNet() (wire.CurrencyNet, error)
GetCurrentNet returns the network the server is running on.
NOTE: This is a dcrd extension.
func (*Client) GetCurrentNetAsync ¶
func (c *Client) GetCurrentNetAsync() 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 dcrd 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() 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) GetGenerate ¶
GetGenerate returns true if the server is set to mine, otherwise false.
func (*Client) GetGenerateAsync ¶
func (c *Client) GetGenerateAsync() FutureGetGenerateResult
GetGenerateAsync 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 GetGenerate for the blocking version and more details.
func (*Client) GetHashesPerSec ¶
GetHashesPerSec returns a recent hashes per second performance measurement while generating coins (mining). Zero is returned if the server is not mining.
func (*Client) GetHashesPerSecAsync ¶
func (c *Client) GetHashesPerSecAsync() FutureGetHashesPerSecResult
GetHashesPerSecAsync 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 GetHashesPerSec for the blocking version and more details.
func (*Client) GetHeaders ¶
func (c *Client) GetHeaders(blockLocators []*chainhash.Hash, hashStop *chainhash.Hash) (*dcrjson.GetHeadersResult, 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.
func (*Client) GetHeadersAsync ¶
func (c *Client) GetHeadersAsync(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.
func (*Client) GetInfo ¶
func (c *Client) GetInfo() (*walletjson.InfoWalletResult, error)
GetInfo returns miscellaneous info regarding the RPC server. The returned info object may be void of wallet information if the remote server does not include wallet functionality.
func (*Client) GetInfoAsync ¶
func (c *Client) GetInfoAsync() FutureGetInfoResult
GetInfoAsync 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 GetInfo for the blocking version and more details.
func (*Client) GetMasterPubkey ¶ added in v2.1.0
func (c *Client) GetMasterPubkey(account string, net hdkeychain.NetworkParams) (*hdkeychain.ExtendedKey, error)
GetMasterPubkey returns a pointer to the master extended public key for account and the network's hierarchical deterministic extended key magic versions (e.g. MainNetParams)
func (*Client) GetMasterPubkeyAsync ¶ added in v2.1.0
func (c *Client) GetMasterPubkeyAsync(account string) FutureGetMasterPubkeyResult
GetMasterPubkeyAsync 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 GetMasterPubkey for the blocking version and more details.
func (*Client) GetMiningInfo ¶
GetMiningInfo returns mining information.
func (*Client) GetMiningInfoAsync ¶
func (c *Client) GetMiningInfoAsync() FutureGetMiningInfoResult
GetMiningInfoAsync 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 GetMiningInfo for the blocking version and more details.
func (*Client) GetNetTotals ¶
GetNetTotals returns network traffic statistics.
func (*Client) GetNetTotalsAsync ¶
func (c *Client) GetNetTotalsAsync() FutureGetNetTotalsResult
GetNetTotalsAsync 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 GetNetTotals for the blocking version and more details.
func (*Client) GetNetworkHashPS ¶
GetNetworkHashPS returns the estimated network hashes per second using the default number of blocks and the most recent block height.
See GetNetworkHashPS2 to override the number of blocks to use and GetNetworkHashPS3 to override the height at which to calculate the estimate.
func (*Client) GetNetworkHashPS2 ¶
GetNetworkHashPS2 returns the estimated network hashes per second for the specified previous number of blocks working backwards from the most recent block height. The blocks parameter can also be -1 in which case the number of blocks since the last difficulty change will be used.
See GetNetworkHashPS to use defaults and GetNetworkHashPS3 to override the height at which to calculate the estimate.
func (*Client) GetNetworkHashPS2Async ¶
func (c *Client) GetNetworkHashPS2Async(blocks int) FutureGetNetworkHashPS
GetNetworkHashPS2Async 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 GetNetworkHashPS2 for the blocking version and more details.
func (*Client) GetNetworkHashPS3 ¶
GetNetworkHashPS3 returns the estimated network hashes per second for the specified previous number of blocks working backwards from the specified block height. The blocks parameter can also be -1 in which case the number of blocks since the last difficulty change will be used.
See GetNetworkHashPS and GetNetworkHashPS2 to use defaults.
func (*Client) GetNetworkHashPS3Async ¶
func (c *Client) GetNetworkHashPS3Async(blocks, height int) FutureGetNetworkHashPS
GetNetworkHashPS3Async 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 GetNetworkHashPS3 for the blocking version and more details.
func (*Client) GetNetworkHashPSAsync ¶
func (c *Client) GetNetworkHashPSAsync() FutureGetNetworkHashPS
GetNetworkHashPSAsync 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 GetNetworkHashPS for the blocking version and more details.
func (*Client) GetNewAddress ¶
GetNewAddress returns a new address.
func (*Client) GetNewAddressAsync ¶
func (c *Client) GetNewAddressAsync(account string) FutureGetNewAddressResult
GetNewAddressAsync 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 GetNewAddress for the blocking version and more details.
func (*Client) GetNewAddressGapPolicy ¶
func (c *Client) GetNewAddressGapPolicy(account string, gapPolicy GapPolicy) (dcrutil.Address, error)
GetNewAddressGapPolicy returns a new address while allowing callers to control the BIP0044 unused address gap limit policy.
func (*Client) GetNewAddressGapPolicyAsync ¶
func (c *Client) GetNewAddressGapPolicyAsync(account string, gapPolicy GapPolicy) FutureGetNewAddressResult
GetNewAddressGapPolicyAsync 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 GetNewAddressGapPolicy for the blocking version and more details.
func (*Client) GetPeerInfo ¶
GetPeerInfo returns data about each connected network peer.
func (*Client) GetPeerInfoAsync ¶
func (c *Client) GetPeerInfoAsync() FutureGetPeerInfoResult
GetPeerInfoAsync 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 GetPeerInfo for the blocking version and more details.
func (*Client) GetRawChangeAddress ¶
GetRawChangeAddress returns a new address for receiving change that will be associated with the provided account. Note that this is only for raw transactions and NOT for normal use.
func (*Client) GetRawChangeAddressAsync ¶
func (c *Client) GetRawChangeAddressAsync(account string) FutureGetRawChangeAddressResult
GetRawChangeAddressAsync 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 GetRawChangeAddress for the blocking version and more details.
func (*Client) GetRawMempool ¶
GetRawMempool returns the hashes of all transactions in the memory pool for the given txType.
See GetRawMempoolVerbose to retrieve data structures with information about the transactions instead.
func (*Client) GetRawMempoolAsync ¶
func (c *Client) GetRawMempoolAsync(txType dcrjson.GetRawMempoolTxTypeCmd) 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(txType dcrjson.GetRawMempoolTxTypeCmd) (map[string]dcrjson.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(txType dcrjson.GetRawMempoolTxTypeCmd) 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 ¶
GetRawTransaction returns a transaction given its hash.
See GetRawTransactionVerbose to obtain additional information about the transaction.
func (*Client) GetRawTransactionAsync ¶
func (c *Client) GetRawTransactionAsync(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 ¶
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(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) GetReceivedByAccount ¶
GetReceivedByAccount returns the total amount received with the specified account with at least the default number of minimum confirmations.
See GetReceivedByAccountMinConf to override the minimum number of confirmations.
func (*Client) GetReceivedByAccountAsync ¶
func (c *Client) GetReceivedByAccountAsync(account string) FutureGetReceivedByAccountResult
GetReceivedByAccountAsync 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 GetReceivedByAccount for the blocking version and more details.
func (*Client) GetReceivedByAccountMinConf ¶
func (c *Client) GetReceivedByAccountMinConf(account string, minConfirms int) (dcrutil.Amount, error)
GetReceivedByAccountMinConf returns the total amount received with the specified account with at least the specified number of minimum confirmations.
See GetReceivedByAccount to use the default minimum number of confirmations.
func (*Client) GetReceivedByAccountMinConfAsync ¶
func (c *Client) GetReceivedByAccountMinConfAsync(account string, minConfirms int) FutureGetReceivedByAccountResult
GetReceivedByAccountMinConfAsync 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 GetReceivedByAccountMinConf for the blocking version and more details.
func (*Client) GetReceivedByAddress ¶
GetReceivedByAddress returns the total amount received by the specified address with at least the default number of minimum confirmations.
See GetReceivedByAddressMinConf to override the minimum number of confirmations.
func (*Client) GetReceivedByAddressAsync ¶
func (c *Client) GetReceivedByAddressAsync(address dcrutil.Address) FutureGetReceivedByAddressResult
GetReceivedByAddressAsync 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 GetReceivedByAddress for the blocking version and more details.
func (*Client) GetReceivedByAddressMinConf ¶
func (c *Client) GetReceivedByAddressMinConf(address dcrutil.Address, minConfirms int) (dcrutil.Amount, error)
GetReceivedByAddressMinConf returns the total amount received by the specified address with at least the specified number of minimum confirmations.
See GetReceivedByAddress to use the default minimum number of confirmations.
func (*Client) GetReceivedByAddressMinConfAsync ¶
func (c *Client) GetReceivedByAddressMinConfAsync(address dcrutil.Address, minConfirms int) FutureGetReceivedByAddressResult
GetReceivedByAddressMinConfAsync 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 GetReceivedByAddressMinConf for the blocking version and more details.
func (*Client) GetStakeDifficulty ¶
GetStakeDifficulty returns the current and next stake difficulty.
NOTE: This is a dcrd extension.
func (*Client) GetStakeDifficultyAsync ¶
func (c *Client) GetStakeDifficultyAsync() FutureGetStakeDifficultyResult
GetStakeDifficultyAsync 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 GetStakeDifficulty for the blocking version and more details.
NOTE: This is a dcrd extension.
func (*Client) GetStakeInfo ¶
func (c *Client) GetStakeInfo() (*walletjson.GetStakeInfoResult, error)
GetStakeInfo returns stake mining info from a given wallet. This includes various statistics on tickets it owns and votes it has produced.
func (*Client) GetStakeInfoAsync ¶
func (c *Client) GetStakeInfoAsync() FutureGetStakeInfoResult
GetStakeInfoAsync 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 GetStakeInfo for the blocking version and more details.
func (*Client) GetStakeVersionInfo ¶
GetStakeVersionInfo returns the stake versions results for past requested intervals (count).
NOTE: This is a dcrd extension.
func (*Client) GetStakeVersionInfoAsync ¶
func (c *Client) GetStakeVersionInfoAsync(count int32) FutureGetStakeVersionInfoResult
GetStakeVersionInfoAsync 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 GetStakeVersionInfo for the blocking version and more details.
NOTE: This is a dcrd extension.
func (*Client) GetStakeVersions ¶
func (c *Client) GetStakeVersions(hash string, count int32) (*dcrjson.GetStakeVersionsResult, error)
GetStakeVersions returns the stake versions and vote versions of past requested blocks.
NOTE: This is a dcrd extension.
func (*Client) GetStakeVersionsAsync ¶
func (c *Client) GetStakeVersionsAsync(hash string, count int32) FutureGetStakeVersionsResult
GetStakeVersionsAsync 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 GetStakeVersions for the blocking version and more details.
NOTE: This is a dcrd extension.
func (*Client) GetTicketPoolValue ¶
GetTicketPoolValue returns the value of the live ticket pool.
NOTE: This is a dcrd extension.
func (*Client) GetTicketPoolValueAsync ¶
func (c *Client) GetTicketPoolValueAsync() FutureGetTicketPoolValueResult
GetTicketPoolValueAsync 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 GetTicketPoolValue for the blocking version and more details.
NOTE: This is a dcrd extension.
func (*Client) GetTickets ¶
GetTickets returns a list of the tickets owned by the wallet, partially or in full. The flag includeImmature is used to indicate if non mature tickets should also be returned.
func (*Client) GetTicketsAsync ¶
func (c *Client) GetTicketsAsync(includeImmature bool) FutureGetTicketsResult
GetTicketsAsync 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 GetTicketsfor the blocking version and more details.
func (*Client) GetTransaction ¶
func (c *Client) GetTransaction(txHash *chainhash.Hash) (*walletjson.GetTransactionResult, error)
GetTransaction returns detailed information about a wallet transaction.
See GetRawTransaction to return the raw transaction instead.
func (*Client) GetTransactionAsync ¶
func (c *Client) GetTransactionAsync(txHash *chainhash.Hash) FutureGetTransactionResult
GetTransactionAsync 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 GetTransaction for the blocking version and more details.
func (*Client) GetTxOut ¶
func (c *Client) GetTxOut(txHash *chainhash.Hash, index uint32, mempool bool) (*dcrjson.GetTxOutResult, error)
GetTxOut returns the transaction output info if it's unspent and nil, otherwise.
func (*Client) GetTxOutAsync ¶
func (c *Client) GetTxOutAsync(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) GetUnconfirmedBalance ¶
GetUnconfirmedBalance returns the unconfirmed balance from the server for the specified account.
func (*Client) GetUnconfirmedBalanceAsync ¶
func (c *Client) GetUnconfirmedBalanceAsync(account string) FutureGetUnconfirmedBalanceResult
GetUnconfirmedBalanceAsync 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 GetUnconfirmedBalance for the blocking version and more details.
func (*Client) GetVoteChoices ¶
func (c *Client) GetVoteChoices() (*walletjson.GetVoteChoicesResult, error)
GetVoteChoices returns the currently-set vote choices for each agenda in the latest supported stake version.
func (*Client) GetVoteChoicesAsync ¶
func (c *Client) GetVoteChoicesAsync() FutureGetVoteChoicesResult
GetVoteChoicesAsync 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 GetVoteChoices for the blocking version and more details.
func (*Client) GetVoteInfo ¶
GetVoteInfo returns voting information for the specified stake version. This includes current voting window, quorum, total votes and agendas.
NOTE: This is a dcrd extension.
func (*Client) GetVoteInfoAsync ¶
func (c *Client) GetVoteInfoAsync(version uint32) FutureGetVoteInfoResult
GetVoteInfoAsync 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 GetVoteInfo for the blocking version and more details.
NOTE: This is a dcrd extension.
func (*Client) GetWork ¶
GetWork returns hash data to work on.
See GetWorkSubmit to submit the found solution.
func (*Client) GetWorkAsync ¶
func (c *Client) GetWorkAsync() FutureGetWork
GetWorkAsync 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 GetWork for the blocking version and more details.
func (*Client) GetWorkSubmit ¶
GetWorkSubmit submits a block header which is a solution to previously requested data and returns whether or not the solution was accepted.
See GetWork to request data to work on.
func (*Client) GetWorkSubmitAsync ¶
func (c *Client) GetWorkSubmitAsync(data string) FutureGetWorkSubmit
GetWorkSubmitAsync 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 GetWorkSubmit for the blocking version and more details.
func (*Client) ImportPrivKey ¶
ImportPrivKey imports the passed private key which must be the wallet import format (WIF).
func (*Client) ImportPrivKeyAsync ¶
func (c *Client) ImportPrivKeyAsync(privKeyWIF *dcrutil.WIF) FutureImportPrivKeyResult
ImportPrivKeyAsync 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 ImportPrivKey for the blocking version and more details.
func (*Client) ImportPrivKeyLabel ¶
ImportPrivKeyLabel imports the passed private key which must be the wallet import format (WIF). It sets the account label to the one provided.
func (*Client) ImportPrivKeyLabelAsync ¶
func (c *Client) ImportPrivKeyLabelAsync(privKeyWIF *dcrutil.WIF, label string) FutureImportPrivKeyResult
ImportPrivKeyLabelAsync 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 ImportPrivKey for the blocking version and more details.
func (*Client) ImportPrivKeyRescan ¶
ImportPrivKeyRescan imports the passed private key which must be the wallet import format (WIF). It sets the account label to the one provided. When rescan is true, the block history is scanned for transactions addressed to provided privKey.
func (*Client) ImportPrivKeyRescanAsync ¶
func (c *Client) ImportPrivKeyRescanAsync(privKeyWIF *dcrutil.WIF, label string, rescan bool) FutureImportPrivKeyResult
ImportPrivKeyRescanAsync 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 ImportPrivKey for the blocking version and more details.
func (*Client) ImportPrivKeyRescanFrom ¶
func (c *Client) ImportPrivKeyRescanFrom(privKeyWIF *dcrutil.WIF, label string, rescan bool, scanFrom int) error
ImportPrivKeyRescanFrom imports the passed private key which must be the wallet import format (WIF). It sets the account label to the one provided. When rescan is true, the block history from block scanFrom is scanned for transactions addressed to provided privKey.
func (*Client) ImportPrivKeyRescanFromAsync ¶
func (c *Client) ImportPrivKeyRescanFromAsync(privKeyWIF *dcrutil.WIF, label string, rescan bool, scanFrom int) FutureImportPrivKeyResult
ImportPrivKeyRescanFromAsync 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 o n the returned instance.
See ImportPrivKey for the blocking version and more details.
func (*Client) ImportScript ¶
ImportScript attempts to import a byte code script into wallet.
func (*Client) ImportScriptAsync ¶
func (c *Client) ImportScriptAsync(script []byte) FutureImportScriptResult
ImportScriptAsync 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 ImportScript for the blocking version and more details.
func (*Client) ImportScriptRescan ¶
ImportScriptRescan attempts to import a byte code script into wallet. It also allows the user to choose whether or not they do a rescan.
func (*Client) ImportScriptRescanAsync ¶
func (c *Client) ImportScriptRescanAsync(script []byte, rescan bool) FutureImportScriptResult
ImportScriptRescanAsync 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 ImportScript for the blocking version and more details.
func (*Client) ImportScriptRescanFrom ¶
ImportScriptRescanFrom attempts to import a byte code script into wallet. It also allows the user to choose whether or not they do a rescan, and which height to rescan from.
func (*Client) ImportScriptRescanFromAsync ¶
func (c *Client) ImportScriptRescanFromAsync(script []byte, rescan bool, scanFrom int) FutureImportScriptResult
ImportScriptRescanFromAsync 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 ImportScript for the blocking version and more details.
func (*Client) KeyPoolRefill ¶
KeyPoolRefill fills the key pool as necessary to reach the default size.
See KeyPoolRefillSize to override the size of the key pool.
func (*Client) KeyPoolRefillAsync ¶
func (c *Client) KeyPoolRefillAsync() FutureKeyPoolRefillResult
KeyPoolRefillAsync 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 KeyPoolRefill for the blocking version and more details.
func (*Client) KeyPoolRefillSize ¶
KeyPoolRefillSize fills the key pool as necessary to reach the specified size.
func (*Client) KeyPoolRefillSizeAsync ¶
func (c *Client) KeyPoolRefillSizeAsync(newSize uint) FutureKeyPoolRefillResult
KeyPoolRefillSizeAsync 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 KeyPoolRefillSize for the blocking version and more details.
func (*Client) ListAccounts ¶
ListAccounts returns a map of account names and their associated balances using the default number of minimum confirmations.
See ListAccountsMinConf to override the minimum number of confirmations.
func (*Client) ListAccountsAsync ¶
func (c *Client) ListAccountsAsync() FutureListAccountsResult
ListAccountsAsync 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 ListAccounts for the blocking version and more details.
func (*Client) ListAccountsMinConf ¶
ListAccountsMinConf returns a map of account names and their associated balances using the specified number of minimum confirmations.
See ListAccounts to use the default minimum number of confirmations.
func (*Client) ListAccountsMinConfAsync ¶
func (c *Client) ListAccountsMinConfAsync(minConfirms int) FutureListAccountsResult
ListAccountsMinConfAsync 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 ListAccountsMinConf for the blocking version and more details.
func (*Client) ListAddressTransactions ¶
func (c *Client) ListAddressTransactions(addresses []dcrutil.Address, account string) ([]walletjson.ListTransactionsResult, error)
ListAddressTransactions returns information about all transactions associated with the provided addresses.
NOTE: This is a dcrwallet extension.
func (*Client) ListAddressTransactionsAsync ¶
func (c *Client) ListAddressTransactionsAsync(addresses []dcrutil.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 dcrd extension.
func (*Client) ListLockUnspent ¶
ListLockUnspent returns a slice of outpoints for all unspent outputs marked as locked by a wallet. Unspent outputs may be marked locked using LockOutput.
func (*Client) ListLockUnspentAsync ¶
func (c *Client) ListLockUnspentAsync() FutureListLockUnspentResult
ListLockUnspentAsync 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 ListLockUnspent for the blocking version and more details.
func (*Client) ListReceivedByAccount ¶
func (c *Client) ListReceivedByAccount() ([]walletjson.ListReceivedByAccountResult, error)
ListReceivedByAccount lists balances by account using the default number of minimum confirmations and including accounts that haven't received any payments.
See ListReceivedByAccountMinConf to override the minimum number of confirmations and ListReceivedByAccountIncludeEmpty to filter accounts that haven't received any payments from the results.
func (*Client) ListReceivedByAccountAsync ¶
func (c *Client) ListReceivedByAccountAsync() FutureListReceivedByAccountResult
ListReceivedByAccountAsync 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 ListReceivedByAccount for the blocking version and more details.
func (*Client) ListReceivedByAccountIncludeEmpty ¶
func (c *Client) ListReceivedByAccountIncludeEmpty(minConfirms int, includeEmpty bool) ([]walletjson.ListReceivedByAccountResult, error)
ListReceivedByAccountIncludeEmpty lists balances by account using the specified number of minimum confirmations and including accounts that haven't received any payments depending on specified flag.
See ListReceivedByAccount and ListReceivedByAccountMinConf to use defaults.
func (*Client) ListReceivedByAccountIncludeEmptyAsync ¶
func (c *Client) ListReceivedByAccountIncludeEmptyAsync(minConfirms int, includeEmpty bool) FutureListReceivedByAccountResult
ListReceivedByAccountIncludeEmptyAsync 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 ListReceivedByAccountIncludeEmpty for the blocking version and more details.
func (*Client) ListReceivedByAccountMinConf ¶
func (c *Client) ListReceivedByAccountMinConf(minConfirms int) ([]walletjson.ListReceivedByAccountResult, error)
ListReceivedByAccountMinConf lists balances by account using the specified number of minimum confirmations not including accounts that haven't received any payments.
See ListReceivedByAccount to use the default minimum number of confirmations and ListReceivedByAccountIncludeEmpty to also filter accounts that haven't received any payments from the results.
func (*Client) ListReceivedByAccountMinConfAsync ¶
func (c *Client) ListReceivedByAccountMinConfAsync(minConfirms int) FutureListReceivedByAccountResult
ListReceivedByAccountMinConfAsync 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 ListReceivedByAccountMinConf for the blocking version and more details.
func (*Client) ListReceivedByAddress ¶
func (c *Client) ListReceivedByAddress() ([]walletjson.ListReceivedByAddressResult, error)
ListReceivedByAddress lists balances by address using the default number of minimum confirmations not including addresses that haven't received any payments or watching only addresses.
See ListReceivedByAddressMinConf to override the minimum number of confirmations and ListReceivedByAddressIncludeEmpty to also include addresses that haven't received any payments in the results.
func (*Client) ListReceivedByAddressAsync ¶
func (c *Client) ListReceivedByAddressAsync() FutureListReceivedByAddressResult
ListReceivedByAddressAsync 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 ListReceivedByAddress for the blocking version and more details.
func (*Client) ListReceivedByAddressIncludeEmpty ¶
func (c *Client) ListReceivedByAddressIncludeEmpty(minConfirms int, includeEmpty bool) ([]walletjson.ListReceivedByAddressResult, error)
ListReceivedByAddressIncludeEmpty lists balances by address using the specified number of minimum confirmations and including addresses that haven't received any payments depending on specified flag.
See ListReceivedByAddress and ListReceivedByAddressMinConf to use defaults.
func (*Client) ListReceivedByAddressIncludeEmptyAsync ¶
func (c *Client) ListReceivedByAddressIncludeEmptyAsync(minConfirms int, includeEmpty bool) FutureListReceivedByAddressResult
ListReceivedByAddressIncludeEmptyAsync 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 ListReceivedByAccountIncludeEmpty for the blocking version and more details.
func (*Client) ListReceivedByAddressMinConf ¶
func (c *Client) ListReceivedByAddressMinConf(minConfirms int) ([]walletjson.ListReceivedByAddressResult, error)
ListReceivedByAddressMinConf lists balances by address using the specified number of minimum confirmations not including addresses that haven't received any payments.
See ListReceivedByAddress to use the default minimum number of confirmations and ListReceivedByAddressIncludeEmpty to also include addresses that haven't received any payments in the results.
func (*Client) ListReceivedByAddressMinConfAsync ¶
func (c *Client) ListReceivedByAddressMinConfAsync(minConfirms int) FutureListReceivedByAddressResult
ListReceivedByAddressMinConfAsync 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 ListReceivedByAddressMinConf for the blocking version and more details.
func (*Client) ListScripts ¶
ListScripts returns a list of the currently known redeemscripts from the wallet as a slice of byte slices.
func (*Client) ListScriptsAsync ¶
func (c *Client) ListScriptsAsync() FutureListScriptsResult
ListScriptsAsync 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 ListScripts for the blocking version and more details.
func (*Client) ListSinceBlock ¶
func (c *Client) ListSinceBlock(blockHash *chainhash.Hash) (*walletjson.ListSinceBlockResult, error)
ListSinceBlock returns all transactions added in blocks since the specified block hash, or all transactions if it is nil, using the default number of minimum confirmations as a filter.
See ListSinceBlockMinConf to override the minimum number of confirmations.
func (*Client) ListSinceBlockAsync ¶
func (c *Client) ListSinceBlockAsync(blockHash *chainhash.Hash) FutureListSinceBlockResult
ListSinceBlockAsync 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 ListSinceBlock for the blocking version and more details.
func (*Client) ListSinceBlockMinConf ¶
func (c *Client) ListSinceBlockMinConf(blockHash *chainhash.Hash, minConfirms int) (*walletjson.ListSinceBlockResult, error)
ListSinceBlockMinConf returns all transactions added in blocks since the specified block hash, or all transactions if it is nil, using the specified number of minimum confirmations as a filter.
See ListSinceBlock to use the default minimum number of confirmations.
func (*Client) ListSinceBlockMinConfAsync ¶
func (c *Client) ListSinceBlockMinConfAsync(blockHash *chainhash.Hash, minConfirms int) FutureListSinceBlockResult
ListSinceBlockMinConfAsync 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 ListSinceBlockMinConf for the blocking version and more details.
func (*Client) ListTransactions ¶
func (c *Client) ListTransactions(account string) ([]walletjson.ListTransactionsResult, error)
ListTransactions returns a list of the most recent transactions.
See the ListTransactionsCount and ListTransactionsCountFrom to control the number of transactions returned and starting point, respectively.
func (*Client) ListTransactionsAsync ¶
func (c *Client) ListTransactionsAsync(account string) FutureListTransactionsResult
ListTransactionsAsync 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 ListTransactions for the blocking version and more details.
func (*Client) ListTransactionsCount ¶
func (c *Client) ListTransactionsCount(account string, count int) ([]walletjson.ListTransactionsResult, error)
ListTransactionsCount returns a list of the most recent transactions up to the passed count.
See the ListTransactions and ListTransactionsCountFrom functions for different options.
func (*Client) ListTransactionsCountAsync ¶
func (c *Client) ListTransactionsCountAsync(account string, count int) FutureListTransactionsResult
ListTransactionsCountAsync 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 ListTransactionsCount for the blocking version and more details.
func (*Client) ListTransactionsCountFrom ¶
func (c *Client) ListTransactionsCountFrom(account string, count, from int) ([]walletjson.ListTransactionsResult, error)
ListTransactionsCountFrom returns a list of the most recent transactions up to the passed count while skipping the first 'from' transactions.
See the ListTransactions and ListTransactionsCount functions to use defaults.
func (*Client) ListTransactionsCountFromAsync ¶
func (c *Client) ListTransactionsCountFromAsync(account string, count, from int) FutureListTransactionsResult
ListTransactionsCountFromAsync 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 ListTransactionsCountFrom for the blocking version and more details.
func (*Client) ListUnspent ¶
func (c *Client) ListUnspent() ([]walletjson.ListUnspentResult, error)
ListUnspent returns all unspent transaction outputs known to a wallet, using the default number of minimum and maximum number of confirmations as a filter (1 and 9999999, respectively).
func (*Client) ListUnspentAsync ¶
func (c *Client) ListUnspentAsync() FutureListUnspentResult
ListUnspentAsync 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 ListUnspent for the blocking version and more details.
func (*Client) ListUnspentMin ¶
func (c *Client) ListUnspentMin(minConf int) ([]walletjson.ListUnspentResult, error)
ListUnspentMin returns all unspent transaction outputs known to a wallet, using the specified number of minimum conformations and default number of maximum confiramtions (9999999) as a filter.
func (*Client) ListUnspentMinAsync ¶
func (c *Client) ListUnspentMinAsync(minConf int) FutureListUnspentResult
ListUnspentMinAsync 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 ListUnspentMin for the blocking version and more details.
func (*Client) ListUnspentMinMax ¶
func (c *Client) ListUnspentMinMax(minConf, maxConf int) ([]walletjson.ListUnspentResult, error)
ListUnspentMinMax returns all unspent transaction outputs known to a wallet, using the specified number of minimum and maximum number of confirmations as a filter.
func (*Client) ListUnspentMinMaxAddresses ¶
func (c *Client) ListUnspentMinMaxAddresses(minConf, maxConf int, addrs []dcrutil.Address) ([]walletjson.ListUnspentResult, error)
ListUnspentMinMaxAddresses returns all unspent transaction outputs that pay to any of specified addresses in a wallet using the specified number of minimum and maximum number of confirmations as a filter.
func (*Client) ListUnspentMinMaxAddressesAsync ¶
func (c *Client) ListUnspentMinMaxAddressesAsync(minConf, maxConf int, addrs []dcrutil.Address) FutureListUnspentResult
ListUnspentMinMaxAddressesAsync 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 ListUnspentMinMaxAddresses for the blocking version and more details.
func (*Client) ListUnspentMinMaxAsync ¶
func (c *Client) ListUnspentMinMaxAsync(minConf, maxConf int) FutureListUnspentResult
ListUnspentMinMaxAsync 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 ListUnspentMinMax for the blocking version and more details.
func (*Client) LiveTickets ¶
LiveTickets returns all currently missed tickets from the missed ticket database in the daemon.
NOTE: This is a dcrd extension.
func (*Client) LiveTicketsAsync ¶
func (c *Client) LiveTicketsAsync() FutureLiveTicketsResult
LiveTicketsAsync 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.
func (*Client) LoadTxFilter ¶
func (c *Client) LoadTxFilter(reload bool, addresses []dcrutil.Address, outPoints []wire.OutPoint) error
LoadTxFilter loads, reloads, or adds data to a websocket client's transaction filter. The filter is consistently updated based on inspected transactions during mempool acceptance, block acceptance, and for all rescanned blocks.
NOTE: This is a dcrd extension and requires a websocket connection.
func (*Client) LoadTxFilterAsync ¶
func (c *Client) LoadTxFilterAsync(reload bool, addresses []dcrutil.Address, outPoints []wire.OutPoint) FutureLoadTxFilterResult
LoadTxFilterAsync 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 LoadTxFilter for the blocking version and more details.
NOTE: This is a dcrd extension and requires a websocket connection.
func (*Client) LockUnspent ¶
LockUnspent marks outputs as locked or unlocked, depending on the value of the unlock bool. When locked, the unspent output will not be selected as input for newly created, non-raw transactions, and will not be returned in future ListUnspent results, until the output is marked unlocked again.
If unlock is false, each outpoint in ops will be marked locked. If unlocked is true and specific outputs are specified in ops (len != 0), exactly those outputs will be marked unlocked. If unlocked is true and no outpoints are specified, all previous locked outputs are marked unlocked.
The locked or unlocked state of outputs are not written to disk and after restarting a wallet process, this data will be reset (every output unlocked).
NOTE: While this method would be a bit more readable if the unlock bool was reversed (that is, LockUnspent(true, ...) locked the outputs), it has been left as unlock to keep compatibility with the reference client API and to avoid confusion for those who are already familiar with the lockunspent RPC.
func (*Client) LockUnspentAsync ¶
func (c *Client) LockUnspentAsync(unlock bool, ops []*wire.OutPoint) FutureLockUnspentResult
LockUnspentAsync 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 LockUnspent for the blocking version and more details.
func (*Client) MissedTickets ¶
MissedTickets returns all currently missed tickets from the missed ticket database in the daemon.
NOTE: This is a dcrd extension.
func (*Client) MissedTicketsAsync ¶
func (c *Client) MissedTicketsAsync() FutureMissedTicketsResult
MissedTicketsAsync 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.
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) NotifyBlocks ¶
NotifyBlocks registers the client to receive notifications when blocks are connected and disconnected from the main chain. The notifications are delivered to the notification handlers associated with the client. Calling this function has no effect if there are no notification handlers and will result in an error if the client is configured to run in HTTP POST mode.
The notifications delivered as a result of this call will be via one of OnBlockConnected or OnBlockDisconnected.
NOTE: This is a dcrd extension and requires a websocket connection.
func (*Client) NotifyBlocksAsync ¶
func (c *Client) NotifyBlocksAsync() FutureNotifyBlocksResult
NotifyBlocksAsync 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 NotifyBlocks for the blocking version and more details.
NOTE: This is a dcrd extension and requires a websocket connection.
func (*Client) NotifyNewTickets ¶
NotifyNewTickets registers the client to receive notifications when blocks are connected to the main chain and new tickets have matured. The notifications are delivered to the notification handlers associated with the client. Calling this function has no effect if there are no notification handlers and will result in an error if the client is configured to run in HTTP POST mode.
The notifications delivered as a result of this call will be via OnNewTickets.
NOTE: This is a dcrd extension and requires a websocket connection.
func (*Client) NotifyNewTicketsAsync ¶
func (c *Client) NotifyNewTicketsAsync() FutureNotifyNewTicketsResult
NotifyNewTicketsAsync 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 NotifyNewTickets for the blocking version and more details.
NOTE: This is a dcrd extension and requires a websocket connection.
func (*Client) NotifyNewTransactions ¶
NotifyNewTransactions registers the client to receive notifications every time a new transaction is accepted to the memory pool. The notifications are delivered to the notification handlers associated with the client. Calling this function has no effect if there are no notification handlers and will result in an error if the client is configured to run in HTTP POST mode.
The notifications delivered as a result of this call will be via one of OnTxAccepted (when verbose is false) or OnTxAcceptedVerbose (when verbose is true).
NOTE: This is a dcrd extension and requires a websocket connection.
func (*Client) NotifyNewTransactionsAsync ¶
func (c *Client) NotifyNewTransactionsAsync(verbose bool) FutureNotifyNewTransactionsResult
NotifyNewTransactionsAsync 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 NotifyNewTransactionsAsync for the blocking version and more details.
NOTE: This is a dcrd extension and requires a websocket connection.
func (*Client) NotifySpentAndMissedTickets ¶
NotifySpentAndMissedTickets registers the client to receive notifications when blocks are connected to the main chain and tickets are spent or missed. The notifications are delivered to the notification handlers associated with the client. Calling this function has no effect if there are no notification handlers and will result in an error if the client is configured to run in HTTP POST mode.
The notifications delivered as a result of this call will be those from OnSpentAndMissedTickets.
NOTE: This is a dcrd extension and requires a websocket connection.
func (*Client) NotifySpentAndMissedTicketsAsync ¶
func (c *Client) NotifySpentAndMissedTicketsAsync() FutureNotifySpentAndMissedTicketsResult
NotifySpentAndMissedTicketsAsync 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 NotifySpentAndMissedTickets for the blocking version and more details.
NOTE: This is a dcrd extension and requires a websocket connection.
func (*Client) NotifyStakeDifficulty ¶
NotifyStakeDifficulty registers the client to receive notifications when blocks are connected to the main chain and stake difficulty is updated. The notifications are delivered to the notification handlers associated with the client. Calling this function has no effect if there are no notification handlers and will result in an error if the client is configured to run in HTTP POST mode.
The notifications delivered as a result of this call will be via OnStakeDifficulty.
NOTE: This is a dcrd extension and requires a websocket connection.
func (*Client) NotifyStakeDifficultyAsync ¶
func (c *Client) NotifyStakeDifficultyAsync() FutureNotifyStakeDifficultyResult
NotifyStakeDifficultyAsync 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 NotifyStakeDifficulty for the blocking version and more details.
NOTE: This is a dcrd extension and requires a websocket connection.
func (*Client) NotifyWinningTickets ¶
NotifyWinningTickets registers the client to receive notifications when blocks are connected to the main chain and tickets are spent or missed. The notifications are delivered to the notification handlers associated with the client. Calling this function has no effect if there are no notification handlers and will result in an error if the client is configured to run in HTTP POST mode.
The notifications delivered as a result of this call will be those from OnWinningTickets.
NOTE: This is a dcrd extension and requires a websocket connection.
func (*Client) NotifyWinningTicketsAsync ¶
func (c *Client) NotifyWinningTicketsAsync() FutureNotifyWinningTicketsResult
NotifyWinningTicketsAsync 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 NotifyWinningTickets for the blocking version and more details.
NOTE: This is a dcrd extension and requires a websocket connection.
func (*Client) Ping ¶
Ping queues a ping to be sent to each connected peer.
Use the GetPeerInfo function and examine the PingTime and PingWait fields to access the ping times.
func (*Client) PingAsync ¶
func (c *Client) PingAsync() FuturePingResult
PingAsync 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 Ping for the blocking version and more details.
func (*Client) PurchaseTicket ¶
func (c *Client) PurchaseTicket(fromAccount string, spendLimit dcrutil.Amount, minConf *int, ticketAddress dcrutil.Address, numTickets *int, poolAddress dcrutil.Address, poolFees *dcrutil.Amount, expiry *int, ticketChange *bool, ticketFee *dcrutil.Amount) ([]*chainhash.Hash, error)
PurchaseTicket takes an account and a spending limit and calls the async puchasetickets command.
func (*Client) PurchaseTicketAsync ¶
func (c *Client) PurchaseTicketAsync(fromAccount string, spendLimit dcrutil.Amount, minConf *int, ticketAddress dcrutil.Address, numTickets *int, poolAddress dcrutil.Address, poolFees *dcrutil.Amount, expiry *int, ticketFee *dcrutil.Amount) FuturePurchaseTicketResult
PurchaseTicketAsync takes an account and a spending limit and returns a future chan to receive the transactions representing the purchased tickets when they come.
func (*Client) RawRequest ¶
func (c *Client) RawRequest(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(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) RenameAccount ¶
RenameAccount creates a new wallet account.
func (*Client) RenameAccountAsync ¶
func (c *Client) RenameAccountAsync(oldAccount, newAccount string) FutureRenameAccountResult
RenameAccountAsync 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 RenameAccount for the blocking version and more details.
func (*Client) Rescan ¶
Rescan 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.
func (*Client) RescanAsync ¶
func (c *Client) RescanAsync(blockHashes []chainhash.Hash) FutureRescanResult
RescanAsync 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 Rescan for the blocking version and more details.
func (*Client) RevokeTickets ¶
RevokeTickets triggers the wallet to issue revocations for any missed tickets that have not yet been revoked.
func (*Client) RevokeTicketsAsync ¶
func (c *Client) RevokeTicketsAsync() FutureRevokeTicketsResult
RevokeTicketsAsync 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 RevokeTickets for the blocking version and more details.
func (*Client) SearchRawTransactions ¶
func (c *Client) SearchRawTransactions(address dcrutil.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(address dcrutil.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(address dcrutil.Address, skip, count int, includePrevOut bool, reverse bool, filterAddrs []string) ([]*dcrjson.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(address dcrutil.Address, skip, count int, includePrevOut bool, 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) SendFrom ¶
func (c *Client) SendFrom(fromAccount string, toAddress dcrutil.Address, amount dcrutil.Amount) (*chainhash.Hash, error)
SendFrom sends the passed amount to the given address using the provided account as a source of funds. Only funds with the default number of minimum confirmations will be used.
See SendFromMinConf and SendFromComment for different options.
NOTE: This function requires to the wallet to be unlocked. See the WalletPassphrase function for more details.
func (*Client) SendFromAsync ¶
func (c *Client) SendFromAsync(fromAccount string, toAddress dcrutil.Address, amount dcrutil.Amount) FutureSendFromResult
SendFromAsync 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 SendFrom for the blocking version and more details.
func (*Client) SendFromComment ¶
func (c *Client) SendFromComment(fromAccount string, toAddress dcrutil.Address, amount dcrutil.Amount, minConfirms int, comment, commentTo string) (*chainhash.Hash, error)
SendFromComment sends the passed amount to the given address using the provided account as a source of funds and stores the provided comment and comment to in the wallet. The comment parameter is intended to be used for the purpose of the transaction while the commentTo parameter is indended to be used for who the transaction is being sent to. Only funds with the passed number of minimum confirmations will be used.
See SendFrom and SendFromMinConf to use defaults.
NOTE: This function requires to the wallet to be unlocked. See the WalletPassphrase function for more details.
func (*Client) SendFromCommentAsync ¶
func (c *Client) SendFromCommentAsync(fromAccount string, toAddress dcrutil.Address, amount dcrutil.Amount, minConfirms int, comment, commentTo string) FutureSendFromResult
SendFromCommentAsync 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 SendFromComment for the blocking version and more details.
func (*Client) SendFromMinConf ¶
func (c *Client) SendFromMinConf(fromAccount string, toAddress dcrutil.Address, amount dcrutil.Amount, minConfirms int) (*chainhash.Hash, error)
SendFromMinConf sends the passed amount to the given address using the provided account as a source of funds. Only funds with the passed number of minimum confirmations will be used.
See SendFrom to use the default number of minimum confirmations and SendFromComment for additional options.
NOTE: This function requires to the wallet to be unlocked. See the WalletPassphrase function for more details.
func (*Client) SendFromMinConfAsync ¶
func (c *Client) SendFromMinConfAsync(fromAccount string, toAddress dcrutil.Address, amount dcrutil.Amount, minConfirms int) FutureSendFromResult
SendFromMinConfAsync 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 SendFromMinConf for the blocking version and more details.
func (*Client) SendMany ¶
func (c *Client) SendMany(fromAccount string, amounts map[dcrutil.Address]dcrutil.Amount) (*chainhash.Hash, error)
SendMany sends multiple amounts to multiple addresses using the provided account as a source of funds in a single transaction. Only funds with the default number of minimum confirmations will be used.
See SendManyMinConf and SendManyComment for different options.
NOTE: This function requires to the wallet to be unlocked. See the WalletPassphrase function for more details.
func (*Client) SendManyAsync ¶
func (c *Client) SendManyAsync(fromAccount string, amounts map[dcrutil.Address]dcrutil.Amount) FutureSendManyResult
SendManyAsync 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 SendMany for the blocking version and more details.
func (*Client) SendManyComment ¶
func (c *Client) SendManyComment(fromAccount string, amounts map[dcrutil.Address]dcrutil.Amount, minConfirms int, comment string) (*chainhash.Hash, error)
SendManyComment sends multiple amounts to multiple addresses using the provided account as a source of funds in a single transaction and stores the provided comment in the wallet. The comment parameter is intended to be used for the purpose of the transaction Only funds with the passed number of minimum confirmations will be used.
See SendMany and SendManyMinConf to use defaults.
NOTE: This function requires to the wallet to be unlocked. See the WalletPassphrase function for more details.
func (*Client) SendManyCommentAsync ¶
func (c *Client) SendManyCommentAsync(fromAccount string, amounts map[dcrutil.Address]dcrutil.Amount, minConfirms int, comment string) FutureSendManyResult
SendManyCommentAsync 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 SendManyComment for the blocking version and more details.
func (*Client) SendManyMinConf ¶
func (c *Client) SendManyMinConf(fromAccount string, amounts map[dcrutil.Address]dcrutil.Amount, minConfirms int) (*chainhash.Hash, error)
SendManyMinConf sends multiple amounts to multiple addresses using the provided account as a source of funds in a single transaction. Only funds with the passed number of minimum confirmations will be used.
See SendMany to use the default number of minimum confirmations and SendManyComment for additional options.
NOTE: This function requires to the wallet to be unlocked. See the WalletPassphrase function for more details.
func (*Client) SendManyMinConfAsync ¶
func (c *Client) SendManyMinConfAsync(fromAccount string, amounts map[dcrutil.Address]dcrutil.Amount, minConfirms int) FutureSendManyResult
SendManyMinConfAsync 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 SendManyMinConf for the blocking version and more details.
func (*Client) SendRawTransaction ¶
SendRawTransaction submits the encoded transaction to the server which will then relay it to the network.
func (*Client) SendRawTransactionAsync ¶
func (c *Client) SendRawTransactionAsync(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) SendToAddress ¶
func (c *Client) SendToAddress(address dcrutil.Address, amount dcrutil.Amount) (*chainhash.Hash, error)
SendToAddress sends the passed amount to the given address.
See SendToAddressComment to associate comments with the transaction in the wallet. The comments are not part of the transaction and are only internal to the wallet.
NOTE: This function requires to the wallet to be unlocked. See the WalletPassphrase function for more details.
func (*Client) SendToAddressAsync ¶
func (c *Client) SendToAddressAsync(address dcrutil.Address, amount dcrutil.Amount) FutureSendToAddressResult
SendToAddressAsync 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 SendToAddress for the blocking version and more details.
func (*Client) SendToAddressComment ¶
func (c *Client) SendToAddressComment(address dcrutil.Address, amount dcrutil.Amount, comment, commentTo string) (*chainhash.Hash, error)
SendToAddressComment sends the passed amount to the given address and stores the provided comment and comment to in the wallet. The comment parameter is intended to be used for the purpose of the transaction while the commentTo parameter is indended to be used for who the transaction is being sent to.
The comments are not part of the transaction and are only internal to the wallet.
See SendToAddress to avoid using comments.
NOTE: This function requires to the wallet to be unlocked. See the WalletPassphrase function for more details.
func (*Client) SendToAddressCommentAsync ¶
func (c *Client) SendToAddressCommentAsync(address dcrutil.Address, amount dcrutil.Amount, comment, commentTo string) FutureSendToAddressResult
SendToAddressCommentAsync 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 SendToAddressComment for the blocking version and more details.
func (*Client) Session ¶
Session returns details regarding a websocket client's current connection.
This RPC requires the client to be running in websocket mode.
NOTE: This is a Decred extension.
func (*Client) SessionAsync ¶
func (c *Client) SessionAsync() 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 Decred extension.
func (*Client) SetGenerate ¶
SetGenerate sets the server to generate coins (mine) or not.
func (*Client) SetGenerateAsync ¶
func (c *Client) SetGenerateAsync(enable bool, numCPUs int) FutureSetGenerateResult
SetGenerateAsync 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 SetGenerate for the blocking version and more details.
func (*Client) SetTicketFee ¶
SetTicketFee sets the ticket fee per KB amount.
func (*Client) SetTicketFeeAsync ¶
func (c *Client) SetTicketFeeAsync(fee dcrutil.Amount) FutureSetTicketFeeResult
SetTicketFeeAsync 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 SetTicketFee for the blocking version and more details.
func (*Client) SetTxFeeAsync ¶
func (c *Client) SetTxFeeAsync(fee dcrutil.Amount) FutureSetTxFeeResult
SetTxFeeAsync 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 SetTxFee for the blocking version and more details.
func (*Client) SetVoteChoice ¶
SetVoteChoice sets a voting choice preference for an agenda.
func (*Client) SetVoteChoiceAsync ¶
func (c *Client) SetVoteChoiceAsync(agendaID, choiceID string) FutureSetVoteChoiceResult
SetVoteChoiceAsync 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 SetVoteChoice for the blocking version and more details.
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) SignMessage ¶
SignMessage signs a message with the private key of the specified address.
NOTE: This function requires to the wallet to be unlocked. See the WalletPassphrase function for more details.
func (*Client) SignMessageAsync ¶
func (c *Client) SignMessageAsync(address dcrutil.Address, message string) FutureSignMessageResult
SignMessageAsync 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 SignMessage for the blocking version and more details.
func (*Client) SignRawSSGenTx ¶
SignRawSSGenTx 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.
func (*Client) SignRawSSGenTxAsync ¶
func (c *Client) SignRawSSGenTxAsync(tx *wire.MsgTx) FutureSignRawTransactionResult
SignRawSSGenTxAsync 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 SignRawSSGenTx for the blocking version and more details.
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(tx *wire.MsgTx, inputs []walletjson.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(tx *wire.MsgTx, inputs []walletjson.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(tx *wire.MsgTx, inputs []walletjson.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(tx *wire.MsgTx, inputs []walletjson.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(tx *wire.MsgTx, inputs []walletjson.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(tx *wire.MsgTx, inputs []walletjson.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(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) StakePoolUserInfo ¶
func (c *Client) StakePoolUserInfo(addr dcrutil.Address) (*walletjson.StakePoolUserInfoResult, error)
StakePoolUserInfo returns a list of tickets and information about them that are paying to the passed address.
func (*Client) StakePoolUserInfoAsync ¶
func (c *Client) StakePoolUserInfoAsync(addr dcrutil.Address) FutureStakePoolUserInfoResult
StakePoolUserInfoAsync 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 GetInfo for the blocking version and more details.
func (*Client) String ¶
String implements fmt.Stringer by returning the URL of the RPC server the client makes requests to.
func (*Client) SubmitBlock ¶
SubmitBlock attempts to submit a new block into the Decred network.
func (*Client) SubmitBlockAsync ¶
func (c *Client) SubmitBlockAsync(block *dcrutil.Block, options *dcrjson.SubmitBlockOptions) FutureSubmitBlockResult
SubmitBlockAsync 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 SubmitBlock for the blocking version and more details.
func (*Client) TicketFeeInfo ¶
func (c *Client) TicketFeeInfo(blocks *uint32, windows *uint32) (*dcrjson.TicketFeeInfoResult, error)
TicketFeeInfo returns information about ticket fees.
This RPC requires the client to be running in websocket mode.
NOTE: This is a Decred extension.
func (*Client) TicketFeeInfoAsync ¶
func (c *Client) TicketFeeInfoAsync(blocks *uint32, windows *uint32) FutureTicketFeeInfoResult
TicketFeeInfoAsync 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 TicketFeeInfo for the blocking version and more details.
NOTE: This is a Decred extension.
func (*Client) TicketVWAP ¶
TicketVWAP returns the vwap weighted average price of tickets.
This RPC requires the client to be running in websocket mode.
NOTE: This is a Decred extension.
func (*Client) TicketVWAPAsync ¶
func (c *Client) TicketVWAPAsync(start *uint32, end *uint32) FutureTicketVWAPResult
TicketVWAPAsync 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 TicketVWAP for the blocking version and more details.
NOTE: This is a Decred extension.
func (*Client) TicketsForAddress ¶
TicketsForAddress returns a list of tickets paying to the passed address. If the daemon server is queried, it returns a search of tickets in the live ticket pool. If the wallet server is queried, it searches all tickets owned by the wallet.
func (*Client) TicketsForAddressAsync ¶
func (c *Client) TicketsForAddressAsync(addr dcrutil.Address) FutureTicketsForAddressResult
TicketsForAddressAsync 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 GetInfo for the blocking version and more details.
func (*Client) TxFeeInfo ¶
func (c *Client) TxFeeInfo(blocks *uint32, start *uint32, end *uint32) (*dcrjson.TxFeeInfoResult, error)
TxFeeInfo returns information about tx fees.
This RPC requires the client to be running in websocket mode.
NOTE: This is a Decred extension.
func (*Client) TxFeeInfoAsync ¶
func (c *Client) TxFeeInfoAsync(blocks *uint32, start *uint32, end *uint32) FutureTxFeeInfoResult
TxFeeInfoAsync 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 TxFeeInfo for the blocking version and more details.
NOTE: This is a Decred extension.
func (*Client) ValidateAddress ¶
func (c *Client) ValidateAddress(address dcrutil.Address) (*walletjson.ValidateAddressWalletResult, error)
ValidateAddress returns information about the given Decred address.
func (*Client) ValidateAddressAsync ¶
func (c *Client) ValidateAddressAsync(address dcrutil.Address) FutureValidateAddressResult
ValidateAddressAsync 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 ValidateAddress 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() 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(checkLevel, numBlocks int64) 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(checkLevel int64) 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) VerifyMessage ¶
VerifyMessage verifies a signed message.
NOTE: This function requires to the wallet to be unlocked. See the WalletPassphrase function for more details.
func (*Client) VerifyMessageAsync ¶
func (c *Client) VerifyMessageAsync(address dcrutil.Address, signature, message string) FutureVerifyMessageResult
VerifyMessageAsync 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 VerifyMessage for the blocking version and more details.
func (*Client) VersionAsync ¶
func (c *Client) VersionAsync() 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.
func (*Client) WaitForShutdown ¶
func (c *Client) WaitForShutdown()
WaitForShutdown blocks until the client goroutines are stopped and the connection is closed.
func (*Client) WalletInfo ¶
func (c *Client) WalletInfo() (*walletjson.WalletInfoResult, error)
WalletInfo returns wallet global state info for a given wallet.
func (*Client) WalletInfoAsync ¶
func (c *Client) WalletInfoAsync() FutureWalletInfoResult
WalletInfoAsync 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 WalletInfo for the blocking version and more details.
func (*Client) WalletLock ¶
WalletLock locks the wallet by removing the encryption key from memory.
After calling this function, the WalletPassphrase function must be used to unlock the wallet prior to calling any other function which requires the wallet to be unlocked.
func (*Client) WalletLockAsync ¶
func (c *Client) WalletLockAsync() FutureWalletLockResult
WalletLockAsync 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 WalletLock for the blocking version and more details.
func (*Client) WalletPassphrase ¶
WalletPassphrase unlocks the wallet by using the passphrase to derive the decryption key which is then stored in memory for the specified timeout (in seconds).
func (*Client) WalletPassphraseChange ¶
WalletPassphraseChange changes the wallet passphrase from the specified old to new passphrase.
func (*Client) WalletPassphraseChangeAsync ¶
func (c *Client) WalletPassphraseChangeAsync(old, new string) FutureWalletPassphraseChangeResult
WalletPassphraseChangeAsync 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 WalletPassphraseChange for the blocking version and more details.
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 // DisableConnectOnNew specifies that a websocket client connection // should not be tried when creating the client with New. Instead, the // client is created and returned unconnected, and Connect must be // called manually. DisableConnectOnNew 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 }
ConnConfig describes the connection configuration parameters for the client. This
type FutureAccountAddressIndexResult ¶
type FutureAccountAddressIndexResult chan *response
FutureAccountAddressIndexResult is a future promise to deliver the result of a AccountAddressIndexAsync RPC invocation (or an applicable error).
func (FutureAccountAddressIndexResult) Receive ¶
func (r FutureAccountAddressIndexResult) Receive() (int, error)
Receive waits for the response promised by the future and returns the info provided by the server.
type FutureAccountSyncAddressIndexResult ¶
type FutureAccountSyncAddressIndexResult chan *response
FutureAccountSyncAddressIndexResult is a future promise to deliver the result of an AccountSyncAddressIndexAsync RPC invocation (or an applicable error).
func (FutureAccountSyncAddressIndexResult) Receive ¶
func (r FutureAccountSyncAddressIndexResult) Receive() error
Receive waits for the response promised by the future and returns the info provided by the server.
type FutureAddMultisigAddressResult ¶
type FutureAddMultisigAddressResult chan *response
FutureAddMultisigAddressResult is a future promise to deliver the result of a AddMultisigAddressAsync RPC invocation (or an applicable error).
type FutureAddNodeResult ¶
type FutureAddNodeResult chan *response
FutureAddNodeResult is a future promise to deliver the result of an AddNodeAsync RPC invocation (or an applicable error).
func (FutureAddNodeResult) Receive ¶
func (r FutureAddNodeResult) Receive() error
Receive waits for the response promised by the future and returns an error if any occurred when performing the specified command.
type FutureAddTicketResult ¶
type FutureAddTicketResult chan *response
FutureAddTicketResult is a future promise to deliver the result of a AddTicketAsync RPC invocation (or an applicable error).
func (FutureAddTicketResult) Receive ¶
func (r FutureAddTicketResult) Receive() error
Receive waits for the response promised by the future and returns the info provided by the server.
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 FutureCreateMultisigResult ¶
type FutureCreateMultisigResult chan *response
FutureCreateMultisigResult is a future promise to deliver the result of a CreateMultisigAsync RPC invocation (or an applicable error).
func (FutureCreateMultisigResult) Receive ¶
func (r FutureCreateMultisigResult) Receive() (*walletjson.CreateMultiSigResult, error)
Receive waits for the response promised by the future and returns the multisignature address and script needed to redeem it.
type FutureCreateNewAccountResult ¶
type FutureCreateNewAccountResult chan *response
FutureCreateNewAccountResult is a future promise to deliver the result of a CreateNewAccountAsync RPC invocation (or an applicable error).
func (FutureCreateNewAccountResult) Receive ¶
func (r FutureCreateNewAccountResult) Receive() error
Receive waits for the response promised by the future and returns the result of creating new account.
type FutureCreateRawSSRtxResult ¶
type FutureCreateRawSSRtxResult chan *response
FutureCreateRawSSRtxResult is a future promise to deliver the result of a CreateRawSSRtxAsync RPC invocation (or an applicable error).
type FutureCreateRawSStxResult ¶
type FutureCreateRawSStxResult chan *response
FutureCreateRawSStxResult is a future promise to deliver the result of a CreateRawSStxAsync RPC invocation (or an applicable error).
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() (*dcrjson.TxRawResult, error)
Receive waits for the response promised by the future and returns information about a transaction given its serialized bytes.
type FutureDumpPrivKeyResult ¶
type FutureDumpPrivKeyResult chan *response
FutureDumpPrivKeyResult is a future promise to deliver the result of a DumpPrivKeyAsync RPC invocation (or an applicable error).
type FutureEstimateSmartFeeResult ¶ added in v2.1.0
type FutureEstimateSmartFeeResult chan *response
FutureEstimateSmartFeeResult is a future promise to deliver the result of a EstimateSmartFee RPC invocation (or an applicable error).
func (FutureEstimateSmartFeeResult) Receive ¶ added in v2.1.0
func (r FutureEstimateSmartFeeResult) Receive() (float64, error)
Receive waits for the response promised by the future and returns a fee estimation for the given target confirmation window and mode.
type FutureEstimateStakeDiffResult ¶
type FutureEstimateStakeDiffResult chan *response
FutureEstimateStakeDiffResult is a future promise to deliver the result of a EstimateStakeDiffAsync RPC invocation (or an applicable error).
func (FutureEstimateStakeDiffResult) Receive ¶
func (r FutureEstimateStakeDiffResult) Receive() (*dcrjson.EstimateStakeDiffResult, error)
Receive waits for the response promised by the future and returns the hash and height of the block in the longest (best) chain.
type FutureExistsAddressResult ¶
type FutureExistsAddressResult chan *response
FutureExistsAddressResult is a future promise to deliver the result of a FutureExistsAddressResultAsync RPC invocation (or an applicable error).
func (FutureExistsAddressResult) Receive ¶
func (r FutureExistsAddressResult) Receive() (bool, error)
Receive waits for the response promised by the future and returns whether or not an address exists in the blockchain or mempool.
type FutureExistsAddressesResult ¶
type FutureExistsAddressesResult chan *response
FutureExistsAddressesResult is a future promise to deliver the result of a FutureExistsAddressesResultAsync RPC invocation (or an applicable error).
func (FutureExistsAddressesResult) Receive ¶
func (r FutureExistsAddressesResult) Receive() (string, error)
Receive waits for the response promised by the future and returns whether or not the addresses exist.
type FutureExistsExpiredTicketsResult ¶
type FutureExistsExpiredTicketsResult chan *response
FutureExistsExpiredTicketsResult is a future promise to deliver the result of a FutureExistsExpiredTicketsResultAsync RPC invocation (or an applicable error).
func (FutureExistsExpiredTicketsResult) Receive ¶
func (r FutureExistsExpiredTicketsResult) Receive() (string, error)
Receive waits for the response promised by the future and returns whether or not the ticket exists in the live ticket database.
type FutureExistsLiveTicketResult ¶
type FutureExistsLiveTicketResult chan *response
FutureExistsLiveTicketResult is a future promise to deliver the result of a FutureExistsLiveTicketResultAsync RPC invocation (or an applicable error).
func (FutureExistsLiveTicketResult) Receive ¶
func (r FutureExistsLiveTicketResult) Receive() (bool, error)
Receive waits for the response promised by the future and returns whether or not the ticket exists in the live ticket database.
type FutureExistsLiveTicketsResult ¶
type FutureExistsLiveTicketsResult chan *response
FutureExistsLiveTicketsResult is a future promise to deliver the result of a FutureExistsLiveTicketsResultAsync RPC invocation (or an applicable error).
func (FutureExistsLiveTicketsResult) Receive ¶
func (r FutureExistsLiveTicketsResult) Receive() (string, error)
Receive waits for the response promised by the future and returns whether or not the ticket exists in the live ticket database.
type FutureExistsMempoolTxsResult ¶
type FutureExistsMempoolTxsResult chan *response
FutureExistsMempoolTxsResult is a future promise to deliver the result of a FutureExistsMempoolTxsResultAsync RPC invocation (or an applicable error).
func (FutureExistsMempoolTxsResult) Receive ¶
func (r FutureExistsMempoolTxsResult) Receive() (string, error)
Receive waits for the response promised by the future and returns whether or not the ticket exists in the mempool.
type FutureExistsMissedTicketsResult ¶
type FutureExistsMissedTicketsResult chan *response
FutureExistsMissedTicketsResult is a future promise to deliver the result of an ExistsMissedTicketsAsync RPC invocation (or an applicable error).
func (FutureExistsMissedTicketsResult) Receive ¶
func (r FutureExistsMissedTicketsResult) Receive() (string, error)
Receive waits for the response promised by the future and returns whether or not the ticket exists in the missed ticket database.
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 FutureFundRawTransactionResult ¶
type FutureFundRawTransactionResult chan *response
FutureFundRawTransactionResult is a future promise to deliver the result of a FundRawTransactionAsync RPC invocation (or an applicable error).
func (FutureFundRawTransactionResult) Receive ¶
func (r FutureFundRawTransactionResult) Receive() (*walletjson.FundRawTransactionResult, error)
Receive waits for the response promised by the future and returns the unsigned transaction with the passed amount and the given address.
type FutureGenerateResult ¶
type FutureGenerateResult chan *response
FutureGenerateResult is a future promise to deliver the result of a GenerateAsync RPC invocation (or an applicable error).
type FutureGenerateVoteResult ¶
type FutureGenerateVoteResult chan *response
FutureGenerateVoteResult is a future promise to deliver the result of a GenerateVoteAsync RPC invocation (or an applicable error).
func (FutureGenerateVoteResult) Receive ¶
func (r FutureGenerateVoteResult) Receive() (*walletjson.GenerateVoteResult, error)
Receive waits for the response promised by the future and returns the info provided by the server.
type FutureGetAccountAddressResult ¶
type FutureGetAccountAddressResult chan *response
FutureGetAccountAddressResult is a future promise to deliver the result of a GetAccountAddressAsync RPC invocation (or an applicable error).
type FutureGetAccountResult ¶
type FutureGetAccountResult chan *response
FutureGetAccountResult is a future promise to deliver the result of a GetAccountAsync RPC invocation (or an applicable error).
func (FutureGetAccountResult) Receive ¶
func (r FutureGetAccountResult) Receive() (string, error)
Receive waits for the response promised by the future and returns the account associated with the passed address.
type FutureGetAddedNodeInfoNoDNSResult ¶
type FutureGetAddedNodeInfoNoDNSResult chan *response
FutureGetAddedNodeInfoNoDNSResult is a future promise to deliver the result of a GetAddedNodeInfoNoDNSAsync RPC invocation (or an applicable error).
func (FutureGetAddedNodeInfoNoDNSResult) Receive ¶
func (r FutureGetAddedNodeInfoNoDNSResult) Receive() ([]string, error)
Receive waits for the response promised by the future and returns a list of manually added (persistent) peers.
type FutureGetAddedNodeInfoResult ¶
type FutureGetAddedNodeInfoResult chan *response
FutureGetAddedNodeInfoResult is a future promise to deliver the result of a GetAddedNodeInfoAsync RPC invocation (or an applicable error).
func (FutureGetAddedNodeInfoResult) Receive ¶
func (r FutureGetAddedNodeInfoResult) Receive() ([]dcrjson.GetAddedNodeInfoResult, error)
Receive waits for the response promised by the future and returns information about manually added (persistent) peers.
type FutureGetAddressesByAccountResult ¶
type FutureGetAddressesByAccountResult chan *response
FutureGetAddressesByAccountResult is a future promise to deliver the result of a GetAddressesByAccountAsync RPC invocation (or an applicable error).
type FutureGetBalanceResult ¶
type FutureGetBalanceResult chan *response
FutureGetBalanceResult is a future promise to deliver the result of a GetBalanceAsync or GetBalanceMinConfAsync RPC invocation (or an applicable error).
func (FutureGetBalanceResult) Receive ¶
func (r FutureGetBalanceResult) Receive() (*walletjson.GetBalanceResult, error)
Receive waits for the response promised by the future and returns the available balance from the server for the specified account.
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 future promise to deliver the result of a GetBlockChainInfoAsync RPC invocation (or an applicable error).
func (FutureGetBlockChainInfoResult) Receive ¶
func (r FutureGetBlockChainInfoResult) Receive() (*dcrjson.GetBlockChainInfoResult, error)
Receive waits for the response promised by the future and returns the info 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 GetBlockHeaderAsync RPC invocation (or an applicable error).
func (FutureGetBlockHeaderVerboseResult) Receive ¶
func (r FutureGetBlockHeaderVerboseResult) Receive() (*dcrjson.GetBlockHeaderVerboseResult, error)
Receive waits for the response promised by the future and returns a data structure of the block header 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 FutureGetBlockSubsidyResult ¶
type FutureGetBlockSubsidyResult chan *response
FutureGetBlockSubsidyResult is a future promise to deliver the result of a GetBlockSubsidyAsync RPC invocation (or an applicable error).
func (FutureGetBlockSubsidyResult) Receive ¶
func (r FutureGetBlockSubsidyResult) Receive() (*dcrjson.GetBlockSubsidyResult, error)
Receive waits for the response promised by the future and returns a data structure of the block subsidy requested from the server given its height and number of voters.
type FutureGetBlockTemplate ¶
type FutureGetBlockTemplate chan *response
FutureGetBlockTemplate is a future promise to deliver the result of a GetBlockTemplateAsync RPC invocation (or an applicable error).
func (FutureGetBlockTemplate) Receive ¶
func (r FutureGetBlockTemplate) Receive() (*dcrjson.GetBlockTemplateResult, error)
Receive waits for the response promised by the future and returns an error if any occurred while generating the block template.
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() (*dcrjson.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).
type FutureGetCFilterResult ¶
type FutureGetCFilterResult chan *response
FutureGetCFilterResult is a future promise to deliver the result of a GetCFilterAsync RPC invocation (or an applicable error).
type FutureGetChainTipsResult ¶
type FutureGetChainTipsResult chan *response
FutureGetChainTipsResult is a future promise to deliver the result of a GetChainTipsAsync RPC invocation (or an applicable error).
func (FutureGetChainTipsResult) Receive ¶
func (r FutureGetChainTipsResult) Receive() ([]dcrjson.GetChainTipsResult, error)
Receive waits for the response promised by the future and returns slice of all known tips in the block tree.
type FutureGetCoinSupplyResult ¶
type FutureGetCoinSupplyResult chan *response
FutureGetCoinSupplyResult is a future promise to deliver the result of a GetCoinSupplyAsync RPC invocation (or an applicable error).
type FutureGetConnectionCountResult ¶
type FutureGetConnectionCountResult chan *response
FutureGetConnectionCountResult is a future promise to deliver the result of a GetConnectionCountAsync RPC invocation (or an applicable error).
func (FutureGetConnectionCountResult) Receive ¶
func (r FutureGetConnectionCountResult) Receive() (int64, error)
Receive waits for the response promised by the future and returns the number of active connections to other peers.
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.CurrencyNet, 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 FutureGetGenerateResult ¶
type FutureGetGenerateResult chan *response
FutureGetGenerateResult is a future promise to deliver the result of a GetGenerateAsync RPC invocation (or an applicable error).
func (FutureGetGenerateResult) Receive ¶
func (r FutureGetGenerateResult) Receive() (bool, error)
Receive waits for the response promised by the future and returns true if the server is set to mine, otherwise false.
type FutureGetHashesPerSecResult ¶
type FutureGetHashesPerSecResult chan *response
FutureGetHashesPerSecResult is a future promise to deliver the result of a GetHashesPerSecAsync RPC invocation (or an applicable error).
func (FutureGetHashesPerSecResult) Receive ¶
func (r FutureGetHashesPerSecResult) Receive() (int64, error)
Receive waits for the response promised by the future and returns a recent hashes per second performance measurement while generating coins (mining). Zero is returned if the server is not mining.
type FutureGetHeadersResult ¶
type FutureGetHeadersResult chan *response
FutureGetHeadersResult is a future promise to deliver the result of a getheaders RPC invocation (or an applicable error).
func (FutureGetHeadersResult) Receive ¶
func (r FutureGetHeadersResult) Receive() (*dcrjson.GetHeadersResult, error)
Receive waits for the response promised by the future and returns the getheaders result.
type FutureGetInfoResult ¶
type FutureGetInfoResult chan *response
FutureGetInfoResult is a future promise to deliver the result of a GetInfoAsync RPC invocation (or an applicable error).
func (FutureGetInfoResult) Receive ¶
func (r FutureGetInfoResult) Receive() (*walletjson.InfoWalletResult, error)
Receive waits for the response promised by the future and returns the info provided by the server.
type FutureGetMasterPubkeyResult ¶ added in v2.1.0
type FutureGetMasterPubkeyResult chan *response
FutureGetMasterPubkeyResult is a future promise to deliver the result of a GetMasterPubkeyAsync RPC invocation (or an applicable error).
func (FutureGetMasterPubkeyResult) Receive ¶ added in v2.1.0
func (r FutureGetMasterPubkeyResult) Receive(net hdkeychain.NetworkParams) (*hdkeychain.ExtendedKey, error)
Receive waits for the response promised by the future and returns a pointer to the master extended public key for account and the network's hierarchical deterministic extended key magic versions (e.g. MainNetParams)
type FutureGetMiningInfoResult ¶
type FutureGetMiningInfoResult chan *response
FutureGetMiningInfoResult is a future promise to deliver the result of a GetMiningInfoAsync RPC invocation (or an applicable error).
func (FutureGetMiningInfoResult) Receive ¶
func (r FutureGetMiningInfoResult) Receive() (*dcrjson.GetMiningInfoResult, error)
Receive waits for the response promised by the future and returns the mining information.
type FutureGetNetTotalsResult ¶
type FutureGetNetTotalsResult chan *response
FutureGetNetTotalsResult is a future promise to deliver the result of a GetNetTotalsAsync RPC invocation (or an applicable error).
func (FutureGetNetTotalsResult) Receive ¶
func (r FutureGetNetTotalsResult) Receive() (*dcrjson.GetNetTotalsResult, error)
Receive waits for the response promised by the future and returns network traffic statistics.
type FutureGetNetworkHashPS ¶
type FutureGetNetworkHashPS chan *response
FutureGetNetworkHashPS is a future promise to deliver the result of a GetNetworkHashPSAsync RPC invocation (or an applicable error).
func (FutureGetNetworkHashPS) Receive ¶
func (r FutureGetNetworkHashPS) Receive() (int64, error)
Receive waits for the response promised by the future and returns the estimated network hashes per second for the block heights provided by the parameters.
type FutureGetNewAddressResult ¶
type FutureGetNewAddressResult chan *response
FutureGetNewAddressResult is a future promise to deliver the result of a GetNewAddressAsync RPC invocation (or an applicable error).
type FutureGetPeerInfoResult ¶
type FutureGetPeerInfoResult chan *response
FutureGetPeerInfoResult is a future promise to deliver the result of a GetPeerInfoAsync RPC invocation (or an applicable error).
func (FutureGetPeerInfoResult) Receive ¶
func (r FutureGetPeerInfoResult) Receive() ([]dcrjson.GetPeerInfoResult, error)
Receive waits for the response promised by the future and returns data about each connected network peer.
type FutureGetRawChangeAddressResult ¶
type FutureGetRawChangeAddressResult chan *response
FutureGetRawChangeAddressResult is a future promise to deliver the result of a GetRawChangeAddressAsync RPC invocation (or an applicable error).
func (FutureGetRawChangeAddressResult) Receive ¶
func (r FutureGetRawChangeAddressResult) Receive() (dcrutil.Address, error)
Receive waits for the response promised by the future and returns a new address for receiving change that will be associated with the provided account. Note that this is only for raw transactions and NOT for normal use.
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]dcrjson.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() (*dcrjson.TxRawResult, error)
Receive waits for the response promised by the future and returns information about a transaction given its hash.
type FutureGetReceivedByAccountResult ¶
type FutureGetReceivedByAccountResult chan *response
FutureGetReceivedByAccountResult is a future promise to deliver the result of a GetReceivedByAccountAsync or GetReceivedByAccountMinConfAsync RPC invocation (or an applicable error).
type FutureGetReceivedByAddressResult ¶
type FutureGetReceivedByAddressResult chan *response
FutureGetReceivedByAddressResult is a future promise to deliver the result of a GetReceivedByAddressAsync or GetReceivedByAddressMinConfAsync RPC invocation (or an applicable error).
type FutureGetStakeDifficultyResult ¶
type FutureGetStakeDifficultyResult chan *response
FutureGetStakeDifficultyResult is a future promise to deliver the result of a GetStakeDifficultyAsync RPC invocation (or an applicable error).
func (FutureGetStakeDifficultyResult) Receive ¶
func (r FutureGetStakeDifficultyResult) Receive() (*dcrjson.GetStakeDifficultyResult, error)
Receive waits for the response promised by the future and returns the network the server is running on.
type FutureGetStakeInfoResult ¶
type FutureGetStakeInfoResult chan *response
FutureGetStakeInfoResult is a future promise to deliver the result of a GetStakeInfoAsync RPC invocation (or an applicable error).
func (FutureGetStakeInfoResult) Receive ¶
func (r FutureGetStakeInfoResult) Receive() (*walletjson.GetStakeInfoResult, error)
Receive waits for the response promised by the future and returns the stake info provided by the server.
type FutureGetStakeVersionInfoResult ¶
type FutureGetStakeVersionInfoResult chan *response
FutureGetStakeVersionInfoResult is a future promise to deliver the result of a GetStakeVersionInfoAsync RPC invocation (or an applicable error).
func (FutureGetStakeVersionInfoResult) Receive ¶
func (r FutureGetStakeVersionInfoResult) Receive() (*dcrjson.GetStakeVersionInfoResult, error)
Receive waits for the response promised by the future and returns the network the server is running on.
type FutureGetStakeVersionsResult ¶
type FutureGetStakeVersionsResult chan *response
FutureGetStakeVersionsResult is a future promise to deliver the result of a GetStakeVersionsAsync RPC invocation (or an applicable error).
func (FutureGetStakeVersionsResult) Receive ¶
func (r FutureGetStakeVersionsResult) Receive() (*dcrjson.GetStakeVersionsResult, error)
Receive waits for the response promised by the future and returns the network the server is running on.
type FutureGetTicketPoolValueResult ¶
type FutureGetTicketPoolValueResult chan *response
FutureGetTicketPoolValueResult is a future promise to deliver the result of a GetTicketPoolValueAsync RPC invocation (or an applicable error).
type FutureGetTicketsResult ¶
type FutureGetTicketsResult chan *response
FutureGetTicketsResult is a future promise to deliver the result of a GetTickets RPC invocation (or an applicable error).
type FutureGetTransactionResult ¶
type FutureGetTransactionResult chan *response
FutureGetTransactionResult is a future promise to deliver the result of a GetTransactionAsync RPC invocation (or an applicable error).
func (FutureGetTransactionResult) Receive ¶
func (r FutureGetTransactionResult) Receive() (*walletjson.GetTransactionResult, error)
Receive waits for the response promised by the future and returns detailed information about a wallet transaction.
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() (*dcrjson.GetTxOutResult, error)
Receive waits for the response promised by the future and returns a transaction given its hash.
type FutureGetUnconfirmedBalanceResult ¶
type FutureGetUnconfirmedBalanceResult chan *response
FutureGetUnconfirmedBalanceResult is a future promise to deliver the result of a GetUnconfirmedBalanceAsync RPC invocation (or an applicable error).
type FutureGetVoteChoicesResult ¶
type FutureGetVoteChoicesResult chan *response
FutureGetVoteChoicesResult is a future promise to deliver the result of a GetVoteChoicesAsync RPC invocation (or an applicable error).
func (FutureGetVoteChoicesResult) Receive ¶
func (r FutureGetVoteChoicesResult) Receive() (*walletjson.GetVoteChoicesResult, error)
Receive waits for the response promised by the future.
type FutureGetVoteInfoResult ¶
type FutureGetVoteInfoResult chan *response
FutureGetVoteInfoResult is a future promise to deliver the result of a GetVoteInfoAsync RPC invocation (or an applicable error).
func (FutureGetVoteInfoResult) Receive ¶
func (r FutureGetVoteInfoResult) Receive() (*dcrjson.GetVoteInfoResult, error)
Receive waits for the response promised by the future and returns the network the server is running on.
type FutureGetWork ¶
type FutureGetWork chan *response
FutureGetWork is a future promise to deliver the result of a GetWorkAsync RPC invocation (or an applicable error).
func (FutureGetWork) Receive ¶
func (r FutureGetWork) Receive() (*dcrjson.GetWorkResult, error)
Receive waits for the response promised by the future and returns the hash data to work on.
type FutureGetWorkSubmit ¶
type FutureGetWorkSubmit chan *response
FutureGetWorkSubmit is a future promise to deliver the result of a GetWorkSubmitAsync RPC invocation (or an applicable error).
func (FutureGetWorkSubmit) Receive ¶
func (r FutureGetWorkSubmit) Receive() (bool, error)
Receive waits for the response promised by the future and returns whether or not the submitted block header was accepted.
type FutureImportPrivKeyResult ¶
type FutureImportPrivKeyResult chan *response
FutureImportPrivKeyResult is a future promise to deliver the result of an ImportPrivKeyAsync RPC invocation (or an applicable error).
func (FutureImportPrivKeyResult) Receive ¶
func (r FutureImportPrivKeyResult) Receive() error
Receive waits for the response promised by the future and returns the result of importing the passed private key which must be the wallet import format (WIF).
type FutureImportScriptResult ¶
type FutureImportScriptResult chan *response
FutureImportScriptResult is a future promise to deliver the result of a ImportScriptAsync RPC invocation (or an applicable error).
func (FutureImportScriptResult) Receive ¶
func (r FutureImportScriptResult) Receive() error
Receive waits for the response promised by the future.
type FutureKeyPoolRefillResult ¶
type FutureKeyPoolRefillResult chan *response
FutureKeyPoolRefillResult is a future promise to deliver the result of a KeyPoolRefillAsync RPC invocation (or an applicable error).
func (FutureKeyPoolRefillResult) Receive ¶
func (r FutureKeyPoolRefillResult) Receive() error
Receive waits for the response promised by the future and returns the result of refilling the key pool.
type FutureListAccountsResult ¶
type FutureListAccountsResult chan *response
FutureListAccountsResult is a future promise to deliver the result of a ListAccountsAsync or ListAccountsMinConfAsync RPC invocation (or an applicable error).
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() ([]walletjson.ListTransactionsResult, error)
Receive waits for the response promised by the future and returns information about all transactions associated with the provided addresses.
type FutureListLockUnspentResult ¶
type FutureListLockUnspentResult chan *response
FutureListLockUnspentResult is a future promise to deliver the result of a ListLockUnspentAsync RPC invocation (or an applicable error).
type FutureListReceivedByAccountResult ¶
type FutureListReceivedByAccountResult chan *response
FutureListReceivedByAccountResult is a future promise to deliver the result of a ListReceivedByAccountAsync, ListReceivedByAccountMinConfAsync, or ListReceivedByAccountIncludeEmptyAsync RPC invocation (or an applicable error).
func (FutureListReceivedByAccountResult) Receive ¶
func (r FutureListReceivedByAccountResult) Receive() ([]walletjson.ListReceivedByAccountResult, error)
Receive waits for the response promised by the future and returns a list of balances by account.
type FutureListReceivedByAddressResult ¶
type FutureListReceivedByAddressResult chan *response
FutureListReceivedByAddressResult is a future promise to deliver the result of a ListReceivedByAddressAsync, ListReceivedByAddressMinConfAsync, or ListReceivedByAddressIncludeEmptyAsync RPC invocation (or an applicable error).
func (FutureListReceivedByAddressResult) Receive ¶
func (r FutureListReceivedByAddressResult) Receive() ([]walletjson.ListReceivedByAddressResult, error)
Receive waits for the response promised by the future and returns a list of balances by address.
type FutureListScriptsResult ¶
type FutureListScriptsResult chan *response
FutureListScriptsResult is a future promise to deliver the result of a ListScriptsAsync RPC invocation (or an applicable error).
func (FutureListScriptsResult) Receive ¶
func (r FutureListScriptsResult) Receive() ([][]byte, error)
Receive waits for the response promised by the future and returns the info provided by the server.
type FutureListSinceBlockResult ¶
type FutureListSinceBlockResult chan *response
FutureListSinceBlockResult is a future promise to deliver the result of a ListSinceBlockAsync or ListSinceBlockMinConfAsync RPC invocation (or an applicable error).
func (FutureListSinceBlockResult) Receive ¶
func (r FutureListSinceBlockResult) Receive() (*walletjson.ListSinceBlockResult, error)
Receive waits for the response promised by the future and returns all transactions added in blocks since the specified block hash, or all transactions if it is nil.
type FutureListTransactionsResult ¶
type FutureListTransactionsResult chan *response
FutureListTransactionsResult is a future promise to deliver the result of a ListTransactionsAsync, ListTransactionsCountAsync, or ListTransactionsCountFromAsync RPC invocation (or an applicable error).
func (FutureListTransactionsResult) Receive ¶
func (r FutureListTransactionsResult) Receive() ([]walletjson.ListTransactionsResult, error)
Receive waits for the response promised by the future and returns a list of the most recent transactions.
type FutureListUnspentResult ¶
type FutureListUnspentResult chan *response
FutureListUnspentResult is a future promise to deliver the result of a ListUnspentAsync, ListUnspentMinAsync, ListUnspentMinMaxAsync, or ListUnspentMinMaxAddressesAsync RPC invocation (or an applicable error).
func (FutureListUnspentResult) Receive ¶
func (r FutureListUnspentResult) Receive() ([]walletjson.ListUnspentResult, error)
Receive waits for the response promised by the future and returns all unspent wallet transaction outputs returned by the RPC call. If the future was returned by a call to ListUnspentMinAsync, ListUnspentMinMaxAsync, or ListUnspentMinMaxAddressesAsync, the range may be limited by the parameters of the RPC invocation.
type FutureLiveTicketsResult ¶
type FutureLiveTicketsResult chan *response
FutureLiveTicketsResult is a future promise to deliver the result of a FutureLiveTicketsResultAsync RPC invocation (or an applicable error).
type FutureLoadTxFilterResult ¶
type FutureLoadTxFilterResult chan *response
FutureLoadTxFilterResult is a future promise to deliver the result of a LoadTxFilterAsync RPC invocation (or an applicable error).
func (FutureLoadTxFilterResult) Receive ¶
func (r FutureLoadTxFilterResult) Receive() error
Receive waits for the response promised by the future and returns an error if the registration was not successful.
type FutureLockUnspentResult ¶
type FutureLockUnspentResult chan *response
FutureLockUnspentResult is a future promise to deliver the error result of a LockUnspentAsync RPC invocation.
func (FutureLockUnspentResult) Receive ¶
func (r FutureLockUnspentResult) Receive() error
Receive waits for the response promised by the future and returns the result of locking or unlocking the unspent output(s).
type FutureMissedTicketsResult ¶
type FutureMissedTicketsResult chan *response
FutureMissedTicketsResult is a future promise to deliver the result of a FutureMissedTicketsResultAsync RPC invocation (or an applicable error).
type FutureMoveResult ¶
type FutureMoveResult chan *response
FutureMoveResult is a future promise to deliver the result of a MoveAsync, MoveMinConfAsync, or MoveCommentAsync RPC invocation (or an applicable error).
func (FutureMoveResult) Receive ¶
func (r FutureMoveResult) Receive() (bool, error)
Receive waits for the response promised by the future and returns the result of the move operation.
type FutureNotifyBlocksResult ¶
type FutureNotifyBlocksResult chan *response
FutureNotifyBlocksResult is a future promise to deliver the result of a NotifyBlocksAsync RPC invocation (or an applicable error).
func (FutureNotifyBlocksResult) Receive ¶
func (r FutureNotifyBlocksResult) Receive() error
Receive waits for the response promised by the future and returns an error if the registration was not successful.
type FutureNotifyNewTicketsResult ¶
type FutureNotifyNewTicketsResult chan *response
FutureNotifyNewTicketsResult is a future promise to deliver the result of a NotifyNewTicketsAsync RPC invocation (or an applicable error).
func (FutureNotifyNewTicketsResult) Receive ¶
func (r FutureNotifyNewTicketsResult) Receive() error
Receive waits for the response promised by the future and returns an error if the registration was not successful.
type FutureNotifyNewTransactionsResult ¶
type FutureNotifyNewTransactionsResult chan *response
FutureNotifyNewTransactionsResult is a future promise to deliver the result of a NotifyNewTransactionsAsync RPC invocation (or an applicable error).
func (FutureNotifyNewTransactionsResult) Receive ¶
func (r FutureNotifyNewTransactionsResult) Receive() error
Receive waits for the response promised by the future and returns an error if the registration was not successful.
type FutureNotifySpentAndMissedTicketsResult ¶
type FutureNotifySpentAndMissedTicketsResult chan *response
FutureNotifySpentAndMissedTicketsResult is a future promise to deliver the result of a NotifySpentAndMissedTicketsAsync RPC invocation (or an applicable error).
func (FutureNotifySpentAndMissedTicketsResult) Receive ¶
func (r FutureNotifySpentAndMissedTicketsResult) Receive() error
Receive waits for the response promised by the future and returns an error if the registration was not successful.
type FutureNotifyStakeDifficultyResult ¶
type FutureNotifyStakeDifficultyResult chan *response
FutureNotifyStakeDifficultyResult is a future promise to deliver the result of a NotifyStakeDifficultyAsync RPC invocation (or an applicable error).
func (FutureNotifyStakeDifficultyResult) Receive ¶
func (r FutureNotifyStakeDifficultyResult) Receive() error
Receive waits for the response promised by the future and returns an error if the registration was not successful.
type FutureNotifyWinningTicketsResult ¶
type FutureNotifyWinningTicketsResult chan *response
FutureNotifyWinningTicketsResult is a future promise to deliver the result of a NotifyWinningTicketsAsync RPC invocation (or an applicable error).
func (FutureNotifyWinningTicketsResult) Receive ¶
func (r FutureNotifyWinningTicketsResult) Receive() error
Receive waits for the response promised by the future and returns an error if the registration was not successful.
type FuturePingResult ¶
type FuturePingResult chan *response
FuturePingResult is a future promise to deliver the result of a PingAsync RPC invocation (or an applicable error).
func (FuturePingResult) Receive ¶
func (r FuturePingResult) Receive() error
Receive waits for the response promised by the future and returns the result of queueing a ping to be sent to each connected peer.
type FuturePurchaseTicketResult ¶
type FuturePurchaseTicketResult chan *response
FuturePurchaseTicketResult a channel for the response promised by the future.
func (FuturePurchaseTicketResult) Receive ¶
func (r FuturePurchaseTicketResult) Receive() ([]*chainhash.Hash, error)
Receive waits for the response promised by the future and returns the hash of the transaction sending multiple amounts to multiple addresses using the provided account as a source of funds.
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 FutureRenameAccountResult ¶
type FutureRenameAccountResult chan *response
FutureRenameAccountResult is a future promise to deliver the result of a RenameAccountAsync RPC invocation (or an applicable error).
func (FutureRenameAccountResult) Receive ¶
func (r FutureRenameAccountResult) Receive() error
Receive waits for the response promised by the future and returns the result of creating new account.
type FutureRescanResult ¶
type FutureRescanResult chan *response
FutureRescanResult is a future promise to deliver the result of a RescanAsynnc RPC invocation (or an applicable error).
func (FutureRescanResult) Receive ¶
func (r FutureRescanResult) Receive() (*dcrjson.RescanResult, error)
Receive waits for the response promised by the future and returns the discovered rescan data.
type FutureRevokeTicketsResult ¶
type FutureRevokeTicketsResult chan *response
FutureRevokeTicketsResult is a future promise to deliver the result of a RevokeTicketsAsync RPC invocation (or an applicable error).
func (FutureRevokeTicketsResult) Receive ¶
func (r FutureRevokeTicketsResult) Receive() error
Receive waits for the response promised by the future and returns the info provided by the server.
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() ([]*dcrjson.SearchRawTransactionsResult, error)
Receive waits for the response promised by the future and returns the found raw transactions.
type FutureSendFromResult ¶
type FutureSendFromResult chan *response
FutureSendFromResult is a future promise to deliver the result of a SendFromAsync, SendFromMinConfAsync, or SendFromCommentAsync RPC invocation (or an applicable error).
type FutureSendManyResult ¶
type FutureSendManyResult chan *response
FutureSendManyResult is a future promise to deliver the result of a SendManyAsync, SendManyMinConfAsync, or SendManyCommentAsync RPC invocation (or an applicable error).
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 FutureSendToAddressResult ¶
type FutureSendToAddressResult chan *response
FutureSendToAddressResult is a future promise to deliver the result of a SendToAddressAsync 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() (*dcrjson.SessionResult, error)
Receive waits for the response promised by the future and returns the session result.
type FutureSetGenerateResult ¶
type FutureSetGenerateResult chan *response
FutureSetGenerateResult is a future promise to deliver the result of a SetGenerateAsync RPC invocation (or an applicable error).
func (FutureSetGenerateResult) Receive ¶
func (r FutureSetGenerateResult) Receive() error
Receive waits for the response promised by the future and returns an error if any occurred when setting the server to generate coins (mine) or not.
type FutureSetTicketFeeResult ¶
type FutureSetTicketFeeResult chan *response
FutureSetTicketFeeResult is a future promise to deliver the result of a SetTicketFeeAsync RPC invocation (or an applicable error).
func (FutureSetTicketFeeResult) Receive ¶
func (r FutureSetTicketFeeResult) Receive() error
Receive waits for the response promised by the future and returns the info provided by the server.
type FutureSetTxFeeResult ¶
type FutureSetTxFeeResult chan *response
FutureSetTxFeeResult is a future promise to deliver the result of a SetTxFeeAsync RPC invocation (or an applicable error).
func (FutureSetTxFeeResult) Receive ¶
func (r FutureSetTxFeeResult) Receive() error
Receive waits for the response promised by the future.
type FutureSetVoteChoiceResult ¶
type FutureSetVoteChoiceResult chan *response
FutureSetVoteChoiceResult is a future promise to deliver the result of a SetVoteChoiceAsync RPC invocation (or an applicable error).
func (FutureSetVoteChoiceResult) Receive ¶
func (r FutureSetVoteChoiceResult) Receive() error
Receive waits for the response promised by the future.
type FutureSignMessageResult ¶
type FutureSignMessageResult chan *response
FutureSignMessageResult is a future promise to deliver the result of a SignMessageAsync RPC invocation (or an applicable error).
func (FutureSignMessageResult) Receive ¶
func (r FutureSignMessageResult) Receive() (string, error)
Receive waits for the response promised by the future and returns the message signed with the private key of the specified address.
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 FutureStakePoolUserInfoResult ¶
type FutureStakePoolUserInfoResult chan *response
FutureStakePoolUserInfoResult is a future promise to deliver the result of a GetInfoAsync RPC invocation (or an applicable error).
func (FutureStakePoolUserInfoResult) Receive ¶
func (r FutureStakePoolUserInfoResult) Receive() (*walletjson.StakePoolUserInfoResult, error)
Receive waits for the response promised by the future and returns the info provided by the server.
type FutureSubmitBlockResult ¶
type FutureSubmitBlockResult chan *response
FutureSubmitBlockResult is a future promise to deliver the result of a SubmitBlockAsync RPC invocation (or an applicable error).
func (FutureSubmitBlockResult) Receive ¶
func (r FutureSubmitBlockResult) Receive() error
Receive waits for the response promised by the future and returns an error if any occurred when submitting the block.
type FutureTicketFeeInfoResult ¶
type FutureTicketFeeInfoResult chan *response
FutureTicketFeeInfoResult is a future promise to deliver the result of a TicketFeeInfoAsync RPC invocation (or an applicable error).
func (FutureTicketFeeInfoResult) Receive ¶
func (r FutureTicketFeeInfoResult) Receive() (*dcrjson.TicketFeeInfoResult, error)
Receive waits for the response promised by the future and returns the ticketfeeinfo result.
type FutureTicketVWAPResult ¶
type FutureTicketVWAPResult chan *response
FutureTicketVWAPResult is a future promise to deliver the result of a TicketVWAPAsync RPC invocation (or an applicable error).
type FutureTicketsForAddressResult ¶
type FutureTicketsForAddressResult chan *response
FutureTicketsForAddressResult is a future promise to deliver the result of a GetInfoAsync RPC invocation (or an applicable error).
func (FutureTicketsForAddressResult) Receive ¶
func (r FutureTicketsForAddressResult) Receive() (*dcrjson.TicketsForAddressResult, error)
Receive waits for the response promised by the future and returns the info provided by the server.
type FutureTxFeeInfoResult ¶
type FutureTxFeeInfoResult chan *response
FutureTxFeeInfoResult is a future promise to deliver the result of a TxFeeInfoAsync RPC invocation (or an applicable error).
func (FutureTxFeeInfoResult) Receive ¶
func (r FutureTxFeeInfoResult) Receive() (*dcrjson.TxFeeInfoResult, error)
Receive waits for the response promised by the future and returns the txfeeinfo result.
type FutureValidateAddressResult ¶
type FutureValidateAddressResult chan *response
FutureValidateAddressResult is a future promise to deliver the result of a ValidateAddressAsync RPC invocation (or an applicable error).
func (FutureValidateAddressResult) Receive ¶
func (r FutureValidateAddressResult) Receive() (*walletjson.ValidateAddressWalletResult, error)
Receive waits for the response promised by the future and returns information about the given Decred address.
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 FutureVerifyMessageResult ¶
type FutureVerifyMessageResult chan *response
FutureVerifyMessageResult is a future promise to deliver the result of a VerifyMessageAsync RPC invocation (or an applicable error).
func (FutureVerifyMessageResult) Receive ¶
func (r FutureVerifyMessageResult) Receive() (bool, error)
Receive waits for the response promised by the future and returns whether or not the message was successfully verified.
type FutureVersionResult ¶
type FutureVersionResult chan *response
FutureVersionResult is a future promise to deliver the result of a version RPC invocation (or an applicable error).
func (FutureVersionResult) Receive ¶
func (r FutureVersionResult) Receive() (map[string]dcrjson.VersionResult, error)
Receive waits for the response promised by the future and returns the version result.
type FutureWalletInfoResult ¶
type FutureWalletInfoResult chan *response
FutureWalletInfoResult is a future promise to deliver the result of a WalletInfoAsync RPC invocation (or an applicable error).
func (FutureWalletInfoResult) Receive ¶
func (r FutureWalletInfoResult) Receive() (*walletjson.WalletInfoResult, error)
Receive waits for the response promised by the future and returns the stake info provided by the server.
type FutureWalletLockResult ¶
type FutureWalletLockResult chan *response
FutureWalletLockResult is a future promise to deliver the result of a WalletLockAsync RPC invocation (or an applicable error).
func (FutureWalletLockResult) Receive ¶
func (r FutureWalletLockResult) Receive() error
Receive waits for the response promised by the future and returns the result of locking the wallet.
type FutureWalletPassphraseChangeResult ¶
type FutureWalletPassphraseChangeResult chan *response
FutureWalletPassphraseChangeResult is a future promise to deliver the result of a WalletPassphraseChangeAsync RPC invocation (or an applicable error).
func (FutureWalletPassphraseChangeResult) Receive ¶
func (r FutureWalletPassphraseChangeResult) Receive() error
Receive waits for the response promised by the future and returns the result of changing the wallet passphrase.
type GapPolicy ¶
type GapPolicy string
GapPolicy defines the policy to use when the BIP0044 unused address gap limit would be violated by creating a new address.
type NotificationHandlers ¶
type NotificationHandlers struct { // OnClientConnected is invoked when the client connects or reconnects // to the RPC server. This callback is run async with the rest of the // notification handlers, and is safe for blocking client requests. OnClientConnected func() // OnBlockConnected is invoked when a block is connected to the longest // (best) chain. It will only be invoked if a preceding call to // NotifyBlocks has been made to register for the notification and the // function is non-nil. OnBlockConnected func(blockHeader []byte, transactions [][]byte) // OnBlockDisconnected is invoked when a block is disconnected from the // longest (best) chain. It will only be invoked if a preceding call to // NotifyBlocks has been made to register for the notification and the // function is non-nil. OnBlockDisconnected func(blockHeader []byte) // OnRelevantTxAccepted is invoked when an unmined transaction passes // the client's transaction filter. OnRelevantTxAccepted func(transaction []byte) // OnReorganization is invoked when the blockchain begins reorganizing. // It will only be invoked if a preceding call to NotifyBlocks has been // made to register for the notification and the function is non-nil. OnReorganization func(oldHash *chainhash.Hash, oldHeight int32, newHash *chainhash.Hash, newHeight int32) // OnWinningTickets is invoked when a block is connected and eligible tickets // to be voted on for this chain are given. It will only be invoked if a // preceding call to NotifyWinningTickets has been made to register for the // notification and the function is non-nil. OnWinningTickets func(blockHash *chainhash.Hash, blockHeight int64, tickets []*chainhash.Hash) // OnSpentAndMissedTickets is invoked when a block is connected to the // longest (best) chain and tickets are spent or missed. It will only be // invoked if a preceding call to NotifySpentAndMissedTickets has been made to // register for the notification and the function is non-nil. OnSpentAndMissedTickets func(hash *chainhash.Hash, height int64, stakeDiff int64, tickets map[chainhash.Hash]bool) // OnNewTickets is invoked when a block is connected to the longest (best) // chain and tickets have matured to become active. It will only be invoked // if a preceding call to NotifyNewTickets has been made to register for the // notification and the function is non-nil. OnNewTickets func(hash *chainhash.Hash, height int64, stakeDiff int64, tickets []*chainhash.Hash) // OnStakeDifficulty is invoked when a block is connected to the longest // (best) chain and a new stake difficulty is calculated. It will only // be invoked if a preceding call to NotifyStakeDifficulty has been // made to register for the notification and the function is non-nil. OnStakeDifficulty func(hash *chainhash.Hash, height int64, stakeDiff int64) // OnTxAccepted is invoked when a transaction is accepted into the // memory pool. It will only be invoked if a preceding call to // NotifyNewTransactions with the verbose flag set to false has been // made to register for the notification and the function is non-nil. OnTxAccepted func(hash *chainhash.Hash, amount dcrutil.Amount) // OnTxAccepted is invoked when a transaction is accepted into the // memory pool. It will only be invoked if a preceding call to // NotifyNewTransactions with the verbose flag set to true has been // made to register for the notification and the function is non-nil. OnTxAcceptedVerbose func(txDetails *dcrjson.TxRawResult) // OnDcrdConnected is invoked when a wallet connects or disconnects from // dcrd. // // This will only be available when client is connected to a wallet // server such as dcrwallet. OnDcrdConnected func(connected bool) // OnAccountBalance is invoked with account balance updates. // // This will only be available when speaking to a wallet server // such as dcrwallet. OnAccountBalance func(account string, balance dcrutil.Amount, confirmed bool) // OnWalletLockState is invoked when a wallet is locked or unlocked. // // This will only be available when client is connected to a wallet // server such as dcrwallet. OnWalletLockState func(locked bool) // OnTicketsPurchased is invoked when a wallet purchases an SStx. // // This will only be available when client is connected to a wallet // server such as dcrwallet. OnTicketsPurchased func(TxHash *chainhash.Hash, amount dcrutil.Amount) // OnVotesCreated is invoked when a wallet generates an SSGen. // // This will only be available when client is connected to a wallet // server such as dcrwallet. OnVotesCreated func(txHash *chainhash.Hash, blockHash *chainhash.Hash, height int32, sstxIn *chainhash.Hash, voteBits uint16) // OnRevocationsCreated is invoked when a wallet generates an SSRtx. // // This will only be available when client is connected to a wallet // server such as dcrwallet. OnRevocationsCreated func(txHash *chainhash.Hash, sstxIn *chainhash.Hash) // OnUnknownNotification is invoked when an unrecognized notification // is received. This typically means the notification handling code // for this package needs to be updated for a new notification type or // the caller is using a custom notification this package does not know // about. OnUnknownNotification func(method string, params []json.RawMessage) }
NotificationHandlers defines callback function pointers to invoke with notifications. Since all of the functions are nil by default, all notifications are effectively ignored until their handlers are set to a concrete callback.
NOTE: Unless otherwise documented, these handlers must NOT directly call any blocking calls on the client instance since the input reader goroutine blocks until the callback has completed. Doing so will result in a deadlock situation.
type SStxCommitOut ¶
type SStxCommitOut struct { Addr dcrutil.Address CommitAmt dcrutil.Amount ChangeAddr dcrutil.Address ChangeAmt dcrutil.Amount }
SStxCommitOut represents the output to an SStx transaction. Specifically a a commitment address and amount, and a change address and amount. Same name as the JSON lib, but different internal structures.
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.