Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 2) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"getnewaddress", | "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, /* opt */ true, | {"label", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "null", | ||||
"The label name for the address to be linked to. If not " | "The label name for the address to be linked to. If not " | ||||
"provided, the default label \"\" is used. It can also be " | "provided, the default label \"\" is used. It can also be set " | ||||
"set to the empty string \"\" to represent the default " | "to the empty string \"\" to represent the default label. The " | ||||
"label. The label does not need to exist, it will be " | "label does not need to exist, it will be created if there is " | ||||
"created if there is no label by the given name."}, | "no label by the given name."}, | ||||
}, | }, | ||||
RPCResult{"\"address\" (string) The new bitcoin address\n"}, | RPCResult{"\"address\" (string) The new bitcoin address\n"}, | ||||
RPCExamples{HelpExampleCli("getnewaddress", "") + | RPCExamples{HelpExampleCli("getnewaddress", "") + | ||||
HelpExampleRpc("getnewaddress", "")}, | HelpExampleRpc("getnewaddress", "")}, | ||||
} | } | ||||
.ToString()); | .ToString()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 236 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 2 || | ||||
HelpRequiringPassphrase(pwallet) + "\n", | HelpRequiringPassphrase(pwallet) + "\n", | ||||
{ | { | ||||
{"address", RPCArg::Type::STR, /* opt */ false, | {"address", RPCArg::Type::STR, /* opt */ false, | ||||
/* default_val */ "", "The bitcoin address to send to."}, | /* default_val */ "", "The bitcoin address to send to."}, | ||||
{"amount", RPCArg::Type::AMOUNT, /* opt */ false, | {"amount", RPCArg::Type::AMOUNT, /* opt */ false, | ||||
/* default_val */ "", | /* default_val */ "", | ||||
"The amount in " + CURRENCY_UNIT + " to send. eg 0.1"}, | "The amount in " + CURRENCY_UNIT + " to send. eg 0.1"}, | ||||
{"comment", RPCArg::Type::STR, /* opt */ true, | {"comment", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "null", | ||||
"A comment used to store what the transaction is for.\n" | "A comment used to store what the transaction is for.\n" | ||||
" This is not part of the " | " This is not part of the " | ||||
"transaction, just kept in your wallet."}, | "transaction, just kept in your wallet."}, | ||||
{"comment_to", RPCArg::Type::STR, /* opt */ true, | {"comment_to", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "null", | ||||
"A comment to store the name of the person or " | "A comment to store the name of the person or organization\n" | ||||
"organization\n" | |||||
" to which you're sending the " | " to which you're sending the " | ||||
"transaction. This is not part of the \n" | "transaction. This is not part of the \n" | ||||
" transaction, just kept in " | " transaction, just kept in " | ||||
"your wallet."}, | "your wallet."}, | ||||
{"subtractfeefromamount", RPCArg::Type::BOOL, | {"subtractfeefromamount", RPCArg::Type::BOOL, | ||||
/* opt */ true, /* default_val */ "false", | /* opt */ true, /* default_val */ "false", | ||||
"The fee will be deducted from the amount being sent.\n" | "The fee will be deducted from the amount being sent.\n" | ||||
" The recipient will receive " | " The recipient will receive " | ||||
▲ Show 20 Lines • Show All 398 Lines • ▼ Show 20 Lines | if (request.fHelp || (request.params.size() > 3)) { | ||||
"getbalance", | "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, /* opt */ true, | {"dummy", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "null", | ||||
"Remains for backward compatibility. Must be " | "Remains for backward compatibility. Must be excluded or set " | ||||
"excluded or set to \"*\"."}, | "to \"*\"."}, | ||||
{"minconf", RPCArg::Type::NUM, /* opt */ true, | {"minconf", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "0", | /* default_val */ "0", | ||||
"Only include transactions confirmed at least this " | "Only include transactions confirmed at least this " | ||||
"many times."}, | "many times."}, | ||||
{"include_watchonly", RPCArg::Type::BOOL, | {"include_watchonly", RPCArg::Type::BOOL, | ||||
/* opt */ true, /* default_val */ "false", | /* opt */ true, /* default_val */ "false", | ||||
"Also include balance in watch-only addresses (see " | "Also include balance in watch-only addresses (see " | ||||
"'importaddress')"}, | "'importaddress')"}, | ||||
▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 2 || | ||||
CURRENCY_UNIT + " is the value"}, | CURRENCY_UNIT + " is the value"}, | ||||
}, | }, | ||||
}, | }, | ||||
{"minconf", RPCArg::Type::NUM, /* opt */ true, | {"minconf", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "1", | /* default_val */ "1", | ||||
"Only use the balance confirmed at least this many " | "Only use the balance confirmed at least this many " | ||||
"times."}, | "times."}, | ||||
{"comment", RPCArg::Type::STR, /* opt */ true, | {"comment", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", "A comment"}, | /* default_val */ "null", "A comment"}, | ||||
{ | { | ||||
"subtractfeefrom", | "subtractfeefrom", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ true, | /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "null", | ||||
"A json array with addresses.\n" | "A json array with addresses.\n" | ||||
" The fee will be equally " | " The fee will be equally " | ||||
"deducted from the amount of each selected address.\n" | "deducted from the amount of each selected address.\n" | ||||
" Those recipients will " | " Those recipients will " | ||||
"receive less bitcoins than you enter in their " | "receive less bitcoins than you enter in their " | ||||
"corresponding amount field.\n" | "corresponding amount field.\n" | ||||
" If no addresses are " | " If no addresses are " | ||||
"specified here, the sender pays the fee.", | "specified here, the sender pays the fee.", | ||||
▲ Show 20 Lines • Show All 187 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 2 || | ||||
"public keys", | "public keys", | ||||
{ | { | ||||
{"key", RPCArg::Type::STR, /* opt */ false, | {"key", RPCArg::Type::STR, /* opt */ false, | ||||
/* default_val */ "", | /* default_val */ "", | ||||
"bitcoin address or hex-encoded public key"}, | "bitcoin address or hex-encoded public key"}, | ||||
}, | }, | ||||
}, | }, | ||||
{"label", RPCArg::Type::STR, /* opt */ true, | {"label", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "null", | ||||
"A label to assign the addresses to."}, | "A label to assign the addresses to."}, | ||||
}, | }, | ||||
RPCResult{"{\n" | RPCResult{"{\n" | ||||
" \"address\":\"multisigaddress\", (string) The " | " \"address\":\"multisigaddress\", (string) The " | ||||
"value of the new multisig address.\n" | "value of the new multisig address.\n" | ||||
" \"redeemScript\":\"script\" (string) The " | " \"redeemScript\":\"script\" (string) The " | ||||
"string value of the hex-encoded redemption script.\n" | "string value of the hex-encoded redemption script.\n" | ||||
"}\n"}, | "}\n"}, | ||||
▲ Show 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 4) { | ||||
/* default_val */ "false", | /* default_val */ "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, /* opt */ true, | {"include_watchonly", RPCArg::Type::BOOL, /* opt */ true, | ||||
/* default_val */ "false", | /* default_val */ "false", | ||||
"Whether to include watch-only addresses (see " | "Whether to include watch-only addresses (see " | ||||
"'importaddress')."}, | "'importaddress')."}, | ||||
{"address_filter", RPCArg::Type::STR, /* opt */ true, | {"address_filter", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "null", | ||||
"If present, only return information on this address."}, | "If present, only return information on this address."}, | ||||
}, | }, | ||||
RPCResult{ | RPCResult{ | ||||
"[\n" | "[\n" | ||||
" {\n" | " {\n" | ||||
" \"involvesWatchonly\" : true, (bool) Only returned " | " \"involvesWatchonly\" : true, (bool) Only returned " | ||||
"if imported addresses were involved in transaction\n" | "if imported addresses were involved in transaction\n" | ||||
" \"address\" : \"receivingaddress\", (string) The " | " \"address\" : \"receivingaddress\", (string) The " | ||||
▲ Show 20 Lines • Show All 202 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 4) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"listtransactions", | "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, /* opt */ true, | {"label", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "null", | ||||
"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."}, | ||||
{"count", RPCArg::Type::NUM, /* opt */ true, | {"count", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "10", | /* default_val */ "10", | ||||
"The number of transactions to return"}, | "The number of transactions to return"}, | ||||
{"skip", RPCArg::Type::NUM, /* opt */ true, | {"skip", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "0", "The number of transactions to skip"}, | /* default_val */ "0", "The number of transactions to skip"}, | ||||
▲ Show 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 4) { | ||||
"transactions if omitted.\n" | "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 affecting " | ||||
"the wallet which were removed are returned in the \"removed\" " | "the wallet which were removed are returned in the \"removed\" " | ||||
"array.\n", | "array.\n", | ||||
{ | { | ||||
{"blockhash", RPCArg::Type::STR, /* opt */ true, | {"blockhash", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "null", | ||||
"The block hash to list transactions since"}, | "If set, the block hash to list transactions since, otherwise " | ||||
"list all transactions."}, | |||||
{"target_confirmations", RPCArg::Type::NUM, /* opt */ true, | {"target_confirmations", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "1", | /* default_val */ "1", | ||||
"Return the nth block hash from the main chain. e.g. 1 " | "Return the nth block hash from the main chain. e.g. 1 " | ||||
"would mean the best block hash. Note: this is not used " | "would mean the best block hash. Note: this is not used " | ||||
"as a filter, but only affects [lastblock] in the return " | "as a filter, but only affects [lastblock] in the return " | ||||
"value"}, | "value"}, | ||||
{"include_watchonly", RPCArg::Type::BOOL, /* opt */ true, | {"include_watchonly", RPCArg::Type::BOOL, /* opt */ true, | ||||
/* default_val */ "false", | /* default_val */ "false", | ||||
▲ Show 20 Lines • Show All 810 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
{"unlock", RPCArg::Type::BOOL, /* opt */ false, | {"unlock", RPCArg::Type::BOOL, /* opt */ false, | ||||
/* default_val */ "", | /* default_val */ "", | ||||
"Whether to unlock (true) or lock (false) the specified " | "Whether to unlock (true) or lock (false) the specified " | ||||
"transactions"}, | "transactions"}, | ||||
{ | { | ||||
"transactions", | "transactions", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ true, | /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "empty array", | ||||
"A json array of objects. Each object the txid " | "A json array of objects. Each object the txid (string) " | ||||
"(string) vout (numeric)", | "vout (numeric).", | ||||
{ | { | ||||
{ | { | ||||
"", | "", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ true, | /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "", | ||||
"", | "", | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 555 Lines • ▼ Show 20 Lines | static UniValue unloadwallet(const Config &config, | ||||
if (request.fHelp || request.params.size() > 1) { | if (request.fHelp || request.params.size() > 1) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"unloadwallet", | "unloadwallet", | ||||
"Unloads the wallet referenced by the request endpoint " | "Unloads the wallet referenced by the request endpoint " | ||||
"otherwise unloads the wallet specified in the argument.\n" | "otherwise unloads the wallet specified in the argument.\n" | ||||
"Specifying the wallet name on a wallet endpoint is invalid.", | "Specifying the wallet name on a wallet endpoint is invalid.", | ||||
{ | { | ||||
{"wallet_name", RPCArg::Type::STR, /* opt */ true, | {"wallet_name", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", "The name of the wallet to unload."}, | /* default_val */ "the wallet name from the RPC request", | ||||
"The name of the wallet to unload."}, | |||||
}, | }, | ||||
RPCResults{}, | RPCResults{}, | ||||
RPCExamples{HelpExampleCli("unloadwallet", "wallet_name") + | RPCExamples{HelpExampleCli("unloadwallet", "wallet_name") + | ||||
HelpExampleRpc("unloadwallet", "wallet_name")}, | HelpExampleRpc("unloadwallet", "wallet_name")}, | ||||
} | } | ||||
.ToString()); | .ToString()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 5) { | ||||
/* default_val */ "1", "The minimum confirmations to filter"}, | /* default_val */ "1", "The minimum confirmations to filter"}, | ||||
{"maxconf", RPCArg::Type::NUM, /* opt */ true, | {"maxconf", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "9999999", | /* default_val */ "9999999", | ||||
"The maximum confirmations to filter"}, | "The maximum confirmations to filter"}, | ||||
{ | { | ||||
"addresses", | "addresses", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ true, | /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "empty array", | ||||
"A json array of bitcoin addresses to filter", | "A json array of bitcoin addresses to filter", | ||||
{ | { | ||||
{"address", RPCArg::Type::STR, /* opt */ true, | {"address", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", "bitcoin address"}, | /* default_val */ "", "bitcoin address"}, | ||||
}, | }, | ||||
}, | }, | ||||
{"include_unsafe", RPCArg::Type::BOOL, /* opt */ true, | {"include_unsafe", RPCArg::Type::BOOL, /* opt */ true, | ||||
/* default_val */ "true", | /* default_val */ "true", | ||||
"Include outputs that are not safe to spend\n" | "Include outputs that are not safe to spend\n" | ||||
" See description of \"safe\" attribute " | " See description of \"safe\" attribute " | ||||
"below."}, | "below."}, | ||||
{"query_options", | {"query_options", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ true, | /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "null", | ||||
"JSON with query options", | "JSON with query options", | ||||
{ | { | ||||
{"minimumAmount", RPCArg::Type::AMOUNT, /* opt */ true, | {"minimumAmount", RPCArg::Type::AMOUNT, /* opt */ true, | ||||
/* default_val */ "0", | /* default_val */ "0", | ||||
"Minimum value of each UTXO in " + CURRENCY_UNIT + ""}, | "Minimum value of each UTXO in " + CURRENCY_UNIT + ""}, | ||||
{"maximumAmount", RPCArg::Type::AMOUNT, /* opt */ true, | {"maximumAmount", RPCArg::Type::AMOUNT, /* opt */ true, | ||||
/* default_val */ "unlimited", | /* default_val */ "unlimited", | ||||
"Maximum value of each UTXO in " + CURRENCY_UNIT + ""}, | "Maximum value of each UTXO in " + CURRENCY_UNIT + ""}, | ||||
▲ Show 20 Lines • Show All 339 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
"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, /* opt */ false, | {"hexstring", RPCArg::Type::STR_HEX, /* opt */ false, | ||||
/* default_val */ "", "The hex string of the raw transaction"}, | /* default_val */ "", "The hex string of the raw transaction"}, | ||||
{"options", | {"options", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ true, | /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "null", | ||||
"for backward compatibility: passing in a true instead of " | "for backward compatibility: passing in a true instead of an " | ||||
"an object will result in {\"includeWatching\":true}", | "object will result in {\"includeWatching\":true}", | ||||
{ | { | ||||
{"changeAddress", RPCArg::Type::STR, /* opt */ true, | {"changeAddress", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "pool address", | /* default_val */ "pool address", | ||||
"The bitcoin address to receive the change"}, | "The bitcoin address to receive the change"}, | ||||
{"changePosition", RPCArg::Type::NUM, /* opt */ true, | {"changePosition", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "", "The index of the change output"}, | /* default_val */ "", "The index of the change output"}, | ||||
{"includeWatching", RPCArg::Type::BOOL, /* opt */ true, | {"includeWatching", RPCArg::Type::BOOL, /* opt */ true, | ||||
/* default_val */ "false", | /* default_val */ "false", | ||||
"Also select inputs which are watch only"}, | "Also select inputs which are watch only"}, | ||||
{"lockUnspents", RPCArg::Type::BOOL, /* opt */ true, | {"lockUnspents", RPCArg::Type::BOOL, /* opt */ true, | ||||
/* default_val */ "false", | /* default_val */ "false", | ||||
"Lock selected unspent outputs"}, | "Lock selected unspent outputs"}, | ||||
{"feeRate", RPCArg::Type::AMOUNT, /* opt */ true, | {"feeRate", RPCArg::Type::AMOUNT, /* opt */ true, | ||||
/* default_val */ | /* default_val */ | ||||
"not set: makes wallet determine the fee", | "not set: makes wallet determine the fee", | ||||
"Set a specific fee rate in " + CURRENCY_UNIT + "/kB"}, | "Set a specific fee rate in " + CURRENCY_UNIT + "/kB"}, | ||||
{ | { | ||||
"subtractFeeFromOutputs", | "subtractFeeFromOutputs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ true, | /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "empty array", | ||||
"A json array of integers.\n" | "A json array of integers.\n" | ||||
" The fee will be " | " The fee will be " | ||||
"equally deducted from the amount of each " | "equally deducted from the amount of each " | ||||
"specified output.\n" | "specified output.\n" | ||||
" The outputs are " | |||||
"specified by their zero-based index, before any " | |||||
"change output is added.\n" | |||||
" Those recipients " | " Those recipients " | ||||
"will receive less bitcoins than you enter in " | "will receive less bitcoins than you enter in " | ||||
"their corresponding amount field.\n" | "their corresponding amount field.\n" | ||||
" If no outputs are " | " If no outputs are " | ||||
"specified here, the sender pays the fee.", | "specified here, the sender pays the fee.", | ||||
{ | { | ||||
{"vout_index", RPCArg::Type::NUM, | {"vout_index", RPCArg::Type::NUM, | ||||
/* opt */ true, /* default_val */ "", | /* opt */ true, /* default_val */ "", | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
HelpRequiringPassphrase(pwallet) + "\n", | HelpRequiringPassphrase(pwallet) + "\n", | ||||
{ | { | ||||
{"hexstring", RPCArg::Type::STR, /* opt */ false, | {"hexstring", RPCArg::Type::STR, /* opt */ false, | ||||
/* default_val */ "", "The transaction hex string"}, | /* default_val */ "", "The transaction hex string"}, | ||||
{ | { | ||||
"prevtxs", | "prevtxs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ true, | /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "null", | ||||
"A json array of previous dependent transaction " | "A json array of previous dependent transaction outputs", | ||||
"outputs", | |||||
{ | { | ||||
{ | { | ||||
"", | "", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ false, | /* opt */ false, | ||||
/* default_val */ "", | /* default_val */ "", | ||||
"", | "", | ||||
{ | { | ||||
{"txid", RPCArg::Type::STR_HEX, | {"txid", RPCArg::Type::STR_HEX, | ||||
/* opt */ false, /* default_val */ "", | /* opt */ false, /* default_val */ "", | ||||
"The transaction id"}, | "The transaction id"}, | ||||
{"vout", RPCArg::Type::NUM, /* opt */ false, | {"vout", RPCArg::Type::NUM, /* opt */ false, | ||||
/* default_val */ "", "The output number"}, | /* default_val */ "", "The output number"}, | ||||
{"scriptPubKey", RPCArg::Type::STR_HEX, | {"scriptPubKey", RPCArg::Type::STR_HEX, | ||||
/* opt */ false, /* default_val */ "", | /* opt */ false, /* default_val */ "", | ||||
"script key"}, | "script key"}, | ||||
{"redeemScript", RPCArg::Type::STR_HEX, | {"redeemScript", RPCArg::Type::STR_HEX, | ||||
/* opt */ true, /* default_val */ "", | /* opt */ true, /* default_val */ "omitted", | ||||
"(required for P2SH)"}, | "(required for P2SH)"}, | ||||
{"amount", RPCArg::Type::AMOUNT, | {"amount", RPCArg::Type::AMOUNT, | ||||
/* opt */ false, /* default_val */ "", | /* opt */ false, /* default_val */ "", | ||||
"The amount spent"}, | "The amount spent"}, | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
"generate", | "generate", | ||||
"\nMine up to nblocks blocks immediately (before the RPC call " | "\nMine up to nblocks blocks immediately (before the RPC call " | ||||
"returns) to an address in the wallet.\n", | "returns) to an address in the wallet.\n", | ||||
{ | { | ||||
{"nblocks", RPCArg::Type::NUM, /* opt */ false, | {"nblocks", RPCArg::Type::NUM, /* opt */ false, | ||||
/* default_val */ "", | /* default_val */ "", | ||||
"How many blocks are generated immediately."}, | "How many blocks are generated immediately."}, | ||||
{"maxtries", RPCArg::Type::NUM, /* opt */ true, | {"maxtries", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "1000000", "How many iterations to try."}, | ||||
"How many iterations to try (default = 1000000)."}, | |||||
}, | }, | ||||
RPCResult{ | RPCResult{ | ||||
"[ blockhashes ] (array) hashes of blocks generated\n"}, | "[ blockhashes ] (array) hashes of blocks generated\n"}, | ||||
RPCExamples{"\nGenerate 11 blocks\n" + | RPCExamples{"\nGenerate 11 blocks\n" + | ||||
HelpExampleCli("generate", "11")}} | HelpExampleCli("generate", "11")}} | ||||
.ToString()); | .ToString()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | UniValue rescanblockchain(const Config &config, const JSONRPCRequest &request) { | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 2) { | if (request.fHelp || request.params.size() > 2) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"rescanblockchain", | "rescanblockchain", | ||||
"\nRescan the local blockchain for wallet related transactions.\n", | "\nRescan the local blockchain for wallet related transactions.\n", | ||||
{ | { | ||||
{"start_height", RPCArg::Type::NUM, /* opt */ true, | {"start_height", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "0", | ||||
"block height where the rescan should start"}, | "block height where the rescan should start"}, | ||||
{"stop_height", RPCArg::Type::NUM, /* opt */ true, | {"stop_height", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "tip height", | ||||
"the last block height that should be scanned. If none is " | "the last block height that should be scanned"}, | ||||
"provided it will rescan up to the tip at return time of this " | |||||
"call."}, | |||||
}, | }, | ||||
RPCResult{"{\n" | RPCResult{"{\n" | ||||
" \"start_height\" (numeric) The block height where " | " \"start_height\" (numeric) The block height where " | ||||
"the rescan started (the requested height or 0\n" | "the rescan started (the requested height or 0\n" | ||||
" \"stop_height\" (numeric) The height of the last " | " \"stop_height\" (numeric) The height of the last " | ||||
"rescanned block. May be null in rare cases if there was " | "rescanned block. May be null in rare cases if there was " | ||||
"a reorg and the call didn't scan any blocks because " | "a reorg and the call didn't scan any blocks because " | ||||
"they were already scanned in the background.\n" | "they were already scanned in the background.\n" | ||||
▲ Show 20 Lines • Show All 427 Lines • ▼ Show 20 Lines | UniValue listlabels(const Config &config, const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() > 1) { | if (request.fHelp || request.params.size() > 1) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
"listlabels", | "listlabels", | ||||
"\nReturns the list of all labels, or labels that are " | "\nReturns the list of all labels, or labels that are " | ||||
"assigned to addresses with a specific purpose.\n", | "assigned to addresses with a specific purpose.\n", | ||||
{ | { | ||||
{"purpose", RPCArg::Type::STR, /* opt */ true, | {"purpose", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "null", | ||||
"Address purpose to list labels for " | "Address purpose to list labels for ('send','receive'). An " | ||||
"('send','receive'). An empty string is the same as not " | "empty string is the same as not providing this argument."}, | ||||
"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" | ||||
" ...\n" | " ...\n" | ||||
"]\n"}, | "]\n"}, | ||||
RPCExamples{"\nList all labels\n" + | RPCExamples{"\nList all labels\n" + | ||||
HelpExampleCli("listlabels", "") + | HelpExampleCli("listlabels", "") + | ||||
"\nList labels that have receiving addresses\n" + | "\nList labels that have receiving addresses\n" + | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 2) { | ||||
"getnewaddress and change address from getrawchangeaddress " | "getnewaddress and change address from getrawchangeaddress " | ||||
"will be from this new seed.\n" | "will be from this new seed.\n" | ||||
" If false, addresses (including " | " If false, addresses (including " | ||||
"change addresses if the wallet already had HD Chain Split " | "change addresses if the wallet already had HD Chain Split " | ||||
"enabled) from the existing\n" | "enabled) from the existing\n" | ||||
" keypool will be used until it " | " keypool will be used until it " | ||||
"has been depleted."}, | "has been depleted."}, | ||||
{"seed", RPCArg::Type::STR, /* opt */ true, | {"seed", RPCArg::Type::STR, /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "random seed", | ||||
"The WIF private key to use as the new HD seed; if not " | "The WIF private key to use as the new HD seed.\n" | ||||
"provided a random seed will be used.\n" | |||||
" The seed value can be retrieved " | " The seed value can be retrieved " | ||||
"using the dumpwallet command. It is the private key marked " | "using the dumpwallet command. It is the private key marked " | ||||
"hdseed=1"}, | "hdseed=1"}, | ||||
}, | }, | ||||
RPCResults{}, | RPCResults{}, | ||||
RPCExamples{HelpExampleCli("sethdseed", "") + | RPCExamples{HelpExampleCli("sethdseed", "") + | ||||
HelpExampleCli("sethdseed", "false") + | HelpExampleCli("sethdseed", "false") + | ||||
HelpExampleCli("sethdseed", "true \"wifkey\"") + | HelpExampleCli("sethdseed", "true \"wifkey\"") + | ||||
▲ Show 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 2 || | ||||
{ | { | ||||
"", | "", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ true, | /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "", | ||||
"", | "", | ||||
{ | { | ||||
{"address", RPCArg::Type::AMOUNT, | {"address", RPCArg::Type::AMOUNT, | ||||
/* opt */ true, /* default_val */ "", | /* opt */ false, /* default_val */ "", | ||||
"A key-value pair. The key (string) is the " | "A key-value pair. The key (string) is the " | ||||
"bitcoin address, the value (float or string) " | "bitcoin address, the value (float or string) " | ||||
"is the amount in " + | "is the amount in " + | ||||
CURRENCY_UNIT + ""}, | CURRENCY_UNIT + ""}, | ||||
}, | }, | ||||
}, | }, | ||||
{ | { | ||||
"", | "", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ true, | /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "", | ||||
"", | "", | ||||
{ | { | ||||
{"data", RPCArg::Type::STR_HEX, | {"data", RPCArg::Type::STR_HEX, /* opt */ false, | ||||
/* opt */ true, /* default_val */ "", | /* default_val */ "", | ||||
"A key-value pair. The key must be " | "A key-value pair. The key must be \"data\", " | ||||
"\"data\", the value is hex-encoded data"}, | "the value is hex-encoded data"}, | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
{"locktime", RPCArg::Type::NUM, /* opt */ true, | {"locktime", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "0", | /* default_val */ "0", | ||||
"Raw locktime. Non-0 value also locktime-activates inputs\n" | "Raw locktime. Non-0 value also locktime-activates inputs\n" | ||||
" Allows this transaction to " | " Allows this transaction to " | ||||
"be replaced by a transaction with higher fees. If provided, " | "be replaced by a transaction with higher fees. If provided, " | ||||
"it is an error if explicit sequence numbers are " | "it is an error if explicit sequence numbers are " | ||||
"incompatible."}, | "incompatible."}, | ||||
{"options", | {"options", | ||||
RPCArg::Type::OBJ, | RPCArg::Type::OBJ, | ||||
/* opt */ true, | /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "null", | ||||
"", | "", | ||||
{ | { | ||||
{"changeAddress", RPCArg::Type::STR_HEX, | {"changeAddress", RPCArg::Type::STR_HEX, | ||||
/* opt */ true, /* default_val */ "pool address", | /* opt */ true, /* default_val */ "pool address", | ||||
"The bitcoin address to receive the change"}, | "The bitcoin address to receive the change"}, | ||||
{"changePosition", RPCArg::Type::NUM, /* opt */ true, | {"changePosition", RPCArg::Type::NUM, /* opt */ true, | ||||
/* default_val */ "random", | /* default_val */ "random", | ||||
"The index of the change output"}, | "The index of the change output"}, | ||||
{"includeWatching", RPCArg::Type::BOOL, /* opt */ true, | {"includeWatching", RPCArg::Type::BOOL, /* opt */ true, | ||||
/* default_val */ "false", | /* default_val */ "false", | ||||
"Also select inputs which are watch only"}, | "Also select inputs which are watch only"}, | ||||
{"lockUnspents", RPCArg::Type::BOOL, /* opt */ true, | {"lockUnspents", RPCArg::Type::BOOL, /* opt */ true, | ||||
/* default_val */ "false", | /* default_val */ "false", | ||||
"Lock selected unspent outputs"}, | "Lock selected unspent outputs"}, | ||||
{"feeRate", RPCArg::Type::AMOUNT, /* opt */ true, | {"feeRate", RPCArg::Type::AMOUNT, /* opt */ true, | ||||
/* default_val */ | /* default_val */ | ||||
"not set: makes wallet determine the fee", | "not set: makes wallet determine the fee", | ||||
"Set a specific fee rate in " + CURRENCY_UNIT + "/kB"}, | "Set a specific fee rate in " + CURRENCY_UNIT + "/kB"}, | ||||
{ | { | ||||
"subtractFeeFromOutputs", | "subtractFeeFromOutputs", | ||||
RPCArg::Type::ARR, | RPCArg::Type::ARR, | ||||
/* opt */ true, | /* opt */ true, | ||||
/* default_val */ "", | /* default_val */ "empty array", | ||||
"A json array of integers.\n" | "A json array of integers.\n" | ||||
" The fee will be " | " The fee will be " | ||||
"equally deducted from the amount of each specified " | "equally deducted from the amount of each specified " | ||||
"output.\n" | "output.\n" | ||||
" The outputs are " | |||||
"specified by their zero-based index, before any " | |||||
"change output is added.\n" | |||||
" Those recipients will " | " Those recipients will " | ||||
"receive less bitcoins than you enter in their " | "receive less bitcoins than you enter in their " | ||||
"corresponding amount field.\n" | "corresponding amount field.\n" | ||||
" If no outputs are " | " If no outputs are " | ||||
"specified here, the sender pays the fee.", | "specified here, the sender pays the fee.", | ||||
{ | { | ||||
{"vout_index", RPCArg::Type::NUM, | {"vout_index", RPCArg::Type::NUM, /* opt */ true, | ||||
/* opt */ true, /* default_val */ "", ""}, | /* default_val */ "", | ||||
"The zero-based output index, before a change " | |||||
"output is added."}, | |||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
"options"}, | "options"}, | ||||
{"bip32derivs", RPCArg::Type::BOOL, /* opt */ true, | {"bip32derivs", RPCArg::Type::BOOL, /* opt */ true, | ||||
/* default_val */ "false", | /* default_val */ "false", | ||||
"If true, includes the BIP 32 derivation paths for public " | "If true, includes the BIP 32 derivation paths for public " | ||||
"keys if we know them"}, | "keys if we know them"}, | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |