Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 3,298 Lines • ▼ Show 20 Lines | RPCHelpMan{ | ||||
{"blank", RPCArg::Type::BOOL, /* default */ "false", | {"blank", RPCArg::Type::BOOL, /* default */ "false", | ||||
"Create a blank wallet. A blank wallet has no keys or HD seed. " | "Create a blank wallet. A blank wallet has no keys or HD seed. " | ||||
"One can be set using sethdseed."}, | "One can be set using sethdseed."}, | ||||
{"passphrase", RPCArg::Type::STR, RPCArg::Optional::OMITTED, | {"passphrase", RPCArg::Type::STR, RPCArg::Optional::OMITTED, | ||||
"Encrypt the wallet with this passphrase."}, | "Encrypt the wallet with this passphrase."}, | ||||
{"avoid_reuse", RPCArg::Type::BOOL, /* default */ "false", | {"avoid_reuse", RPCArg::Type::BOOL, /* default */ "false", | ||||
"Keep track of coin reuse, and treat dirty and clean coins " | "Keep track of coin reuse, and treat dirty and clean coins " | ||||
"differently with privacy considerations in mind."}, | "differently with privacy considerations in mind."}, | ||||
{"descriptors", RPCArg::Type::BOOL, /* default */ "false", | |||||
"Create a native descriptor wallet. The wallet will use " | |||||
"descriptors internally to handle address creation"}, | |||||
}, | }, | ||||
RPCResult{RPCResult::Type::OBJ, | RPCResult{RPCResult::Type::OBJ, | ||||
"", | "", | ||||
"", | "", | ||||
{ | { | ||||
{RPCResult::Type::STR, "name", | {RPCResult::Type::STR, "name", | ||||
"The wallet name if created successfully. If the wallet " | "The wallet name if created successfully. If the wallet " | ||||
"was created using a full path, the wallet_name will be " | "was created using a full path, the wallet_name will be " | ||||
Show All 26 Lines | if (!request.params[3].isNull()) { | ||||
Untranslated("Empty string given as passphrase, wallet will " | Untranslated("Empty string given as passphrase, wallet will " | ||||
"not be encrypted.")); | "not be encrypted.")); | ||||
} | } | ||||
} | } | ||||
if (!request.params[4].isNull() && request.params[4].get_bool()) { | if (!request.params[4].isNull() && request.params[4].get_bool()) { | ||||
flags |= WALLET_FLAG_AVOID_REUSE; | flags |= WALLET_FLAG_AVOID_REUSE; | ||||
} | } | ||||
if (!request.params[5].isNull() && request.params[5].get_bool()) { | |||||
flags |= WALLET_FLAG_DESCRIPTORS; | |||||
} | |||||
bilingual_str error; | bilingual_str error; | ||||
std::shared_ptr<CWallet> wallet; | std::shared_ptr<CWallet> wallet; | ||||
WalletCreationStatus status = | WalletCreationStatus status = | ||||
CreateWallet(config.GetChainParams(), *g_rpc_chain, passphrase, flags, | CreateWallet(config.GetChainParams(), *g_rpc_chain, passphrase, flags, | ||||
request.params[0].get_str(), error, warnings, wallet); | request.params[0].get_str(), error, warnings, wallet); | ||||
switch (status) { | switch (status) { | ||||
case WalletCreationStatus::CREATION_FAILED: | case WalletCreationStatus::CREATION_FAILED: | ||||
▲ Show 20 Lines • Show All 1,632 Lines • ▼ Show 20 Lines | |||||
// clang-format off | // clang-format off | ||||
static const CRPCCommand commands[] = { | static const CRPCCommand commands[] = { | ||||
// category name actor (function) argNames | // category name actor (function) argNames | ||||
// ------------------- ------------------------ ---------------------- ---------- | // ------------------- ------------------------ ---------------------- ---------- | ||||
{ "rawtransactions", "fundrawtransaction", fundrawtransaction, {"hexstring","options"} }, | { "rawtransactions", "fundrawtransaction", fundrawtransaction, {"hexstring","options"} }, | ||||
{ "wallet", "abandontransaction", abandontransaction, {"txid"} }, | { "wallet", "abandontransaction", abandontransaction, {"txid"} }, | ||||
{ "wallet", "addmultisigaddress", addmultisigaddress, {"nrequired","keys","label"} }, | { "wallet", "addmultisigaddress", addmultisigaddress, {"nrequired","keys","label"} }, | ||||
{ "wallet", "backupwallet", backupwallet, {"destination"} }, | { "wallet", "backupwallet", backupwallet, {"destination"} }, | ||||
{ "wallet", "createwallet", createwallet, {"wallet_name", "disable_private_keys", "blank", "passphrase", "avoid_reuse"} }, | { "wallet", "createwallet", createwallet, {"wallet_name", "disable_private_keys", "blank", "passphrase", "avoid_reuse", "descriptors"} }, | ||||
{ "wallet", "encryptwallet", encryptwallet, {"passphrase"} }, | { "wallet", "encryptwallet", encryptwallet, {"passphrase"} }, | ||||
{ "wallet", "getaddressesbylabel", getaddressesbylabel, {"label"} }, | { "wallet", "getaddressesbylabel", getaddressesbylabel, {"label"} }, | ||||
{ "wallet", "getaddressinfo", getaddressinfo, {"address"} }, | { "wallet", "getaddressinfo", getaddressinfo, {"address"} }, | ||||
{ "wallet", "getbalance", getbalance, {"dummy","minconf","include_watchonly","avoid_reuse"} }, | { "wallet", "getbalance", getbalance, {"dummy","minconf","include_watchonly","avoid_reuse"} }, | ||||
{ "wallet", "getnewaddress", getnewaddress, {"label", "address_type"} }, | { "wallet", "getnewaddress", getnewaddress, {"label", "address_type"} }, | ||||
{ "wallet", "getrawchangeaddress", getrawchangeaddress, {"address_type"} }, | { "wallet", "getrawchangeaddress", getrawchangeaddress, {"address_type"} }, | ||||
{ "wallet", "getreceivedbyaddress", getreceivedbyaddress, {"address","minconf"} }, | { "wallet", "getreceivedbyaddress", getreceivedbyaddress, {"address","minconf"} }, | ||||
{ "wallet", "getreceivedbylabel", getreceivedbylabel, {"label","minconf"} }, | { "wallet", "getreceivedbylabel", getreceivedbylabel, {"label","minconf"} }, | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |