38 static const std::string WALLET_ENDPOINT_BASE =
"/wallet/";
42 if (request.
URI.substr(0, WALLET_ENDPOINT_BASE.size()) == WALLET_ENDPOINT_BASE) {
44 std::string requestedWallet =
urlDecode(request.
URI.substr(WALLET_ENDPOINT_BASE.size()));
46 if (pwallet->GetName() == requestedWallet) {
59 ?
"\nRequires wallet passphrase to be set with walletpassphrase call." 65 if (pwallet)
return true;
66 if (avoidException)
return false;
74 RPC_METHOD_NOT_FOUND,
"Method not found (wallet method is disabled because no wallet is loaded)");
77 "Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path).");
90 entry.
push_back(Pair(
"confirmations", confirms));
106 entry.
push_back(Pair(
"walletconflicts", conflicts));
111 std::string rbfStatus =
"no";
120 entry.
push_back(Pair(
"bip125-replaceable", rbfStatus));
122 for (
const std::pair<std::string, std::string>& item : wtx.
mapValue)
123 entry.
push_back(Pair(item.first, item.second));
128 std::string strAccount = value.
get_str();
129 if (strAccount ==
"*")
142 throw std::runtime_error(
143 "getnewaddress ( \"account\" )\n" 144 "\nReturns a new Raven address for receiving payments.\n" 145 "If 'account' is specified (DEPRECATED), it is added to the address book \n" 146 "so payments received with the address will be credited to 'account'.\n" 148 "1. \"account\" (string, optional) DEPRECATED. The account name for the address to be linked to. If not provided, the default account \"\" is used. It can also be set to the empty string \"\" to represent the default account. The account does not need to exist, it will be created if there is no account by the given name.\n" 150 "\"address\" (string) The new raven address\n" 159 std::string strAccount;
187 return pubKey.
GetID();
198 throw std::runtime_error(
199 "getaccountaddress \"account\"\n" 200 "\nDEPRECATED. Returns the current Raven address for receiving payments to this account.\n" 202 "1. \"account\" (string, required) The account name for the address. It can also be set to the empty string \"\" to represent the default account. The account does not need to exist, it will be created and a new address created if there is no account by the given name.\n" 204 "\"address\" (string) The account raven address\n" 232 throw std::runtime_error(
233 "getrawchangeaddress\n" 234 "\nReturns a new Raven address, for receiving change.\n" 235 "This is for use with raw transactions, NOT normal use.\n" 237 "\"address\" (string) The address\n" 270 throw std::runtime_error(
271 "setaccount \"address\" \"account\"\n" 272 "\nDEPRECATED. Sets the account associated with the given address.\n" 274 "1. \"address\" (string, required) The raven address to be associated with an account.\n" 275 "2. \"account\" (string, required) The account to assign the address to.\n" 277 +
HelpExampleCli(
"setaccount",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"tabby\"")
278 +
HelpExampleRpc(
"setaccount",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", \"tabby\"")
288 std::string strAccount;
293 if (
IsMine(*pwallet, dest)) {
318 throw std::runtime_error(
319 "getaccount \"address\"\n" 320 "\nDEPRECATED. Returns the account associated with the given address.\n" 322 "1. \"address\" (string, required) The raven address for account lookup.\n" 324 "\"accountname\" (string) the account address\n" 326 +
HelpExampleCli(
"getaccount",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\"")
327 +
HelpExampleRpc(
"getaccount",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\"")
337 std::string strAccount;
338 std::map<CTxDestination, CAddressBookData>::iterator mi = pwallet->
mapAddressBook.find(dest);
339 if (mi != pwallet->
mapAddressBook.end() && !(*mi).second.name.empty()) {
340 strAccount = (*mi).second.name;
354 throw std::runtime_error(
355 "getaddressesbyaccount \"account\"\n" 356 "\nDEPRECATED. Returns the list of addresses for the given account.\n" 358 "1. \"account\" (string, required) The account name.\n" 360 "[ (json array of string)\n" 361 " \"address\" (string) a raven address associated with the given account\n" 375 for (
const std::pair<CTxDestination, CAddressBookData>& item : pwallet->
mapAddressBook) {
377 const std::string& strName = item.second.name;
378 if (strName == strAccount) {
393 if (nValue > curBalance)
406 std::string strError;
407 std::vector<CRecipient> vecSend;
408 int nChangePosRet = -1;
409 CRecipient recipient = {scriptPubKey, nValue, fSubtractFeeFromAmount};
411 if (!pwallet->
CreateTransaction(vecSend, wtxNew, reservekey, nFeeRequired, nChangePosRet, strError, coin_control)) {
412 if (!fSubtractFeeFromAmount && nValue + nFeeRequired > curBalance)
413 strError =
strprintf(
"Error: This transaction requires a transaction fee of at least %s",
FormatMoney(nFeeRequired));
431 throw std::runtime_error(
432 "sendtoaddress \"address\" amount ( \"comment\" \"comment_to\" subtractfeefromamount replaceable conf_target \"estimate_mode\")\n" 433 "\nSend an amount to a given address.\n" 436 "1. \"address\" (string, required) The raven address to send to.\n" 437 "2. \"amount\" (numeric or string, required) The amount in " +
CURRENCY_UNIT +
" to send. eg 0.1\n" 438 "3. \"comment\" (string, optional) A comment used to store what the transaction is for. \n" 439 " This is not part of the transaction, just kept in your wallet.\n" 440 "4. \"comment_to\" (string, optional) A comment to store the name of the person or organization \n" 441 " to which you're sending the transaction. This is not part of the \n" 442 " transaction, just kept in your wallet.\n" 443 "5. subtractfeefromamount (boolean, optional, default=false) The fee will be deducted from the amount being sent.\n" 444 " The recipient will receive less ravens than you enter in the amount field.\n" 446 "6. conf_target (numeric, optional) Confirmation target (in blocks)\n" 447 "7. \"estimate_mode\" (string, optional, default=UNSET) The fee estimate mode, must be one of:\n" 450 " \"CONSERVATIVE\"\n" 452 "\"txid\" (string) The transaction id.\n" 454 +
HelpExampleCli(
"sendtoaddress",
"\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1")
455 +
HelpExampleCli(
"sendtoaddress",
"\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"donation\" \"seans outpost\"")
456 +
HelpExampleCli(
"sendtoaddress",
"\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"\" \"\" true")
457 +
HelpExampleRpc(
"sendtoaddress",
"\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.1, \"donation\", \"seans outpost\"")
480 bool fSubtractFeeFromAmount =
false;
503 SendMoney(pwallet, dest, nAmount, fSubtractFeeFromAmount, wtx, coin_control);
516 throw std::runtime_error(
517 "listaddressgroupings\n" 518 "\nLists groups of addresses which have had their common ownership\n" 519 "made public by common use as inputs or as the resulting change\n" 520 "in past transactions\n" 525 " \"address\", (string) The raven address\n" 527 " \"account\" (string, optional) DEPRECATED. The account\n" 559 return jsonGroupings;
570 throw std::runtime_error(
571 "signmessage \"address\" \"message\"\n" 572 "\nSign a message with the private key of an address" 575 "1. \"address\" (string, required) The raven address to use for the private key.\n" 576 "2. \"message\" (string, required) The message to create a signature of.\n" 578 "\"signature\" (string) The signature of the message encoded in base 64\n" 580 "\nUnlock the wallet for 30 seconds\n" 582 "\nCreate the signature\n" 583 +
HelpExampleCli(
"signmessage",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"my message\"") +
584 "\nVerify the signature\n" 585 +
HelpExampleCli(
"verifymessage",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"signature\" \"my message\"") +
587 +
HelpExampleRpc(
"signmessage",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", \"my message\"")
602 const CKeyID *keyID = boost::get<CKeyID>(&dest);
608 if (!pwallet->
GetKey(*keyID, key)) {
616 std::vector<unsigned char> vchSig;
631 throw std::runtime_error(
632 "getreceivedbyaddress \"address\" ( minconf )\n" 633 "\nReturns the total amount received by the given address in transactions with at least minconf confirmations.\n" 635 "1. \"address\" (string, required) The raven address for transactions.\n" 636 "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" 638 "amount (numeric) The total amount in " +
CURRENCY_UNIT +
" received at this address.\n" 640 "\nThe amount from transactions with at least 1 confirmation\n" 641 +
HelpExampleCli(
"getreceivedbyaddress",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\"") +
642 "\nThe amount including unconfirmed transactions, zero confirmations\n" 643 +
HelpExampleCli(
"getreceivedbyaddress",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" 0") +
644 "\nThe amount with at least 6 confirmations\n" 645 +
HelpExampleCli(
"getreceivedbyaddress",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" 6") +
646 "\nAs a json rpc call\n" 647 +
HelpExampleRpc(
"getreceivedbyaddress",
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", 6")
659 if (!
IsMine(*pwallet, scriptPubKey)) {
670 for (
const std::pair<uint256, CWalletTx>& pairWtx : pwallet->
mapWallet) {
675 for (
const CTxOut& txout : wtx.
tx->vout)
693 throw std::runtime_error(
694 "getreceivedbyaccount \"account\" ( minconf )\n" 695 "\nDEPRECATED. Returns the total amount received by addresses with <account> in transactions with at least [minconf] confirmations.\n" 697 "1. \"account\" (string, required) The selected account, may be the default account using \"\".\n" 698 "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" 700 "amount (numeric) The total amount in " +
CURRENCY_UNIT +
" received for this account.\n" 702 "\nAmount received by the default account with at least 1 confirmation\n" 704 "\nAmount received at the tabby account including unconfirmed amounts with zero confirmations\n" 706 "\nThe amount with at least 6 confirmations\n" 708 "\nAs a json rpc call\n" 726 for (
const std::pair<uint256, CWalletTx>& pairWtx : pwallet->
mapWallet) {
731 for (
const CTxOut& txout : wtx.
tx->vout)
753 throw std::runtime_error(
754 "getbalance ( \"account\" minconf include_watchonly )\n" 755 "\nIf account is not specified, returns the server's total available balance.\n" 756 "If account is specified (DEPRECATED), returns the balance in the account.\n" 757 "Note that the account \"\" is not the same as leaving the parameter out.\n" 758 "The server total may be different to the balance in the default \"\" account.\n" 760 "1. \"account\" (string, optional) DEPRECATED. The account string may be given as a\n" 761 " specific account name to find the balance associated with wallet keys in\n" 762 " a named account, or as the empty string (\"\") to find the balance\n" 763 " associated with wallet keys not in any named account, or as \"*\" to find\n" 764 " the balance associated with all wallet keys regardless of account.\n" 765 " When this option is specified, it calculates the balance in a different\n" 766 " way than when it is not specified, and which can count spends twice when\n" 767 " there are conflicting pending transactions (such as those created by\n" 768 " the bumpfee command), temporarily resulting in low or even negative\n" 769 " balances. In general, account balance calculation is not considered\n" 770 " reliable and has resulted in confusing outcomes, so it is recommended to\n" 771 " avoid passing this argument.\n" 772 "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" 773 "3. include_watchonly (bool, optional, default=false) Also include balance in watch-only addresses (see 'importaddress')\n" 775 "amount (numeric) The total amount in " +
CURRENCY_UNIT +
" received for this account.\n" 777 "\nThe total amount in the wallet with 1 or more confirmations\n" 779 "\nThe total amount in the wallet at least 6 blocks confirmed\n" 781 "\nAs a json rpc call\n" 792 if (account_value.
isNull()) {
795 "getbalance minconf option is only currently supported if an account is specified");
797 if (!include_watchonly.
isNull()) {
799 "getbalance include_watchonly option is only currently supported if an account is specified");
804 const std::string& account_param = account_value.
get_str();
805 const std::string* account = account_param !=
"*" ? &account_param :
nullptr;
811 if(!include_watchonly.
isNull())
826 throw std::runtime_error(
827 "getunconfirmedbalance\n" 828 "Returns the server's total unconfirmed balance\n");
845 throw std::runtime_error(
846 "move \"fromaccount\" \"toaccount\" amount ( minconf \"comment\" )\n" 847 "\nDEPRECATED. Move a specified amount from one account in your wallet to another.\n" 849 "1. \"fromaccount\" (string, required) The name of the account to move funds from. May be the default account using \"\".\n" 850 "2. \"toaccount\" (string, required) The name of the account to move funds to. May be the default account using \"\".\n" 851 "3. amount (numeric) Quantity of " +
CURRENCY_UNIT +
" to move between accounts.\n" 852 "4. (dummy) (numeric, optional) Ignored. Remains for backward compatibility.\n" 853 "5. \"comment\" (string, optional) An optional comment, stored in the wallet only.\n" 855 "true|false (boolean) true if successful.\n" 857 "\nMove 0.01 " +
CURRENCY_UNIT +
" from the default account to the account named tabby\n" 859 "\nMove 0.01 " +
CURRENCY_UNIT +
" timotei to akiko with a comment and funds have 6 confirmations\n" 860 +
HelpExampleCli(
"move",
"\"timotei\" \"akiko\" 0.01 6 \"happy birthday!\"") +
861 "\nAs a json rpc call\n" 862 +
HelpExampleRpc(
"move",
"\"timotei\", \"akiko\", 0.01, 6, \"happy birthday!\"")
876 std::string strComment;
880 if (!pwallet->
AccountMove(strFrom, strTo, nAmount, strComment)) {
896 throw std::runtime_error(
897 "sendfrom \"fromaccount\" \"toaddress\" amount ( minconf \"comment\" \"comment_to\" )\n" 898 "\nDEPRECATED (use sendtoaddress). Sent an amount from an account to a raven address." 901 "1. \"fromaccount\" (string, required) The name of the account to send funds from. May be the default account using \"\".\n" 902 " Specifying an account does not influence coin selection, but it does associate the newly created\n" 903 " transaction with the account, so the account's balance computation and transaction history can reflect\n" 905 "2. \"toaddress\" (string, required) The raven address to send funds to.\n" 906 "3. amount (numeric or string, required) The amount in " +
CURRENCY_UNIT +
" (transaction fee is added on top).\n" 907 "4. minconf (numeric, optional, default=1) Only use funds with at least this many confirmations.\n" 908 "5. \"comment\" (string, optional) A comment used to store what the transaction is for. \n" 909 " This is not part of the transaction, just kept in your wallet.\n" 910 "6. \"comment_to\" (string, optional) An optional comment to store the name of the person or organization \n" 911 " to which you're sending the transaction. This is not part of the transaction, \n" 912 " it is just kept in your wallet.\n" 914 "\"txid\" (string) The transaction id.\n" 916 "\nSend 0.01 " +
CURRENCY_UNIT +
" from the default account to the address, must have at least 1 confirmation\n" 917 +
HelpExampleCli(
"sendfrom",
"\"\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01") +
918 "\nSend 0.01 from the tabby account to the given address, funds must have at least 6 confirmations\n" 919 +
HelpExampleCli(
"sendfrom",
"\"tabby\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01 6 \"donation\" \"seans outpost\"") +
920 "\nAs a json rpc call\n" 921 +
HelpExampleRpc(
"sendfrom",
"\"tabby\", \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.01, 6, \"donation\", \"seans outpost\"")
950 if (nAmount > nBalance)
954 SendMoney(pwallet, dest, nAmount,
false, wtx, no_coin_control);
968 throw std::runtime_error(
969 "sendmany \"fromaccount\" {\"address\":amount,...} ( minconf \"comment\" [\"address\",...] replaceable conf_target \"estimate_mode\")\n" 970 "\nSend multiple times. Amounts are double-precision floating point numbers." 973 "1. \"fromaccount\" (string, required) DEPRECATED. The account to send the funds from. Should be \"\" for the default account\n" 974 "2. \"amounts\" (string, required) A json object with addresses and amounts\n" 976 " \"address\":amount (numeric or string) The raven address is the key, the numeric amount (can be string) in " +
CURRENCY_UNIT +
" is the value\n" 979 "3. minconf (numeric, optional, default=1) Only use the balance confirmed at least this many times.\n" 980 "4. \"comment\" (string, optional) A comment\n" 981 "5. subtractfeefrom (array, optional) A json array with addresses.\n" 982 " The fee will be equally deducted from the amount of each selected address.\n" 983 " Those recipients will receive less ravens than you enter in their corresponding amount field.\n" 984 " If no addresses are specified here, the sender pays the fee.\n" 986 " \"address\" (string) Subtract fee from this address\n" 990 "6. conf_target (numeric, optional) Confirmation target (in blocks)\n" 991 "7. \"estimate_mode\" (string, optional, default=UNSET) The fee estimate mode, must be one of:\n" 994 " \"CONSERVATIVE\"\n" 996 "\"txid\" (string) The transaction id for the send. Only 1 transaction is created regardless of \n" 997 " the number of addresses.\n" 999 "\nSend two amounts to two different addresses:\n" 1000 +
HelpExampleCli(
"sendmany",
"\"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\"") +
1001 "\nSend two amounts to two different addresses setting the confirmation and comment:\n" 1002 +
HelpExampleCli(
"sendmany",
"\"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\" 6 \"testing\"") +
1003 "\nSend two amounts to two different addresses, subtract fee from amount:\n" 1004 +
HelpExampleCli(
"sendmany",
"\"\" \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\" 1 \"\" \"[\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\",\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\"]\"") +
1005 "\nAs a json rpc call\n" 1006 +
HelpExampleRpc(
"sendmany",
"\"\", \"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\", 6, \"testing\"")
1046 std::set<CTxDestination> destinations;
1047 std::vector<CRecipient> vecSend;
1050 std::vector<std::string> keys = sendTo.
getKeys();
1051 for (
const std::string& name_ : keys) {
1057 if (destinations.count(dest)) {
1060 destinations.insert(dest);
1066 totalAmount += nAmount;
1068 bool fSubtractFeeFromAmount =
false;
1069 for (
unsigned int idx = 0; idx < subtractFeeFromAmount.
size(); idx++) {
1070 const UniValue& addr = subtractFeeFromAmount[idx];
1072 fSubtractFeeFromAmount =
true;
1075 CRecipient recipient = {scriptPubKey, nAmount, fSubtractFeeFromAmount};
1083 if (totalAmount > nBalance)
1089 int nChangePosRet = -1;
1090 std::string strFailReason;
1091 bool fCreated = pwallet->
CreateTransaction(vecSend, wtx, keyChange, nFeeRequired, nChangePosRet, strFailReason, coin_control);
1115 std::string msg =
"addmultisigaddress nrequired [\"key\",...] ( \"account\" )\n" 1116 "\nAdd a nrequired-to-sign multisignature address to the wallet.\n" 1117 "Each key is a Raven address or hex-encoded public key.\n" 1118 "If 'account' is specified (DEPRECATED), assign address to that account.\n" 1121 "1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.\n" 1122 "2. \"keys\" (string, required) A json array of raven addresses or hex-encoded public keys\n" 1124 " \"address\" (string) raven address or hex-encoded public key\n" 1127 "3. \"account\" (string, optional) DEPRECATED. An account to assign the addresses to.\n" 1130 "\"address\" (string) A raven address associated with the keys.\n" 1133 "\nAdd a multisig address from 2 addresses\n" 1134 +
HelpExampleCli(
"addmultisigaddress",
"2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") +
1135 "\nAs json rpc call\n" 1136 +
HelpExampleRpc(
"addmultisigaddress",
"2, \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"")
1138 throw std::runtime_error(msg);
1143 std::string strAccount;
1187 if (pwallet && pwallet->
GetCScript(scriptID, subscript)) {
1189 std::vector<unsigned char> witprog;
1220 std::string msg =
"addwitnessaddress \"address\"\n" 1221 "\nAdd a witness address for a script (with pubkey or redeemscript known).\n" 1222 "It returns the witness script.\n" 1225 "1. \"address\" (string, required) An address known to the wallet\n" 1228 "\"witnessaddress\", (string) The value of the new address (P2SH of witness script).\n" 1231 throw std::runtime_error(msg);
1247 bool ret = boost::apply_visitor(w, dest);
1266 nConf = std::numeric_limits<int>::max();
1267 fIsWatchonly =
false;
1275 if (!params[0].isNull())
1276 nMinDepth = params[0].
get_int();
1279 bool fIncludeEmpty =
false;
1280 if (!params[1].isNull())
1281 fIncludeEmpty = params[1].
get_bool();
1284 if(!params[2].isNull())
1285 if(params[2].get_bool())
1289 std::map<CTxDestination, tallyitem> mapTally;
1290 for (
const std::pair<uint256, CWalletTx>& pairWtx : pwallet->
mapWallet) {
1297 if (nDepth < nMinDepth)
1300 for (
const CTxOut& txout : wtx.
tx->vout)
1307 if(!(mine & filter))
1321 std::map<std::string, tallyitem> mapAccountTally;
1322 for (
const std::pair<CTxDestination, CAddressBookData>& item : pwallet->
mapAddressBook) {
1324 const std::string& strAccount = item.second.name;
1325 std::map<CTxDestination, tallyitem>::iterator it = mapTally.find(dest);
1326 if (it == mapTally.end() && !fIncludeEmpty)
1330 int nConf = std::numeric_limits<int>::max();
1331 bool fIsWatchonly =
false;
1332 if (it != mapTally.end())
1334 nAmount = (*it).second.nAmount;
1335 nConf = (*it).second.nConf;
1336 fIsWatchonly = (*it).second.fIsWatchonly;
1341 tallyitem& _item = mapAccountTally[strAccount];
1350 obj.
push_back(Pair(
"involvesWatchonly",
true));
1352 obj.
push_back(Pair(
"account", strAccount));
1354 obj.
push_back(Pair(
"confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));
1356 obj.
push_back(Pair(
"label", strAccount));
1358 if (it != mapTally.end())
1360 for (
const uint256& _item : (*it).second.txids)
1365 obj.
push_back(Pair(
"txids", transactions));
1372 for (std::map<std::string, tallyitem>::iterator it = mapAccountTally.begin(); it != mapAccountTally.end(); ++it)
1374 CAmount nAmount = (*it).second.nAmount;
1375 int nConf = (*it).second.nConf;
1377 if((*it).second.fIsWatchonly)
1378 obj.
push_back(Pair(
"involvesWatchonly",
true));
1379 obj.
push_back(Pair(
"account", (*it).first));
1381 obj.
push_back(Pair(
"confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));
1397 throw std::runtime_error(
1398 "listreceivedbyaddress ( minconf include_empty include_watchonly)\n" 1399 "\nList balances by receiving address.\n" 1401 "1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.\n" 1402 "2. include_empty (bool, optional, default=false) Whether to include addresses that haven't received any payments.\n" 1403 "3. include_watchonly (bool, optional, default=false) Whether to include watch-only addresses (see 'importaddress').\n" 1408 " \"involvesWatchonly\" : true, (bool) Only returned if imported addresses were involved in transaction\n" 1409 " \"address\" : \"receivingaddress\", (string) The receiving address\n" 1410 " \"account\" : \"accountname\", (string) DEPRECATED. The account of the receiving address. The default account is \"\".\n" 1411 " \"amount\" : x.xxx, (numeric) The total amount in " +
CURRENCY_UNIT +
" received by the address\n" 1412 " \"confirmations\" : n, (numeric) The number of confirmations of the most recent transaction included\n" 1413 " \"label\" : \"label\", (string) A comment for the address/transaction, if any\n" 1415 " n, (numeric) The ids of transactions received with the address \n" 1442 throw std::runtime_error(
1443 "listreceivedbyaccount ( minconf include_empty include_watchonly)\n" 1444 "\nDEPRECATED. List balances by account.\n" 1446 "1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.\n" 1447 "2. include_empty (bool, optional, default=false) Whether to include accounts that haven't received any payments.\n" 1448 "3. include_watchonly (bool, optional, default=false) Whether to include watch-only addresses (see 'importaddress').\n" 1453 " \"involvesWatchonly\" : true, (bool) Only returned if imported addresses were involved in transaction\n" 1454 " \"account\" : \"accountname\", (string) The account name of the receiving account\n" 1455 " \"amount\" : x.xxx, (numeric) The total amount received by addresses with this account\n" 1456 " \"confirmations\" : n, (numeric) The number of confirmations of the most recent transaction included\n" 1457 " \"label\" : \"label\" (string) A comment for the address/transaction, if any\n" 1495 std::string strSentAccount;
1496 std::list<COutputEntry> listReceived;
1497 std::list<COutputEntry> listSent;
1499 std::list<CAssetOutputEntry> listAssetsReceived;
1500 std::list<CAssetOutputEntry> listAssetsSent;
1502 wtx.
GetAmounts(listReceived, listSent, nFee, strSentAccount, filter, listAssetsReceived, listAssetsSent);
1504 bool fAllAccounts = (strAccount == std::string(
"*"));
1508 if ((!listSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount))
1514 entry.
push_back(Pair(
"involvesWatchonly",
true));
1516 entry.
push_back(Pair(
"account", strSentAccount));
1517 MaybePushAddress(entry, s.destination);
1518 entry.
push_back(Pair(
"category",
"send"));
1537 std::string account;
1541 if (fAllAccounts || (account == strAccount))
1545 entry.
push_back(Pair(
"involvesWatchonly",
true));
1547 entry.
push_back(Pair(
"account", account));
1548 MaybePushAddress(entry, r.destination);
1552 entry.
push_back(Pair(
"category",
"orphan"));
1554 entry.
push_back(Pair(
"category",
"immature"));
1556 entry.
push_back(Pair(
"category",
"generate"));
1560 entry.
push_back(Pair(
"category",
"receive"));
1564 entry.
push_back(Pair(
"label", account));
1581 entry.
push_back(Pair(
"asset_name", data.assetName));
1584 if (!data.message.empty() && data.expireTime > 0)
1587 entry.
push_back(Pair(
"vout", data.vout));
1588 entry.
push_back(Pair(
"category",
"receive"));
1593 if ((!listAssetsSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount)) {
1598 entry.
push_back(Pair(
"asset_name", data.assetName));
1601 if (!data.message.empty() && data.expireTime > 0)
1604 entry.
push_back(Pair(
"vout", data.vout));
1605 entry.
push_back(Pair(
"category",
"send"));
1617 ListTransactions(pwallet, wtx, strAccount, nMinDepth, fLong, ret, assetDetails, filter);
1622 bool fAllAccounts = (strAccount == std::string(
"*"));
1624 if (fAllAccounts || acentry.
strAccount == strAccount)
1628 entry.
push_back(Pair(
"category",
"move"));
1645 throw std::runtime_error(
1646 "listtransactions ( \"account\" count skip include_watchonly)\n" 1647 "\nReturns up to 'count' most recent transactions skipping the first 'from' transactions for account 'account'.\n" 1649 "1. \"account\" (string, optional) DEPRECATED. The account name. Should be \"*\".\n" 1650 "2. count (numeric, optional, default=10) The number of transactions to return\n" 1651 "3. skip (numeric, optional, default=0) The number of transactions to skip\n" 1652 "4. include_watchonly (bool, optional, default=false) Include transactions to watch-only addresses (see 'importaddress')\n" 1656 " \"account\":\"accountname\", (string) DEPRECATED. The account name associated with the transaction. \n" 1657 " It will be \"\" for the default account.\n" 1658 " \"address\":\"address\", (string) The raven address of the transaction. Not present for \n" 1659 " move transactions (category = move).\n" 1660 " \"category\":\"send|receive|move\", (string) The transaction category. 'move' is a local (off blockchain)\n" 1661 " transaction between accounts, and not associated with an address,\n" 1662 " transaction id or block. 'send' and 'receive' transactions are \n" 1663 " associated with an address, transaction id and block details\n" 1664 " \"amount\": x.xxx, (numeric) The amount in " +
CURRENCY_UNIT +
". This is negative for the 'send' category, and for the\n" 1665 " 'move' category for moves outbound. It is positive for the 'receive' category,\n" 1666 " and for the 'move' category for inbound funds.\n" 1667 " \"label\": \"label\", (string) A comment for the address/transaction, if any\n" 1668 " \"vout\": n, (numeric) the vout value\n" 1669 " \"fee\": x.xxx, (numeric) The amount of the fee in " +
CURRENCY_UNIT +
". This is negative and only available for the \n" 1670 " 'send' category of transactions.\n" 1671 " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and \n" 1672 " 'receive' category of transactions. Negative confirmations indicate the\n" 1673 " transaction conflicts with the block chain\n" 1674 " \"trusted\": xxx, (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.\n" 1675 " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction. Available for 'send' and 'receive'\n" 1676 " category of transactions.\n" 1677 " \"blockindex\": n, (numeric) The index of the transaction in the block that includes it. Available for 'send' and 'receive'\n" 1678 " category of transactions.\n" 1679 " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n" 1680 " \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n" 1681 " \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n" 1682 " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT). Available \n" 1683 " for 'send' and 'receive' category of transactions.\n" 1684 " \"comment\": \"...\", (string) If a comment is associated with the transaction.\n" 1685 " \"otheraccount\": \"accountname\", (string) DEPRECATED. For the 'move' category of transactions, the account the funds came \n" 1686 " from (for receiving funds, positive amounts), or went to (for sending funds,\n" 1687 " negative amounts).\n" 1688 " \"bip125-replaceable\": \"yes|no|unknown\", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n" 1689 " may be unknown for unconfirmed transactions not in the mempool\n" 1690 " \"abandoned\": xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n" 1691 " 'send' category of transactions.\n" 1696 "\nList the most recent 10 transactions in the systems\n" 1698 "\nList transactions 100 to 120\n" 1700 "\nAs a json rpc call\n" 1707 std::string strAccount =
"*";
1731 for (CWallet::TxItems::const_reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it)
1733 CWalletTx *
const pwtx = (*it).second.first;
1734 if (pwtx !=
nullptr)
1737 if (pacentry !=
nullptr)
1740 if ((
int)ret.
size() >= (nCount+nFrom))
break;
1744 if (nFrom > (
int)ret.
size())
1746 if ((nFrom + nCount) > (
int)ret.
size())
1747 nCount = ret.
size() - nFrom;
1749 std::vector<UniValue> arrTmp = ret.
getValues();
1751 std::vector<UniValue>::iterator first = arrTmp.begin();
1752 std::advance(first, nFrom);
1753 std::vector<UniValue>::iterator last = arrTmp.begin();
1754 std::advance(last, nFrom+nCount);
1756 if (last != arrTmp.end()) arrTmp.erase(last, arrTmp.end());
1757 if (first != arrTmp.begin()) arrTmp.erase(arrTmp.begin(), first);
1759 std::reverse(arrTmp.begin(), arrTmp.end());
1776 throw std::runtime_error(
1777 "listaccounts ( minconf include_watchonly)\n" 1778 "\nDEPRECATED. Returns Object that has account names as keys, account balances as values.\n" 1780 "1. minconf (numeric, optional, default=1) Only include transactions with at least this many confirmations\n" 1781 "2. include_watchonly (bool, optional, default=false) Include balances in watch-only addresses (see 'importaddress')\n" 1783 "{ (json object where keys are account names, and values are numeric balances\n" 1784 " \"account\": x.xxx, (numeric) The property name is the account name, and the value is the total balance for the account.\n" 1788 "\nList account balances where there at least 1 confirmation\n" 1790 "\nList account balances including zero confirmation transactions\n" 1792 "\nList account balances for 6 or more confirmations\n" 1794 "\nAs json rpc call\n" 1809 std::map<std::string, CAmount> mapAccountBalances;
1810 for (
const std::pair<CTxDestination, CAddressBookData>& entry : pwallet->
mapAddressBook) {
1811 if (
IsMine(*pwallet, entry.first) & includeWatchonly) {
1812 mapAccountBalances[entry.second.name] = 0;
1816 for (
const std::pair<uint256, CWalletTx>& pairWtx : pwallet->
mapWallet) {
1819 std::string strSentAccount;
1820 std::list<COutputEntry> listReceived;
1821 std::list<COutputEntry> listSent;
1825 wtx.
GetAmounts(listReceived, listSent, nFee, strSentAccount, includeWatchonly);
1826 mapAccountBalances[strSentAccount] -= nFee;
1828 mapAccountBalances[strSentAccount] -= s.amount;
1829 if (nDepth >= nMinDepth)
1833 mapAccountBalances[pwallet->
mapAddressBook[r.destination].name] += r.amount;
1836 mapAccountBalances[
""] += r.amount;
1840 const std::list<CAccountingEntry>& acentries = pwallet->
laccentries;
1842 mapAccountBalances[entry.strAccount] += entry.nCreditDebit;
1845 for (
const std::pair<std::string, CAmount>& accountBalance : mapAccountBalances) {
1859 throw std::runtime_error(
1860 "listsinceblock ( \"blockhash\" target_confirmations include_watchonly include_removed )\n" 1861 "\nGet all transactions in blocks since block [blockhash], or all transactions if omitted.\n" 1862 "If \"blockhash\" is no longer a part of the main chain, transactions from the fork point onward are included.\n" 1863 "Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the \"removed\" array.\n" 1865 "1. \"blockhash\" (string, optional) The block hash to list transactions since\n" 1866 "2. target_confirmations: (numeric, optional, default=1) Return 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 affects [lastblock] in the return value\n" 1867 "3. include_watchonly: (bool, optional, default=false) Include transactions to watch-only addresses (see 'importaddress')\n" 1868 "4. include_removed: (bool, optional, default=true) Show transactions that were removed due to a reorg in the \"removed\" array\n" 1869 " (not guaranteed to work on pruned nodes)\n" 1872 " \"transactions\": [\n" 1873 " \"account\":\"accountname\", (string) DEPRECATED. The account name associated with the transaction. Will be \"\" for the default account.\n" 1874 " \"address\":\"address\", (string) The raven address of the transaction. Not present for move transactions (category = move).\n" 1875 " \"category\":\"send|receive\", (string) The transaction category. 'send' has negative amounts, 'receive' has positive amounts.\n" 1876 " \"amount\": x.xxx, (numeric) The amount in " +
CURRENCY_UNIT +
". This is negative for the 'send' category, and for the 'move' category for moves \n" 1877 " outbound. It is positive for the 'receive' category, and for the 'move' category for inbound funds.\n" 1878 " \"vout\" : n, (numeric) the vout value\n" 1879 " \"fee\": x.xxx, (numeric) The amount of the fee in " +
CURRENCY_UNIT +
". This is negative and only available for the 'send' category of transactions.\n" 1880 " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and 'receive' category of transactions.\n" 1881 " When it's < 0, it means the transaction conflicted that many blocks ago.\n" 1882 " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction. Available for 'send' and 'receive' category of transactions.\n" 1883 " \"blockindex\": n, (numeric) The index of the transaction in the block that includes it. Available for 'send' and 'receive' category of transactions.\n" 1884 " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n" 1885 " \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n" 1886 " \"time\": xxx, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).\n" 1887 " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions.\n" 1888 " \"bip125-replaceable\": \"yes|no|unknown\", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n" 1889 " may be unknown for unconfirmed transactions not in the mempool\n" 1890 " \"abandoned\": xxx, (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions.\n" 1891 " \"comment\": \"...\", (string) If a comment is associated with the transaction.\n" 1892 " \"label\" : \"label\" (string) A comment for the address/transaction, if any\n" 1893 " \"to\": \"...\", (string) If a comment to is associated with the transaction.\n" 1896 " <structure is the same as \"transactions\" above, only present if include_removed=true>\n" 1897 " Note: transactions that were readded in the active chain will appear as-is in this array, and may thus have a positive confirmation count.\n" 1899 " \"lastblock\": \"lastblockhash\" (string) The hash of the block (target_confirmations-1) from the best block on the main chain. This is typically used to feed back into listsinceblock the next time you call it. So you would generally use a target_confirmations of say 6, so you will be continually re-notified of transactions until they've reached 6 confirmations plus any new ones\n" 1903 +
HelpExampleCli(
"listsinceblock",
"\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\" 6")
1904 +
HelpExampleRpc(
"listsinceblock",
"\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\", 6")
1912 int target_confirms = 1;
1921 paltindex = pindex = it->second;
1934 if (target_confirms < 1) {
1949 for (
const std::pair<uint256, CWalletTx>& pairWtx : pwallet->
mapWallet) {
1960 while (include_removed && paltindex && paltindex != pindex) {
1966 auto it = pwallet->
mapWallet.find(tx->GetHash());
1970 ListTransactions(pwallet, it->second,
"*", -100000000,
true, removed, filter);
1973 paltindex = paltindex->
pprev;
1980 ret.
push_back(Pair(
"transactions", transactions));
1981 if (include_removed) ret.
push_back(Pair(
"removed", removed));
1995 throw std::runtime_error(
1996 "gettransaction \"txid\" ( include_watchonly )\n" 1997 "\nGet detailed information about in-wallet transaction <txid>\n" 1999 "1. \"txid\" (string, required) The transaction id\n" 2000 "2. \"include_watchonly\" (bool, optional, default=false) Whether to include watch-only addresses in balance calculation and details[]\n" 2003 " \"amount\" : x.xxx, (numeric) The transaction amount in " +
CURRENCY_UNIT +
"\n" 2004 " \"fee\": x.xxx, (numeric) The amount of the fee in " +
CURRENCY_UNIT +
". This is negative and only available for the \n" 2005 " 'send' category of transactions.\n" 2006 " \"confirmations\" : n, (numeric) The number of confirmations\n" 2007 " \"blockhash\" : \"hash\", (string) The block hash\n" 2008 " \"blockindex\" : xx, (numeric) The index of the transaction in the block that includes it\n" 2009 " \"blocktime\" : ttt, (numeric) The time in seconds since epoch (1 Jan 1970 GMT)\n" 2010 " \"txid\" : \"transactionid\", (string) The transaction id.\n" 2011 " \"time\" : ttt, (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)\n" 2012 " \"timereceived\" : ttt, (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)\n" 2013 " \"bip125-replaceable\": \"yes|no|unknown\", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\n" 2014 " may be unknown for unconfirmed transactions not in the mempool\n" 2015 " \"details\" : [\n" 2017 " \"account\" : \"accountname\", (string) DEPRECATED. The account name involved in the transaction, can be \"\" for the default account.\n" 2018 " \"address\" : \"address\", (string) The raven address involved in the transaction\n" 2019 " \"category\" : \"send|receive\", (string) The category, either 'send' or 'receive'\n" 2020 " \"amount\" : x.xxx, (numeric) The amount in " +
CURRENCY_UNIT +
"\n" 2021 " \"label\" : \"label\", (string) A comment for the address/transaction, if any\n" 2022 " \"vout\" : n, (numeric) the vout value\n" 2023 " \"fee\": x.xxx, (numeric) The amount of the fee in " +
CURRENCY_UNIT +
". This is negative and only available for the \n" 2024 " 'send' category of transactions.\n" 2025 " \"abandoned\": xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \n" 2026 " 'send' category of transactions.\n" 2030 " \"asset_details\" : [\n" 2032 " \"asset_type\" : \"new_asset|transfer_asset|reissue_asset\", (string) The type of asset transaction\n" 2033 " \"asset_name\" : \"asset_name\", (string) The name of the asset\n" 2034 " \"amount\" : x.xxx, (numeric) The amount in " +
CURRENCY_UNIT +
"\n" 2035 " \"address\" : \"address\", (string) The raven address involved in the transaction\n" 2036 " \"vout\" : n, (numeric) the vout value\n" 2037 " \"category\" : \"send|receive\", (string) The category, either 'send' or 'receive'\n" 2042 " \"hex\" : \"data\" (string) Raw data for transaction\n" 2046 +
HelpExampleCli(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
2047 +
HelpExampleCli(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\" true")
2048 +
HelpExampleRpc(
"gettransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
2063 auto it = pwallet->
mapWallet.find(hash);
2071 CAmount nNet = nCredit - nDebit;
2082 ListTransactions(pwallet, wtx,
"*", 0,
false, details, assetDetails, filter);
2083 entry.
push_back(Pair(
"details", details));
2084 entry.
push_back(Pair(
"asset_details", assetDetails));
2100 throw std::runtime_error(
2101 "abandontransaction \"txid\"\n" 2102 "\nMark in-wallet transaction <txid> as abandoned\n" 2103 "This will mark this transaction and all its in-wallet descendants as abandoned which will allow\n" 2104 "for their inputs to be respent. It can be used to replace \"stuck\" or evicted transactions.\n" 2105 "It only works on transactions which are not included in a block and are not currently in the mempool.\n" 2106 "It has no effect on transactions which are already conflicted or abandoned.\n" 2108 "1. \"txid\" (string, required) The transaction id\n" 2111 +
HelpExampleCli(
"abandontransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
2112 +
HelpExampleRpc(
"abandontransaction",
"\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"")
2140 throw std::runtime_error(
2141 "backupwallet \"destination\"\n" 2142 "\nSafely copies current wallet file to destination, which can be a directory or a path with filename.\n" 2144 "1. \"destination\" (string) The destination directory or file\n" 2169 throw std::runtime_error(
2170 "keypoolrefill ( newsize )\n" 2171 "\nFills the keypool." 2174 "1. newsize (numeric, optional, default=100) The new keypool size\n" 2183 unsigned int kpSize = 0;
2201 static void LockWallet(
CWallet* pWallet)
2216 throw std::runtime_error(
2217 "walletpassphrase \"passphrase\" timeout\n" 2218 "\nStores the wallet decryption key in memory for 'timeout' seconds.\n" 2219 "This is needed prior to performing transactions related to private keys such as sending ravens\n" 2221 "1. \"passphrase\" (string, required) The wallet passphrase\n" 2222 "2. timeout (numeric, required) The time to keep the decryption key in seconds.\n" 2224 "Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock\n" 2225 "time that overrides the old one.\n" 2227 "\nUnlock the wallet for 60 seconds\n" 2229 "\nLock the wallet again (before 60 seconds)\n" 2231 "\nAs json rpc call\n" 2246 strWalletPass.reserve(100);
2251 if (strWalletPass.length() > 0)
2253 if (!pwallet->
Unlock(strWalletPass)) {
2258 throw std::runtime_error(
2259 "walletpassphrase <passphrase> <timeout>\n" 2260 "Stores the wallet decryption key in memory for <timeout> seconds.");
2280 throw std::runtime_error(
2281 "walletpassphrasechange \"oldpassphrase\" \"newpassphrase\"\n" 2282 "\nChanges the wallet passphrase from 'oldpassphrase' to 'newpassphrase'.\n" 2284 "1. \"oldpassphrase\" (string) The current passphrase\n" 2285 "2. \"newpassphrase\" (string) The new passphrase\n" 2287 +
HelpExampleCli(
"walletpassphrasechange",
"\"old one\" \"new one\"")
2288 +
HelpExampleRpc(
"walletpassphrasechange",
"\"old one\", \"new one\"")
2303 strOldWalletPass.reserve(100);
2307 strNewWalletPass.reserve(100);
2310 if (strOldWalletPass.length() < 1 || strNewWalletPass.length() < 1)
2311 throw std::runtime_error(
2312 "walletpassphrasechange <oldpassphrase> <newpassphrase>\n" 2313 "Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.");
2331 throw std::runtime_error(
2333 "\nRemoves the wallet encryption key from memory, locking the wallet.\n" 2334 "After calling this method, you will need to call walletpassphrase again\n" 2335 "before being able to call any methods which require the wallet to be unlocked.\n" 2337 "\nSet the passphrase for 2 minutes to perform a transaction\n" 2339 "\nPerform a send (requires passphrase set)\n" 2340 +
HelpExampleCli(
"sendtoaddress",
"\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 1.0") +
2341 "\nClear the passphrase since we are done before 2 minutes is up\n" 2343 "\nAs json rpc call\n" 2371 throw std::runtime_error(
2372 "encryptwallet \"passphrase\"\n" 2373 "\nEncrypts the wallet with 'passphrase'. This is for first time encryption.\n" 2374 "After this, any calls that interact with private keys such as sending or signing \n" 2375 "will require the passphrase to be set prior the making these calls.\n" 2376 "Use the walletpassphrase call for this, and then walletlock call.\n" 2377 "If the wallet is already encrypted, use the walletpassphrasechange call.\n" 2378 "Note that this will shutdown the server.\n" 2380 "1. \"passphrase\" (string) The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long.\n" 2382 "\nEncrypt your wallet\n" 2384 "\nNow set the passphrase to use the wallet, such as for signing or sending raven\n" 2386 "\nNow we can do something like sign\n" 2387 +
HelpExampleCli(
"signmessage",
"\"address\" \"test message\"") +
2388 "\nNow lock the wallet again by removing the passphrase\n" 2390 "\nAs a json rpc call\n" 2406 strWalletPass.reserve(100);
2409 if (strWalletPass.length() < 1)
2410 throw std::runtime_error(
2411 "encryptwallet <passphrase>\n" 2412 "Encrypts the wallet with <passphrase>.");
2422 return "wallet encrypted; Raven server stopping, restart to run with encrypted wallet. The keypool has been flushed and a new HD seed was generated (if you are using HD). You need to make a new backup.";
2433 throw std::runtime_error(
2434 "lockunspent unlock ([{\"txid\":\"txid\",\"vout\":n},...])\n" 2435 "\nUpdates list of temporarily unspendable outputs.\n" 2436 "Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs.\n" 2437 "If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked.\n" 2438 "A locked transaction output will not be chosen by automatic coin selection, when spending ravens.\n" 2439 "Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list\n" 2440 "is always cleared (by virtue of process exit) when a node stops or fails.\n" 2441 "Also see the listunspent call\n" 2443 "1. unlock (boolean, required) Whether to unlock (true) or lock (false) the specified transactions\n" 2444 "2. \"transactions\" (string, optional) A json array of objects. Each object the txid (string) vout (numeric)\n" 2445 " [ (json array of json objects)\n" 2447 " \"txid\":\"id\", (string) The transaction id\n" 2448 " \"vout\": n (numeric) The output number\n" 2454 "true|false (boolean) Whether the command was successful or not\n" 2457 "\nList the unspent transactions\n" 2459 "\nLock an unspent transaction\n" 2460 +
HelpExampleCli(
"lockunspent",
"false \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
2461 "\nList the locked transactions\n" 2463 "\nUnlock the transaction again\n" 2464 +
HelpExampleCli(
"lockunspent",
"true \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
2465 "\nAs a json rpc call\n" 2466 +
HelpExampleRpc(
"lockunspent",
"false, \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"")
2484 for (
unsigned int idx = 0; idx < outputs.
size(); idx++) {
2485 const UniValue& output = outputs[idx];
2523 throw std::runtime_error(
2525 "\nReturns list of temporarily unspendable outputs.\n" 2526 "See the lockunspent call to lock and unlock transactions for spending.\n" 2530 " \"txid\" : \"transactionid\", (string) The transaction id locked\n" 2531 " \"vout\" : n (numeric) The vout value\n" 2536 "\nList the unspent transactions\n" 2538 "\nLock an unspent transaction\n" 2539 +
HelpExampleCli(
"lockunspent",
"false \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
2540 "\nList the locked transactions\n" 2542 "\nUnlock the transaction again\n" 2543 +
HelpExampleCli(
"lockunspent",
"true \"[{\\\"txid\\\":\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\",\\\"vout\\\":1}]\"") +
2544 "\nAs a json rpc call\n" 2551 std::vector<COutPoint> vOutpts;
2559 o.
push_back(Pair(
"txid", outpt.hash.GetHex()));
2560 o.
push_back(Pair(
"vout", (
int)outpt.n));
2575 throw std::runtime_error(
2577 "\nSet the transaction fee per kB. Overwrites the paytxfee parameter.\n" 2579 "1. amount (numeric or string, required) The transaction fee in " +
CURRENCY_UNIT +
"/kB\n" 2581 "true|false (boolean) Returns true if successful\n" 2604 throw std::runtime_error(
2606 "Returns an object containing various wallet state info.\n" 2609 " \"walletname\": xxxxx, (string) the wallet name\n" 2610 " \"walletversion\": xxxxx, (numeric) the wallet version\n" 2611 " \"balance\": xxxxxxx, (numeric) the total confirmed balance of the wallet in " +
CURRENCY_UNIT +
"\n" 2612 " \"unconfirmed_balance\": xxx, (numeric) the total unconfirmed balance of the wallet in " +
CURRENCY_UNIT +
"\n" 2613 " \"immature_balance\": xxxxxx, (numeric) the total immature balance of the wallet in " +
CURRENCY_UNIT +
"\n" 2614 " \"txcount\": xxxxxxx, (numeric) the total number of transactions in the wallet\n" 2615 " \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since Unix epoch) of the oldest pre-generated key in the key pool\n" 2616 " \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated (only counts external keys)\n" 2617 " \"keypoolsize_hd_internal\": xxxx, (numeric) how many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used)\n" 2618 " \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n" 2619 " \"paytxfee\": x.xxxx, (numeric) the transaction fee configuration, set in " +
CURRENCY_UNIT +
"/kB\n" 2620 " \"hdseedid\": \"<hash160>\" (string, optional) the Hash160 of the HD seed (only present when HD is enabled)\n" 2621 " \"hdmasterkeyid\": \"<hash160>\" (string, optional) alias for hdseedid retained for backwards-compatibility. Will be removed in V0.18.\n" 2641 obj.
push_back(Pair(
"keypoolsize", (int64_t)kpExternalSize));
2660 throw std::runtime_error(
2662 "Returns a list of currently loaded wallets.\n" 2663 "For full information on the wallet, use \"getwalletinfo\"\n" 2665 "[ (json array of strings)\n" 2666 " \"walletname\" (string) the wallet name\n" 2698 throw std::runtime_error(
2699 "resendwallettransactions\n" 2700 "Immediately re-broadcast unconfirmed wallet transactions to all peers.\n" 2701 "Intended only for testing; the wallet code periodically re-broadcasts\n" 2703 "Returns an RPC error if -walletbroadcast is set to false.\n" 2704 "Returns array of transaction ids that were re-broadcast.\n" 2718 for (
const uint256& txid : txids)
2733 throw std::runtime_error(
2734 "listunspent ( minconf maxconf [\"addresses\",...] [include_unsafe] [query_options])\n" 2735 "\nReturns array of unspent transaction outputs\n" 2736 "with between minconf and maxconf (inclusive) confirmations.\n" 2737 "Optionally filter to only include txouts paid to specified addresses.\n" 2739 "1. minconf (numeric, optional, default=1) The minimum confirmations to filter\n" 2740 "2. maxconf (numeric, optional, default=9999999) The maximum confirmations to filter\n" 2741 "3. \"addresses\" (string) A json array of raven addresses to filter\n" 2743 " \"address\" (string) raven address\n" 2746 "4. include_unsafe (bool, optional, default=true) Include outputs that are not safe to spend\n" 2747 " See description of \"safe\" attribute below.\n" 2748 "5. query_options (json, optional) JSON with query options\n" 2750 " \"minimumAmount\" (numeric or string, default=0) Minimum value of each UTXO in " +
CURRENCY_UNIT +
"\n" 2751 " \"maximumAmount\" (numeric or string, default=unlimited) Maximum value of each UTXO in " +
CURRENCY_UNIT +
"\n" 2752 " \"maximumCount\" (numeric or string, default=unlimited) Maximum number of UTXOs\n" 2753 " \"minimumSumAmount\" (numeric or string, default=unlimited) Minimum sum value of all UTXOs in " +
CURRENCY_UNIT +
"\n" 2756 "[ (array of json object)\n" 2758 " \"txid\" : \"txid\", (string) the transaction id \n" 2759 " \"vout\" : n, (numeric) the vout value\n" 2760 " \"address\" : \"address\", (string) the raven address\n" 2761 " \"account\" : \"account\", (string) DEPRECATED. The associated account, or \"\" for the default account\n" 2762 " \"scriptPubKey\" : \"key\", (string) the script key\n" 2763 " \"amount\" : x.xxx, (numeric) the transaction output amount in " +
CURRENCY_UNIT +
"\n" 2764 " \"confirmations\" : n, (numeric) The number of confirmations\n" 2765 " \"redeemScript\" : n (string) The redeemScript if scriptPubKey is P2SH\n" 2766 " \"spendable\" : xxx, (bool) Whether we have the private keys to spend this output\n" 2767 " \"solvable\" : xxx, (bool) Whether we know how to spend this output, ignoring the lack of keys\n" 2768 " \"safe\" : xxx (bool) Whether this output is considered safe to spend. Unconfirmed transactions\n" 2769 " from outside keys and unconfirmed replacement transactions are considered unsafe\n" 2770 " and are not eligible for spending by fundrawtransaction and sendtoaddress.\n" 2777 +
HelpExampleCli(
"listunspent",
"6 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"")
2778 +
HelpExampleRpc(
"listunspent",
"6, 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"")
2779 +
HelpExampleCli(
"listunspent",
"6 9999999 '[]' true '{ \"minimumAmount\": 0.005 }'")
2780 +
HelpExampleRpc(
"listunspent",
"6, 9999999, [] , true, { \"minimumAmount\": 0.005 } ")
2791 int nMaxDepth = 9999999;
2797 std::set<CTxDestination> destinations;
2801 for (
unsigned int idx = 0; idx < inputs.
size(); idx++) {
2802 const UniValue& input = inputs[idx];
2807 if (!destinations.insert(dest).second) {
2813 bool include_unsafe =
true;
2820 CAmount nMaximumAmount = MAX_MONEY;
2821 CAmount nMinimumSumAmount = MAX_MONEY;
2822 uint64_t nMaximumCount = 0;
2827 if (options.
exists(
"minimumAmount"))
2830 if (options.
exists(
"maximumAmount"))
2833 if (options.
exists(
"minimumSumAmount"))
2836 if (options.
exists(
"maximumCount"))
2837 nMaximumCount = options[
"maximumCount"].get_int64();
2841 std::vector<COutput> vecOutputs;
2842 assert(pwallet !=
nullptr);
2845 pwallet->
AvailableCoins(vecOutputs, !include_unsafe,
nullptr, nMinimumAmount, nMaximumAmount, nMinimumSumAmount, nMaximumCount, nMinDepth, nMaxDepth);
2846 for (
const COutput& out : vecOutputs) {
2848 const CScript& scriptPubKey = out.tx->tx->vout[out.i].scriptPubKey;
2851 if (destinations.size() && (!fValidAddress || !destinations.count(address)))
2855 entry.
push_back(Pair(
"txid", out.tx->GetHash().GetHex()));
2858 if (fValidAddress) {
2866 const CScriptID& hash = boost::get<CScriptID>(address);
2868 if (pwallet->
GetCScript(hash, redeemScript)) {
2869 entry.
push_back(Pair(
"redeemScript",
HexStr(redeemScript.begin(), redeemScript.end())));
2876 entry.
push_back(Pair(
"confirmations", out.nDepth));
2877 entry.
push_back(Pair(
"spendable", out.fSpendable));
2878 entry.
push_back(Pair(
"solvable", out.fSolvable));
2879 entry.
push_back(Pair(
"safe", out.fSafe));
2894 throw std::runtime_error(
2895 "fundrawtransaction \"hexstring\" ( options )\n" 2896 "\nAdd inputs to a transaction until it has enough in value to meet its out value.\n" 2897 "This will not modify existing inputs, and will add at most one change output to the outputs.\n" 2898 "No existing outputs will be modified unless \"subtractFeeFromOutputs\" is specified.\n" 2899 "Note that inputs which were signed may need to be resigned after completion since in/outputs have been added.\n" 2900 "The inputs added will not be signed, use signrawtransaction for that.\n" 2901 "Note that all existing inputs must have their previous output transaction be in the wallet.\n" 2902 "Note that all inputs selected must be of standard form and P2SH scripts must be\n" 2903 "in the wallet using importaddress or addmultisigaddress (to calculate fees).\n" 2904 "You can see whether this is the case by checking the \"solvable\" field in the listunspent output.\n" 2905 "Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only\n" 2907 "1. \"hexstring\" (string, required) The hex string of the raw transaction\n" 2908 "2. options (object, optional)\n" 2910 " \"changeAddress\" (string, optional, default pool address) The raven address to receive the change\n" 2911 " \"changePosition\" (numeric, optional, default random) The index of the change output\n" 2912 " \"includeWatching\" (boolean, optional, default false) Also select inputs which are watch only\n" 2913 " \"lockUnspents\" (boolean, optional, default false) Lock selected unspent outputs\n" 2914 " \"feeRate\" (numeric, optional, default not set: makes wallet determine the fee) Set a specific fee rate in " +
CURRENCY_UNIT +
"/kB\n" 2915 " \"subtractFeeFromOutputs\" (array, optional) A json array of integers.\n" 2916 " The fee will be equally deducted from the amount of each specified output.\n" 2917 " The outputs are specified by their zero-based index, before any change output is added.\n" 2918 " Those recipients will receive less ravens than you enter in their corresponding amount field.\n" 2919 " If no outputs are specified here, the sender pays the fee.\n" 2920 " [vout_index,...]\n" 2922 " Allows this transaction to be replaced by a transaction with higher fees\n" 2923 " \"conf_target\" (numeric, optional) Confirmation target (in blocks)\n" 2924 " \"estimate_mode\" (string, optional, default=UNSET) The fee estimate mode, must be one of:\n" 2927 " \"CONSERVATIVE\"\n" 2929 " for backward compatibility: passing in a true instead of an object will result in {\"includeWatching\":true}\n" 2932 " \"hex\": \"value\", (string) The resulting raw transaction (hex-encoded string)\n" 2933 " \"fee\": n, (numeric) Fee in " +
CURRENCY_UNIT +
" the resulting transaction pays\n" 2934 " \"changepos\": n (numeric) The position of the added change output, or -1\n" 2937 "\nCreate a transaction with no inputs\n" 2938 +
HelpExampleCli(
"createrawtransaction",
"\"[]\" \"{\\\"myaddress\\\":0.01}\"") +
2939 "\nAdd sufficient unsigned inputs to meet the output value\n" 2940 +
HelpExampleCli(
"fundrawtransaction",
"\"rawtransactionhex\"") +
2941 "\nSign the transaction\n" 2942 +
HelpExampleCli(
"signrawtransaction",
"\"fundedtransactionhex\"") +
2943 "\nSend the transaction\n" 2944 +
HelpExampleCli(
"sendrawtransaction",
"\"signedtransactionhex\"")
2951 int changePosition = -1;
2952 bool lockUnspents =
false;
2954 std::set<int> setSubtractFeeFromOutputs;
2981 if (options.
exists(
"changeAddress")) {
2991 if (options.
exists(
"changePosition"))
2992 changePosition = options[
"changePosition"].get_int();
2994 if (options.
exists(
"includeWatching"))
2997 if (options.
exists(
"lockUnspents"))
2998 lockUnspents = options[
"lockUnspents"].get_bool();
3000 if (options.
exists(
"feeRate"))
3006 if (options.
exists(
"subtractFeeFromOutputs"))
3007 subtractFeeFromOutputs = options[
"subtractFeeFromOutputs"].get_array();
3012 if (options.
exists(
"conf_target")) {
3013 if (options.
exists(
"feeRate")) {
3018 if (options.
exists(
"estimate_mode")) {
3019 if (options.
exists(
"feeRate")) {
3034 if (tx.
vout.size() == 0)
3037 if (changePosition != -1 && (changePosition < 0 || (
unsigned int)changePosition > tx.
vout.size()))
3040 for (
unsigned int idx = 0; idx < subtractFeeFromOutputs.
size(); idx++) {
3041 int pos = subtractFeeFromOutputs[idx].
get_int();
3042 if (setSubtractFeeFromOutputs.count(pos))
3046 if (pos >=
int(tx.
vout.size()))
3048 setSubtractFeeFromOutputs.insert(pos);
3052 std::string strFailReason;
3054 if (!pwallet->
FundTransaction(tx, nFeeOut, changePosition, strFailReason, lockUnspents, setSubtractFeeFromOutputs, coinControl)) {
3060 result.
push_back(Pair(
"changepos", changePosition));
3068 throw std::runtime_error(
"bumpfee has been deprecated on the RVN Wallet.");
3217 throw std::runtime_error(
3218 "generate nblocks ( maxtries )\n" 3219 "\nMine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet.\n" 3221 "1. nblocks (numeric, required) How many blocks are generated immediately.\n" 3222 "2. maxtries (numeric, optional) How many iterations to try (default = 1000000).\n" 3224 "[ blockhashes ] (array) hashes of blocks generated\n" 3226 "\nGenerate 11 blocks\n" 3232 uint64_t max_tries = 1000000;
3237 std::shared_ptr<CReserveScript> coinbase_script;
3241 if (!coinbase_script) {
3246 if (coinbase_script->reserveScript.empty()) {
3250 return generateBlocks(coinbase_script, num_generate, max_tries,
true);
3261 throw std::runtime_error(
3262 "rescanblockchain (\"start_height\") (\"stop_height\")\n" 3263 "\nRescan the local blockchain for wallet related transactions.\n" 3265 "1. \"start_height\" (numeric, optional) block height where the rescan should start\n" 3266 "2. \"stop_height\" (numeric, optional) the last block height that should be scanned\n" 3269 " \"start_height\" (numeric) The block height where the rescan has started. If omitted, rescan started from the genesis block.\n" 3270 " \"stop_height\" (numeric) The height of the last rescanned block. If omitted, rescan stopped at the chain tip.\n" 3304 throw JSONRPCError(
RPC_MISC_ERROR,
"Can't rescan beyond pruned data. Use RPC call getblockchaininfo to determine your pruned height.");
3306 block = block->
pprev;
3343 {
"rawtransactions",
"fundrawtransaction", &
fundrawtransaction, {
"hexstring",
"options"} },
3347 {
"wallet",
"addmultisigaddress", &
addmultisigaddress, {
"nrequired",
"keys",
"account"} },
3349 {
"wallet",
"backupwallet", &
backupwallet, {
"destination"} },
3350 {
"wallet",
"bumpfee", &
bumpfee, {
"txid",
"options"} },
3351 {
"wallet",
"dumpprivkey", &
dumpprivkey, {
"address"} },
3352 {
"wallet",
"dumpwallet", &
dumpwallet, {
"filename"} },
3353 {
"wallet",
"encryptwallet", &
encryptwallet, {
"passphrase"} },
3355 {
"wallet",
"getaccount", &
getaccount, {
"address"} },
3357 {
"wallet",
"getbalance", &
getbalance, {
"account",
"minconf",
"include_watchonly"} },
3362 {
"wallet",
"gettransaction", &
gettransaction, {
"txid",
"include_watchonly"} },
3365 {
"wallet",
"importmulti", &
importmulti, {
"requests",
"options"} },
3366 {
"wallet",
"importprivkey", &
importprivkey, {
"privkey",
"label",
"rescan"} },
3367 {
"wallet",
"importwallet", &
importwallet, {
"filename"} },
3368 {
"wallet",
"importaddress", &
importaddress, {
"address",
"label",
"rescan",
"p2sh"} },
3369 {
"wallet",
"importprunedfunds", &
importprunedfunds, {
"rawtransaction",
"txoutproof"} },
3370 {
"wallet",
"importpubkey", &
importpubkey, {
"pubkey",
"label",
"rescan"} },
3372 {
"wallet",
"listaccounts", &
listaccounts, {
"minconf",
"include_watchonly"} },
3375 {
"wallet",
"listreceivedbyaccount", &
listreceivedbyaccount, {
"minconf",
"include_empty",
"include_watchonly"} },
3376 {
"wallet",
"listreceivedbyaddress", &
listreceivedbyaddress, {
"minconf",
"include_empty",
"include_watchonly"} },
3377 {
"wallet",
"listsinceblock", &
listsinceblock, {
"blockhash",
"target_confirmations",
"include_watchonly",
"include_removed"} },
3378 {
"wallet",
"listtransactions", &
listtransactions, {
"account",
"count",
"skip",
"include_watchonly"} },
3379 {
"wallet",
"listunspent", &
listunspent, {
"minconf",
"maxconf",
"addresses",
"include_unsafe",
"query_options"} },
3381 {
"wallet",
"lockunspent", &
lockunspent, {
"unlock",
"transactions"} },
3382 {
"wallet",
"move", &
movecmd, {
"fromaccount",
"toaccount",
"amount",
"minconf",
"comment"} },
3383 {
"wallet",
"sendfrom", &
sendfrom, {
"fromaccount",
"toaddress",
"amount",
"minconf",
"comment",
"comment_to"} },
3384 {
"wallet",
"sendmany", &
sendmany, {
"fromaccount",
"amounts",
"minconf",
"comment",
"subtractfeefrom",
"conf_target",
"estimate_mode"} },
3385 {
"wallet",
"sendtoaddress", &
sendtoaddress, {
"address",
"amount",
"comment",
"comment_to",
"subtractfeefromamount",
"conf_target",
"estimate_mode"} },
3386 {
"wallet",
"setaccount", &
setaccount, {
"address",
"account"} },
3387 {
"wallet",
"settxfee", &
settxfee, {
"amount"} },
3388 {
"wallet",
"signmessage", &
signmessage, {
"address",
"message"} },
3391 {
"wallet",
"walletpassphrase", &
walletpassphrase, {
"passphrase",
"timeout"} },
3393 {
"wallet",
"rescanblockchain", &
rescanblockchain, {
"start_height",
"stop_height"} },
3395 {
"generating",
"generate", &
generate, {
"nblocks",
"maxtries"} },
3400 for (
unsigned int vcidx = 0; vcidx <
ARRAYLEN(commands); vcidx++)
UniValue getunconfirmedbalance(const JSONRPCRequest &request)
No wallet specified (error when there are multiple wallets loaded)
void RPCTypeCheckObj(const UniValue &o, const std::map< std::string, UniValueType > &typesExpected, bool fAllowNull, bool fStrict)
std::set< std::set< CTxDestination > > GetAddressGroupings()
bool CanSupportFeature(enum WalletFeature wf) const
check whether we are allowed to upgrade (or already support) to the named feature ...
UniValue listaccounts(const JSONRPCRequest &request)
void AcentryToJSON(const CAccountingEntry &acentry, const std::string &strAccount, UniValue &ret)
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
bool fPruneMode
True if we're running in -prune mode.
CAmount GetImmatureBalance() const
const std::vector< UniValue > & getValues() const
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a standard scriptPubKey for the destination address.
Keypool ran out, call keypoolrefill first.
int64_t GetOldestKeyPoolTime()
UniValue listaddressgroupings(const JSONRPCRequest &request)
UniValue resendwallettransactions(const JSONRPCRequest &request)
UniValue importwallet(const JSONRPCRequest &request)
UniValue bumpfee(const JSONRPCRequest &request)
UniValue signmessage(const JSONRPCRequest &request)
bool fAllowWatchOnly
Includes watch only addresses which match the ISMINE_WATCH_SOLVABLE criteria.
Enter the wallet passphrase with walletpassphrase first.
Raven RPC command dispatcher.
CScript _createmultisig_redeemScript(CWallet *const pwallet, const UniValue ¶ms)
Used by addmultisigaddress / createmultisig:
bool FeeModeFromString(const std::string &mode_string, FeeEstimateMode &fee_estimate_mode)
bool AccountMove(std::string strFrom, std::string strTo, CAmount nAmount, std::string strComment="")
CBlockIndex * pprev
pointer to the index of the predecessor of this block
uint32_t nStatus
Verification status of this block. See enum BlockStatus.
UniValue abandontransaction(const JSONRPCRequest &request)
boost::optional< unsigned int > m_confirm_target
Override the default confirmation target if set.
UniValue keypoolrefill(const JSONRPCRequest &request)
std::map< CTxDestination, CAddressBookData > mapAddressBook
std::set< uint256 > GetConflicts() const
CCriticalSection cs_wallet
bool IsPayToScriptHash() const
UniValue getreceivedbyaddress(const JSONRPCRequest &request)
const uint256 & GetHash() const
bool IsFromMe(const isminefilter &filter) const
UniValue getrawchangeaddress(const JSONRPCRequest &request)
bool VerifyScript(const CScript &scriptSig, const CScript &scriptPubKey, const CScriptWitness *witness, unsigned int flags, const BaseSignatureChecker &checker, ScriptError *serror)
std::vector< uint256 > txids
bool EnsureWalletIsAvailable(CWallet *const pwallet, bool avoidException)
UniValue getaddressesbyaccount(const JSONRPCRequest &request)
std::string strFromAccount
std::string DateTimeStrFormat(const char *pszFormat, int64_t nTime)
UniValue fundrawtransaction(const JSONRPCRequest &request)
CAmount GetDebit(const isminefilter &filter) const
filter decides which addresses will count towards the debit
std::string urlDecode(const std::string &urlEncoded)
bool GetCScript(const CScriptID &hash, CScript &redeemScriptOut) const override
bool FundTransaction(CMutableTransaction &tx, CAmount &nFeeRet, int &nChangePosInOut, std::string &strFailReason, bool lockUnspents, const std::set< int > &setSubtractFeeFromOutputs, CCoinControl)
Insert additional inputs into the transaction by calling CreateTransaction();.
int Height() const
Return the maximal height in the chain.
CCriticalSection cs_main
Global state.
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination is a CNoDestination.
std::string AccountFromValue(const UniValue &value)
CTxDestination DecodeDestination(const std::string &str)
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
CBlockIndex * ScanForWalletTransactions(CBlockIndex *pindexStart, CBlockIndex *pindexStop, bool fUpdate=false)
Scan the block chain (starting in pindexStart) for transactions from or to us.
isminetype IsMine(const CKeyStore &keystore, const CScript &scriptPubKey, SigVersion sigversion)
std::vector< CWalletRef > vpwallets
bool operator()(const CKeyID &keyID)
UniValue settxfee(const JSONRPCRequest &request)
const std::string & get_str() const
uint8_t isminefilter
used for bitflags of isminetype
CBlockIndex * Genesis() const
Returns the index entry for the genesis block of this chain, or nullptr if none.
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
const UniValue & get_array() const
const std::string CURRENCY_UNIT
unsigned int GetKeyPoolSize()
bool IsWitnessProgram(int &version, std::vector< unsigned char > &program) const
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
int64_t get_int64() const
UniValue listsinceblock(const JSONRPCRequest &request)
UniValue ValueFromAmount(const CAmount &amount, const int8_t units)
const std::vector< std::string > & getKeys() const
UniValue getbalance(const JSONRPCRequest &request)
bool EncryptWallet(const SecureString &strWalletPassphrase)
UniValue getnewaddress(const JSONRPCRequest &request)
std::shared_ptr< const CTransaction > CTransactionRef
bool appendCommand(const std::string &name, const CRPCCommand *pcmd)
Appends a CRPCCommand to the dispatch table.
bool ProduceSignature(const BaseSignatureCreator &creator, const CScript &fromPubKey, SignatureData &sigdata)
Produce a script signature using a generic signature creator.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
const std::string strMessageMagic
bool fOverrideFeeRate
Override automatic min/max checks on fee, m_feerate must be set if true.
std::string HelpRequiringPassphrase(CWallet *const pwallet)
CAmount GetBalance() const
void RPCTypeCheck(const UniValue ¶ms, const std::list< UniValue::VType > &typesExpected, bool fAllowNull)
Type-check arguments; throws JSONRPCError if wrong type given.
Invalid, missing or duplicate parameter.
std::map< CTxDestination, CAmount > GetAddressBalances()
boost::optional< CFeeRate > m_feerate
Override the default payTxFee if set.
UniValue listreceivedbyaddress(const JSONRPCRequest &request)
const UniValue & find_value(const UniValue &obj, const std::string &name)
UniValue generateBlocks(std::shared_ptr< CReserveScript > coinbaseScript, int nGenerate, uint64_t nMaxTries, bool keepScript)
Generate blocks (mine)
mapValue_t mapValue
Key/value map with information about the transaction.
bool SignCompact(const uint256 &hash, std::vector< unsigned char > &vchSig) const
Create a compact signature (65 bytes), which allows reconstructing the used public key...
void WalletTxToJSON(const CWalletTx &wtx, UniValue &entry)
UniValue getwalletinfo(const JSONRPCRequest &request)
std::list< CAccountingEntry > laccentries
int64_t CAmount
Amount in corbies (Can be negative)
std::multimap< int64_t, TxPair > TxItems
uint256 GetBlockHash() const
bool CreateTransaction(const std::vector< CRecipient > &vecSend, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRet, int &nChangePosInOut, std::string &strFailReason, const CCoinControl &coin_control, bool sign=true)
bool SetAddressBook(const CTxDestination &address, const std::string &strName, const std::string &purpose)
UniValue sendmany(const JSONRPCRequest &request)
The wallet passphrase entered was incorrect.
size_t KeypoolCountExternalKeys()
void push_back(const T &value)
bool push_back(const UniValue &val)
UniValue importaddress(const JSONRPCRequest &request)
bool CheckFinalTx(const CTransaction &tx, int flags)
Transaction validation functions.
bool AbandonTransaction(const uint256 &hashTx)
void UnlockCoin(const COutPoint &output)
bool AreAssetsDeployed()
RVN START.
UniValue getreceivedbyaccount(const JSONRPCRequest &request)
std::string GetName() const
Get a name for this wallet for logging/debugging purposes.
bool AddCScript(const CScript &redeemScript) override
Support for BIP 0013 : see https://github.com/raven/bips/blob/master/bip-0013.mediawiki.
bool DecodeHexTx(CMutableTransaction &tx, const std::string &strHexTx, bool fTryNoWitness=false)
bool exists(const std::string &key) const
UniValue listwallets(const JSONRPCRequest &request)
int GetVersion()
get the current wallet format (the oldest client version guaranteed to understand this wallet) ...
UniValue generate(const JSONRPCRequest &request)
UniValue setaccount(const JSONRPCRequest &request)
CTxDestination destChange
void RPCTypeCheckArgument(const UniValue &value, UniValue::VType typeExpected)
Type-check one argument; throws JSONRPCError if wrong type given.
Witnessifier(CWallet *_pwallet)
uint256 uint256S(const char *str)
An encapsulated public key.
void AvailableCoins(std::vector< COutput > &vCoins, bool fOnlySafe=true, const CCoinControl *coinControl=nullptr, const CAmount &nMinimumAmount=1, const CAmount &nMaximumAmount=MAX_MONEY, const CAmount &nMinimumSumAmount=MAX_MONEY, const uint64_t &nMaximumCount=0, const int &nMinDepth=0, const int &nMaxDepth=9999999) const
populate vCoins with vector of available COutputs.
UniValue walletpassphrasechange(const JSONRPCRequest &request)
std::string GetRejectReason() const
bool IsHex(const std::string &str)
Unexpected type was passed as parameter.
CAmount GetUnconfirmedBalance() const
Command given in wrong wallet encryption state (encrypting an encrypted wallet etc.)
UniValue ListReceived(CWallet *const pwallet, const UniValue ¶ms, bool fByAccounts)
UniValue importprunedfunds(const JSONRPCRequest &request)
int GetBlocksToMaturity() const
UniValue dumpwallet(const JSONRPCRequest &request)
CAmount GetLegacyBalance(const isminefilter &filter, int minDepth, const std::string *account) const
const char * GetTxnOutputType(txnouttype t)
Get the name of a txnouttype as a C string, or nullptr if unknown.
UniValue sendfrom(const JSONRPCRequest &request)
bool GetReservedKey(CPubKey &pubkey, bool internal=false)
UniValue getaccount(const JSONRPCRequest &request)
General application defined errors.
bool pushKV(const std::string &key, const UniValue &val)
bool GetKey(const CKeyID &address, CKey &keyOut) const override
An output of a transaction.
CChain chainActive
The currently-connected chain of blocks (protected by cs_main).
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Raven scriptPubKey for the given CTxDestination.
std::string HelpExampleCli(const std::string &methodname, const std::string &args)
CAmount AmountFromValue(const UniValue &value)
Invalid wallet specified.
An outpoint - a combination of a transaction hash and an index n into its vout.
std::vector< CTxOut > vout
std::string FormatMoney(const CAmount &n)
Money parsing/formatting utilities.
void LockCoin(const COutPoint &output)
UniValue sendtoaddress(const JSONRPCRequest &request)
void RPCRunLater(const std::string &name, std::function< void(void)> func, int64_t nSeconds)
Run func nSeconds from now.
CScriptWitness scriptWitness
UniValue rescanblockchain(const JSONRPCRequest &request)
UniValue getaccountaddress(const JSONRPCRequest &request)
A transaction with a bunch of additional info that only the owner cares about.
void RegisterWalletRPCCommands(CRPCTable &t)
UniValue walletlock(const JSONRPCRequest &request)
bool GetBroadcastTransactions() const
Inquire whether this wallet broadcasts transactions.
Failed to encrypt the wallet.
std::vector< uint256 > ResendWalletTransactionsBefore(int64_t nTime, CConnman *connman)
void ListTransactions(CWallet *const pwallet, const CWalletTx &wtx, const std::string &strAccount, int nMinDepth, bool fLong, UniValue &ret, UniValue &retAssets, const isminefilter &filter)
List transactions based on the given criteria.
std::set< CTxDestination > GetAccountAddresses(const std::string &strAccount) const
void GetScriptForMining(std::shared_ptr< CReserveScript > &script)
std::vector< CTransactionRef > vtx
UniValue walletpassphrase(const JSONRPCRequest &request)
std::string EncodeDestination(const CTxDestination &dest)
bool ChangeWalletPassphrase(const SecureString &strOldWalletPassphrase, const SecureString &strNewWalletPassphrase)
CAmount GetCredit(const isminefilter &filter) const
int64_t GetTxTime() const
A key allocated from the key pool.
The block chain is a tree shaped structure starting with the genesis block at the root...
const CChainParams & Params()
Return the currently selected parameters.
Serialized script, used inside transaction inputs and outputs.
int RPCSerializationFlags()
bool TopUpKeyPool(unsigned int kpSize=0)
Not enough funds in wallet or account.
const UniValue & get_obj() const
bool push_backV(const std::vector< UniValue > &vec)
bool operator()(const CNoDestination &dest) const
A reference to a CKey: the Hash160 of its serialized public key.
CBlockIndex * Tip() const
Returns the index entry for the tip of this chain, or nullptr if none.
std::string GetHex() const
bool GetAccountPubkey(CPubKey &pubKey, std::string strAccount, bool bForceNew=false)
CTxDestination GetAccountAddress(CWallet *const pwallet, std::string strAccount, bool bForceNew=false)
UniValue addwitnessaddress(const JSONRPCRequest &request)
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
unsigned int ParseConfirmTarget(const UniValue &value)
Check bounds on a command line confirm target.
std::string EncodeHexTx(const CTransaction &tx, const int serializeFlags=0)
Fee rate in satoshis per kilobyte: CAmount / kB.
std::unique_ptr< CConnman > g_connman
const UniValue NullUniValue
CWallet * GetWalletForJSONRPCRequest(const JSONRPCRequest &request)
Figures out what wallet, if any, to use for a JSONRPCRequest.
UniValue removeprunedfunds(const JSONRPCRequest &request)
CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE)
Transaction fee set by the user.
bool IsWitnessEnabled(const CBlockIndex *pindexPrev, const Consensus::Params ¶ms)
Check whether witness commitments are required for block.
std::map< uint256, CWalletTx > mapWallet
A reference to a CScript: the Hash160 of its serialization (see script.h)
UniValue backupwallet(const JSONRPCRequest &request)
bool GetKeyFromPool(CPubKey &key, bool internal=false)
A mutable version of CTransaction.
A writer stream (for serialization) that computes a 256-bit hash.
UniValue dumpprivkey(const JSONRPCRequest &request)
FeeEstimateMode m_fee_mode
Fee estimation mode to control arguments to estimateSmartFee.
UniValue JSONRPCError(int code, const std::string &message)
No valid connection manager instance found.
int64_t GetTime()
GetTimeMicros() and GetTimeMillis() both return the system time, but in different units...
unsigned int nTimeReceived
time received by this node
An encapsulated private key.
int nHeight
height of the entry in the chain. The genesis block has height 0
const Consensus::Params & GetConsensus() const
bool ReadBlockFromDisk(CBlock &block, const CDiskBlockPos &pos, const Consensus::Params &consensusParams)
Functions for disk access for blocks.
void ListLockedCoins(std::vector< COutPoint > &vOutpts) const
UniValue abortrescan(const JSONRPCRequest &request)
UniValue listunspent(const JSONRPCRequest &request)
full block available in blk*.dat
UniValue gettransaction(const JSONRPCRequest &request)
const CHDChain & GetHDChain() const
CKeyID seed_id
seed hash160
bool BackupWallet(const std::string &strDest)
UniValue importmulti(const JSONRPCRequest &request)
void SetHex(const char *psz)
UniValue lockunspent(const JSONRPCRequest &request)
UniValue importprivkey(const JSONRPCRequest &request)
UniValue importpubkey(const JSONRPCRequest &request)
UniValue listtransactions(const JSONRPCRequest &request)
const CBlockIndex * FindFork(const CBlockIndex *pindex) const
Find the last common block between this chain and a block index entry.
std::string strOtherAccount
CScript GetScriptForWitness(const CScript &redeemscript)
Generate a pay-to-witness script for the given redeem script.
std::string EncodeAssetData(std::string decoded)
bool operator()(const CScriptID &scriptID)
int GetDepthInMainChain(const CBlockIndex *&pindexRet) const
Return depth of transaction in blockchain: <0 : conflicts with a transaction this deep in the blockch...
CAmount GetFeePerK() const
Return the fee in satoshis for a size of 1000 bytes.
UniValue listlockunspent(const JSONRPCRequest &request)
Wrapper for UniValue::VType, which includes typeAny: Used to denote don't care type.
UniValue movecmd(const JSONRPCRequest &request)
int64_t nRelockTime
Holds a timestamp at which point the wallet is scheduled (externally) to be relocked. Caller must arrange for actual relocking to occur via Lock().
UniValue encryptwallet(const JSONRPCRequest &request)
Error parsing or validating structure in raw format.
std::string EncodeBase64(const unsigned char *pch, size_t len)
A signature creator that just produces 72-byte empty signatures.
bool Unlock(const SecureString &strWalletPassphrase)
void EnsureWalletIsUnlocked(CWallet *const pwallet)
UniValue listreceivedbyaccount(const JSONRPCRequest &request)
bool CommitTransaction(CWalletTx &wtxNew, CReserveKey &reservekey, CConnman *connman, CValidationState &state)
RVN END.
void GetAmounts(std::list< COutputEntry > &listReceived, std::list< COutputEntry > &listSent, CAmount &nFee, std::string &strSentAccount, const isminefilter &filter) const
UniValue addmultisigaddress(const JSONRPCRequest &request)