Documentation
¶
Index ¶
- Variables
- func AccountAddressIndex(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func AccountFetchAddresses(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func AccountSyncAddressIndex(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func AddMultiSigAddress(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func AddTicket(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func Consolidate(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func CreateMultiSig(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func CreateNewAccount(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func DumpPrivKey(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func DumpWallet(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetAccount(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetAccountAddress(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetAddressesByAccount(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetBalance(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetBalanceToMaintain(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetBestBlock(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetBestBlockHash(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetBlockCount(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetGenerate(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetInfo(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func GetMasterPubkey(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetMultisigOutInfo(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func GetNewAddress(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetRawChangeAddress(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetReceivedByAccount(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetReceivedByAddress(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetSeed(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetStakeInfo(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func GetTicketFee(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetTicketMaxPrice(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetTicketVoteBits(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetTickets(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func GetTicketsVoteBits(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetTransaction(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetUnconfirmedBalance(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func GetWalletFee(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func HelpNoChainRPC(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func HelpWithChainRPC(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func ImportPrivKey(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func ImportScript(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func KeypoolRefill(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func ListAccounts(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func ListAddressTransactions(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func ListAllTransactions(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func ListLockUnspent(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func ListReceivedByAccount(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func ListReceivedByAddress(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func ListScripts(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func ListSinceBlock(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func ListTransactions(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func ListUnspent(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func ListUnspentMultisig(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func LockUnspent(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func PurchaseTicket(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func RedeemMultiSigOut(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func RedeemMultiSigOuts(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func RenameAccount(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func SendFrom(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func SendMany(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func SendToAddress(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func SendToMultiSig(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func SendToSSGen(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func SendToSSRtx(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func SendToSStx(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func SetBalanceToMaintain(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func SetGenerate(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func SetTicketFee(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func SetTicketMaxPrice(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func SetTicketVoteBits(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func SetTxFee(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func SignMessage(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func SignRawTransaction(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func SignRawTransactions(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func StakePoolUserInfo(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func TicketsForAddress(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func Unimplemented(interface{}, *wallet.Wallet) (interface{}, error)
- func Unsupported(interface{}, *wallet.Wallet) (interface{}, error)
- func UseLogger(logger btclog.Logger)
- func ValidateAddress(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func VerifyMessage(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func WalletInfo(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
- func WalletIsLocked(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func WalletLock(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func WalletPassphrase(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- func WalletPassphraseChange(icmd interface{}, w *wallet.Wallet) (interface{}, error)
- type DeserializationError
- type InvalidParameterError
- type Options
- type ParseError
- type Server
Constants ¶
This section is empty.
Variables ¶
var ( ErrNeedPositiveAmount = InvalidParameterError{ errors.New("amount must be positive"), } ErrNeedBelowMaxAmount = InvalidParameterError{ errors.New("amount must be below max amount"), } ErrNeedPositiveSpendLimit = InvalidParameterError{ errors.New("spend limit must be positive"), } ErrNeedPositiveMinconf = InvalidParameterError{ errors.New("minconf must be positive"), } ErrAddressNotInWallet = dcrjson.RPCError{ Code: dcrjson.ErrRPCWallet, Message: "address not found in wallet", } ErrAccountNameNotFound = dcrjson.RPCError{ Code: dcrjson.ErrRPCWalletInvalidAccountName, Message: "account name not found", } ErrUnloadedWallet = dcrjson.RPCError{ Code: dcrjson.ErrRPCWallet, Message: "Request requires a wallet but wallet has not loaded yet", } ErrWalletUnlockNeeded = dcrjson.RPCError{ Code: dcrjson.ErrRPCWalletUnlockNeeded, Message: "Enter the wallet passphrase with walletpassphrase first", } ErrNotImportedAccount = dcrjson.RPCError{ Code: dcrjson.ErrRPCWallet, Message: "imported addresses must belong to the imported account", } ErrNoTransactionInfo = dcrjson.RPCError{ Code: dcrjson.ErrRPCNoTxInfo, Message: "No information for transaction", } ErrReservedAccountName = dcrjson.RPCError{ Code: dcrjson.ErrRPCInvalidParameter, Message: "Account name is reserved by RPC server", } ErrMainNetSafety = dcrjson.RPCError{ Code: dcrjson.ErrRPCWallet, Message: "RPC function disabled on MainNet wallets for security purposes", } )
Errors variables that are defined once here to avoid duplication below.
var ErrNoAuth = errors.New("no auth")
ErrNoAuth represents an error where authentication could not succeed due to a missing Authorization HTTP header.
Functions ¶
func AccountAddressIndex ¶ added in v0.0.10
AccountAddressIndex returns the current address index for the passed account and branch.
func AccountFetchAddresses ¶ added in v0.0.10
AccountFetchAddresses returns the all addresses from (start,end] for the passed account and branch.
func AccountSyncAddressIndex ¶ added in v0.0.10
AccountSyncAddressIndex synchronizes the address manager and local address pool for some account and branch to the passed index. If the current pool index is beyond the passed index, an error is returned. If the passed index is the same as the current pool index, nothing is returned. If the syncing is successful, nothing is returned.
func AddMultiSigAddress ¶
func AddMultiSigAddress(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
AddMultiSigAddress handles an addmultisigaddress request by adding a multisig address to the given wallet.
func Consolidate ¶
Consolidate handles a consolidate request by returning attempting to compress as many inputs as given and then returning the txHash and error.
func CreateMultiSig ¶
CreateMultiSig handles an createmultisig request by returning a multisig address for the given inputs.
func CreateNewAccount ¶
CreateNewAccount handles a createnewaccount request by creating and returning a new account. If the last account has no transaction history as per BIP 0044 a new account cannot be created so an error will be returned.
func DumpPrivKey ¶
DumpPrivKey handles a dumpprivkey request with the private key for a single address, or an appropiate error if the wallet is locked.
func DumpWallet ¶
DumpWallet handles a dumpwallet request by returning all private keys in a wallet, or an appropiate error if the wallet is locked. TODO: finish this to match bitcoind by writing the dump to a file.
func GetAccount ¶
GetAccount handles a getaccount request by returning the account name associated with a single address.
func GetAccountAddress ¶
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 dcrd mempool). If the most recently-requested address has been used, a new address (the next chained address in the keypool) is used. This can fail if the keypool runs out (and will return dcrjson.ErrRPCWalletKeypoolRanOut if that happens).
func GetAddressesByAccount ¶
GetAddressesByAccount handles a getaddressesbyaccount request by returning all addresses for an account, or an error if the requested account does not exist.
func GetBalance ¶
GetBalance handles a getbalance request by returning the balance for an account (wallet), or an error if the requested account does not exist.
func GetBalanceToMaintain ¶
GetBalanceToMaintain handles a getbalancetomaintain request by returning the wallet balancetomaintain as a float64.
func GetBestBlock ¶
GetBestBlock handles a getbestblock request by returning a JSON object with the height and hash of the most recently processed block.
func GetBestBlockHash ¶
GetBestBlockHash handles a getbestblockhash request by returning the hash of the most recently processed block.
func GetBlockCount ¶
GetBlockCount handles a getblockcount request by returning the chain height of the most recently processed block.
func GetGenerate ¶
GetGenerate returns if stake mining is enabled for the wallet.
func GetInfo ¶
GetInfo handles a getinfo request by returning the a structure containing information about the current state of dcrcwallet. exist.
func GetMasterPubkey ¶
GetMasterPubkey handles a getmasterpubkey request by returning the wallet master pubkey encoded as a string.
func GetMultisigOutInfo ¶
func GetMultisigOutInfo(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
GetMultisigOutInfo displays information about a given multisignature output.
func GetNewAddress ¶
GetNewAddress handles a getnewaddress request by returning a new address for an account. If the account does not exist an appropiate error is returned. TODO: Follow BIP 0044 and warn if number of unused addresses exceeds the gap limit.
func GetRawChangeAddress ¶
GetRawChangeAddress handles a getrawchangeaddress request by creating and returning a new change address for an account.
Note: bitcoind allows specifying the account as an optional parameter, but ignores the parameter.
func GetReceivedByAccount ¶
GetReceivedByAccount handles a getreceivedbyaccount request by returning the total amount received by addresses of an account.
func GetReceivedByAddress ¶
GetReceivedByAddress handles a getreceivedbyaddress request by returning the total amount received by a single address.
func GetStakeInfo ¶
func GetStakeInfo(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
GetStakeInfo gets a large amounts of information about the stake environment and a number of statistics about local staking in the wallet. These are better explained one-by-one:
PoolSize uint32 Number of live tickets in the ticket pool Difficulty int64 Current stake difficulty AllMempoolTix uint32 Number of tickets currently in the mempool OwnMempoolTix uint32 Number of tickets in mempool that are from this wallet Immature uint32 Number of tickets from this wallet that are in the blockchain but which are not yet mature Live uint32 Number of mature, active tickets owned by this wallet ProportionLive float64 (Live / PoolSize) Voted uint32 Number of votes cast by this wallet TotalSubsidy int64 Total amount of coins earned by stake mining Missed uint32 Number of missed tickets (failing to vote or expired) ProportionMissed float64 (Missed / (Missed + Voted)) Revoked uint32 Number of missed tickets that were missed and then revoked
Getting this information is extremely costly as in involves a massive number of chain server calls.
func GetTicketFee ¶
GetTicketFee gets the currently set price per kb for tickets
func GetTicketMaxPrice ¶
GetTicketMaxPrice gets the maximum price the user is willing to pay for a ticket.
func GetTicketVoteBits ¶
GetTicketVoteBits fetches the per-ticket voteBits for a given ticket from a ticket hash. If the voteBits are unset, it returns the default voteBits. Otherwise, it returns the voteBits it finds. Missing tickets return an error.
func GetTickets ¶
func GetTickets(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
GetTickets handles a gettickets request by returning the hashes of the tickets currently owned by wallet, encoded as strings.
func GetTicketsVoteBits ¶
GetTicketsVoteBits fetches the per-ticket voteBits for a given array of ticket hashes. If the voteBits are unset, it returns the default voteBits. Otherwise, it returns the voteBits it finds. Missing tickets return an error.
func GetTransaction ¶
GetTransaction handles a gettransaction request by returning details about a single transaction saved by wallet.
func GetUnconfirmedBalance ¶
GetUnconfirmedBalance handles a getunconfirmedbalance extension request by returning the current unconfirmed balance of an account.
func GetWalletFee ¶
GetWalletFee returns the currently set tx fee for the requested wallet
func HelpNoChainRPC ¶
HelpNoChainRPC handles the help request when the RPC server has not been associated with a consensus RPC client. No help messages are included for passthrough requests.
func HelpWithChainRPC ¶
func HelpWithChainRPC(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
HelpWithChainRPC handles the help request when the RPC server has been associated with a consensus RPC client. The additional RPC client is used to include help messages for methods implemented by the consensus server via RPC passthrough.
func ImportPrivKey ¶
ImportPrivKey handles an importprivkey request by parsing a WIF-encoded private key and adding it to an account.
func ImportScript ¶
func ImportScript(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
ImportScript imports a redeem script for a P2SH output.
func KeypoolRefill ¶
KeypoolRefill handles the keypoolrefill command. Since we handle the keypool automatically this does nothing since refilling is never manually required.
func ListAccounts ¶
ListAccounts handles a listaccounts request by returning a map of account names to their balances.
func ListAddressTransactions ¶
ListAddressTransactions handles a listaddresstransactions request by returning an array of maps with details of spent and received wallet transactions. The form of the reply is identical to listtransactions, but the array elements are limited to transaction details which are about the addresess included in the request.
func ListAllTransactions ¶
ListAllTransactions handles a listalltransactions request by returning a map with details of sent and recevied wallet transactions. This is similar to ListTransactions, except it takes only a single optional argument for the account name and replies with all transactions.
func ListLockUnspent ¶
ListLockUnspent handles a listlockunspent request by returning an slice of all locked outpoints.
func ListReceivedByAccount ¶
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.
It takes two parameters:
"minconf": minimum number of confirmations to consider a transaction - default: one; "includeempty": whether or not to include addresses that have no transactions - default: false.
func ListReceivedByAddress ¶
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.
It takes two parameters:
"minconf": minimum number of confirmations to consider a transaction - default: one; "includeempty": whether or not to include addresses that have no transactions - default: false.
func ListScripts ¶
ListScripts handles a listscripts request by returning an array of script details for all scripts in the wallet.
func ListSinceBlock ¶
func ListSinceBlock(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
ListSinceBlock handles a listsinceblock request by returning an array of maps with details of sent and received wallet transactions since the given block.
func ListTransactions ¶
ListTransactions handles a listtransactions request by returning an array of maps with details of sent and recevied wallet transactions.
func ListUnspent ¶
ListUnspent handles the listunspent command.
func ListUnspentMultisig ¶
ListUnspentMultisig handles the listunspentmultisig command.
func LockUnspent ¶
LockUnspent handles the lockunspent command.
func PurchaseTicket ¶
PurchaseTicket indicates to the wallet that a ticket should be purchased using all currently available funds. If the ticket could not be purchased because there are not enough eligible funds, an error will be returned.
func RedeemMultiSigOut ¶
func RedeemMultiSigOut(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
RedeemMultiSigOut receives a transaction hash/idx and fetches the first output index or indices with known script hashes from the transaction. It then construct a transaction with a single P2PKH paying to a specified address. It signs any inputs that it can, then provides the raw transaction to the user to export to others to sign.
func RedeemMultiSigOuts ¶
func RedeemMultiSigOuts(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
RedeemMultisigOuts receives a script hash (in the form of a script hash address), looks up all the unspent outpoints associated with that address, then generates a list of partially signed transactions spending to either an address specified or internal addresses in this wallet.
func RenameAccount ¶
RenameAccount handles a renameaccount request by renaming an account. If the account does not exist an appropiate error will be returned.
func SendFrom ¶
func SendFrom(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
SendFrom handles a sendfrom RPC request by creating a new transaction spending unspent transaction outputs for a wallet to another payment address. Leftover inputs not sent to the payment address or a fee for the miner are sent back to a new address in the wallet. Upon success, the TxID for the created transaction is returned.
func SendMany ¶
SendMany handles a sendmany RPC request by creating a new transaction spending unspent transaction outputs for a wallet to any number of payment addresses. Leftover inputs not sent to the payment address or a fee for the miner are sent back to a new address in the wallet. Upon success, the TxID for the created transaction is returned.
func SendToAddress ¶
SendToAddress handles a sendtoaddress RPC request by creating a new transaction spending unspent transaction outputs for a wallet to another payment address. Leftover inputs not sent to the payment address or a fee for the miner are sent back to a new address in the wallet. Upon success, the TxID for the created transaction is returned.
func SendToMultiSig ¶
func SendToMultiSig(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
SendToMultiSig handles a sendtomultisig RPC request by creating a new transaction spending amount many funds to an output containing a multi- signature script hash. The function will fail if there isn't at least one public key in the public key list that corresponds to one that is owned locally. Upon successfully sending the transaction to the daemon, the script hash is stored in the transaction manager and the corresponding address specified to be watched by the daemon. The function returns a tx hash, P2SH address, and a multisig script if successful. TODO Use with non-default accounts as well
func SendToSSGen ¶
SendToSSGen handles a sendtossgen RPC request by creating a new transaction spending a stake ticket and generating stake rewards. Upon success, the TxID for the created transaction is returned. DECRED TODO: Clean these up
func SendToSSRtx ¶
func SendToSSRtx(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
SendToSSRtx handles a sendtossrtx RPC request by creating a new transaction spending a stake ticket and generating stake rewards. Upon success, the TxID for the created transaction is returned. DECRED TODO: Clean these up
func SendToSStx ¶
func SendToSStx(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
SendToSStx handles a sendtosstx RPC request by creating a new transaction payment addresses. Leftover inputs not sent to the payment address or a fee for the miner are sent back to a new address in the wallet. Upon success, the TxID for the created transaction is returned. DECRED TODO: Clean these up
func SetBalanceToMaintain ¶
SetBalanceToMaintain sets the balance to maintain for automatic ticket pur.
func SetGenerate ¶
SetGenerate enables or disables stake mining the wallet (ticket autopurchase, vote generation, and revocation generation). The number of processors may be declared but is ignored (as this is non-PoW work).
func SetTicketFee ¶
SetTicketFee sets the transaction fee per kilobyte added to tickets.
func SetTicketMaxPrice ¶
SetTicketMaxPrice sets the maximum price the user is willing to pay for a ticket.
func SetTicketVoteBits ¶
SetTicketVoteBits sets the per-ticket voteBits for a given ticket from a ticket hash. Missing tickets return an error.
func SignMessage ¶
SignMessage signs the given message with the private key for the given address
func SignRawTransaction ¶
func SignRawTransaction(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
SignRawTransaction handles the signrawtransaction command.
func SignRawTransactions ¶
func SignRawTransactions(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
SignRawTransactions handles the signrawtransactions command.
func StakePoolUserInfo ¶ added in v0.1.2
StakePoolUserInfo returns the ticket information for a given user from the stake pool.
func TicketsForAddress ¶
TicketsForAddress retrieves all ticket hashes that have the passed voting address. It will only return tickets that are in the mempool or blockchain, and should not return pruned tickets.
func Unimplemented ¶
Unimplemented handles an unimplemented RPC request with the appropiate error.
func Unsupported ¶
Unsupported handles a standard bitcoind RPC request which is unsupported by dcrwallet due to design differences.
func UseLogger ¶
UseLogger sets the package-wide logger. Any calls to this function must be made before a server is created and used (it is not concurrent safe).
func ValidateAddress ¶
ValidateAddress handles the validateaddress command.
func VerifyMessage ¶
VerifyMessage handles the verifymessage command by verifying the provided compact signature for the given address and message.
func WalletInfo ¶ added in v0.0.10
func WalletInfo(icmd interface{}, w *wallet.Wallet, chainClient *chain.RPCClient) (interface{}, error)
WalletInfo gets the current information about the wallet. If the daemon is connected and fails to ping, the function will still return that the daemon is disconnected.
func WalletIsLocked ¶
WalletIsLocked handles the walletislocked extension request by returning the current lock state (false for unlocked, true for locked) of an account.
func WalletLock ¶
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).
func WalletPassphrase ¶
WalletPassphrase responds to the walletpassphrase request by unlocking the wallet. The decryption key is saved in the wallet until timeout seconds expires, after which the wallet is locked.
func WalletPassphraseChange ¶
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.
If the old passphrase is correct and the passphrase is changed, all wallets will be immediately locked.
Types ¶
type DeserializationError ¶
type DeserializationError struct {
// contains filtered or unexported fields
}
DeserializationError describes a failed deserializaion due to bad user input. It corresponds to dcrjson.ErrRPCDeserialization.
type InvalidParameterError ¶
type InvalidParameterError struct {
// contains filtered or unexported fields
}
InvalidParameterError describes an invalid parameter passed by the user. It corresponds to dcrjson.ErrRPCInvalidParameter.
type Options ¶
type Options struct { Username string Password string MaxPOSTClients int64 MaxWebsocketClients int64 UnsafeMainNet bool }
Options contains the required options for running the legacy RPC server.
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
ParseError describes a failed parse due to bad user input. It corresponds to dcrjson.ErrRPCParse.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server holds the items the RPC server may need to access (auth, config, shutdown, etc.)
func NewServer ¶
NewServer creates a new server for serving legacy RPC client connections, both HTTP POST and websocket.
func (*Server) PostClientRPC ¶
func (s *Server) PostClientRPC(w http.ResponseWriter, r *http.Request)
PostClientRPC processes and replies to a JSON-RPC client request.
func (*Server) RegisterWallet ¶
RegisterWallet associates the legacy RPC server with the wallet. This function must be called before any wallet RPCs can be called by clients.
func (*Server) RequestProcessShutdown ¶
func (s *Server) RequestProcessShutdown() <-chan struct{}
RequestProcessShutdown returns a channel that is sent to when an authorized client requests remote shutdown.
func (*Server) SetChainServer ¶
SetChainServer sets the chain server client component needed to run a fully functional decred wallet RPC server. This can be called to enable RPC passthrough even before a loaded wallet is set, but the wallet's RPC client is preferred.