Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 190 Lines • ▼ Show 20 Lines | static UniValue getnewaddress(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"getnewaddress", | "getnewaddress", | ||||
"\nReturns a new Bitcoin address for receiving payments.\n" | "Returns a new Bitcoin address for receiving payments.\n" | ||||
"If 'label' is specified, it is added to the address book \n" | "If 'label' is specified, it is added to the address book \n" | ||||
"so payments received with the address will be associated with " | "so payments received with the address will be associated with " | ||||
"'label'.\n", | "'label'.\n", | ||||
{ | { | ||||
{"label", RPCArg::Type::STR, /* default */ "null", | {"label", RPCArg::Type::STR, /* default */ "null", | ||||
"The label name for the address to be linked to. If not provided, " | "The label name for the address to be linked to. If not provided, " | ||||
"the default label \"\" is used. It can also be set to the empty " | "the default label \"\" is used. It can also be set to the empty " | ||||
"string \"\" to represent the default label. The label does not " | "string \"\" to represent the default label. The label does not " | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | static UniValue getrawchangeaddress(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"getrawchangeaddress", | "getrawchangeaddress", | ||||
"\nReturns a new Bitcoin address, for receiving change.\n" | "Returns a new Bitcoin address, for receiving change.\n" | ||||
"This is for use with raw transactions, NOT normal use.\n", | "This is for use with raw transactions, NOT normal use.\n", | ||||
{}, | {}, | ||||
RPCResult{"\"address\" (string) The address\n"}, | RPCResult{"\"address\" (string) The address\n"}, | ||||
RPCExamples{HelpExampleCli("getrawchangeaddress", "") + | RPCExamples{HelpExampleCli("getrawchangeaddress", "") + | ||||
HelpExampleRpc("getrawchangeaddress", "")}, | HelpExampleRpc("getrawchangeaddress", "")}, | ||||
} | } | ||||
.Check(request); | .Check(request); | ||||
Show All 29 Lines | static UniValue setlabel(const Config &config, const JSONRPCRequest &request) { | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"setlabel", | "setlabel", | ||||
"\nSets the label associated with the given address.\n", | "Sets the label associated with the given address.\n", | ||||
{ | { | ||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, | {"address", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The bitcoin address to be associated with a label."}, | "The bitcoin address to be associated with a label."}, | ||||
{"label", RPCArg::Type::STR, RPCArg::Optional::NO, | {"label", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The label to assign to the address."}, | "The label to assign to the address."}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResults{}, | ||||
RPCExamples{ | RPCExamples{ | ||||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | static UniValue sendtoaddress(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"sendtoaddress", | "sendtoaddress", | ||||
"\nSend an amount to a given address.\n" + | "Send an amount to a given address.\n" + | ||||
HelpRequiringPassphrase(pwallet) + "\n", | HelpRequiringPassphrase(pwallet) + "\n", | ||||
{ | { | ||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, | {"address", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The bitcoin address to send to."}, | "The bitcoin address to send to."}, | ||||
{"amount", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, | {"amount", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, | ||||
"The amount in " + CURRENCY_UNIT + " to send. eg 0.1"}, | "The amount in " + CURRENCY_UNIT + " to send. eg 0.1"}, | ||||
{"comment", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, | {"comment", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, | ||||
"A comment used to store what the transaction is for.\n" | "A comment used to store what the transaction is for.\n" | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | static UniValue listaddressgroupings(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"listaddressgroupings", | "listaddressgroupings", | ||||
"\nLists groups of addresses which have had their common ownership\n" | "Lists groups of addresses which have had their common ownership\n" | ||||
"made public by common use as inputs or as the resulting change\n" | "made public by common use as inputs or as the resulting change\n" | ||||
"in past transactions\n", | "in past transactions\n", | ||||
{}, | {}, | ||||
RPCResult{"[\n" | RPCResult{"[\n" | ||||
" [\n" | " [\n" | ||||
" [\n" | " [\n" | ||||
" \"address\", (string) The bitcoin address\n" | " \"address\", (string) The bitcoin address\n" | ||||
" amount, (numeric) The amount in " + | " amount, (numeric) The amount in " + | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | static UniValue signmessage(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"signmessage", | "signmessage", | ||||
"\nSign a message with the private key of an address" + | "Sign a message with the private key of an address" + | ||||
HelpRequiringPassphrase(pwallet) + "\n", | HelpRequiringPassphrase(pwallet) + "\n", | ||||
{ | { | ||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, | {"address", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The bitcoin address to use for the private key."}, | "The bitcoin address to use for the private key."}, | ||||
{"message", RPCArg::Type::STR, RPCArg::Optional::NO, | {"message", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The message to create a signature of."}, | "The message to create a signature of."}, | ||||
}, | }, | ||||
RPCResult{"\"signature\" (string) The signature of the " | RPCResult{"\"signature\" (string) The signature of the " | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | static UniValue getreceivedbyaddress(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"getreceivedbyaddress", | "getreceivedbyaddress", | ||||
"\nReturns the total amount received by the given address in " | "Returns the total amount received by the given address in " | ||||
"transactions with at least minconf confirmations.\n", | "transactions with at least minconf confirmations.\n", | ||||
{ | { | ||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, | {"address", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The bitcoin address for transactions."}, | "The bitcoin address for transactions."}, | ||||
{"minconf", RPCArg::Type::NUM, /* default */ "1", | {"minconf", RPCArg::Type::NUM, /* default */ "1", | ||||
"Only include transactions confirmed at least this many times."}, | "Only include transactions confirmed at least this many times."}, | ||||
}, | }, | ||||
RPCResult{"amount (numeric) The total amount in " + CURRENCY_UNIT + | RPCResult{"amount (numeric) The total amount in " + CURRENCY_UNIT + | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | static UniValue getreceivedbylabel(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"getreceivedbylabel", | "getreceivedbylabel", | ||||
"\nReturns the total amount received by addresses with <label> in " | "Returns the total amount received by addresses with <label> in " | ||||
"transactions with at least [minconf] confirmations.\n", | "transactions with at least [minconf] confirmations.\n", | ||||
{ | { | ||||
{"label", RPCArg::Type::STR, RPCArg::Optional::NO, | {"label", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The selected label, may be the default label using \"\"."}, | "The selected label, may be the default label using \"\"."}, | ||||
{"minconf", RPCArg::Type::NUM, /* default */ "1", | {"minconf", RPCArg::Type::NUM, /* default */ "1", | ||||
"Only include transactions confirmed at least this many times."}, | "Only include transactions confirmed at least this many times."}, | ||||
}, | }, | ||||
RPCResult{"amount (numeric) The total amount in " + | RPCResult{"amount (numeric) The total amount in " + | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | static UniValue getbalance(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"getbalance", | "getbalance", | ||||
"\nReturns the total available balance.\n" | "Returns the total available balance.\n" | ||||
"The available balance is what the wallet considers currently " | "The available balance is what the wallet considers currently " | ||||
"spendable, and is\n" | "spendable, and is\n" | ||||
"thus affected by options which limit spendability such as " | "thus affected by options which limit spendability such as " | ||||
"-spendzeroconfchange.\n", | "-spendzeroconfchange.\n", | ||||
{ | { | ||||
{"dummy", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, | {"dummy", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, | ||||
"Remains for backward compatibility. Must be excluded or set to " | "Remains for backward compatibility. Must be excluded or set to " | ||||
"\"*\"."}, | "\"*\"."}, | ||||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | static UniValue sendmany(const Config &config, const JSONRPCRequest &request) { | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"sendmany", | "sendmany", | ||||
"\nSend multiple times. Amounts are double-precision " | "Send multiple times. Amounts are double-precision " | ||||
"floating point numbers." + | "floating point numbers." + | ||||
HelpRequiringPassphrase(pwallet) + "\n", | HelpRequiringPassphrase(pwallet) + "\n", | ||||
{ | { | ||||
{"dummy", RPCArg::Type::STR, RPCArg::Optional::NO, | {"dummy", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"Must be set to \"\" for backwards compatibility.", "\"\""}, | "Must be set to \"\" for backwards compatibility.", "\"\""}, | ||||
{ | { | ||||
"amounts", | "amounts", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
▲ Show 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | static UniValue addmultisigaddress(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"addmultisigaddress", | "addmultisigaddress", | ||||
"\nAdd a nrequired-to-sign multisignature address to the wallet. " | "Add a nrequired-to-sign multisignature address to the wallet. " | ||||
"Requires a new wallet backup.\n" | "Requires a new wallet backup.\n" | ||||
"Each key is a Bitcoin address or hex-encoded public key.\n" | "Each key is a Bitcoin address or hex-encoded public key.\n" | ||||
"If 'label' is specified (DEPRECATED), assign address to that label.\n", | "If 'label' is specified (DEPRECATED), assign address to that label.\n", | ||||
{ | { | ||||
{"nrequired", RPCArg::Type::NUM, RPCArg::Optional::NO, | {"nrequired", RPCArg::Type::NUM, RPCArg::Optional::NO, | ||||
"The number of required signatures out of the n keys or " | "The number of required signatures out of the n keys or " | ||||
"addresses."}, | "addresses."}, | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | static UniValue listreceivedbyaddress(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"listreceivedbyaddress", | "listreceivedbyaddress", | ||||
"\nList balances by receiving address.\n", | "List balances by receiving address.\n", | ||||
{ | { | ||||
{"minconf", RPCArg::Type::NUM, /* default */ "1", | {"minconf", RPCArg::Type::NUM, /* default */ "1", | ||||
"The minimum number of confirmations before payments are " | "The minimum number of confirmations before payments are " | ||||
"included."}, | "included."}, | ||||
{"include_empty", RPCArg::Type::BOOL, /* default */ "false", | {"include_empty", RPCArg::Type::BOOL, /* default */ "false", | ||||
"Whether to include addresses that haven't received any " | "Whether to include addresses that haven't received any " | ||||
"payments."}, | "payments."}, | ||||
{"include_watchonly", RPCArg::Type::BOOL, | {"include_watchonly", RPCArg::Type::BOOL, | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | static UniValue listreceivedbylabel(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"listreceivedbylabel", | "listreceivedbylabel", | ||||
"\nList received transactions by label.\n", | "List received transactions by label.\n", | ||||
{ | { | ||||
{"minconf", RPCArg::Type::NUM, /* default */ "1", | {"minconf", RPCArg::Type::NUM, /* default */ "1", | ||||
"The minimum number of confirmations before payments are " | "The minimum number of confirmations before payments are " | ||||
"included."}, | "included."}, | ||||
{"include_empty", RPCArg::Type::BOOL, /* default */ "false", | {"include_empty", RPCArg::Type::BOOL, /* default */ "false", | ||||
"Whether to include labels that haven't received any payments."}, | "Whether to include labels that haven't received any payments."}, | ||||
{"include_watchonly", RPCArg::Type::BOOL, | {"include_watchonly", RPCArg::Type::BOOL, | ||||
/* default */ "true for watch-only wallets, otherwise false", | /* default */ "true for watch-only wallets, otherwise false", | ||||
▲ Show 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | UniValue listtransactions(const Config &config, const JSONRPCRequest &request) { | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"listtransactions", | "listtransactions", | ||||
"\nIf a label name is provided, this will return only incoming " | "If a label name is provided, this will return only incoming " | ||||
"transactions paying to addresses with the specified label.\n" | "transactions paying to addresses with the specified label.\n" | ||||
"\nReturns up to 'count' most recent transactions skipping the first " | "\nReturns up to 'count' most recent transactions skipping the first " | ||||
"'from' transactions.\n", | "'from' transactions.\n", | ||||
{ | { | ||||
{"label", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, | {"label", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, | ||||
"If set, should be a valid label name to return only incoming " | "If set, should be a valid label name to return only incoming " | ||||
"transactions with the specified label, or \"*\" to disable " | "transactions with the specified label, or \"*\" to disable " | ||||
"filtering and return all transactions."}, | "filtering and return all transactions."}, | ||||
▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | static UniValue listsinceblock(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"listsinceblock", | "listsinceblock", | ||||
"\nGet all transactions in blocks since block [blockhash], or all " | "Get all transactions in blocks since block [blockhash], or all " | ||||
"transactions if omitted.\n" | "transactions if omitted.\n" | ||||
"If \"blockhash\" is no longer a part of the main chain, transactions " | "If \"blockhash\" is no longer a part of the main chain, transactions " | ||||
"from the fork point onward are included.\n" | "from the fork point onward are included.\n" | ||||
"Additionally, if include_removed is set, transactions affecting the " | "Additionally, if include_removed is set, transactions affecting the " | ||||
"wallet which were removed are returned in the \"removed\" array.\n", | "wallet which were removed are returned in the \"removed\" array.\n", | ||||
{ | { | ||||
{"blockhash", RPCArg::Type::STR, | {"blockhash", RPCArg::Type::STR, | ||||
RPCArg::Optional::OMITTED_NAMED_ARG, | RPCArg::Optional::OMITTED_NAMED_ARG, | ||||
▲ Show 20 Lines • Show All 190 Lines • ▼ Show 20 Lines | static UniValue gettransaction(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"gettransaction", | "gettransaction", | ||||
"\nGet detailed information about in-wallet transaction <txid>\n", | "Get detailed information about in-wallet transaction <txid>\n", | ||||
{ | { | ||||
{"txid", RPCArg::Type::STR, RPCArg::Optional::NO, | {"txid", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The transaction id"}, | "The transaction id"}, | ||||
{"include_watchonly", RPCArg::Type::BOOL, | {"include_watchonly", RPCArg::Type::BOOL, | ||||
/* default */ "true for watch-only wallets, otherwise false", | /* default */ "true for watch-only wallets, otherwise false", | ||||
"Whether to include watch-only addresses in balance calculation " | "Whether to include watch-only addresses in balance calculation " | ||||
"and details[]"}, | "and details[]"}, | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | static UniValue abandontransaction(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"abandontransaction", | "abandontransaction", | ||||
"\nMark in-wallet transaction <txid> as abandoned\n" | "Mark in-wallet transaction <txid> as abandoned\n" | ||||
"This will mark this transaction and all its in-wallet descendants as " | "This will mark this transaction and all its in-wallet descendants as " | ||||
"abandoned which will allow\n" | "abandoned which will allow\n" | ||||
"for their inputs to be respent. It can be used to replace \"stuck\" " | "for their inputs to be respent. It can be used to replace \"stuck\" " | ||||
"or evicted transactions.\n" | "or evicted transactions.\n" | ||||
"It only works on transactions which are not included in a block and " | "It only works on transactions which are not included in a block and " | ||||
"are not currently in the mempool.\n" | "are not currently in the mempool.\n" | ||||
"It has no effect on transactions which are already abandoned.\n", | "It has no effect on transactions which are already abandoned.\n", | ||||
{ | { | ||||
Show All 38 Lines | static UniValue backupwallet(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"backupwallet", | "backupwallet", | ||||
"\nSafely copies current wallet file to destination, which can be a " | "Safely copies current wallet file to destination, which can be a " | ||||
"directory or a path with filename.\n", | "directory or a path with filename.\n", | ||||
{ | { | ||||
{"destination", RPCArg::Type::STR, RPCArg::Optional::NO, | {"destination", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The destination directory or file"}, | "The destination directory or file"}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResults{}, | ||||
RPCExamples{HelpExampleCli("backupwallet", "\"backup.dat\"") + | RPCExamples{HelpExampleCli("backupwallet", "\"backup.dat\"") + | ||||
HelpExampleRpc("backupwallet", "\"backup.dat\"")}, | HelpExampleRpc("backupwallet", "\"backup.dat\"")}, | ||||
Show All 21 Lines | static UniValue keypoolrefill(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"keypoolrefill", | "keypoolrefill", | ||||
"\nFills the keypool." + HelpRequiringPassphrase(pwallet) + "\n", | "Fills the keypool." + HelpRequiringPassphrase(pwallet) + "\n", | ||||
{ | { | ||||
{"newsize", RPCArg::Type::NUM, /* default */ "100", | {"newsize", RPCArg::Type::NUM, /* default */ "100", | ||||
"The new keypool size"}, | "The new keypool size"}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResults{}, | ||||
RPCExamples{HelpExampleCli("keypoolrefill", "") + | RPCExamples{HelpExampleCli("keypoolrefill", "") + | ||||
HelpExampleRpc("keypoolrefill", "")}, | HelpExampleRpc("keypoolrefill", "")}, | ||||
} | } | ||||
Show All 34 Lines | static UniValue walletpassphrase(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"walletpassphrase", | "walletpassphrase", | ||||
"\nStores the wallet decryption key in memory for 'timeout' seconds.\n" | "Stores the wallet decryption key in memory for 'timeout' seconds.\n" | ||||
"This is needed prior to performing transactions related to private " | "This is needed prior to performing transactions related to private " | ||||
"keys such as sending bitcoins\n" | "keys such as sending bitcoins\n" | ||||
"\nNote:\n" | "\nNote:\n" | ||||
"Issuing the walletpassphrase command while the wallet is already " | "Issuing the walletpassphrase command while the wallet is already " | ||||
"unlocked will set a new unlock\n" | "unlocked will set a new unlock\n" | ||||
"time that overrides the old one.\n", | "time that overrides the old one.\n", | ||||
{ | { | ||||
{"passphrase", RPCArg::Type::STR, RPCArg::Optional::NO, | {"passphrase", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | static UniValue walletpassphrasechange(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"walletpassphrasechange", | "walletpassphrasechange", | ||||
"\nChanges the wallet passphrase from 'oldpassphrase' to " | "Changes the wallet passphrase from 'oldpassphrase' to " | ||||
"'newpassphrase'.\n", | "'newpassphrase'.\n", | ||||
{ | { | ||||
{"oldpassphrase", RPCArg::Type::STR, RPCArg::Optional::NO, | {"oldpassphrase", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The current passphrase"}, | "The current passphrase"}, | ||||
{"newpassphrase", RPCArg::Type::STR, RPCArg::Optional::NO, | {"newpassphrase", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The new passphrase"}, | "The new passphrase"}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResults{}, | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | static UniValue walletlock(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"walletlock", | "walletlock", | ||||
"\nRemoves the wallet encryption key from memory, locking the wallet.\n" | "Removes the wallet encryption key from memory, locking the wallet.\n" | ||||
"After calling this method, you will need to call walletpassphrase " | "After calling this method, you will need to call walletpassphrase " | ||||
"again\n" | "again\n" | ||||
"before being able to call any methods which require the wallet to be " | "before being able to call any methods which require the wallet to be " | ||||
"unlocked.\n", | "unlocked.\n", | ||||
{}, | {}, | ||||
RPCResults{}, | RPCResults{}, | ||||
RPCExamples{ | RPCExamples{ | ||||
"\nSet the passphrase for 2 minutes to perform a transaction\n" + | "\nSet the passphrase for 2 minutes to perform a transaction\n" + | ||||
Show All 29 Lines | static UniValue encryptwallet(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"encryptwallet", | "encryptwallet", | ||||
"\nEncrypts the wallet with 'passphrase'. This is for first time " | "Encrypts the wallet with 'passphrase'. This is for first time " | ||||
"encryption.\n" | "encryption.\n" | ||||
"After this, any calls that interact with private keys such as sending " | "After this, any calls that interact with private keys such as sending " | ||||
"or signing \n" | "or signing \n" | ||||
"will require the passphrase to be set prior the making these calls.\n" | "will require the passphrase to be set prior the making these calls.\n" | ||||
"Use the walletpassphrase call for this, and then walletlock call.\n" | "Use the walletpassphrase call for this, and then walletlock call.\n" | ||||
"If the wallet is already encrypted, use the walletpassphrasechange " | "If the wallet is already encrypted, use the walletpassphrasechange " | ||||
"call.\n", | "call.\n", | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | static UniValue lockunspent(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"lockunspent", | "lockunspent", | ||||
"\nUpdates list of temporarily unspendable outputs.\n" | "Updates list of temporarily unspendable outputs.\n" | ||||
"Temporarily lock (unlock=false) or unlock (unlock=true) specified " | "Temporarily lock (unlock=false) or unlock (unlock=true) specified " | ||||
"transaction outputs.\n" | "transaction outputs.\n" | ||||
"If no transaction outputs are specified when unlocking then all " | "If no transaction outputs are specified when unlocking then all " | ||||
"current locked transaction outputs are unlocked.\n" | "current locked transaction outputs are unlocked.\n" | ||||
"A locked transaction output will not be chosen by automatic coin " | "A locked transaction output will not be chosen by automatic coin " | ||||
"selection, when spending bitcoins.\n" | "selection, when spending bitcoins.\n" | ||||
"Locks are stored in memory only. Nodes start with zero locked " | "Locks are stored in memory only. Nodes start with zero locked " | ||||
"outputs, and the locked output list\n" | "outputs, and the locked output list\n" | ||||
▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | static UniValue listlockunspent(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"listlockunspent", | "listlockunspent", | ||||
"\nReturns list of temporarily unspendable outputs.\n" | "Returns list of temporarily unspendable outputs.\n" | ||||
"See the lockunspent call to lock and unlock transactions for " | "See the lockunspent call to lock and unlock transactions for " | ||||
"spending.\n", | "spending.\n", | ||||
{}, | {}, | ||||
RPCResult{ | RPCResult{ | ||||
"[\n" | "[\n" | ||||
" {\n" | " {\n" | ||||
" \"txid\" : \"transactionid\", (string) The transaction id " | " \"txid\" : \"transactionid\", (string) The transaction id " | ||||
"locked\n" | "locked\n" | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | static UniValue settxfee(const Config &config, const JSONRPCRequest &request) { | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"settxfee", | "settxfee", | ||||
"\nSet the transaction fee per kB for this wallet. Overrides the " | "Set the transaction fee per kB for this wallet. Overrides the " | ||||
"global -paytxfee command line parameter.\n", | "global -paytxfee command line parameter.\n", | ||||
{ | { | ||||
{"amount", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, | {"amount", RPCArg::Type::AMOUNT, RPCArg::Optional::NO, | ||||
"The transaction fee in " + CURRENCY_UNIT + "/kB"}, | "The transaction fee in " + CURRENCY_UNIT + "/kB"}, | ||||
}, | }, | ||||
RPCResult{"true|false (boolean) Returns true if successful\n"}, | RPCResult{"true|false (boolean) Returns true if successful\n"}, | ||||
RPCExamples{HelpExampleCli("settxfee", "0.00001") + | RPCExamples{HelpExampleCli("settxfee", "0.00001") + | ||||
HelpExampleRpc("settxfee", "0.00001")}, | HelpExampleRpc("settxfee", "0.00001")}, | ||||
▲ Show 20 Lines • Show All 289 Lines • ▼ Show 20 Lines | static UniValue listwallets(const Config &config, | ||||
return obj; | return obj; | ||||
} | } | ||||
static UniValue loadwallet(const Config &config, | static UniValue loadwallet(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"loadwallet", | "loadwallet", | ||||
"\nLoads a wallet from a wallet file or directory." | "Loads a wallet from a wallet file or directory." | ||||
"\nNote that all wallet command-line options used when starting " | "\nNote that all wallet command-line options used when starting " | ||||
"bitcoind will be" | "bitcoind will be" | ||||
"\napplied to the new wallet (eg -zapwallettxes, upgradewallet, " | "\napplied to the new wallet (eg -zapwallettxes, upgradewallet, " | ||||
"rescan, etc).\n", | "rescan, etc).\n", | ||||
{ | { | ||||
{"filename", RPCArg::Type::STR, RPCArg::Optional::NO, | {"filename", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The wallet directory or .dat file."}, | "The wallet directory or .dat file."}, | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | static UniValue setwalletflag(const Config &config, | ||||
std::string flags = ""; | std::string flags = ""; | ||||
for (auto &it : WALLET_FLAG_MAP) { | for (auto &it : WALLET_FLAG_MAP) { | ||||
if (it.second & MUTABLE_WALLET_FLAGS) { | if (it.second & MUTABLE_WALLET_FLAGS) { | ||||
flags += (flags == "" ? "" : ", ") + it.first; | flags += (flags == "" ? "" : ", ") + it.first; | ||||
} | } | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"setwalletflag", | "setwalletflag", | ||||
"\nChange the state of the given wallet flag for a wallet.\n", | "Change the state of the given wallet flag for a wallet.\n", | ||||
{ | { | ||||
{"flag", RPCArg::Type::STR, RPCArg::Optional::NO, | {"flag", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The name of the flag to change. Current available flags: " + | "The name of the flag to change. Current available flags: " + | ||||
flags}, | flags}, | ||||
{"value", RPCArg::Type::BOOL, /* default */ "true", | {"value", RPCArg::Type::BOOL, /* default */ "true", | ||||
"The new state."}, | "The new state."}, | ||||
}, | }, | ||||
RPCResult{ | RPCResult{ | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | static UniValue setwalletflag(const Config &config, | ||||
return res; | return res; | ||||
} | } | ||||
static UniValue createwallet(const Config &config, | static UniValue createwallet(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"createwallet", | "createwallet", | ||||
"\nCreates and loads a new wallet.\n", | "Creates and loads a new wallet.\n", | ||||
{ | { | ||||
{"wallet_name", RPCArg::Type::STR, RPCArg::Optional::NO, | {"wallet_name", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The name for the new wallet. If this is a path, the wallet will " | "The name for the new wallet. If this is a path, the wallet will " | ||||
"be created at the path location."}, | "be created at the path location."}, | ||||
{"disable_private_keys", RPCArg::Type::BOOL, /* default */ "false", | {"disable_private_keys", RPCArg::Type::BOOL, /* default */ "false", | ||||
"Disable the possibility of private keys (only watchonlys are " | "Disable the possibility of private keys (only watchonlys are " | ||||
"possible in this mode)."}, | "possible in this mode)."}, | ||||
{"blank", RPCArg::Type::BOOL, /* default */ "false", | {"blank", RPCArg::Type::BOOL, /* default */ "false", | ||||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | static UniValue listunspent(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"listunspent", | "listunspent", | ||||
"\nReturns array of unspent transaction outputs\n" | "Returns array of unspent transaction outputs\n" | ||||
"with between minconf and maxconf (inclusive) confirmations.\n" | "with between minconf and maxconf (inclusive) confirmations.\n" | ||||
"Optionally filter to only include txouts paid to specified " | "Optionally filter to only include txouts paid to specified " | ||||
"addresses.\n", | "addresses.\n", | ||||
{ | { | ||||
{"minconf", RPCArg::Type::NUM, /* default */ "1", | {"minconf", RPCArg::Type::NUM, /* default */ "1", | ||||
"The minimum confirmations to filter"}, | "The minimum confirmations to filter"}, | ||||
{"maxconf", RPCArg::Type::NUM, /* default */ "9999999", | {"maxconf", RPCArg::Type::NUM, /* default */ "9999999", | ||||
"The maximum confirmations to filter"}, | "The maximum confirmations to filter"}, | ||||
▲ Show 20 Lines • Show All 344 Lines • ▼ Show 20 Lines | static UniValue fundrawtransaction(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"fundrawtransaction", | "fundrawtransaction", | ||||
"\nAdd inputs to a transaction until it has enough in value to meet " | "Add inputs to a transaction until it has enough in value to meet " | ||||
"its out value.\n" | "its out value.\n" | ||||
"This will not modify existing inputs, and will add at most one change " | "This will not modify existing inputs, and will add at most one change " | ||||
"output to the outputs.\n" | "output to the outputs.\n" | ||||
"No existing outputs will be modified unless " | "No existing outputs will be modified unless " | ||||
"\"subtractFeeFromOutputs\" is specified.\n" | "\"subtractFeeFromOutputs\" is specified.\n" | ||||
"Note that inputs which were signed may need to be resigned after " | "Note that inputs which were signed may need to be resigned after " | ||||
"completion since in/outputs have been added.\n" | "completion since in/outputs have been added.\n" | ||||
"The inputs added will not be signed, use signrawtransactionwithkey or " | "The inputs added will not be signed, use signrawtransactionwithkey or " | ||||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | UniValue signrawtransactionwithwallet(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"signrawtransactionwithwallet", | "signrawtransactionwithwallet", | ||||
"\nSign inputs for raw transaction (serialized, hex-encoded).\n" | "Sign inputs for raw transaction (serialized, hex-encoded).\n" | ||||
"The second optional argument (may be null) is an array of previous " | "The second optional argument (may be null) is an array of previous " | ||||
"transaction outputs that\n" | "transaction outputs that\n" | ||||
"this transaction depends on but may not yet be in the block chain.\n" + | "this transaction depends on but may not yet be in the block chain.\n" + | ||||
HelpRequiringPassphrase(pwallet) + "\n", | HelpRequiringPassphrase(pwallet) + "\n", | ||||
{ | { | ||||
{"hexstring", RPCArg::Type::STR, RPCArg::Optional::NO, | {"hexstring", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The transaction hex string"}, | "The transaction hex string"}, | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | UniValue rescanblockchain(const Config &config, const JSONRPCRequest &request) { | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"rescanblockchain", | "rescanblockchain", | ||||
"\nRescan the local blockchain for wallet related transactions.\n", | "Rescan the local blockchain for wallet related transactions.\n", | ||||
{ | { | ||||
{"start_height", RPCArg::Type::NUM, /* default */ "0", | {"start_height", RPCArg::Type::NUM, /* default */ "0", | ||||
"block height where the rescan should start"}, | "block height where the rescan should start"}, | ||||
{"stop_height", RPCArg::Type::NUM, | {"stop_height", RPCArg::Type::NUM, | ||||
RPCArg::Optional::OMITTED_NAMED_ARG, | RPCArg::Optional::OMITTED_NAMED_ARG, | ||||
"the last block height that should be scanned"}, | "the last block height that should be scanned"}, | ||||
}, | }, | ||||
RPCResult{"{\n" | RPCResult{"{\n" | ||||
▲ Show 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | UniValue getaddressinfo(const Config &config, const JSONRPCRequest &request) { | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"getaddressinfo", | "getaddressinfo", | ||||
"\nReturn information about the given bitcoin address. Some " | "Return information about the given bitcoin address. Some " | ||||
"information requires the address\n" | "information requires the address\n" | ||||
"to be in the wallet.\n", | "to be in the wallet.\n", | ||||
{ | { | ||||
{"address", RPCArg::Type::STR, RPCArg::Optional::NO, | {"address", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The bitcoin address to get the information of."}, | "The bitcoin address to get the information of."}, | ||||
}, | }, | ||||
RPCResult{ | RPCResult{ | ||||
"{\n" | "{\n" | ||||
▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | UniValue getaddressesbylabel(const Config &config, | ||||
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"getaddressesbylabel", | "getaddressesbylabel", | ||||
"\nReturns the list of addresses assigned the specified label.\n", | "Returns the list of addresses assigned the specified label.\n", | ||||
{ | { | ||||
{"label", RPCArg::Type::STR, RPCArg::Optional::NO, "The label."}, | {"label", RPCArg::Type::STR, RPCArg::Optional::NO, "The label."}, | ||||
}, | }, | ||||
RPCResult{ | RPCResult{ | ||||
"{ (json object with addresses as keys)\n" | "{ (json object with addresses as keys)\n" | ||||
" \"address\": { (json object with information about address)\n" | " \"address\": { (json object with information about address)\n" | ||||
" \"purpose\": \"string\" (string) Purpose of address " | " \"purpose\": \"string\" (string) Purpose of address " | ||||
"(\"send\" for sending address, \"receive\" for receiving " | "(\"send\" for sending address, \"receive\" for receiving " | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | UniValue listlabels(const Config &config, const JSONRPCRequest &request) { | ||||
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request); | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"listlabels", | "listlabels", | ||||
"\nReturns the list of all labels, or labels that are assigned to " | "Returns the list of all labels, or labels that are assigned to " | ||||
"addresses with a specific purpose.\n", | "addresses with a specific purpose.\n", | ||||
{ | { | ||||
{"purpose", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, | {"purpose", RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, | ||||
"Address purpose to list labels for ('send','receive'). An empty " | "Address purpose to list labels for ('send','receive'). An empty " | ||||
"string is the same as not providing this argument."}, | "string is the same as not providing this argument."}, | ||||
}, | }, | ||||
RPCResult{"[ (json array of string)\n" | RPCResult{"[ (json array of string)\n" | ||||
" \"label\", (string) Label name\n" | " \"label\", (string) Label name\n" | ||||
Show All 38 Lines | static UniValue sethdseed(const Config &config, const JSONRPCRequest &request) { | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"sethdseed", | "sethdseed", | ||||
"\nSet or generate a new HD wallet seed. Non-HD wallets will not be " | "Set or generate a new HD wallet seed. Non-HD wallets will not be " | ||||
"upgraded to being a HD wallet. Wallets that are already\n" | "upgraded to being a HD wallet. Wallets that are already\n" | ||||
"HD will have a new HD seed set so that new keys added to the keypool " | "HD will have a new HD seed set so that new keys added to the keypool " | ||||
"will be derived from this new seed.\n" | "will be derived from this new seed.\n" | ||||
"\nNote that you will need to MAKE A NEW BACKUP of your wallet after " | "\nNote that you will need to MAKE A NEW BACKUP of your wallet after " | ||||
"setting the HD wallet seed.\n" + | "setting the HD wallet seed.\n" + | ||||
HelpRequiringPassphrase(pwallet) + "\n", | HelpRequiringPassphrase(pwallet) + "\n", | ||||
{ | { | ||||
{"newkeypool", RPCArg::Type::BOOL, /* default */ "true", | {"newkeypool", RPCArg::Type::BOOL, /* default */ "true", | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | static UniValue walletprocesspsbt(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"walletprocesspsbt", | "walletprocesspsbt", | ||||
"\nUpdate a PSBT with input information from our wallet and then sign " | "Update a PSBT with input information from our wallet and then sign " | ||||
"inputs that we can sign for." + | "inputs that we can sign for." + | ||||
HelpRequiringPassphrase(pwallet) + "\n", | HelpRequiringPassphrase(pwallet) + "\n", | ||||
{ | { | ||||
{"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, | {"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, | ||||
"The transaction base64 string"}, | "The transaction base64 string"}, | ||||
{"sign", RPCArg::Type::BOOL, /* default */ "true", | {"sign", RPCArg::Type::BOOL, /* default */ "true", | ||||
"Also sign the transaction when updating"}, | "Also sign the transaction when updating"}, | ||||
{"sighashtype", RPCArg::Type::STR, /* default */ "ALL|FORKID", | {"sighashtype", RPCArg::Type::STR, /* default */ "ALL|FORKID", | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | static UniValue walletcreatefundedpsbt(const Config &config, | ||||
CWallet *const pwallet = wallet.get(); | CWallet *const pwallet = wallet.get(); | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"walletcreatefundedpsbt", | "walletcreatefundedpsbt", | ||||
"\nCreates and funds a transaction in the Partially Signed Transaction " | "Creates and funds a transaction in the Partially Signed Transaction " | ||||
"format. Inputs will be added if supplied inputs are not enough\n" | "format. Inputs will be added if supplied inputs are not enough\n" | ||||
"Implements the Creator and Updater roles.\n", | "Implements the Creator and Updater roles.\n", | ||||
{ | { | ||||
{ | { | ||||
"inputs", | "inputs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
RPCArg::Optional::NO, | RPCArg::Optional::NO, | ||||
"A json array of json objects", | "A json array of json objects", | ||||
▲ Show 20 Lines • Show All 218 Lines • Show Last 20 Lines |