Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 159 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 2) { | if (request.fHelp || request.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"getnewaddress ( \"label\" )\n" | RPCHelpMan{ | ||||
"getnewaddress", | |||||
"\nReturns a new Bitcoin address for receiving payments.\n" | "\nReturns 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, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"label\" (string, optional) The label name for the " | "1. \"label\" (string, optional) The label name for the " | ||||
"address to be linked to. If not provided, the default label \"\" " | "address to be linked to. If not provided, the default label \"\" " | ||||
"is used. It can also be set to the empty string \"\" to represent " | "is used. It can also be set to the empty string \"\" to represent " | ||||
"the default label. The label does not need to exist, it will be " | "the default label. The label does not need to exist, it will be " | ||||
"created if there is no label by the given name.\n" | "created if there is no label by the given name.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"\"address\" (string) The new bitcoin address\n" | "\"address\" (string) The new bitcoin address\n" | ||||
▲ Show 20 Lines • Show All 54 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 1) { | if (request.fHelp || request.params.size() > 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"getrawchangeaddress\n" | RPCHelpMan{ | ||||
"getrawchangeaddress", | |||||
"\nReturns a new Bitcoin address, for receiving change.\n" | "\nReturns 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", | ||||
{}} | |||||
.ToString() + | |||||
"\nResult:\n" | "\nResult:\n" | ||||
"\"address\" (string) The address\n" | "\"address\" (string) The address\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("getrawchangeaddress", "") + | HelpExampleCli("getrawchangeaddress", "") + | ||||
HelpExampleRpc("getrawchangeaddress", "")); | HelpExampleRpc("getrawchangeaddress", "")); | ||||
} | } | ||||
// Belt and suspenders check for disabled private keys | // Belt and suspenders check for disabled private keys | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 2) { | if (request.fHelp || request.params.size() != 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"setlabel \"address\" \"label\"\n" | RPCHelpMan{"setlabel", | ||||
"\nSets the label associated with the given address.\n" | "\nSets the label associated with the given address.\n", | ||||
{ | |||||
{"address", RPCArg::Type::STR, false}, | |||||
{"label", RPCArg::Type::STR, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"address\" (string, required) The bitcoin address to " | "1. \"address\" (string, required) The bitcoin address to " | ||||
"be associated with a label.\n" | "be associated with a label.\n" | ||||
"2. \"label\" (string, required) The label to assign to " | "2. \"label\" (string, required) The label to assign to " | ||||
"the address.\n" | "the address.\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("setlabel", | HelpExampleCli("setlabel", | ||||
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"tabby\"") + | "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"tabby\"") + | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | static UniValue sendtoaddress(const Config &config, | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 2 || | if (request.fHelp || request.params.size() < 2 || | ||||
request.params.size() > 5) { | request.params.size() > 5) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"sendtoaddress \"address\" amount ( \"comment\" \"comment_to\" " | RPCHelpMan{"sendtoaddress", | ||||
"subtractfeefromamount )\n" | "\nSend an amount to a given address.\n", | ||||
"\nSend an amount to a given address.\n" + | { | ||||
{"address", RPCArg::Type::STR, false}, | |||||
{"amount", RPCArg::Type::AMOUNT, false}, | |||||
{"comment", RPCArg::Type::STR, true}, | |||||
{"comment_to", RPCArg::Type::STR, true}, | |||||
{"subtractfeefromamount", RPCArg::Type::BOOL, true}, | |||||
}} | |||||
.ToString() + | |||||
HelpRequiringPassphrase(pwallet) + | HelpRequiringPassphrase(pwallet) + | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"address\" (string, required) The bitcoin address " | "1. \"address\" (string, required) The bitcoin address " | ||||
"to send to.\n" | "to send to.\n" | ||||
"2. \"amount\" (numeric or string, required) The " | "2. \"amount\" (numeric or string, required) The " | ||||
"amount in " + | "amount in " + | ||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
" to send. eg 0.1\n" | " to send. eg 0.1\n" | ||||
▲ Show 20 Lines • Show All 73 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 0) { | if (request.fHelp || request.params.size() != 0) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"listaddressgroupings\n" | RPCHelpMan{"listaddressgroupings", | ||||
"\nLists groups of addresses which have had their common " | "\nLists groups of addresses which have had their " | ||||
"ownership\n" | "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 " | ||||
"in past transactions\n" | "resulting change\n" | ||||
"in past transactions\n", | |||||
{}} | |||||
.ToString() + | |||||
"\nResult:\n" | "\nResult:\n" | ||||
"[\n" | "[\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 " + | ||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
"\n" | "\n" | ||||
▲ Show 20 Lines • Show All 45 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 2) { | if (request.fHelp || request.params.size() != 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"signmessage \"address\" \"message\"\n" | RPCHelpMan{"signmessage", | ||||
"\nSign a message with the private key of an address" + | "\nSign a message with the private key of an address", | ||||
{ | |||||
{"address", RPCArg::Type::STR, false}, | |||||
{"message", RPCArg::Type::STR, false}, | |||||
}} | |||||
.ToString() + | |||||
HelpRequiringPassphrase(pwallet) + | HelpRequiringPassphrase(pwallet) + | ||||
"\n" | "\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"address\" (string, required) The bitcoin address to " | "1. \"address\" (string, required) The bitcoin address to " | ||||
"use for the private key.\n" | "use for the private key.\n" | ||||
"2. \"message\" (string, required) The message to create a " | "2. \"message\" (string, required) The message to create a " | ||||
"signature of.\n" | "signature of.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | static UniValue getreceivedbyaddress(const Config &config, | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 2) { | request.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"getreceivedbyaddress \"address\" ( minconf )\n" | RPCHelpMan{ | ||||
"getreceivedbyaddress", | |||||
"\nReturns the total amount received by the given address in " | "\nReturns 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, false}, | |||||
{"minconf", RPCArg::Type::NUM, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"address\" (string, required) The bitcoin address for " | "1. \"address\" (string, required) The bitcoin address for " | ||||
"transactions.\n" | "transactions.\n" | ||||
"2. minconf (numeric, optional, default=1) Only " | "2. minconf (numeric, optional, default=1) Only " | ||||
"include transactions confirmed at least this many times.\n" | "include transactions confirmed at least this many times.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"amount (numeric) The total amount in " + | "amount (numeric) The total amount in " + | ||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | static UniValue getreceivedbylabel(const Config &config, | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 2) { | request.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"getreceivedbylabel \"label\" ( minconf )\n" | RPCHelpMan{ | ||||
"\nReturns the total amount received by addresses with <label> in " | "getreceivedbylabel", | ||||
"transactions with at least [minconf] confirmations.\n" | "\nReturns the total amount received by addresses with <label> " | ||||
"in transactions with at least [minconf] confirmations.\n", | |||||
{ | |||||
{"label", RPCArg::Type::STR, false}, | |||||
{"minconf", RPCArg::Type::NUM, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"label\" (string, required) The selected label, may be " | "1. \"label\" (string, required) The selected label, may be " | ||||
"the default label using \"\".\n" | "the default label using \"\".\n" | ||||
"2. minconf (numeric, optional, default=1) Only include " | "2. minconf (numeric, optional, default=1) Only include " | ||||
"transactions confirmed at least this many times.\n" | "transactions confirmed at least this many times.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"amount (numeric) The total amount in " + | "amount (numeric) The total amount in " + | ||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
▲ Show 20 Lines • Show All 62 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; | ||||
} | } | ||||
if (request.fHelp || (request.params.size() > 3)) { | if (request.fHelp || (request.params.size() > 3)) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"getbalance ( \"dummy\" minconf include_watchonly )\n" | RPCHelpMan{"getbalance", | ||||
"\nReturns the total available balance.\n" | "\nReturns the total available balance.\n" | ||||
"The available balance is what the wallet considers " | "The available balance is what the wallet considers " | ||||
"currently spendable, and is\n" | "currently spendable, and is\n" | ||||
"thus affected by options which limit spendability such " | "thus affected by options which limit spendability such " | ||||
"as -spendzeroconfchange.\n" | "as -spendzeroconfchange.\n", | ||||
{ | |||||
{"dummy", RPCArg::Type::STR, true}, | |||||
{"minconf", RPCArg::Type::NUM, true}, | |||||
{"include_watchonly", RPCArg::Type::BOOL, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. (dummy) (string, optional) Remains for " | "1. (dummy) (string, optional) Remains for " | ||||
"backward compatibility. Must be excluded or set to " | "backward compatibility. Must be excluded or set to " | ||||
"\"*\".\n" | "\"*\".\n" | ||||
"2. minconf (numeric, optional, default=0) " | "2. minconf (numeric, optional, default=0) " | ||||
"Only include transactions confirmed at least this many " | "Only include transactions confirmed at least this many " | ||||
"times.\n" | "times.\n" | ||||
"3. include_watchonly (bool, optional, default=false) Also include " | "3. include_watchonly (bool, optional, default=false) Also include " | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | static UniValue getunconfirmedbalance(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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 0) { | if (request.fHelp || request.params.size() > 0) { | ||||
throw std::runtime_error( | throw std::runtime_error(RPCHelpMan{ | ||||
"getunconfirmedbalance\n" | "getunconfirmedbalance", | ||||
"Returns the server's total unconfirmed balance\n"); | "Returns the server's total unconfirmed balance\n", | ||||
{}}.ToString()); | |||||
} | } | ||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
auto locked_chain = pwallet->chain().lock(); | auto locked_chain = pwallet->chain().lock(); | ||||
LOCK(pwallet->cs_wallet); | LOCK(pwallet->cs_wallet); | ||||
return ValueFromAmount(pwallet->GetUnconfirmedBalance()); | return ValueFromAmount(pwallet->GetUnconfirmedBalance()); | ||||
} | } | ||||
static UniValue sendmany(const Config &config, const JSONRPCRequest &request) { | static UniValue sendmany(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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 2 || | if (request.fHelp || request.params.size() < 2 || | ||||
request.params.size() > 5) { | request.params.size() > 5) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"sendmany \"dummy\" {\"address\":amount,...} ( minconf \"comment\" " | RPCHelpMan{"sendmany", | ||||
"[\"address\",...] )\n" | "\nSend multiple times. Amounts are double-precision " | ||||
"\nSend multiple times. Amounts are double-precision floating " | "floating point numbers.\n", | ||||
"point numbers.\n" + | { | ||||
{"dummy", RPCArg::Type::STR, false, "\"\""}, | |||||
{"amounts", | |||||
RPCArg::Type::OBJ, | |||||
{ | |||||
{"address", RPCArg::Type::AMOUNT, false}, | |||||
}, | |||||
false}, | |||||
{"minconf", RPCArg::Type::NUM, true}, | |||||
{"comment", RPCArg::Type::STR, true}, | |||||
{"subtractfeefrom", | |||||
RPCArg::Type::ARR, | |||||
{ | |||||
{"address", RPCArg::Type::STR, true}, | |||||
}, | |||||
true}, | |||||
}} | |||||
.ToString() + | |||||
HelpRequiringPassphrase(pwallet) + | HelpRequiringPassphrase(pwallet) + | ||||
"\n" | "\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"dummy\" (string, required) Must be set to \"\" " | "1. \"dummy\" (string, required) Must be set to \"\" " | ||||
"for backwards compatibility.\n" | "for backwards compatibility.\n" | ||||
"2. \"amounts\" (string, required) A json object with " | "2. \"amounts\" (string, required) A json object with " | ||||
"addresses and amounts\n" | "addresses and amounts\n" | ||||
" {\n" | " {\n" | ||||
▲ Show 20 Lines • Show All 426 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 4) { | if (request.fHelp || request.params.size() > 4) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"listreceivedbyaddress ( minconf include_empty include_watchonly " | RPCHelpMan{"listreceivedbyaddress", | ||||
"address_filter )\n" | "\nList balances by receiving address.\n", | ||||
"\nList balances by receiving address.\n" | { | ||||
{"minconf", RPCArg::Type::NUM, true}, | |||||
{"include_empty", RPCArg::Type::BOOL, true}, | |||||
{"include_watchonly", RPCArg::Type::BOOL, true}, | |||||
{"address_filter", RPCArg::Type::STR, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. minconf (numeric, optional, default=1) The minimum " | "1. minconf (numeric, optional, default=1) The minimum " | ||||
"number of confirmations before payments are included.\n" | "number of confirmations before payments are included.\n" | ||||
"2. include_empty (bool, optional, default=false) Whether to " | "2. include_empty (bool, optional, default=false) Whether to " | ||||
"include addresses that haven't received any payments.\n" | "include addresses that haven't received any payments.\n" | ||||
"3. include_watchonly (bool, optional, default=false) Whether to " | "3. include_watchonly (bool, optional, default=false) Whether to " | ||||
"include watch-only addresses (see 'importaddress').\n" | "include watch-only addresses (see 'importaddress').\n" | ||||
"4. address_filter (string, optional) If present, only return " | "4. address_filter (string, optional) If present, only return " | ||||
▲ Show 20 Lines • Show All 47 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 3) { | if (request.fHelp || request.params.size() > 3) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"listreceivedbylabel ( minconf include_empty include_watchonly)\n" | RPCHelpMan{"listreceivedbylabel", | ||||
"\nList received transactions by label.\n" | "\nList received transactions by label.\n", | ||||
{ | |||||
{"minconf", RPCArg::Type::NUM, true}, | |||||
{"include_empty", RPCArg::Type::BOOL, true}, | |||||
{"include_watchonly", RPCArg::Type::BOOL, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. minconf (numeric, optional, default=1) The minimum " | "1. minconf (numeric, optional, default=1) The minimum " | ||||
"number of confirmations before payments are included.\n" | "number of confirmations before payments are included.\n" | ||||
"2. include_empty (bool, optional, default=false) Whether to " | "2. include_empty (bool, optional, default=false) Whether to " | ||||
"include labels that haven't received any payments.\n" | "include labels that haven't received any payments.\n" | ||||
"3. include_watchonly (bool, optional, default=false) Whether to " | "3. include_watchonly (bool, optional, default=false) Whether to " | ||||
"include watch-only addresses (see 'importaddress').\n" | "include watch-only addresses (see 'importaddress').\n" | ||||
▲ Show 20 Lines • Show All 130 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 4) { | if (request.fHelp || request.params.size() > 4) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"listtransactions ( \"label\" count skip include_watchonly )\n" | RPCHelpMan{ | ||||
"listtransactions", | |||||
"\nIf a label name is provided, this will return only incoming " | "\nIf 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 " | "\nReturns up to 'count' most recent transactions skipping the " | ||||
"first 'from' transactions.\n" | "first 'from' transactions.\n", | ||||
{ | |||||
{"label", RPCArg::Type::STR, true}, | |||||
{"count", RPCArg::Type::NUM, true}, | |||||
{"skip", RPCArg::Type::NUM, true}, | |||||
{"include_watchonly", RPCArg::Type::BOOL, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"label\" (string, optional) If set, should be a valid " | "1. \"label\" (string, optional) If set, should be a valid " | ||||
"label name to return only incoming transactions with the " | "label name to return only incoming transactions with the " | ||||
"specified label, or \"*\" to disable filtering and return all " | "specified label, or \"*\" to disable filtering and return all " | ||||
"transactions.\n" | "transactions.\n" | ||||
"2. count (numeric, optional, default=10) The number of " | "2. count (numeric, optional, default=10) The number of " | ||||
"transactions to return\n" | "transactions to return\n" | ||||
"3. skip (numeric, optional, default=0) The number of " | "3. skip (numeric, optional, default=0) The number of " | ||||
▲ Show 20 Lines • Show All 149 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 4) { | if (request.fHelp || request.params.size() > 4) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"listsinceblock ( \"blockhash\" target_confirmations " | RPCHelpMan{ | ||||
"include_watchonly include_removed )\n" | "listsinceblock", | ||||
"\nGet all transactions in blocks since block [blockhash], or all " | "\nGet all transactions in blocks since block [blockhash], or " | ||||
"transactions if omitted.\n" | "all transactions if omitted.\n" | ||||
"If \"blockhash\" is no longer a part of the main chain, " | "If \"blockhash\" is no longer a part of the main chain, " | ||||
"transactions from the fork point onward are included.\n" | "transactions from the fork point onward are included.\n" | ||||
"Additionally, if include_removed is set, transactions affecting " | "Additionally, if include_removed is set, transactions " | ||||
"the wallet which were removed are returned in the \"removed\" " | "affecting the wallet which were removed are returned in the " | ||||
"array.\n" | "\"removed\" array.\n", | ||||
{ | |||||
{"blockhash", RPCArg::Type::STR, true}, | |||||
{"target_confirmations", RPCArg::Type::NUM, true}, | |||||
{"include_watchonly", RPCArg::Type::BOOL, true}, | |||||
{"include_removed", RPCArg::Type::BOOL, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"blockhash\" (string, optional) The block hash to " | "1. \"blockhash\" (string, optional) The block hash to " | ||||
"list transactions since\n" | "list transactions since\n" | ||||
"2. target_confirmations: (numeric, optional, default=1) Return " | "2. target_confirmations: (numeric, optional, default=1) Return " | ||||
"the nth block hash from the main chain. e.g. 1 would mean the " | "the nth block hash from the main chain. e.g. 1 would mean the " | ||||
"best block hash. Note: this is not used as a filter, but only " | "best block hash. Note: this is not used as a filter, but only " | ||||
"affects [lastblock] in the return value\n" | "affects [lastblock] in the return value\n" | ||||
"3. include_watchonly: (bool, optional, default=false) " | "3. include_watchonly: (bool, optional, default=false) " | ||||
▲ Show 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | static UniValue gettransaction(const Config &config, | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 2) { | request.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"gettransaction \"txid\" ( include_watchonly )\n" | RPCHelpMan{"gettransaction", | ||||
"\nGet detailed information about in-wallet transaction <txid>\n" | "\nGet detailed information about in-wallet transaction " | ||||
"<txid>\n", | |||||
{ | |||||
{"txid", RPCArg::Type::STR, false}, | |||||
{"include_watchonly", RPCArg::Type::BOOL, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"txid\" (string, required) The transaction " | "1. \"txid\" (string, required) The transaction " | ||||
"id\n" | "id\n" | ||||
"2. \"include_watchonly\" (bool, optional, default=false) " | "2. \"include_watchonly\" (bool, optional, default=false) " | ||||
"Whether to include watch-only addresses in balance calculation " | "Whether to include watch-only addresses in balance calculation " | ||||
"and details[]\n" | "and details[]\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"{\n" | "{\n" | ||||
▲ Show 20 Lines • Show All 118 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"abandontransaction \"txid\"\n" | RPCHelpMan{"abandontransaction", | ||||
"\nMark in-wallet transaction <txid> as abandoned\n" | "\nMark in-wallet transaction <txid> as abandoned\n" | ||||
"This will mark this transaction and all its in-wallet descendants " | "This will mark this transaction and all its in-wallet " | ||||
"as abandoned which will allow\n" | "descendants as abandoned which will allow\n" | ||||
"for their inputs to be respent. It can be used to replace " | "for their inputs to be respent. It can be used to " | ||||
"\"stuck\" or evicted transactions.\n" | "replace \"stuck\" or evicted transactions.\n" | ||||
"It only works on transactions which are not included in a block " | "It only works on transactions which are not included " | ||||
"and are not currently in the mempool.\n" | "in a block and 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", | |||||
{ | |||||
{"txid", RPCArg::Type::STR_HEX, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"txid\" (string, required) The transaction id\n" | "1. \"txid\" (string, required) The transaction id\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("abandontransaction", "\"1075db55d416d3ca199f55b6084" | HelpExampleCli("abandontransaction", "\"1075db55d416d3ca199f55b6084" | ||||
"e2115b9345e16c5cf302fc80e9d5f" | "e2115b9345e16c5cf302fc80e9d5f" | ||||
"bf5d48d\"") + | "bf5d48d\"") + | ||||
HelpExampleRpc("abandontransaction", "\"1075db55d416d3ca199f55b6084" | HelpExampleRpc("abandontransaction", "\"1075db55d416d3ca199f55b6084" | ||||
Show All 29 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"backupwallet \"destination\"\n" | RPCHelpMan{"backupwallet", | ||||
"\nSafely copies current wallet file to destination, which can be " | "\nSafely copies current wallet file to destination, " | ||||
"a directory or a path with filename.\n" | "which can be a directory or a path with filename.\n", | ||||
{ | |||||
{"destination", RPCArg::Type::STR, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"destination\" (string) The destination directory or file\n" | "1. \"destination\" (string) The destination directory or file\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("backupwallet", "\"backup.dat\"") + | HelpExampleCli("backupwallet", "\"backup.dat\"") + | ||||
HelpExampleRpc("backupwallet", "\"backup.dat\"")); | HelpExampleRpc("backupwallet", "\"backup.dat\"")); | ||||
} | } | ||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
Show All 17 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 1) { | if (request.fHelp || request.params.size() > 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"keypoolrefill ( newsize )\n" | RPCHelpMan{"keypoolrefill", | ||||
"\nFills the keypool." + | "\nFills the keypool.", | ||||
{ | |||||
{"newsize", RPCArg::Type::NUM, true}, | |||||
}} | |||||
.ToString() + | |||||
HelpRequiringPassphrase(pwallet) + | HelpRequiringPassphrase(pwallet) + | ||||
"\n" | "\n" | ||||
"\nArguments\n" | "\nArguments\n" | ||||
"1. newsize (numeric, optional, default=100) " | "1. newsize (numeric, optional, default=100) " | ||||
"The new keypool size\n" | "The new keypool size\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("keypoolrefill", "") + | HelpExampleCli("keypoolrefill", "") + | ||||
HelpExampleRpc("keypoolrefill", "")); | HelpExampleRpc("keypoolrefill", "")); | ||||
Show All 40 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; | ||||
} | } | ||||
if (pwallet->IsCrypted() && (request.fHelp || request.params.size() != 2)) { | if (pwallet->IsCrypted() && (request.fHelp || request.params.size() != 2)) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"walletpassphrase \"passphrase\" timeout\n" | RPCHelpMan{"walletpassphrase", | ||||
"\nStores the wallet decryption key in memory for 'timeout' " | "\nStores the wallet decryption key in memory for " | ||||
"seconds.\n" | "'timeout' seconds.\n" | ||||
"This is needed prior to performing transactions related to " | "This is needed prior to performing transactions " | ||||
"private keys such as sending bitcoins\n" | "related to private keys such as sending bitcoins\n", | ||||
{ | |||||
{"passphrase", RPCArg::Type::STR, false}, | |||||
{"timeout", RPCArg::Type::NUM, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"passphrase\" (string, required) The wallet passphrase\n" | "1. \"passphrase\" (string, required) The wallet passphrase\n" | ||||
"2. timeout (numeric, required) The time to keep the " | "2. timeout (numeric, required) The time to keep the " | ||||
"decryption key in seconds; capped at 100000000 (~3 years).\n" | "decryption key in seconds; capped at 100000000 (~3 years).\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" | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | static UniValue walletpassphrase(const Config &config, | ||||
if (strWalletPass.length() > 0) { | if (strWalletPass.length() > 0) { | ||||
if (!pwallet->Unlock(strWalletPass)) { | if (!pwallet->Unlock(strWalletPass)) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_WALLET_PASSPHRASE_INCORRECT, | RPC_WALLET_PASSPHRASE_INCORRECT, | ||||
"Error: The wallet passphrase entered was incorrect."); | "Error: The wallet passphrase entered was incorrect."); | ||||
} | } | ||||
} else { | } else { | ||||
throw std::runtime_error( | throw std::runtime_error(RPCHelpMan{ | ||||
"walletpassphrase <passphrase> <timeout>\n" | "walletpassphrase", | ||||
"Stores the wallet decryption key in memory for " | "Stores the wallet decryption key in memory for <timeout> seconds.", | ||||
"<timeout> seconds."); | { | ||||
{"passphrase", RPCArg::Type::STR, false}, | |||||
{"timeout", RPCArg::Type::NUM, false}, | |||||
}}.ToString()); | |||||
} | } | ||||
pwallet->TopUpKeyPool(); | pwallet->TopUpKeyPool(); | ||||
pwallet->nRelockTime = GetTime() + nSleepTime; | pwallet->nRelockTime = GetTime() + nSleepTime; | ||||
RPCRunLater(strprintf("lockwallet(%s)", pwallet->GetName()), | RPCRunLater(strprintf("lockwallet(%s)", pwallet->GetName()), | ||||
std::bind(LockWallet, pwallet), nSleepTime); | std::bind(LockWallet, pwallet), nSleepTime); | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
static UniValue walletpassphrasechange(const Config &config, | static UniValue walletpassphrasechange(const Config &config, | ||||
const JSONRPCRequest &request) { | 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; | ||||
} | } | ||||
if (pwallet->IsCrypted() && (request.fHelp || request.params.size() != 2)) { | if (pwallet->IsCrypted() && (request.fHelp || request.params.size() != 2)) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"walletpassphrasechange \"oldpassphrase\" \"newpassphrase\"\n" | RPCHelpMan{"walletpassphrasechange", | ||||
"\nChanges the wallet passphrase from 'oldpassphrase' to " | "\nChanges the wallet passphrase from 'oldpassphrase' " | ||||
"'newpassphrase'.\n" | "to 'newpassphrase'.\n", | ||||
{ | |||||
{"oldpassphrase", RPCArg::Type::STR, false}, | |||||
{"newpassphrase", RPCArg::Type::STR, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"oldpassphrase\" (string) The current passphrase\n" | "1. \"oldpassphrase\" (string) The current passphrase\n" | ||||
"2. \"newpassphrase\" (string) The new passphrase\n" | "2. \"newpassphrase\" (string) The new passphrase\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("walletpassphrasechange", | HelpExampleCli("walletpassphrasechange", | ||||
"\"old one\" \"new one\"") + | "\"old one\" \"new one\"") + | ||||
HelpExampleRpc("walletpassphrasechange", | HelpExampleRpc("walletpassphrasechange", | ||||
"\"old one\", \"new one\"")); | "\"old one\", \"new one\"")); | ||||
Show All 19 Lines | static UniValue walletpassphrasechange(const Config &config, | ||||
strOldWalletPass.reserve(100); | strOldWalletPass.reserve(100); | ||||
strOldWalletPass = request.params[0].get_str().c_str(); | strOldWalletPass = request.params[0].get_str().c_str(); | ||||
SecureString strNewWalletPass; | SecureString strNewWalletPass; | ||||
strNewWalletPass.reserve(100); | strNewWalletPass.reserve(100); | ||||
strNewWalletPass = request.params[1].get_str().c_str(); | strNewWalletPass = request.params[1].get_str().c_str(); | ||||
if (strOldWalletPass.length() < 1 || strNewWalletPass.length() < 1) { | if (strOldWalletPass.length() < 1 || strNewWalletPass.length() < 1) { | ||||
throw std::runtime_error( | throw std::runtime_error(RPCHelpMan{ | ||||
"walletpassphrasechange <oldpassphrase> <newpassphrase>\n" | "walletpassphrasechange", | ||||
"Changes the wallet passphrase from <oldpassphrase> to " | "Changes the wallet passphrase from <oldpassphrase> to " | ||||
"<newpassphrase>."); | "<newpassphrase>.", | ||||
{ | |||||
{"oldpassphrase", RPCArg::Type::STR, false}, | |||||
{"newpassphrase", RPCArg::Type::STR, false}, | |||||
}}.ToString()); | |||||
} | } | ||||
if (!pwallet->ChangeWalletPassphrase(strOldWalletPass, strNewWalletPass)) { | if (!pwallet->ChangeWalletPassphrase(strOldWalletPass, strNewWalletPass)) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_WALLET_PASSPHRASE_INCORRECT, | RPC_WALLET_PASSPHRASE_INCORRECT, | ||||
"Error: The wallet passphrase entered was incorrect."); | "Error: The wallet passphrase entered was incorrect."); | ||||
} | } | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
static UniValue walletlock(const Config &config, | static UniValue walletlock(const Config &config, | ||||
const JSONRPCRequest &request) { | 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; | ||||
} | } | ||||
if (pwallet->IsCrypted() && (request.fHelp || request.params.size() != 0)) { | if (pwallet->IsCrypted() && (request.fHelp || request.params.size() != 0)) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"walletlock\n" | RPCHelpMan{"walletlock", | ||||
"\nRemoves the wallet encryption key from memory, locking the " | "\nRemoves the wallet encryption key from memory, " | ||||
"wallet.\n" | "locking the wallet.\n" | ||||
"After calling this method, you will need to call walletpassphrase " | "After calling this method, you will need to call " | ||||
"again\n" | "walletpassphrase again\n" | ||||
"before being able to call any methods which require the wallet to " | "before being able to call any methods which require " | ||||
"be unlocked.\n" | "the wallet to be unlocked.\n", | ||||
{}} | |||||
.ToString() + | |||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nSet the passphrase for 2 minutes to perform a transaction\n" + | "\nSet the passphrase for 2 minutes to perform a transaction\n" + | ||||
HelpExampleCli("walletpassphrase", "\"my pass phrase\" 120") + | HelpExampleCli("walletpassphrase", "\"my pass phrase\" 120") + | ||||
"\nPerform a send (requires passphrase set)\n" + | "\nPerform a send (requires passphrase set)\n" + | ||||
HelpExampleCli("sendtoaddress", | HelpExampleCli("sendtoaddress", | ||||
"\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 1.0") + | "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 1.0") + | ||||
"\nClear the passphrase since we are done before 2 minutes is " | "\nClear the passphrase since we are done before 2 minutes is " | ||||
"up\n" + | "up\n" + | ||||
Show All 26 Lines | static UniValue encryptwallet(const Config &config, | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (!pwallet->IsCrypted() && | if (!pwallet->IsCrypted() && | ||||
(request.fHelp || request.params.size() != 1)) { | (request.fHelp || request.params.size() != 1)) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"encryptwallet \"passphrase\"\n" | RPCHelpMan{"encryptwallet", | ||||
"\nEncrypts the wallet with 'passphrase'. This is for first time " | "\nEncrypts the wallet with 'passphrase'. This is for " | ||||
"encryption.\n" | "first time encryption.\n" | ||||
"After this, any calls that interact with private keys such as " | "After this, any calls that interact with private keys " | ||||
"sending or signing \n" | "such as sending or signing \n" | ||||
"will require the passphrase to be set prior the making these " | "will require the passphrase to be set prior the making " | ||||
"calls.\n" | "these calls.\n" | ||||
"Use the walletpassphrase call for this, and then walletlock " | "Use the walletpassphrase call for this, and then " | ||||
"call.\n" | "walletlock call.\n" | ||||
"If the wallet is already encrypted, use the " | "If the wallet is already encrypted, use the " | ||||
"walletpassphrasechange call.\n" | "walletpassphrasechange call.\n", | ||||
{ | |||||
{"passphrase", RPCArg::Type::STR, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"passphrase\" (string) The pass phrase to encrypt the " | "1. \"passphrase\" (string) The pass phrase to encrypt the " | ||||
"wallet with. It must be at least 1 character, but should be " | "wallet with. It must be at least 1 character, but should be " | ||||
"long.\n" | "long.\n" | ||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nEncrypt your wallet\n" + | "\nEncrypt your wallet\n" + | ||||
HelpExampleCli("encryptwallet", "\"my pass phrase\"") + | HelpExampleCli("encryptwallet", "\"my pass phrase\"") + | ||||
"\nNow set the passphrase to use the wallet, such as for signing " | "\nNow set the passphrase to use the wallet, such as for signing " | ||||
Show All 22 Lines | static UniValue encryptwallet(const Config &config, | ||||
// SecureString::operator=(std::string) | // SecureString::operator=(std::string) | ||||
// Alternately, find a way to make request.params[0] mlock()'d to begin | // Alternately, find a way to make request.params[0] mlock()'d to begin | ||||
// with. | // with. | ||||
SecureString strWalletPass; | SecureString strWalletPass; | ||||
strWalletPass.reserve(100); | strWalletPass.reserve(100); | ||||
strWalletPass = request.params[0].get_str().c_str(); | strWalletPass = request.params[0].get_str().c_str(); | ||||
if (strWalletPass.length() < 1) { | if (strWalletPass.length() < 1) { | ||||
throw std::runtime_error("encryptwallet <passphrase>\n" | throw std::runtime_error(RPCHelpMan{ | ||||
"Encrypts the wallet with <passphrase>."); | "encryptwallet", | ||||
"Encrypts the wallet with <passphrase>.", | |||||
{ | |||||
{"passphrase", RPCArg::Type::STR, false}, | |||||
}}.ToString()); | |||||
} | } | ||||
if (!pwallet->EncryptWallet(strWalletPass)) { | if (!pwallet->EncryptWallet(strWalletPass)) { | ||||
throw JSONRPCError(RPC_WALLET_ENCRYPTION_FAILED, | throw JSONRPCError(RPC_WALLET_ENCRYPTION_FAILED, | ||||
"Error: Failed to encrypt the wallet."); | "Error: Failed to encrypt the wallet."); | ||||
} | } | ||||
return "wallet encrypted; The keypool has been flushed and a new HD seed " | return "wallet encrypted; The keypool has been flushed and a new HD seed " | ||||
"was generated (if you are using HD). You need to make a new " | "was generated (if you are using HD). You need to make a new " | ||||
"backup."; | "backup."; | ||||
} | } | ||||
static UniValue lockunspent(const Config &config, | static UniValue lockunspent(const Config &config, | ||||
const JSONRPCRequest &request) { | 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 2) { | request.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
RPCHelpMan{"lockunspent", | RPCHelpMan{ | ||||
"lockunspent", | |||||
"\nUpdates list of temporarily unspendable outputs.\n" | |||||
"Temporarily lock (unlock=false) or unlock (unlock=true) " | |||||
"specified transaction outputs.\n" | |||||
"If no transaction outputs are specified when unlocking then " | |||||
"all current locked transaction outputs are unlocked.\n" | |||||
"A locked transaction output will not be chosen by automatic " | |||||
"coin selection, when spending bitcoins.\n" | |||||
"Locks are stored in memory only. Nodes start with zero locked " | |||||
"outputs, and the locked output list\n" | |||||
"is always cleared (by virtue of process exit) when a node " | |||||
"stops or fails.\n" | |||||
"Also see the listunspent call\n", | |||||
{ | { | ||||
{"unlock", RPCArg::Type::BOOL, false}, | {"unlock", RPCArg::Type::BOOL, false}, | ||||
{"transactions", | {"transactions", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
{ | { | ||||
{"", | {"", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
{ | { | ||||
{"txid", RPCArg::Type::STR_HEX, false}, | {"txid", RPCArg::Type::STR_HEX, false}, | ||||
{"vout", RPCArg::Type::NUM, false}, | {"vout", RPCArg::Type::NUM, false}, | ||||
}, | }, | ||||
true}, | true}, | ||||
}, | }, | ||||
true}, | true}, | ||||
}} | }} | ||||
.ToString() + | .ToString() + | ||||
"\nUpdates list of temporarily unspendable outputs.\n" | |||||
"Temporarily lock (unlock=false) or unlock (unlock=true) specified " | |||||
"transaction outputs.\n" | |||||
"If no transaction outputs are specified when unlocking then all " | |||||
"current locked transaction outputs are unlocked.\n" | |||||
"A locked transaction output will not be chosen by automatic coin " | |||||
"selection, when spending bitcoins.\n" | |||||
"Locks are stored in memory only. Nodes start with zero locked " | |||||
"outputs, and the locked output list\n" | |||||
"is always cleared (by virtue of process exit) when a node stops " | |||||
"or fails.\n" | |||||
"Also see the listunspent call\n" | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. unlock (boolean, required) Whether to unlock (true) " | "1. unlock (boolean, required) Whether to unlock (true) " | ||||
"or lock (false) the specified transactions\n" | "or lock (false) the specified transactions\n" | ||||
"2. \"transactions\" (string, optional) A json array of objects. " | "2. \"transactions\" (string, optional) A json array of objects. " | ||||
"Each object the txid (string) vout (numeric)\n" | "Each object the txid (string) vout (numeric)\n" | ||||
" [ (json array of json objects)\n" | " [ (json array of json objects)\n" | ||||
" {\n" | " {\n" | ||||
" \"txid\":\"id\", (string) The transaction id\n" | " \"txid\":\"id\", (string) The transaction id\n" | ||||
▲ Show 20 Lines • Show All 123 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 0) { | if (request.fHelp || request.params.size() > 0) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"listlockunspent\n" | RPCHelpMan{"listlockunspent", | ||||
"\nReturns list of temporarily unspendable outputs.\n" | "\nReturns list of temporarily unspendable outputs.\n" | ||||
"See the lockunspent call to lock and unlock transactions for " | "See the lockunspent call to lock and unlock " | ||||
"spending.\n" | "transactions for spending.\n", | ||||
{}} | |||||
.ToString() + | |||||
"\nResult:\n" | "\nResult:\n" | ||||
"[\n" | "[\n" | ||||
" {\n" | " {\n" | ||||
" \"txid\" : \"transactionid\", (string) The transaction id " | " \"txid\" : \"transactionid\", (string) The transaction id " | ||||
"locked\n" | "locked\n" | ||||
" \"vout\" : n (numeric) The vout value\n" | " \"vout\" : n (numeric) The vout value\n" | ||||
" }\n" | " }\n" | ||||
" ,...\n" | " ,...\n" | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | static UniValue settxfee(const Config &config, const JSONRPCRequest &request) { | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 1) { | request.params.size() > 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"settxfee amount\n" | RPCHelpMan{ | ||||
"\nSet the transaction fee per kB for this wallet. Overrides the " | "settxfee", | ||||
"global -paytxfee command line parameter.\n" | "\nSet the transaction fee per kB for this wallet. Overrides " | ||||
"the global -paytxfee command line parameter.\n", | |||||
{ | |||||
{"amount", RPCArg::Type::AMOUNT, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. amount (numeric or string, required) The transaction " | "1. amount (numeric or string, required) The transaction " | ||||
"fee in " + | "fee in " + | ||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
"/kB\n" | "/kB\n" | ||||
"\nResult\n" | "\nResult\n" | ||||
"true|false (boolean) Returns true if successful\n" | "true|false (boolean) Returns true if successful\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
Show All 30 Lines | static UniValue getwalletinfo(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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 0) { | if (request.fHelp || request.params.size() != 0) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"getwalletinfo\n" | RPCHelpMan{ | ||||
"Returns an object containing various wallet state info.\n" | "getwalletinfo", | ||||
"Returns an object containing various wallet state info.\n", | |||||
{}} | |||||
.ToString() + | |||||
"\nResult:\n" | "\nResult:\n" | ||||
"{\n" | "{\n" | ||||
" \"walletname\": xxxxx, (string) the wallet name\n" | " \"walletname\": xxxxx, (string) the wallet name\n" | ||||
" \"walletversion\": xxxxx, (numeric) the wallet " | " \"walletversion\": xxxxx, (numeric) the wallet " | ||||
"version\n" | "version\n" | ||||
" \"balance\": xxxxxxx, (numeric) the total " | " \"balance\": xxxxxxx, (numeric) the total " | ||||
"confirmed balance of the wallet in " + | "confirmed balance of the wallet in " + | ||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | obj.pushKV("private_keys_enabled", | ||||
!pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)); | !pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)); | ||||
return obj; | return obj; | ||||
} | } | ||||
static UniValue listwalletdir(const Config &config, | static UniValue listwalletdir(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 0) { | if (request.fHelp || request.params.size() != 0) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"listwalletdir\n" | RPCHelpMan{"listwalletdir", | ||||
"Returns a list of wallets in the wallet directory.\n" | "Returns a list of wallets in the wallet directory.\n", | ||||
{}} | |||||
.ToString() + | |||||
"{\n" | "{\n" | ||||
" \"wallets\" : [ (json array of objects)\n" | " \"wallets\" : [ (json array of objects)\n" | ||||
" {\n" | " {\n" | ||||
" \"name\" : \"name\" (string) The wallet name\n" | " \"name\" : \"name\" (string) The wallet name\n" | ||||
" }\n" | " }\n" | ||||
" ,...\n" | " ,...\n" | ||||
" ]\n" | " ]\n" | ||||
"}\n" | "}\n" | ||||
Show All 13 Lines | static UniValue listwalletdir(const Config &config, | ||||
result.pushKV("wallets", wallets); | result.pushKV("wallets", wallets); | ||||
return result; | return result; | ||||
} | } | ||||
static UniValue listwallets(const Config &config, | static UniValue listwallets(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 0) { | if (request.fHelp || request.params.size() != 0) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"listwallets\n" | RPCHelpMan{ | ||||
"listwallets", | |||||
"Returns a list of currently loaded wallets.\n" | "Returns a list of currently loaded wallets.\n" | ||||
"For full information on the wallet, use \"getwalletinfo\"\n" | "For full information on the wallet, use \"getwalletinfo\"\n", | ||||
{}} | |||||
.ToString() + | |||||
"\nResult:\n" | "\nResult:\n" | ||||
"[ (json array of strings)\n" | "[ (json array of strings)\n" | ||||
" \"walletname\" (string) the wallet name\n" | " \"walletname\" (string) the wallet name\n" | ||||
" ...\n" | " ...\n" | ||||
"]\n" | "]\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("listwallets", "") + | HelpExampleCli("listwallets", "") + | ||||
HelpExampleRpc("listwallets", "")); | HelpExampleRpc("listwallets", "")); | ||||
Show All 13 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) { | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"loadwallet \"filename\"\n" | RPCHelpMan{"loadwallet", | ||||
"\nLoads a wallet from a wallet file or directory." | "\nLoads 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 " | ||||
"bitcoind will be" | "starting bitcoind will be" | ||||
"\napplied to the new wallet (eg -zapwallettxes, upgradewallet, " | "\napplied to the new wallet (eg -zapwallettxes, " | ||||
"rescan, etc).\n" | "upgradewallet, rescan, etc).\n", | ||||
{ | |||||
{"filename", RPCArg::Type::STR, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"filename\" (string, required) The wallet directory or " | "1. \"filename\" (string, required) The wallet directory or " | ||||
".dat file.\n" | ".dat file.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"{\n" | "{\n" | ||||
" \"name\" : <wallet_name>, (string) The wallet name if " | " \"name\" : <wallet_name>, (string) The wallet name if " | ||||
"loaded successfully.\n" | "loaded successfully.\n" | ||||
" \"warning\" : <warning>, (string) Warning message if " | " \"warning\" : <warning>, (string) Warning message if " | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | static UniValue loadwallet(const Config &config, | ||||
return obj; | return obj; | ||||
} | } | ||||
static UniValue createwallet(const Config &config, | static UniValue createwallet(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 3) { | request.params.size() > 3) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"createwallet \"wallet_name\" ( disable_private_keys )\n" | RPCHelpMan{"createwallet", | ||||
"\nCreates and loads a new wallet.\n" | "\nCreates and loads a new wallet.\n", | ||||
{ | |||||
{"wallet_name", RPCArg::Type::STR, false}, | |||||
{"disable_private_keys", RPCArg::Type::BOOL, true}, | |||||
{"blank", RPCArg::Type::BOOL, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"wallet_name\" (string, required) The name for the new " | "1. \"wallet_name\" (string, required) The name for the new " | ||||
"wallet. If this is a path, the wallet will be created at the path " | "wallet. If this is a path, the wallet will be created at the path " | ||||
"location.\n" | "location.\n" | ||||
"2. disable_private_keys (boolean, optional, default: false) " | "2. disable_private_keys (boolean, optional, default: false) " | ||||
"Disable the possibility of private keys (only watchonlys are " | "Disable the possibility of private keys (only watchonlys are " | ||||
"possible in this mode).\n" | "possible in this mode).\n" | ||||
"3. blank (boolean, optional, default: false) Create a blank " | "3. blank (boolean, optional, default: false) Create a blank " | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | static UniValue createwallet(const Config &config, | ||||
return obj; | return obj; | ||||
} | } | ||||
static UniValue unloadwallet(const Config &config, | static UniValue unloadwallet(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() > 1) { | if (request.fHelp || request.params.size() > 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"unloadwallet ( \"wallet_name\" )\n" | RPCHelpMan{ | ||||
"Unloads the wallet referenced by the request endpoint otherwise " | "unloadwallet", | ||||
"unloads the wallet specified in the argument.\n" | "Unloads the wallet referenced by the request endpoint " | ||||
"Specifying the wallet name on a wallet endpoint is invalid." | "otherwise unloads the wallet specified in the argument.\n" | ||||
"Specifying the wallet name on a wallet endpoint is invalid.", | |||||
{ | |||||
{"wallet_name", RPCArg::Type::STR, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"wallet_name\" (string, optional) The name of the wallet " | "1. \"wallet_name\" (string, optional) The name of the wallet " | ||||
"to unload.\n" | "to unload.\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("unloadwallet", "wallet_name") + | HelpExampleCli("unloadwallet", "wallet_name") + | ||||
HelpExampleRpc("unloadwallet", "wallet_name")); | HelpExampleRpc("unloadwallet", "wallet_name")); | ||||
} | } | ||||
Show All 31 Lines | static UniValue resendwallettransactions(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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 0) { | if (request.fHelp || request.params.size() != 0) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"resendwallettransactions\n" | RPCHelpMan{"resendwallettransactions", | ||||
"Immediately re-broadcast unconfirmed wallet transactions to all " | "Immediately re-broadcast unconfirmed wallet " | ||||
"peers.\n" | "transactions to all peers.\n" | ||||
"Intended only for testing; the wallet code periodically " | "Intended only for testing; the wallet code " | ||||
"re-broadcasts\n" | "periodically re-broadcasts\n", | ||||
{}} | |||||
.ToString() + | |||||
"automatically.\n" | "automatically.\n" | ||||
"Returns an RPC error if -walletbroadcast is set to false.\n" | "Returns an RPC error if -walletbroadcast is set to false.\n" | ||||
"Returns array of transaction ids that were re-broadcast.\n"); | "Returns array of transaction ids that were re-broadcast.\n"); | ||||
} | } | ||||
if (!g_connman) { | if (!g_connman) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_CLIENT_P2P_DISABLED, | RPC_CLIENT_P2P_DISABLED, | ||||
Show All 27 Lines | static UniValue listunspent(const Config &config, | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 5) { | if (request.fHelp || request.params.size() > 5) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"listunspent", | "listunspent", | ||||
"\nReturns array of unspent transaction outputs\n" | |||||
"with between minconf and maxconf (inclusive) confirmations.\n" | |||||
"Optionally filter to only include txouts paid to specified " | |||||
"addresses.\n", | |||||
{ | { | ||||
{"minconf", RPCArg::Type::NUM, true}, | {"minconf", RPCArg::Type::NUM, true}, | ||||
{"maxconf", RPCArg::Type::NUM, true}, | {"maxconf", RPCArg::Type::NUM, true}, | ||||
{"addresses", | {"addresses", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
{ | { | ||||
{"address", RPCArg::Type::STR, true}, | {"address", RPCArg::Type::STR, true}, | ||||
}, | }, | ||||
true}, | true}, | ||||
{"include_unsafe", RPCArg::Type::BOOL, true}, | {"include_unsafe", RPCArg::Type::BOOL, true}, | ||||
{"query_options", | {"query_options", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
{ | { | ||||
{"minimumAmount", RPCArg::Type::AMOUNT, true}, | {"minimumAmount", RPCArg::Type::AMOUNT, true}, | ||||
{"maximumAmount", RPCArg::Type::AMOUNT, true}, | {"maximumAmount", RPCArg::Type::AMOUNT, true}, | ||||
{"maximumCount", RPCArg::Type::NUM, true}, | {"maximumCount", RPCArg::Type::NUM, true}, | ||||
{"minimumSumAmount", RPCArg::Type::AMOUNT, true}, | {"minimumSumAmount", RPCArg::Type::AMOUNT, true}, | ||||
}, | }, | ||||
true}, | true, | ||||
"query_options"}, | |||||
}} | }} | ||||
.ToString() + | .ToString() + | ||||
"\nReturns array of unspent transaction outputs\n" | |||||
"with between minconf and maxconf (inclusive) confirmations.\n" | |||||
"Optionally filter to only include txouts paid to specified " | |||||
"addresses.\n" | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. minconf (numeric, optional, default=1) The minimum " | "1. minconf (numeric, optional, default=1) The minimum " | ||||
"confirmations to filter\n" | "confirmations to filter\n" | ||||
"2. maxconf (numeric, optional, default=9999999) The " | "2. maxconf (numeric, optional, default=9999999) The " | ||||
"maximum confirmations to filter\n" | "maximum confirmations to filter\n" | ||||
"3. \"addresses\" (string, optional) A json array of bitcoin " | "3. \"addresses\" (string, optional) A json array of bitcoin " | ||||
"addresses to filter\n" | "addresses to filter\n" | ||||
" [\n" | " [\n" | ||||
▲ Show 20 Lines • Show All 314 Lines • ▼ Show 20 Lines | static UniValue fundrawtransaction(const Config &config, | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 2) { | request.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"fundrawtransaction \"hexstring\" ( options )\n" | RPCHelpMan{ | ||||
"fundrawtransaction", | |||||
"\nAdd inputs to a transaction until it has enough in value to " | "\nAdd inputs to a transaction until it has enough in value to " | ||||
"meet its out value.\n" | "meet its out value.\n" | ||||
"This will not modify existing inputs, and will add at most one " | "This will not modify existing inputs, and will add at most " | ||||
"change output to the outputs.\n" | "one change 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 " | ||||
"completion since in/outputs have been added.\n" | "after completion since in/outputs have been added.\n" | ||||
"The inputs added will not be signed, use " | "The inputs added will not be signed, use " | ||||
"signrawtransactionwithkey or signrawtransactionwithwallet for " | "signrawtransactionwithkey or signrawtransactionwithwallet for " | ||||
"that.\n" | "that.\n" | ||||
"Note that all existing inputs must have their previous output " | "Note that all existing inputs must have their previous output " | ||||
"transaction be in the wallet.\n" | "transaction be in the wallet.\n" | ||||
"Note that all inputs selected must be of standard form and P2SH " | "Note that all inputs selected must be of standard form and " | ||||
"scripts must be\n" | "P2SH scripts must be\n" | ||||
"in the wallet using importaddress or addmultisigaddress (to " | "in the wallet using importaddress or addmultisigaddress (to " | ||||
"calculate fees).\n" | "calculate fees).\n" | ||||
"You can see whether this is the case by checking the \"solvable\" " | "You can see whether this is the case by checking the " | ||||
"field in the listunspent output.\n" | "\"solvable\" field in the listunspent output.\n" | ||||
"Only pay-to-pubkey, multisig, and P2SH versions thereof are " | "Only pay-to-pubkey, multisig, and P2SH versions thereof are " | ||||
"currently supported for watch-only\n" | "currently supported for watch-only\n", | ||||
{ | |||||
{"hexstring", RPCArg::Type::STR_HEX, false}, | |||||
{"options", | |||||
RPCArg::Type::OBJ, | |||||
{ | |||||
{"changeAddress", RPCArg::Type::STR, true}, | |||||
{"changePosition", RPCArg::Type::NUM, true}, | |||||
{"includeWatching", RPCArg::Type::BOOL, true}, | |||||
{"lockUnspents", RPCArg::Type::BOOL, true}, | |||||
{"feeRate", RPCArg::Type::AMOUNT, true}, | |||||
{"subtractFeeFromOutputs", | |||||
RPCArg::Type::ARR, | |||||
{ | |||||
{"vout_index", RPCArg::Type::NUM, true}, | |||||
}, | |||||
true}, | |||||
}, | |||||
true, | |||||
"options"}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"hexstring\" (string, required) The hex string of " | "1. \"hexstring\" (string, required) The hex string of " | ||||
"the raw transaction\n" | "the raw transaction\n" | ||||
"2. options (object, optional)\n" | "2. options (object, optional)\n" | ||||
" {\n" | " {\n" | ||||
" \"changeAddress\" (string, optional, default pool " | " \"changeAddress\" (string, optional, default pool " | ||||
"address) The bitcoin address to receive the change\n" | "address) The bitcoin address to receive the change\n" | ||||
" \"changePosition\" (numeric, optional, default " | " \"changePosition\" (numeric, optional, default " | ||||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 3) { | request.params.size() > 3) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
RPCHelpMan{ | RPCHelpMan{ | ||||
"signrawtransactionwithwallet", | "signrawtransactionwithwallet", | ||||
"\nSign inputs for raw transaction (serialized, hex-encoded).\n" | |||||
"The second optional argument (may be null) is an array of " | |||||
"previous transaction outputs that\n" | |||||
"this transaction depends on but may not yet be in the block " | |||||
"chain.\n", | |||||
{ | { | ||||
{"hexstring", RPCArg::Type::STR_HEX, false}, | {"hexstring", RPCArg::Type::STR_HEX, false}, | ||||
{"prevtxs", | {"prevtxs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
{ | { | ||||
{"", | {"", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
{ | { | ||||
{"txid", RPCArg::Type::STR_HEX, false}, | {"txid", RPCArg::Type::STR_HEX, false}, | ||||
{"vout", RPCArg::Type::NUM, false}, | {"vout", RPCArg::Type::NUM, false}, | ||||
{"scriptPubKey", RPCArg::Type::STR_HEX, false}, | {"scriptPubKey", RPCArg::Type::STR_HEX, false}, | ||||
{"redeemScript", RPCArg::Type::STR_HEX, false}, | {"redeemScript", RPCArg::Type::STR_HEX, false}, | ||||
{"amount", RPCArg::Type::AMOUNT, false}, | {"amount", RPCArg::Type::AMOUNT, false}, | ||||
}, | }, | ||||
false}, | false}, | ||||
}, | }, | ||||
true}, | true}, | ||||
{"sighashtype", RPCArg::Type::STR, true}, | {"sighashtype", RPCArg::Type::STR, true}, | ||||
}} | }} | ||||
.ToString() + | .ToString() + | ||||
"\nSign inputs for raw transaction (serialized, hex-encoded).\n" | |||||
"The second optional argument (may be null) is an array of " | |||||
"previous transaction outputs that\n" | |||||
"this transaction depends on but may not yet be in the block " | |||||
"chain.\n" + | |||||
HelpRequiringPassphrase(pwallet) + | HelpRequiringPassphrase(pwallet) + | ||||
"\n" | "\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"hexstring\" (string, required) The " | "1. \"hexstring\" (string, required) The " | ||||
"transaction hex string\n" | "transaction hex string\n" | ||||
"2. \"prevtxs\" (string, optional) An json " | "2. \"prevtxs\" (string, optional) An json " | ||||
"array of previous dependent transaction outputs\n" | "array of previous dependent transaction outputs\n" | ||||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | UniValue generate(const Config &config, const JSONRPCRequest &request) { | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 2) { | request.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"generate nblocks ( maxtries )\n" | RPCHelpMan{"generate", | ||||
"\nMine up to nblocks blocks immediately (before the RPC call " | "\nMine up to nblocks blocks immediately (before the " | ||||
"returns) to an address in the wallet.\n" | "RPC call returns) to an address in the wallet.\n", | ||||
{ | |||||
{"nblocks", RPCArg::Type::NUM, false}, | |||||
{"maxtries", RPCArg::Type::NUM, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. nblocks (numeric, required) How many blocks are generated " | "1. nblocks (numeric, required) How many blocks are generated " | ||||
"immediately.\n" | "immediately.\n" | ||||
"2. maxtries (numeric, optional) How many iterations to try " | "2. maxtries (numeric, optional) How many iterations to try " | ||||
"(default = 1000000).\n" | "(default = 1000000).\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"[ blockhashes ] (array) hashes of blocks generated\n" | "[ blockhashes ] (array) hashes of blocks generated\n" | ||||
"\nExamples:\n" | "\nExamples:\n" | ||||
Show All 31 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 2) { | if (request.fHelp || request.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"rescanblockchain (\"start_height\") (\"stop_height\")\n" | RPCHelpMan{"rescanblockchain", | ||||
"\nRescan the local blockchain for wallet related transactions.\n" | "\nRescan the local blockchain for wallet related " | ||||
"transactions.\n", | |||||
{ | |||||
{"start_height", RPCArg::Type::NUM, true}, | |||||
{"stop_height", RPCArg::Type::NUM, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"start_height\" (numeric, optional) block height where the " | "1. \"start_height\" (numeric, optional) block height where the " | ||||
"rescan should start\n" | "rescan should start\n" | ||||
"2. \"stop_height\" (numeric, optional) the last block height " | "2. \"stop_height\" (numeric, optional) the last block height " | ||||
"that should be scanned\n" | "that should be scanned\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"{\n" | "{\n" | ||||
" \"start_height\" (numeric) The block height where the " | " \"start_height\" (numeric) The block height where the " | ||||
▲ Show 20 Lines • Show All 189 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"getaddressinfo \"address\"\n" | RPCHelpMan{"getaddressinfo", | ||||
"\nReturn information about the given bitcoin address. Some " | "\nReturn information about the given bitcoin address. " | ||||
"information requires the address\n" | "Some information requires the address\n" | ||||
"to be in the wallet.\n" | "to be in the wallet.\n", | ||||
{ | |||||
{"address", RPCArg::Type::STR, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"address\" (string, required) The bitcoin " | "1. \"address\" (string, required) The bitcoin " | ||||
"address to get the information of.\n" | "address to get the information of.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"{\n" | "{\n" | ||||
" \"address\" : \"address\", (string) The bitcoin address " | " \"address\" : \"address\", (string) The bitcoin address " | ||||
"validated\n" | "validated\n" | ||||
" \"scriptPubKey\" : \"hex\", (string) The hex-encoded " | " \"scriptPubKey\" : \"hex\", (string) The hex-encoded " | ||||
▲ Show 20 Lines • Show All 132 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"getaddressesbylabel \"label\"\n" | RPCHelpMan{"getaddressesbylabel", | ||||
"\nReturns the list of addresses assigned the specified label.\n" | "\nReturns the list of addresses assigned the specified " | ||||
"label.\n", | |||||
{ | |||||
{"label", RPCArg::Type::STR, false}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"label\" (string, required) The label.\n" | "1. \"label\" (string, required) The label.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"{ (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 " | ||||
"address)\n" | "address)\n" | ||||
Show All 30 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 1) { | if (request.fHelp || request.params.size() > 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"listlabels ( \"purpose\" )\n" | RPCHelpMan{"listlabels", | ||||
"\nReturns the list of all labels, or labels that are assigned to " | "\nReturns the list of all labels, or labels that are " | ||||
"addresses with a specific purpose.\n" | "assigned to addresses with a specific purpose.\n", | ||||
{ | |||||
{"purpose", RPCArg::Type::STR, true}, | |||||
}} | |||||
.ToString() + | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"purpose\" (string, optional) Address purpose to list " | "1. \"purpose\" (string, optional) Address purpose to list " | ||||
"labels for ('send','receive'). An empty string is the same as not " | "labels for ('send','receive'). An empty string is the same as not " | ||||
"providing this argument.\n" | "providing this argument.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"[ (json array of string)\n" | "[ (json array of string)\n" | ||||
" \"label\", (string) Label name\n" | " \"label\", (string) Label name\n" | ||||
" ...\n" | " ...\n" | ||||
Show All 37 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; | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 2) { | if (request.fHelp || request.params.size() > 2) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"sethdseed ( \"newkeypool\" \"seed\" )\n" | RPCHelpMan{"sethdseed", | ||||
"\nSet or generate a new HD wallet seed. Non-HD wallets will not " | "\nSet or generate a new HD wallet seed. Non-HD wallets " | ||||
"be upgraded to being a HD wallet. Wallets that are already\n" | "will not be upgraded to being a HD wallet. Wallets " | ||||
"HD will have a new HD seed set so that new keys added to the " | "that are already\n" | ||||
"keypool will be derived from this new seed.\n" | "HD will have a new HD seed set so that new keys added " | ||||
"\nNote that you will need to MAKE A NEW BACKUP of your wallet " | "to the keypool will be derived from this new seed.\n" | ||||
"after setting the HD wallet seed.\n" + | "\nNote that you will need to MAKE A NEW BACKUP of your " | ||||
"wallet after setting the HD wallet seed.\n", | |||||
{ | |||||
{"newkeypool", RPCArg::Type::BOOL, true}, | |||||
{"seed", RPCArg::Type::STR, true}, | |||||
}} | |||||
.ToString() + | |||||
HelpRequiringPassphrase(pwallet) + | HelpRequiringPassphrase(pwallet) + | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"newkeypool\" (boolean, optional, default=true) " | "1. \"newkeypool\" (boolean, optional, default=true) " | ||||
"Whether to flush old unused addresses, including change " | "Whether to flush old unused addresses, including change " | ||||
"addresses, from the keypool and regenerate it.\n" | "addresses, from the keypool and regenerate it.\n" | ||||
" If true, the next address from " | " If true, the next address from " | ||||
"getnewaddress and change address from getrawchangeaddress will be " | "getnewaddress and change address from getrawchangeaddress will be " | ||||
"from this new seed.\n" | "from this new seed.\n" | ||||
▲ Show 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | static UniValue walletprocesspsbt(const Config &config, | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 4) { | request.params.size() > 4) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"walletprocesspsbt \"psbt\" ( sign \"sighashtype\" bip32derivs )\n" | RPCHelpMan{"walletprocesspsbt", | ||||
"\nUpdate a PSBT with input information from our wallet and then " | "\nUpdate a PSBT with input information from our wallet " | ||||
"sign inputs\n" | "and then sign inputs that we can sign for.\n", | ||||
"that we can sign for.\n" + | { | ||||
{"psbt", RPCArg::Type::STR, false}, | |||||
{"sign", RPCArg::Type::BOOL, true}, | |||||
{"sighashtype", RPCArg::Type::STR, true}, | |||||
{"bip32derivs", RPCArg::Type::BOOL, true}, | |||||
}} | |||||
.ToString() + | |||||
HelpRequiringPassphrase(pwallet) + | HelpRequiringPassphrase(pwallet) + | ||||
"\n" | "\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"psbt\" (string, required) The " | "1. \"psbt\" (string, required) The " | ||||
"transaction base64 string\n" | "transaction base64 string\n" | ||||
"2. sign (boolean, optional, " | "2. sign (boolean, optional, " | ||||
"default=true) Also sign the transaction when updating\n" | "default=true) Also sign the transaction when updating\n" | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | static UniValue walletcreatefundedpsbt(const Config &config, | ||||
if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
if (request.fHelp || request.params.size() < 2 || | if (request.fHelp || request.params.size() < 2 || | ||||
request.params.size() > 5) { | request.params.size() > 5) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
RPCHelpMan{"walletcreatefundedpsbt", | RPCHelpMan{"walletcreatefundedpsbt", | ||||
"\nCreates and funds a transaction in the Partially " | |||||
"Signed Transaction format. Inputs will be added if " | |||||
"supplied inputs are not enough\n" | |||||
"Implements the Creator and Updater roles.\n", | |||||
{ | { | ||||
{"inputs", | {"inputs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
{ | { | ||||
{"", | {"", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
{ | { | ||||
{"txid", RPCArg::Type::STR_HEX, false}, | {"txid", RPCArg::Type::STR_HEX, false}, | ||||
Show All 23 Lines | if (request.fHelp || request.params.size() < 2 || | ||||
{"locktime", RPCArg::Type::NUM, true}, | {"locktime", RPCArg::Type::NUM, true}, | ||||
{"options", | {"options", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
{ | { | ||||
{"changeAddress", RPCArg::Type::STR, true}, | {"changeAddress", RPCArg::Type::STR, true}, | ||||
{"changePosition", RPCArg::Type::NUM, true}, | {"changePosition", RPCArg::Type::NUM, true}, | ||||
{"includeWatching", RPCArg::Type::BOOL, true}, | {"includeWatching", RPCArg::Type::BOOL, true}, | ||||
{"lockUnspents", RPCArg::Type::BOOL, true}, | {"lockUnspents", RPCArg::Type::BOOL, true}, | ||||
{"feeRate", RPCArg::Type::NUM, true}, | {"feeRate", RPCArg::Type::AMOUNT, true}, | ||||
{"subtractFeeFromOutputs", | {"subtractFeeFromOutputs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
{ | { | ||||
{"int", RPCArg::Type::NUM, true}, | {"int", RPCArg::Type::NUM, true}, | ||||
}, | }, | ||||
true}, | true, | ||||
"options"}, | |||||
}, | }, | ||||
true}, | true}, | ||||
{"bip32derivs", RPCArg::Type::BOOL, true}, | {"bip32derivs", RPCArg::Type::BOOL, true}, | ||||
}} | }} | ||||
.ToString() + | .ToString() + | ||||
"\nCreates and funds a transaction in the Partially Signed " | |||||
"Transaction format. Inputs will be added if supplied inputs are " | |||||
"not enough\n" | |||||
"Implements the Creator and Updater roles.\n" | |||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"inputs\" (array, required) A json array of " | "1. \"inputs\" (array, required) A json array of " | ||||
"json objects\n" | "json objects\n" | ||||
" [\n" | " [\n" | ||||
" {\n" | " {\n" | ||||
" \"txid\":\"id\", (string, required) The transaction " | " \"txid\":\"id\", (string, required) The transaction " | ||||
"id\n" | "id\n" | ||||
" \"vout\":n, (numeric, required) The output " | " \"vout\":n, (numeric, required) The output " | ||||
▲ Show 20 Lines • Show All 174 Lines • Show Last 20 Lines |