Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 756 Lines • ▼ Show 20 Lines | static UniValue getreceivedbyaddress(const Config &config, | ||||
} | } | ||||
// Tally | // Tally | ||||
Amount nAmount = Amount::zero(); | Amount nAmount = Amount::zero(); | ||||
for (const std::pair<uint256, CWalletTx> &pairWtx : pwallet->mapWallet) { | for (const std::pair<uint256, CWalletTx> &pairWtx : pwallet->mapWallet) { | ||||
const CWalletTx &wtx = pairWtx.second; | const CWalletTx &wtx = pairWtx.second; | ||||
CValidationState state; | CValidationState state; | ||||
if (wtx.IsCoinBase() || | if (wtx.IsCoinBase() || !ContextualCheckTransactionForCurrentBlock( | ||||
!ContextualCheckTransactionForCurrentBlock(config, *wtx.tx, | config, *wtx.tx, state)) { | ||||
state)) { | |||||
continue; | continue; | ||||
} | } | ||||
for (const CTxOut &txout : wtx.tx->vout) { | for (const CTxOut &txout : wtx.tx->vout) { | ||||
if (txout.scriptPubKey == scriptPubKey) { | if (txout.scriptPubKey == scriptPubKey) { | ||||
if (wtx.GetDepthInMainChain() >= nMinDepth) { | if (wtx.GetDepthInMainChain() >= nMinDepth) { | ||||
nAmount += txout.nValue; | nAmount += txout.nValue; | ||||
} | } | ||||
Show All 19 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
"transactions with at least [minconf] confirmations.\n" | "transactions with at least [minconf] confirmations.\n" | ||||
"\nArguments:\n" | "\nArguments:\n" | ||||
"1. \"label\" (string, required) The selected label, may be " | "1. \"label\" (string, required) The selected label, may be " | ||||
"the default label using \"\".\n" | "the default label using \"\".\n" | ||||
"2. minconf (numeric, optional, default=1) Only include " | "2. minconf (numeric, optional, default=1) Only include " | ||||
"transactions confirmed at least this many times.\n" | "transactions confirmed at least this many times.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"amount (numeric) The total amount in " + | "amount (numeric) The total amount in " + | ||||
CURRENCY_UNIT + " received for this label.\n" | CURRENCY_UNIT + | ||||
" received for this label.\n" | |||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nAmount received by the default label with at " | "\nAmount received by the default label with at least 1 " | ||||
"least 1 confirmation\n" + | "confirmation\n" + | ||||
HelpExampleCli("getreceivedbylabel", "\"\"") + | HelpExampleCli("getreceivedbylabel", "\"\"") + | ||||
"\nAmount received at the tabby label including unconfirmed " | "\nAmount received at the tabby label including unconfirmed " | ||||
"amounts with zero confirmations\n" + | "amounts with zero confirmations\n" + | ||||
HelpExampleCli("getreceivedbylabel", "\"tabby\" 0") + | HelpExampleCli("getreceivedbylabel", "\"tabby\" 0") + | ||||
"\nThe amount with at least 6 confirmations\n" + | "\nThe amount with at least 6 confirmations\n" + | ||||
HelpExampleCli("getreceivedbylabel", "\"tabby\" 6") + | HelpExampleCli("getreceivedbylabel", "\"tabby\" 6") + | ||||
"\nAs a json rpc call\n" + | "\nAs a json rpc call\n" + | ||||
HelpExampleRpc("getreceivedbylabel", "\"tabby\", 6")); | HelpExampleRpc("getreceivedbylabel", "\"tabby\", 6")); | ||||
Show All 11 Lines | UniValue getreceivedbylabel(const Config &config, | ||||
std::string label = LabelFromValue(request.params[0]); | std::string label = LabelFromValue(request.params[0]); | ||||
std::set<CTxDestination> setAddress = pwallet->GetLabelAddresses(label); | std::set<CTxDestination> setAddress = pwallet->GetLabelAddresses(label); | ||||
// Tally | // Tally | ||||
Amount nAmount = Amount::zero(); | Amount nAmount = Amount::zero(); | ||||
for (const std::pair<uint256, CWalletTx> &pairWtx : pwallet->mapWallet) { | for (const std::pair<uint256, CWalletTx> &pairWtx : pwallet->mapWallet) { | ||||
const CWalletTx &wtx = pairWtx.second; | const CWalletTx &wtx = pairWtx.second; | ||||
CValidationState state; | CValidationState state; | ||||
if (wtx.IsCoinBase() || | if (wtx.IsCoinBase() || !ContextualCheckTransactionForCurrentBlock( | ||||
!ContextualCheckTransactionForCurrentBlock(config, *wtx.tx, | config, *wtx.tx, state)) { | ||||
state)) { | |||||
continue; | continue; | ||||
} | } | ||||
for (const CTxOut &txout : wtx.tx->vout) { | for (const CTxOut &txout : wtx.tx->vout) { | ||||
CTxDestination address; | CTxDestination address; | ||||
if (ExtractDestination(txout.scriptPubKey, address) && | if (ExtractDestination(txout.scriptPubKey, address) && | ||||
IsMine(*pwallet, address) && setAddress.count(address)) { | IsMine(*pwallet, address) && setAddress.count(address)) { | ||||
if (wtx.GetDepthInMainChain() >= nMinDepth) { | if (wtx.GetDepthInMainChain() >= nMinDepth) { | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 3) { | ||||
"recommended to avoid passing\n" | "recommended to avoid passing\n" | ||||
" this argument.\n" | " this argument.\n" | ||||
"2. minconf (numeric, optional, default=1) Only include " | "2. minconf (numeric, optional, default=1) Only include " | ||||
"transactions confirmed at least this many times.\n" | "transactions confirmed at least this many times.\n" | ||||
"3. include_watchonly (bool, optional, default=false) Also include " | "3. include_watchonly (bool, optional, default=false) Also include " | ||||
"balance in watch-only addresses (see 'importaddress')\n" | "balance in watch-only addresses (see 'importaddress')\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"amount (numeric) The total amount in " + | "amount (numeric) The total amount in " + | ||||
CURRENCY_UNIT + " received for this account.\n" | CURRENCY_UNIT + | ||||
" received for this account.\n" | |||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nThe total amount in the wallet\n" + | "\nThe total amount in the wallet\n" + | ||||
HelpExampleCli("getbalance", "") + | HelpExampleCli("getbalance", "") + | ||||
"\nThe total amount in the wallet at least 5 blocks confirmed\n" + | "\nThe total amount in the wallet at least 5 blocks confirmed\n" + | ||||
HelpExampleCli("getbalance", "\"*\" 6") + "\nAs a json rpc call\n" + | HelpExampleCli("getbalance", "\"*\" 6") + "\nAs a json rpc call\n" + | ||||
HelpExampleRpc("getbalance", "\"*\", 6")); | HelpExampleRpc("getbalance", "\"*\", 6")); | ||||
} | } | ||||
ObserveSafeMode(); | ObserveSafeMode(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 3 || | ||||
"stored in the wallet only.\n" | "stored in the wallet only.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"true|false (boolean) true if successful.\n" | "true|false (boolean) true if successful.\n" | ||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nMove 0.01 " + | "\nMove 0.01 " + | ||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
" from the default account to the account named tabby\n" + | " from the default account to the account named tabby\n" + | ||||
HelpExampleCli("move", "\"\" \"tabby\" 0.01") + "\nMove 0.01 " + | HelpExampleCli("move", "\"\" \"tabby\" 0.01") + "\nMove 0.01 " + | ||||
CURRENCY_UNIT + " timotei to akiko with a comment and funds have 6 " | CURRENCY_UNIT + | ||||
" timotei to akiko with a comment and funds have 6 " | |||||
"confirmations\n" + | "confirmations\n" + | ||||
HelpExampleCli("move", | HelpExampleCli("move", | ||||
"\"timotei\" \"akiko\" 0.01 6 \"happy birthday!\"") + | "\"timotei\" \"akiko\" 0.01 6 \"happy birthday!\"") + | ||||
"\nAs a json rpc call\n" + | "\nAs a json rpc call\n" + | ||||
HelpExampleRpc( | HelpExampleRpc( | ||||
"move", | "move", | ||||
"\"timotei\", \"akiko\", 0.01, 6, \"happy birthday!\"")); | "\"timotei\", \"akiko\", 0.01, 6, \"happy birthday!\"")); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 3 || | ||||
" to which you're sending the " | " to which you're sending the " | ||||
"transaction. This is not part of the transaction, \n" | "transaction. This is not part of the transaction, \n" | ||||
" it is just kept in your " | " it is just kept in your " | ||||
"wallet.\n" | "wallet.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"\"txid\" (string) The transaction id.\n" | "\"txid\" (string) The transaction id.\n" | ||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nSend 0.01 " + | "\nSend 0.01 " + | ||||
CURRENCY_UNIT + " from the default account to the address, must " | CURRENCY_UNIT + | ||||
"have at least 1 confirmation\n" + | " from the default account to the address, must have at least 1 " | ||||
"confirmation\n" + | |||||
HelpExampleCli("sendfrom", | HelpExampleCli("sendfrom", | ||||
"\"\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01") + | "\"\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.01") + | ||||
"\nSend 0.01 from the tabby account to the given address, funds " | "\nSend 0.01 from the tabby account to the given address, funds " | ||||
"must have at least 6 confirmations\n" + | "must have at least 6 confirmations\n" + | ||||
HelpExampleCli("sendfrom", | HelpExampleCli("sendfrom", | ||||
"\"tabby\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" " | "\"tabby\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" " | ||||
"0.01 6 \"donation\" \"seans outpost\"") + | "0.01 6 \"donation\" \"seans outpost\"") + | ||||
"\nAs a json rpc call\n" + | "\nAs a json rpc call\n" + | ||||
▲ Show 20 Lines • Show All 334 Lines • ▼ Show 20 Lines | UniValue ListReceived(const Config &config, CWallet *const pwallet, | ||||
} | } | ||||
// Tally | // Tally | ||||
std::map<CTxDestination, tallyitem> mapTally; | std::map<CTxDestination, tallyitem> mapTally; | ||||
for (const std::pair<uint256, CWalletTx> &pairWtx : pwallet->mapWallet) { | for (const std::pair<uint256, CWalletTx> &pairWtx : pwallet->mapWallet) { | ||||
const CWalletTx &wtx = pairWtx.second; | const CWalletTx &wtx = pairWtx.second; | ||||
CValidationState state; | CValidationState state; | ||||
if (wtx.IsCoinBase() || | if (wtx.IsCoinBase() || !ContextualCheckTransactionForCurrentBlock( | ||||
!ContextualCheckTransactionForCurrentBlock(config, *wtx.tx, | config, *wtx.tx, state)) { | ||||
state)) { | |||||
continue; | continue; | ||||
} | } | ||||
int nDepth = wtx.GetDepthInMainChain(); | int nDepth = wtx.GetDepthInMainChain(); | ||||
if (nDepth < nMinDepth) { | if (nDepth < nMinDepth) { | ||||
continue; | continue; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 525 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 2) { | ||||
"{ (json object where keys are account names, " | "{ (json object where keys are account names, " | ||||
"and values are numeric balances\n" | "and values are numeric balances\n" | ||||
" \"account\": x.xxx, (numeric) The property name is the account " | " \"account\": x.xxx, (numeric) The property name is the account " | ||||
"name, and the value is the total balance for the account.\n" | "name, and the value is the total balance for the account.\n" | ||||
" ...\n" | " ...\n" | ||||
"}\n" | "}\n" | ||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nList account balances where there at least 1 confirmation\n" + | "\nList account balances where there at least 1 confirmation\n" + | ||||
HelpExampleCli("listaccounts", "") + "\nList account balances " | HelpExampleCli("listaccounts", "") + | ||||
"including zero confirmation " | "\nList account balances including zero confirmation " | ||||
"transactions\n" + | "transactions\n" + | ||||
HelpExampleCli("listaccounts", "0") + | HelpExampleCli("listaccounts", "0") + | ||||
"\nList account balances for 6 or more confirmations\n" + | "\nList account balances for 6 or more confirmations\n" + | ||||
HelpExampleCli("listaccounts", "6") + "\nAs json rpc call\n" + | HelpExampleCli("listaccounts", "6") + "\nAs json rpc call\n" + | ||||
HelpExampleRpc("listaccounts", "6")); | HelpExampleRpc("listaccounts", "6")); | ||||
} | } | ||||
ObserveSafeMode(); | ObserveSafeMode(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
▲ Show 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
"The account name involved in the transaction, can be \"\" for the " | "The account name involved in the transaction, can be \"\" for the " | ||||
"default account.\n" | "default account.\n" | ||||
" \"address\" : \"address\", (string) The bitcoin " | " \"address\" : \"address\", (string) The bitcoin " | ||||
"address involved in the transaction\n" | "address involved in the transaction\n" | ||||
" \"category\" : \"send|receive\", (string) The category, " | " \"category\" : \"send|receive\", (string) The category, " | ||||
"either 'send' or 'receive'\n" | "either 'send' or 'receive'\n" | ||||
" \"amount\" : x.xxx, (numeric) The amount " | " \"amount\" : x.xxx, (numeric) The amount " | ||||
"in " + | "in " + | ||||
CURRENCY_UNIT + "\n" | CURRENCY_UNIT + | ||||
"\n" | |||||
" \"label\" : \"label\", " | " \"label\" : \"label\", " | ||||
"(string) A comment for the address/transaction, " | "(string) A comment for the address/transaction, " | ||||
"if any\n" | "if any\n" | ||||
" \"vout\" : n, " | " \"vout\" : n, " | ||||
"(numeric) the vout value\n" | "(numeric) the vout value\n" | ||||
" \"fee\": x.xxx, " | " \"fee\": x.xxx, " | ||||
"(numeric) The amount of the fee in " + | "(numeric) The amount of the fee in " + | ||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
". This is negative and only available for the \n" | ". This is negative and only available for the \n" | ||||
" 'send' category of " | " 'send' category of " | ||||
"transactions.\n" | "transactions.\n" | ||||
" \"abandoned\": xxx (bool) 'true' if the " | " \"abandoned\": xxx (bool) 'true' if the " | ||||
"transaction has been abandoned (inputs are respendable). Only " | "transaction has been abandoned (inputs are respendable). Only " | ||||
"available for the \n" | "available for the \n" | ||||
" 'send' category of " | " 'send' category of " | ||||
▲ Show 20 Lines • Show All 533 Lines • ▼ Show 20 Lines | static UniValue lockunspent(const Config &config, | ||||
for (size_t idx = 0; idx < outputs.size(); idx++) { | for (size_t idx = 0; idx < outputs.size(); idx++) { | ||||
const UniValue &output = outputs[idx]; | const UniValue &output = outputs[idx]; | ||||
if (!output.isObject()) { | if (!output.isObject()) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"Invalid parameter, expected object"); | "Invalid parameter, expected object"); | ||||
} | } | ||||
const UniValue &o = output.get_obj(); | const UniValue &o = output.get_obj(); | ||||
RPCTypeCheckObj(o, | RPCTypeCheckObj(o, { | ||||
{ | |||||
{"txid", UniValueType(UniValue::VSTR)}, | {"txid", UniValueType(UniValue::VSTR)}, | ||||
{"vout", UniValueType(UniValue::VNUM)}, | {"vout", UniValueType(UniValue::VNUM)}, | ||||
}); | }); | ||||
std::string txid = find_value(o, "txid").get_str(); | std::string txid = find_value(o, "txid").get_str(); | ||||
if (!IsHex(txid)) { | if (!IsHex(txid)) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"Invalid parameter, expected hex txid"); | "Invalid parameter, expected hex txid"); | ||||
} | } | ||||
int nOutput = find_value(o, "vout").get_int(); | int nOutput = find_value(o, "vout").get_int(); | ||||
▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 0) { | ||||
"Returns an object containing various wallet state info.\n" | "Returns an object containing various wallet state info.\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"{\n" | "{\n" | ||||
" \"walletname\": xxxxx, (string) the wallet name\n" | " \"walletname\": xxxxx, (string) the wallet name\n" | ||||
" \"walletversion\": xxxxx, (numeric) the wallet " | " \"walletversion\": xxxxx, (numeric) the wallet " | ||||
"version\n" | "version\n" | ||||
" \"balance\": xxxxxxx, (numeric) the total " | " \"balance\": xxxxxxx, (numeric) the total " | ||||
"confirmed balance of the wallet in " + | "confirmed balance of the wallet in " + | ||||
CURRENCY_UNIT + "\n" | CURRENCY_UNIT + | ||||
"\n" | |||||
" \"unconfirmed_balance\": xxx, (numeric) " | " \"unconfirmed_balance\": xxx, (numeric) " | ||||
"the total unconfirmed balance of the wallet in " + | "the total unconfirmed balance of the wallet in " + | ||||
CURRENCY_UNIT + "\n" | CURRENCY_UNIT + | ||||
"\n" | |||||
" \"immature_balance\": xxxxxx, (numeric) " | " \"immature_balance\": xxxxxx, (numeric) " | ||||
"the total immature balance of the wallet in " + | "the total immature balance of the wallet in " + | ||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
"\n" | "\n" | ||||
" \"txcount\": xxxxxxx, (numeric) the total number " | " \"txcount\": xxxxxxx, (numeric) the total number " | ||||
"of transactions in the wallet\n" | "of transactions in the wallet\n" | ||||
" \"keypoololdest\": xxxxxx, (numeric) the timestamp " | " \"keypoololdest\": xxxxxx, (numeric) the timestamp " | ||||
"(seconds since Unix epoch) of the oldest pre-generated key in the " | "(seconds since Unix epoch) of the oldest pre-generated key in the " | ||||
"key pool\n" | "key pool\n" | ||||
" \"keypoolsize\": xxxx, (numeric) how many new keys " | " \"keypoolsize\": xxxx, (numeric) how many new keys " | ||||
"are pre-generated (only counts external keys)\n" | "are pre-generated (only counts external keys)\n" | ||||
" \"keypoolsize_hd_internal\": xxxx, (numeric) how many new keys " | " \"keypoolsize_hd_internal\": xxxx, (numeric) how many new keys " | ||||
"are pre-generated for internal use (used for change outputs, only " | "are pre-generated for internal use (used for change outputs, only " | ||||
"appears if the wallet is using this feature, otherwise external " | "appears if the wallet is using this feature, otherwise external " | ||||
"keys are used)\n" | "keys are used)\n" | ||||
" \"unlocked_until\": ttt, (numeric) the timestamp in " | " \"unlocked_until\": ttt, (numeric) the timestamp in " | ||||
"seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is " | "seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is " | ||||
"unlocked for transfers, or 0 if the wallet is locked\n" | "unlocked for transfers, or 0 if the wallet is locked\n" | ||||
" \"paytxfee\": x.xxxx, (numeric) the transaction " | " \"paytxfee\": x.xxxx, (numeric) the transaction " | ||||
"fee configuration, set in " + | "fee configuration, set in " + | ||||
CURRENCY_UNIT + "/kB\n" | CURRENCY_UNIT + | ||||
"/kB\n" | |||||
" \"hdmasterkeyid\": \"<hash160>\" (string) " | " \"hdmasterkeyid\": \"<hash160>\" (string) " | ||||
"the Hash160 of the HD master pubkey\n" | "the Hash160 of the HD master pubkey\n" | ||||
"}\n" | "}\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("getwalletinfo", "") + | HelpExampleCli("getwalletinfo", "") + | ||||
HelpExampleRpc("getwalletinfo", "")); | HelpExampleRpc("getwalletinfo", "")); | ||||
} | } | ||||
ObserveSafeMode(); | ObserveSafeMode(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
UniValue obj(UniValue::VOBJ); | UniValue obj(UniValue::VOBJ); | ||||
▲ Show 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 5) { | ||||
" ]\n" | " ]\n" | ||||
"4. include_unsafe (bool, optional, default=true) Include outputs " | "4. include_unsafe (bool, optional, default=true) Include outputs " | ||||
"that are not safe to spend\n" | "that are not safe to spend\n" | ||||
" See description of \"safe\" attribute below.\n" | " See description of \"safe\" attribute below.\n" | ||||
"5. query_options (json, optional) JSON with query options\n" | "5. query_options (json, optional) JSON with query options\n" | ||||
" {\n" | " {\n" | ||||
" \"minimumAmount\" (numeric or string, default=0) Minimum " | " \"minimumAmount\" (numeric or string, default=0) Minimum " | ||||
"value of each UTXO in " + | "value of each UTXO in " + | ||||
CURRENCY_UNIT + "\n" | CURRENCY_UNIT + | ||||
" \"maximumAmount\" (numeric or string, " | "\n" | ||||
"default=unlimited) Maximum value of each UTXO " | " \"maximumAmount\" (numeric or string, default=unlimited) " | ||||
"in " + | "Maximum value of each UTXO in " + | ||||
CURRENCY_UNIT + "\n" | CURRENCY_UNIT + | ||||
" \"maximumCount\" (numeric or string, " | "\n" | ||||
"default=unlimited) Maximum number of UTXOs\n" | " \"maximumCount\" (numeric or string, default=unlimited) " | ||||
" \"minimumSumAmount\" (numeric or string, " | "Maximum number of UTXOs\n" | ||||
"default=unlimited) Minimum sum value of all UTXOs " | " \"minimumSumAmount\" (numeric or string, default=unlimited) " | ||||
"in " + | "Minimum sum value of all UTXOs in " + | ||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
"\n" | "\n" | ||||
" }\n" | " }\n" | ||||
"\nResult\n" | "\nResult\n" | ||||
"[ (array of json object)\n" | "[ (array of json object)\n" | ||||
" {\n" | " {\n" | ||||
" \"txid\" : \"txid\", (string) the transaction id \n" | " \"txid\" : \"txid\", (string) the transaction id \n" | ||||
" \"vout\" : n, (numeric) the vout value\n" | " \"vout\" : n, (numeric) the vout value\n" | ||||
▲ Show 20 Lines • Show All 228 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
" for backward compatibility: passing in a " | " for backward compatibility: passing in a " | ||||
"true instead of an object will result in " | "true instead of an object will result in " | ||||
"{\"includeWatching\":true}\n" | "{\"includeWatching\":true}\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
"{\n" | "{\n" | ||||
" \"hex\": \"value\", (string) The resulting raw " | " \"hex\": \"value\", (string) The resulting raw " | ||||
"transaction (hex-encoded string)\n" | "transaction (hex-encoded string)\n" | ||||
" \"fee\": n, (numeric) Fee in " + | " \"fee\": n, (numeric) Fee in " + | ||||
CURRENCY_UNIT + " the resulting transaction pays\n" | CURRENCY_UNIT + | ||||
" \"changepos\": n (numeric) The " | " the resulting transaction pays\n" | ||||
"position of the added change output, or -1\n" | " \"changepos\": n (numeric) The position of the added " | ||||
"change output, or -1\n" | |||||
"}\n" | "}\n" | ||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nCreate a transaction with no inputs\n" + | "\nCreate a transaction with no inputs\n" + | ||||
HelpExampleCli("createrawtransaction", | HelpExampleCli("createrawtransaction", | ||||
"\"[]\" \"{\\\"myaddress\\\":0.01}\"") + | "\"[]\" \"{\\\"myaddress\\\":0.01}\"") + | ||||
"\nAdd sufficient unsigned inputs to meet the output value\n" + | "\nAdd sufficient unsigned inputs to meet the output value\n" + | ||||
HelpExampleCli("fundrawtransaction", "\"rawtransactionhex\"") + | HelpExampleCli("fundrawtransaction", "\"rawtransactionhex\"") + | ||||
"\nSign the transaction\n" + | "\nSign the transaction\n" + | ||||
HelpExampleCli("signrawtransaction", "\"fundedtransactionhex\"") + | HelpExampleCli("signrawtransaction", "\"fundedtransactionhex\"") + | ||||
"\nSend the transaction\n" + | "\nSend the transaction\n" + | ||||
HelpExampleCli("sendrawtransaction", "\"signedtransactionhex\"")); | HelpExampleCli("sendrawtransaction", "\"signedtransactionhex\"")); | ||||
▲ Show 20 Lines • Show All 324 Lines • Show Last 20 Lines |