Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 2,873 Lines • ▼ Show 20 Lines | if (!seed_id.IsNull()) { | ||||
obj.pushKV("hdseedid", seed_id.GetHex()); | obj.pushKV("hdseedid", seed_id.GetHex()); | ||||
obj.pushKV("hdmasterkeyid", seed_id.GetHex()); | obj.pushKV("hdmasterkeyid", seed_id.GetHex()); | ||||
} | } | ||||
obj.pushKV("private_keys_enabled", | obj.pushKV("private_keys_enabled", | ||||
!pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)); | !pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)); | ||||
return obj; | return obj; | ||||
} | } | ||||
static UniValue listwalletdir(const Config &config, | |||||
const JSONRPCRequest &request) { | |||||
if (request.fHelp || request.params.size() != 0) { | |||||
throw std::runtime_error( | |||||
"listwalletdir\n" | |||||
"Returns a list of wallets in the wallet directory.\n" | |||||
"{\n" | |||||
" \"wallets\" : [ (json array of objects)\n" | |||||
" {\n" | |||||
" \"name\" : \"name\" (string) The wallet name\n" | |||||
" }\n" | |||||
" ,...\n" | |||||
" ]\n" | |||||
"}\n" | |||||
"\nExamples:\n" + | |||||
HelpExampleCli("listwalletdir", "") + | |||||
HelpExampleRpc("listwalletdir", "")); | |||||
} | |||||
UniValue wallets(UniValue::VARR); | |||||
for (const auto &path : ListWalletDir()) { | |||||
UniValue wallet(UniValue::VOBJ); | |||||
wallet.pushKV("name", path.string()); | |||||
wallets.push_back(wallet); | |||||
} | |||||
UniValue result(UniValue::VOBJ); | |||||
result.pushKV("wallets", wallets); | |||||
return result; | |||||
} | |||||
static UniValue listwallets(const Config &config, | static UniValue listwallets(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 0) { | if (request.fHelp || request.params.size() != 0) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"listwallets\n" | "listwallets\n" | ||||
"Returns a list of currently loaded wallets.\n" | "Returns a list of currently loaded wallets.\n" | ||||
"For full information on the wallet, use \"getwalletinfo\"\n" | "For full information on the wallet, use \"getwalletinfo\"\n" | ||||
"\nResult:\n" | "\nResult:\n" | ||||
▲ Show 20 Lines • Show All 1,810 Lines • ▼ Show 20 Lines | static const ContextFreeRPCCommand commands[] = { | ||||
{ "wallet", "listaddressgroupings", listaddressgroupings, {} }, | { "wallet", "listaddressgroupings", listaddressgroupings, {} }, | ||||
{ "wallet", "listlabels", listlabels, {"purpose"} }, | { "wallet", "listlabels", listlabels, {"purpose"} }, | ||||
{ "wallet", "listlockunspent", listlockunspent, {} }, | { "wallet", "listlockunspent", listlockunspent, {} }, | ||||
{ "wallet", "listreceivedbyaddress", listreceivedbyaddress, {"minconf","include_empty","include_watchonly","address_filter"} }, | { "wallet", "listreceivedbyaddress", listreceivedbyaddress, {"minconf","include_empty","include_watchonly","address_filter"} }, | ||||
{ "wallet", "listreceivedbylabel", listreceivedbylabel, {"minconf","include_empty","include_watchonly"} }, | { "wallet", "listreceivedbylabel", listreceivedbylabel, {"minconf","include_empty","include_watchonly"} }, | ||||
{ "wallet", "listsinceblock", listsinceblock, {"blockhash","target_confirmations","include_watchonly","include_removed"} }, | { "wallet", "listsinceblock", listsinceblock, {"blockhash","target_confirmations","include_watchonly","include_removed"} }, | ||||
{ "wallet", "listtransactions", listtransactions, {"label|dummy","count","skip","include_watchonly"} }, | { "wallet", "listtransactions", listtransactions, {"label|dummy","count","skip","include_watchonly"} }, | ||||
{ "wallet", "listunspent", listunspent, {"minconf","maxconf","addresses","include_unsafe","query_options"} }, | { "wallet", "listunspent", listunspent, {"minconf","maxconf","addresses","include_unsafe","query_options"} }, | ||||
{ "wallet", "listwalletdir", listwalletdir, {} }, | |||||
{ "wallet", "listwallets", listwallets, {} }, | { "wallet", "listwallets", listwallets, {} }, | ||||
{ "wallet", "loadwallet", loadwallet, {"filename"} }, | { "wallet", "loadwallet", loadwallet, {"filename"} }, | ||||
{ "wallet", "lockunspent", lockunspent, {"unlock","transactions"} }, | { "wallet", "lockunspent", lockunspent, {"unlock","transactions"} }, | ||||
{ "wallet", "rescanblockchain", rescanblockchain, {"start_height", "stop_height"} }, | { "wallet", "rescanblockchain", rescanblockchain, {"start_height", "stop_height"} }, | ||||
{ "wallet", "sendmany", sendmany, {"dummy","amounts","minconf","comment","subtractfeefrom"} }, | { "wallet", "sendmany", sendmany, {"dummy","amounts","minconf","comment","subtractfeefrom"} }, | ||||
{ "wallet", "sendtoaddress", sendtoaddress, {"address","amount","comment","comment_to","subtractfeefromamount"} }, | { "wallet", "sendtoaddress", sendtoaddress, {"address","amount","comment","comment_to","subtractfeefromamount"} }, | ||||
{ "wallet", "sethdseed", sethdseed, {"newkeypool","seed"} }, | { "wallet", "sethdseed", sethdseed, {"newkeypool","seed"} }, | ||||
{ "wallet", "setlabel", setlabel, {"address","label"} }, | { "wallet", "setlabel", setlabel, {"address","label"} }, | ||||
Show All 17 Lines |