# Functions
AddMultiSigAddress handles an addmultisigaddress request by adding a multisig address to the given wallet.
No description provided by the author
Confirms returns the number of confirmations for a transaction in a block at height txHeight (or -1 for an unconfirmed tx) given the chain height curHeight.
CreateMultiSig handles an createmultisig request by returning a multisig address for the given inputs.
CreateNewAccount handles a createnewaccount request by creating and returning a new account.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DecodeHexStr decodes the hex encoding of a string, possibly prepending a leading '0' character if there is an odd number of bytes in the hex string.
No description provided by the author
DumpPrivKey handles a dumpprivkey request with the private key for a single address, or an appropriate error if the wallet is locked.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GetAccount handles a getaccount request by returning the account name associated with a single address.
GetAccountAddress handles a getaccountaddress by returning the most recently-created chained address that has not yet been used (does not yet appear in the blockchain, or any tx that has arrived in the pod mempool).
GetAddressesByAccount handles a getaddressesbyaccount request by returning all addresses for an account, or an error if the requested account does not exist.
GetBalance handles a getbalance request by returning the balance for an account (wallet), or an error if the requested account does not exist.
GetBestBlock handles a getbestblock request by returning a JSON object with the height and hash of the most recently processed block.
GetBestBlockHash handles a getbestblockhash request by returning the hash of the most recently processed block.
GetBlockCount handles a getblockcount request by returning the chain height of the most recently processed block.
GetInfo handles a getinfo request by returning the a structure containing information about the current state of btcwallet.
GetNewAddress handles a getnewaddress request by returning a new address for an account.
GetRawChangeAddress handles a getrawchangeaddress request by creating and returning a new change address for an account.
GetReceivedByAccount handles a getreceivedbyaccount request by returning the total amount received by addresses of an account.
GetReceivedByAddress handles a getreceivedbyaddress request by returning the total amount received by a single address.
GetTransaction handles a gettransaction request by returning details about a single transaction saved by wallet.
GetUnconfirmedBalance handles a getunconfirmedbalance extension request by returning the current unconfirmed balance of an account.
No description provided by the author
Help handles the Help request by returning one line usage of all available methods, or full Help for a specific method.
No description provided by the author
HelpNoChainRPC handles the help request when the RPC server has not been associated with a consensus RPC client.
HelpWithChainRPC handles the help request when the RPC server has been associated with a consensus RPC client.
HTTPBasicAuth returns the UTF-8 bytes of the HTTP Basic authentication string:
"Basic " + base64(username + ":" + password).
IDPointer returns a pointer to the passed ID, or nil if the interface is nil.
ImportPrivKey handles an importprivkey request by parsing a WIF-encoded private key and adding it to an account.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
JSONAuthFail sends a message back to the client if the http auth is rejected.
JSONError creates a JSON-RPC error from the Go error.
KeypoolRefill handles the keypoolrefill command.
LazyApplyHandler looks up the best request handler func for the method, returning a closure that will execute it with the (required) wallet and (optional) consensus RPC server.
ListAccounts handles a listaccounts request by returning a map of account names to their balances.
ListAddressTransactions handles a listaddresstransactions request by returning an array of maps with details of spent and received wallet transactions.
ListAllTransactions handles a listalltransactions request by returning a map with details of sent and received wallet transactions.
ListLockUnspent handles a listlockunspent request by returning an slice of all locked outpoints.
ListReceivedByAccount handles a listreceivedbyaccount request by returning a slice of objects, each one containing:
"account": the receiving account;
"amount": total amount received by the account;
"confirmations": number of confirmations of the most recent transaction.
ListReceivedByAddress handles a listreceivedbyaddress request by returning a slice of objects, each one containing:
"account": the account of the receiving address;
"address": the receiving address;
"amount": total amount received by the address;
"confirmations": number of confirmations of the most recent transaction.
ListSinceBlock handles a listsinceblock request by returning an array of maps with details of sent and received wallet transactions since the given block.
ListTransactions handles a listtransactions request by returning an array of maps with details of sent and recevied wallet transactions.
ListUnspent handles the listunspent command.
LockUnspent handles the lockunspent command.
MakeMultiSigScript is a helper function to combine common logic for AddMultiSig and CreateMultiSig.
MakeOutputs creates a slice of transaction outputs from a pair of address strings to amounts.
MakeResponse makes the JSON-RPC response struct for the result and error returned by a requestHandler.
NewCAPI returns a new CAPI .
NewCAPIClient creates a new client for a kopach_worker.
NewServer creates a new server for serving legacy RPC client connections, both HTTP POST and websocket.
No description provided by the author
RenameAccount handles a renameaccount request by renaming an account.
RunAPI starts up the api handler server that receives rpc.API messages and runs the handler and returns the result Note that the parameters are type asserted to prevent the consumer of the API from sending wrong message types not because it's necessary since they are interfaces end to end.
SendFrom handles a sendfrom RPC request by creating a new transaction spending unspent transaction outputs for a wallet to another payment address.
SendMany handles a sendmany RPC request by creating a new transaction spending unspent transaction outputs for a wallet to any number of payment addresses.
SendPairs creates and sends payment transactions.
SendToAddress handles a sendtoaddress RPC request by creating a new transaction spending unspent transaction outputs for a wallet to another payment address.
SetTxFee sets the transaction fee per kilobyte added to transactions.
SignMessage signs the given message with the private key for the given address.
SignRawTransaction handles the signrawtransaction command.
Throttled wraps an http.Handler with throttling of concurrent active clients by responding with an HTTP 429 when the threshold is crossed.
ThrottledFn wraps an http.HandlerFunc with throttling of concurrent active clients by responding with an HTTP 429 when the threshold is crossed.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Unimplemented handles an Unimplemented RPC request with the appropiate error.
Unsupported handles a standard bitcoind RPC request which is Unsupported by btcwallet due to design differences.
ValidateAddress handles the validateaddress command.
VerifyMessage handles the verifymessage command by verifying the provided compact signature for the given address and message.
WalletIsLocked handles the walletislocked extension request by returning the current lock state (false for unlocked, true for locked) of an account.
WalletLock handles a walletlock request by locking the all account wallets, returning an error if any wallet is not encrypted (for example, a watching-only wallet).
WalletPassphrase responds to the walletpassphrase request by unlocking the wallet.
WalletPassphraseChange responds to the walletpassphrasechange request by unlocking all accounts with the provided old passphrase, and re-encrypting each private key with an AES key derived from the new passphrase.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
MaxRequestSize specifies the maximum number of bytes in the request body that may be read from a client.
# Variables
Errors variables that are defined once here to avoid duplication below.
Errors variables that are defined once here to avoid duplication below.
Errors variables that are defined once here to avoid duplication below.
Errors variables that are defined once here to avoid duplication below.
ErrNoAuth represents an error where authentication could not succeed due to a missing Authorization HTTP header.
Errors variables that are defined once here to avoid duplication below.
Errors variables that are defined once here to avoid duplication below.
Errors variables that are defined once here to avoid duplication below.
Errors variables that are defined once here to avoid duplication below.
Errors variables that are defined once here to avoid duplication below.
No description provided by the author
Help may execute concurrently, so synchronize access.
No description provided by the author
No description provided by the author
RPCHandlers is all of the RPC calls available
- Handler is the handler function
- Call is a channel carrying a struct containing parameters and error that is listened to in RunAPI to dispatch the calls
- Result is a bundle of command parameters and a channel that the result will be sent back on
Get and save the Result function's return, and you can then call the call functions check, result and wait functions for asynchronous and synchronous calls to RPC functions.
# Structs
No description provided by the author
API stores the channel, parameters and result values from calls via the channel.
CAPI is the central structure for configuration and access to a net/rpc API access endpoint for this RPC API.
No description provided by the author
No description provided by the author
No description provided by the author
TODO(jrick): There are several error paths which 'replace' various errors with a more appropiate error from the json package.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TODO(jrick): There are several error paths which 'replace' various errors with a more appropiate error from the json package.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Options contains the required options for running the legacy RPC server.
TODO(jrick): There are several error paths which 'replace' various errors with a more appropiate error from the json package.
No description provided by the author
No description provided by the author
No description provided by the author
Server holds the items the RPC server may need to access (auth, config, shutdown, etc.).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
LazyHandler is a closure over a requestHandler or passthrough request with the RPC server's wallet and chain server variables as part of the closure context.
RequestHandler is a handler function to handle an unmarshaled and parsed request into a marshalable response.