6#include <bitcoin-build-config.h>
29 "You need to rescan the blockchain in order to correctly mark used "
30 "destinations in the past. Until this is done, some destinations may "
31 "be considered unused, even if the opposite is the case."},
45 "Returns an object containing various wallet state info.\n",
59 {
RPCResult::Type::NUM,
"keypoolsize",
"how many new keys are pre-generated (only counts external keys)"},
60 {
RPCResult::Type::NUM,
"keypoolsize_hd_internal",
true,
"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)"},
61 {
RPCResult::Type::NUM_TIME,
"unlocked_until",
true,
"the " +
UNIX_EPOCH_TIME +
" until which the wallet is unlocked for transfers, or 0 if the wallet is locked (only present for passphrase-encrypted wallets)"},
63 {
RPCResult::Type::BOOL,
"private_keys_enabled",
"false if privatekeys are disabled for this wallet (enforced watch-only wallet)"},
64 {
RPCResult::Type::BOOL,
"avoid_reuse",
"whether this wallet tracks clean/dirty coins in terms of reuse"},
65 {
RPCResult::Type::OBJ,
"scanning",
"current scanning details, or false if no scan is in progress",
70 {
RPCResult::Type::BOOL,
"descriptors",
"whether this wallet uses descriptors for output script management"},
71 {
RPCResult::Type::BOOL,
"external_signer",
"whether this wallet is configured to use an external signer such as a hardware wallet"},
72 {
RPCResult::Type::BOOL,
"blank",
"Whether this wallet intentionally does not contain any keys, scripts, or descriptors"},
73 {
RPCResult::Type::NUM_TIME,
"birthtime",
true,
"The start time for blocks scanning. It could be modified by (re)importing any descriptor with an earlier timestamp."},
88 pwallet->BlockUntilSyncedToCurrentChain();
90 LOCK(pwallet->cs_wallet);
94 size_t kpExternalSize = pwallet->KeypoolCountExternalKeys();
96 obj.
pushKV(
"walletname", pwallet->GetName());
97 obj.
pushKV(
"walletversion", pwallet->GetVersion());
98 obj.
pushKV(
"format", pwallet->GetDatabase().Format());
102 obj.
pushKV(
"txcount", (
int)pwallet->mapWallet.size());
103 const auto kp_oldest = pwallet->GetOldestKeyPoolTime();
104 if (kp_oldest.has_value()) {
105 obj.
pushKV(
"keypoololdest", kp_oldest.value());
107 obj.
pushKV(
"keypoolsize", (int64_t)kpExternalSize);
110 obj.
pushKV(
"keypoolsize_hd_internal", (int64_t)(pwallet->GetKeyPoolSize() - kpExternalSize));
112 if (pwallet->IsCrypted()) {
113 obj.
pushKV(
"unlocked_until", pwallet->nRelockTime);
118 if (pwallet->IsScanning()) {
120 scanning.
pushKV(
"duration", Ticks<std::chrono::seconds>(pwallet->ScanningDuration()));
121 scanning.
pushKV(
"progress", pwallet->ScanningProgress());
122 obj.
pushKV(
"scanning", std::move(scanning));
124 obj.
pushKV(
"scanning",
false);
129 if (int64_t birthtime = pwallet->GetBirthTime(); birthtime !=
UNKNOWN_TIME) {
130 obj.
pushKV(
"birthtime", birthtime);
142 "Returns a list of wallets in the wallet directory.\n",
165 wallet.pushKV(
"name", path.utf8string());
170 result.
pushKV(
"wallets", std::move(wallets));
179 "Returns a list of currently loaded wallets.\n"
180 "For full information on the wallet, use \"getwalletinfo\"\n",
210 "\nLoads a wallet from a wallet file or directory."
211 "\nNote that all wallet command-line options used when starting bitcoind will be"
212 "\napplied to the new wallet.\n",
214 {
"filename",
RPCArg::Type::STR,
RPCArg::Optional::NO,
"The path to the directory of the wallet to be loaded, either absolute or relative to the \"wallets\" directory. The \"wallets\" directory is set by the -walletdir option and defaults to the \"wallets\" folder within the data directory."},
221 {
RPCResult::Type::ARR,
"warnings",
true,
"Warning messages, if any, related to loading the wallet.",
228 "\nLoad wallet from the wallet dir:\n"
231 +
"\nLoad wallet using absolute path (Unix):\n"
234 +
"\nLoad wallet using absolute path (Windows):\n"
235 +
HelpExampleCli(
"loadwallet",
"\"DriveLetter:\\path\\to\\walletname\\\"")
236 +
HelpExampleRpc(
"loadwallet",
"\"DriveLetter:\\path\\to\\walletname\\\"")
241 const std::string
name(request.params[0].get_str());
248 std::vector<bilingual_str> warnings;
249 std::optional<bool> load_on_start = request.params[1].isNull() ? std::nullopt : std::optional<bool>(request.params[1].get_bool());
253 if (std::any_of(context.wallets.begin(), context.wallets.end(), [&
name](
const auto&
wallet) { return wallet->GetName() == name; })) {
258 std::shared_ptr<CWallet>
const wallet =
LoadWallet(context,
name, load_on_start, options, status, error, warnings);
276 flags += (
flags ==
"" ?
"" :
", ") + it.first;
279 "\nChange the state of the given wallet flag for a wallet.\n",
301 std::string flag_str = request.params[0].get_str();
302 bool value = request.params[1].isNull() || request.params[1].get_bool();
316 if (pwallet->IsWalletFlagSet(flag) == value) {
320 res.pushKV(
"flag_name", flag_str);
321 res.pushKV(
"flag_state", value);
324 pwallet->SetWalletFlag(flag);
326 pwallet->UnsetWalletFlag(flag);
342 "\nCreates and loads a new wallet.\n",
348 {
"avoid_reuse",
RPCArg::Type::BOOL,
RPCArg::Default{
false},
"Keep track of coin reuse, and treat dirty and clean coins differently with privacy considerations in mind."},
351 {
"external_signer",
RPCArg::Type::BOOL,
RPCArg::Default{
false},
"Use an external signer such as a hardware wallet. Requires -signer to be configured. Wallet creation will fail if keys cannot be fetched. Requires disable_private_keys and descriptors set to true."},
356 {
RPCResult::Type::STR,
"name",
"The wallet name if created successfully. If the wallet was created using a full path, the wallet_name will be the full path."},
357 {
RPCResult::Type::ARR,
"warnings",
true,
"Warning messages, if any, related to creating and loading the wallet.",
366 +
HelpExampleCliNamed(
"createwallet", {{
"wallet_name",
"descriptors"}, {
"avoid_reuse",
true}, {
"descriptors",
true}, {
"load_on_startup",
true}})
367 +
HelpExampleRpcNamed(
"createwallet", {{
"wallet_name",
"descriptors"}, {
"avoid_reuse",
true}, {
"descriptors",
true}, {
"load_on_startup",
true}})
373 if (!request.params[1].isNull() && request.params[1].get_bool()) {
377 if (!request.params[2].isNull() && request.params[2].get_bool()) {
381 passphrase.reserve(100);
382 std::vector<bilingual_str> warnings;
383 if (!request.params[3].isNull()) {
384 passphrase = std::string_view{request.params[3].get_str()};
385 if (passphrase.empty()) {
387 warnings.emplace_back(
Untranslated(
"Empty string given as passphrase, wallet will not be encrypted."));
391 if (!request.params[4].isNull() && request.params[4].get_bool()) {
395 if (!self.
Arg<
bool>(
"descriptors")) {
396 throw JSONRPCError(
RPC_WALLET_ERROR,
"descriptors argument must be set to \"true\"; it is no longer possible to create a legacy wallet.");
398 if (!request.params[7].isNull() && request.params[7].get_bool()) {
399#ifdef ENABLE_EXTERNAL_SIGNER
413 std::optional<bool> load_on_start = request.params[6].isNull() ? std::nullopt : std::optional<bool>(request.params[6].get_bool());
414 const std::shared_ptr<CWallet>
wallet =
CreateWallet(context, request.params[0].get_str(), load_on_start, options, status, error, warnings);
432 "Unloads the wallet referenced by the request endpoint, otherwise unloads the wallet specified in the argument.\n"
433 "Specifying the wallet name on a wallet endpoint is invalid.",
435 {
"wallet_name",
RPCArg::Type::STR,
RPCArg::DefaultHint{
"the wallet name from the RPC endpoint"},
"The name of the wallet to unload. If provided both here and in the RPC endpoint, the two must be identical."},
439 {
RPCResult::Type::ARR,
"warnings",
true,
"Warning messages, if any, related to unloading the wallet.",
450 std::string wallet_name;
452 if (!(request.params[0].isNull() || request.params[0].get_str() == wallet_name)) {
456 wallet_name = request.params[0].get_str();
465 std::vector<bilingual_str> warnings;
475 std::optional<bool> load_on_start{self.
MaybeArg<
bool>(
"load_on_startup")};
494 "\nUpgrade the wallet. Upgrades to the latest version if no version number is specified.\n"
495 "New keys may be generated and a new wallet backup will need to be made.",
521 if (!request.params[0].isNull()) {
522 version = request.params[0].getInt<
int>();
525 const int previous_version{pwallet->GetVersion()};
526 const bool wallet_upgraded{pwallet->UpgradeWallet(version, error)};
527 const int current_version{pwallet->GetVersion()};
530 if (wallet_upgraded) {
531 if (previous_version == current_version) {
532 result =
"Already at latest version. Wallet version unchanged.";
534 result =
strprintf(
"Wallet upgraded successfully from version %i to version %i.", previous_version, current_version);
539 obj.
pushKV(
"wallet_name", pwallet->GetName());
540 obj.
pushKV(
"previous_version", previous_version);
541 obj.
pushKV(
"current_version", current_version);
542 if (!result.empty()) {
543 obj.
pushKV(
"result", result);
556 "\nCalculate the balance change resulting in the signing and broadcasting of the given transaction(s).\n",
588 if (request.params[1].isObject()) {
589 UniValue options = request.params[1];
596 include_watchonly = options[
"include_watchonly"];
604 const auto& txs = request.params[0].get_array();
606 std::map<COutPoint, CAmount> new_utxos;
607 std::set<COutPoint> spent;
609 for (
size_t i = 0; i < txs.size(); ++i) {
611 if (!
DecodeHexTx(mtx, txs[i].get_str(),
true,
true)) {
616 std::map<COutPoint, Coin> coins;
620 wallet.chain().findCoins(coins);
624 for (
const auto& txin : mtx.
vin) {
625 const auto& outpoint = txin.
prevout;
626 if (spent.count(outpoint)) {
629 if (new_utxos.count(outpoint)) {
630 changes -= new_utxos.at(outpoint);
631 new_utxos.erase(outpoint);
633 if (coins.at(outpoint).IsSpent()) {
636 changes -=
wallet.GetDebit(txin, filter);
638 spent.insert(outpoint);
646 const auto& hash = mtx.
GetHash();
647 for (
size_t i = 0; i < mtx.
vout.size(); ++i) {
648 const auto& txout = mtx.
vout[i];
649 bool is_mine = 0 < (
wallet.IsMine(txout) & filter);
650 changes += new_utxos[
COutPoint(hash, i)] = is_mine ? txout.nValue : 0;
665 "\nMigrate the wallet to a descriptor wallet.\n"
666 "A new wallet backup will need to be made.\n"
667 "\nThe migration process will create a backup of the wallet before migrating. This backup\n"
668 "file will be named <wallet name>-<timestamp>.legacy.bak and can be found in the directory\n"
669 "for this wallet. In the event of an incorrect migration, the backup can be restored using restorewallet."
670 "\nEncrypted wallets must have the passphrase provided as an argument to this call.\n"
671 "\nThis RPC may take a long time to complete. Increasing the RPC client timeout is recommended.",
673 {
"wallet_name",
RPCArg::Type::STR,
RPCArg::DefaultHint{
"the wallet name from the RPC endpoint"},
"The name of the wallet to migrate. If provided both here and in the RPC endpoint, the two must be identical."},
680 {
RPCResult::Type::STR,
"watchonly_name",
true,
"The name of the migrated wallet containing the watchonly scripts"},
681 {
RPCResult::Type::STR,
"solvables_name",
true,
"The name of the migrated wallet containing solvable but not watched scripts"},
691 std::string wallet_name;
693 if (!(request.params[0].isNull() || request.params[0].get_str() == wallet_name)) {
697 if (request.params[0].isNull()) {
700 wallet_name = request.params[0].get_str();
704 wallet_pass.reserve(100);
705 if (!request.params[1].isNull()) {
706 wallet_pass = std::string_view{request.params[1].get_str()};
716 r.pushKV(
"wallet_name", res->wallet_name);
717 if (res->watchonly_wallet) {
718 r.pushKV(
"watchonly_name", res->watchonly_wallet->GetName());
720 if (res->solvables_wallet) {
721 r.pushKV(
"solvables_name", res->solvables_wallet->GetName());
723 r.pushKV(
"backup_path", res->backup_path.utf8string());
734 "\nList all BIP 32 HD keys in the wallet and which descriptors use them.\n",
751 {
RPCResult::Type::BOOL,
"active",
"Whether this descriptor is currently used to generate new addresses"},
773 const bool active_only{options.exists(
"active_only") ? options[
"active_only"].get_bool() :
false};
774 const bool priv{options.exists(
"private") ? options[
"private"].get_bool() :
false};
780 std::set<ScriptPubKeyMan*> spkms;
782 spkms =
wallet->GetActiveScriptPubKeyMans();
784 spkms =
wallet->GetAllScriptPubKeyMans();
787 std::map<CExtPubKey, std::set<std::tuple<std::string, bool, bool>>> wallet_xpubs;
788 std::map<CExtPubKey, CExtKey> wallet_xprvs;
789 for (
auto* spkm : spkms) {
792 LOCK(desc_spkm->cs_desc_man);
796 std::set<CPubKey> desc_pubkeys;
797 std::set<CExtPubKey> desc_xpubs;
798 w_desc.
descriptor->GetPubKeys(desc_pubkeys, desc_xpubs);
800 std::string desc_str;
801 bool ok = desc_spkm->GetDescriptorString(desc_str,
false);
803 wallet_xpubs[xpub].emplace(desc_str,
wallet->IsActiveScriptPubKeyMan(*spkm), desc_spkm->HasPrivKey(xpub.pubkey.GetID()));
804 if (std::optional<CKey> key = priv ? desc_spkm->GetKey(xpub.pubkey.GetID()) : std::nullopt) {
805 wallet_xprvs[xpub] =
CExtKey(xpub, *key);
811 for (
const auto& [xpub, descs] : wallet_xpubs) {
812 bool has_xprv =
false;
814 for (
const auto& [desc, active, has_priv] : descs) {
817 d.
pushKV(
"active", active);
818 has_xprv |= has_priv;
824 xpub_info.
pushKV(
"has_private", has_xprv);
828 xpub_info.
pushKV(
"descriptors", std::move(descriptors));
830 response.
push_back(std::move(xpub_info));
841 "Creates the wallet's descriptor for the given address type. "
842 "The address type must be one that the wallet does not already have a descriptor for."
847 {
"internal",
RPCArg::Type::BOOL,
RPCArg::DefaultHint{
"Both external and internal will be generated unless this parameter is specified"},
"Whether to only make one descriptor that is internal (if parameter is true) or external (if parameter is false)"},
848 {
"hdkey",
RPCArg::Type::STR,
RPCArg::DefaultHint{
"The HD key used by all other active descriptors"},
"The HD key that the wallet knows the private key of, listed using 'gethdkeys', to use for this descriptor's key"},
873 std::optional<OutputType> output_type =
ParseOutputType(request.params[0].get_str());
879 UniValue internal_only{options[
"internal"]};
882 std::vector<bool> internals;
883 if (internal_only.isNull()) {
885 internals.push_back(
true);
887 internals.push_back(internal_only.get_bool());
890 LOCK(pwallet->cs_wallet);
894 if (hdkey.isNull()) {
895 std::set<CExtPubKey> active_xpubs = pwallet->GetActiveHDPubKeys();
896 if (active_xpubs.size() != 1) {
899 xpub = *active_xpubs.begin();
907 std::optional<CKey> key = pwallet->GetKey(xpub.
pubkey.
GetID());
911 CExtKey active_hdkey(xpub, *key);
913 std::vector<std::reference_wrapper<DescriptorScriptPubKeyMan>> spkms;
915 for (
bool internal : internals) {
918 if (!pwallet->GetScriptPubKeyMan(w_id)) {
919 spkms.emplace_back(pwallet->SetupDescriptorScriptPubKeyMan(batch, active_hdkey, *output_type, internal));
928 for (
const auto& spkm : spkms) {
929 std::string desc_str;
930 bool ok = spkm.get().GetDescriptorString(desc_str,
false);
932 descs.push_back(desc_str);
935 out.pushKV(
"descs", std::move(descs));
950#ifdef ENABLE_EXTERNAL_SIGNER
1061#ifdef ENABLE_EXTERNAL_SIGNER
int64_t CAmount
Amount in satoshis (Can be negative)
#define CHECK_NONFATAL(condition)
Identity function.
An encapsulated private key.
const std::byte * begin() const
bool IsCompressed() const
Check whether the public key corresponding to this private key is (to be) compressed.
CPubKey GetPubKey() const
Compute the public key from a private key.
const std::byte * end() const
void Set(const T pbegin, const T pend, bool fCompressedIn)
Initialize using begin and end iterators to byte data.
An outpoint - a combination of a transaction hash and an index n into its vout.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
An input of a transaction.
auto Arg(std::string_view key) const
Helper to get a required or default-valued request argument.
auto MaybeArg(std::string_view key) const
Helper to get an optional request argument.
An interface to be implemented by keystores that support signing.
void push_back(UniValue val)
void pushKV(std::string key, UniValue val)
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Access to the wallet database.
Descriptor with some wallet metadata.
std::shared_ptr< Descriptor > descriptor
RAII object to check and reserve a wallet rescan.
bool reserve(bool with_passphrase=false)
UniValue ValueFromAmount(const CAmount amount)
bool DecodeHexTx(CMutableTransaction &tx, const std::string &hex_tx, bool try_no_witness=false, bool try_witness=true)
const std::string CURRENCY_UNIT
std::string EncodeExtKey(const CExtKey &key)
CExtPubKey DecodeExtPubKey(const std::string &str)
std::string EncodeExtPubKey(const CExtPubKey &key)
void ReadDatabaseArgs(const ArgsManager &args, DBOptions &options)
bilingual_str ErrorString(const Result< T > &result)
void ReadDatabaseArgs(const ArgsManager &args, DatabaseOptions &options)
Balance GetBalance(const CWallet &wallet, const int min_depth, bool avoid_reuse)
std::shared_ptr< CWallet > LoadWallet(WalletContext &context, const std::string &name, std::optional< bool > load_on_start, const DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error, std::vector< bilingual_str > &warnings)
static RPCHelpMan loadwallet()
std::shared_ptr< CWallet > GetWalletForJSONRPCRequest(const JSONRPCRequest &request)
Figures out what wallet, if any, to use for a JSONRPCRequest.
RPCHelpMan listreceivedbyaddress()
std::vector< std::shared_ptr< CWallet > > GetWallets(WalletContext &context)
RPCHelpMan keypoolrefill()
RPCHelpMan removeprunedfunds()
RPCHelpMan listlockunspent()
static const RPCResult RESULT_LAST_PROCESSED_BLOCK
bool GetWalletNameFromJSONRPCRequest(const JSONRPCRequest &request, std::string &wallet_name)
RPCHelpMan walletprocesspsbt()
void HandleWalletError(const std::shared_ptr< CWallet > wallet, DatabaseStatus &status, bilingual_str &error)
void EnsureWalletIsUnlocked(const CWallet &wallet)
static RPCHelpMan getwalletinfo()
RPCHelpMan backupwallet()
static RPCHelpMan listwalletdir()
RPCHelpMan walletpassphrase()
const std::string HELP_REQUIRING_PASSPHRASE
RPCHelpMan getreceivedbyaddress()
RPCHelpMan walletdisplayaddress()
RPCHelpMan importprunedfunds()
util::Result< MigrationResult > MigrateLegacyToDescriptor(std::shared_ptr< CWallet > local_wallet, const SecureString &passphrase, WalletContext &context, bool was_loaded)
Requirement: The wallet provided to this function must be isolated, with no attachment to the node's ...
RPCHelpMan simulaterawtransaction()
static RPCHelpMan setwalletflag()
std::underlying_type_t< isminetype > isminefilter
used for bitflags of isminetype
RPCHelpMan walletcreatefundedpsbt()
bool RemoveWallet(WalletContext &context, const std::shared_ptr< CWallet > &wallet, std::optional< bool > load_on_start)
WalletContext & EnsureWalletContext(const std::any &context)
RPCHelpMan listaddressgroupings()
RPCHelpMan walletpassphrasechange()
fs::path GetWalletDir()
Get the path of the wallet directory.
RPCHelpMan abandontransaction()
bool HaveKey(const SigningProvider &wallet, const CKey &key)
Checks if a CKey is in the given CWallet compressed or otherwise.
RPCHelpMan listdescriptors()
RPCHelpMan listtransactions()
RPCHelpMan signrawtransactionwithwallet()
static RPCHelpMan listwallets()
static RPCHelpMan upgradewallet()
static constexpr int64_t UNKNOWN_TIME
Constant representing an unknown spkm creation time.
static const std::map< std::string, WalletFlags > WALLET_FLAG_MAP
static RPCHelpMan unloadwallet()
RPCHelpMan listsinceblock()
RPCHelpMan restorewallet()
void AppendLastProcessedBlock(UniValue &entry, const CWallet &wallet)
bool ParseIncludeWatchonly(const UniValue &include_watchonly, const CWallet &wallet)
Used by RPC commands that have an include_watchonly parameter.
RPCHelpMan getreceivedbylabel()
RPCHelpMan importdescriptors()
RPCHelpMan getrawchangeaddress()
static RPCHelpMan createwallet()
RPCHelpMan getaddressinfo()
RPCHelpMan encryptwallet()
RPCHelpMan gettransaction()
RPCHelpMan getaddressesbylabel()
RPCHelpMan fundrawtransaction()
static const std::map< uint64_t, std::string > WALLET_FLAG_CAVEATS
std::shared_ptr< CWallet > CreateWallet(WalletContext &context, const std::string &name, std::optional< bool > load_on_start, DatabaseOptions &options, DatabaseStatus &status, bilingual_str &error, std::vector< bilingual_str > &warnings)
static RPCHelpMan migratewallet()
RPCHelpMan rescanblockchain()
@ WALLET_FLAG_EXTERNAL_SIGNER
Indicates that the wallet needs an external signer.
@ WALLET_FLAG_AVOID_REUSE
@ WALLET_FLAG_DESCRIPTORS
Indicate that this wallet supports DescriptorScriptPubKeyMan.
@ WALLET_FLAG_DISABLE_PRIVATE_KEYS
@ WALLET_FLAG_BLANK_WALLET
Flag set when a wallet contains no HD seed and no private keys, scripts, addresses,...
void WaitForDeleteWallet(std::shared_ptr< CWallet > &&wallet)
Explicitly delete the wallet.
static constexpr uint64_t MUTABLE_WALLET_FLAGS
RPCHelpMan getnewaddress()
RPCHelpMan listreceivedbylabel()
std::shared_ptr< CWallet > GetWallet(WalletContext &context, const std::string &name)
RPCHelpMan getunconfirmedbalance()
std::span< const CRPCCommand > GetWalletRPCCommands()
RPCHelpMan sendtoaddress()
std::vector< std::pair< fs::path, std::string > > ListDatabases(const fs::path &wallet_dir)
Recursively list database paths in directory.
static RPCHelpMan createwalletdescriptor()
WalletDescriptor GenerateWalletDescriptor(const CExtPubKey &master_key, const OutputType &addr_type, bool internal)
std::optional< OutputType > ParseOutputType(const std::string &type)
UniValue JSONRPCError(int code, const std::string &message)
RPCErrorCode
Bitcoin RPC error codes.
@ RPC_MISC_ERROR
General application defined errors.
@ RPC_WALLET_ENCRYPTION_FAILED
Failed to encrypt the wallet.
@ RPC_INVALID_PARAMETER
Invalid, missing or duplicate parameter.
@ RPC_WALLET_ERROR
Wallet errors.
@ RPC_WALLET_ALREADY_LOADED
This same wallet is already loaded.
@ RPC_WALLET_NOT_FOUND
Invalid wallet specified.
@ RPC_DESERIALIZATION_ERROR
Error parsing or validating structure in raw format.
@ RPC_INVALID_ADDRESS_OR_KEY
Invalid address or key.
std::string HelpExampleCli(const std::string &methodname, const std::string &args)
std::string HelpExampleRpcNamed(const std::string &methodname, const RPCArgList &args)
void PushWarnings(const UniValue &warnings, UniValue &obj)
Push warning messages to an RPC "warnings" field as a JSON array of strings.
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
const std::string UNIX_EPOCH_TIME
String used to describe UNIX epoch time in documentation, factored out to a constant for consistency.
void RPCTypeCheckObj(const UniValue &o, const std::map< std::string, UniValueType > &typesExpected, bool fAllowNull, bool fStrict)
std::string HelpExampleCliNamed(const std::string &methodname, const RPCArgList &args)
uint256 DescriptorID(const Descriptor &desc)
Unique identifier that may not change over time, unless explicitly marked as not backwards compatible...
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
A mutable version of CTransaction.
std::vector< CTxOut > vout
Txid GetHash() const
Compute the hash of this CMutableTransaction.
@ STR_HEX
Special type that is a STR with only hex chars.
@ OBJ_NAMED_PARAMS
Special type that behaves almost exactly like OBJ, defining an options object with a list of pre-defi...
std::string DefaultHint
Hint for default value.
@ OMITTED
Optional argument for which the default value is omitted from help text for one of two reasons:
@ NUM_TIME
Special numeric to denote unix epoch time.
@ STR_AMOUNT
Special string to represent a floating point amount.
Wrapper for UniValue::VType, which includes typeAny: Used to denote don't care type.
SecureString create_passphrase
WalletContext struct containing references to state shared between CWallet instances,...
consteval auto _(util::TranslatedLiteral str)
bilingual_str Untranslated(std::string original)
Mark a bilingual_str as untranslated.