Bitcoin ABC  0.26.3
P2P Digital Currency
util.h
Go to the documentation of this file.
1 // Copyright (c) 2017-2021 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_WALLET_RPC_UTIL_H
6 #define BITCOIN_WALLET_RPC_UTIL_H
7 
8 #include <any>
9 #include <memory>
10 #include <string>
11 #include <vector>
12 
13 struct bilingual_str;
14 class CWallet;
15 class JSONRPCRequest;
17 class UniValue;
18 struct WalletContext;
19 
20 extern const std::string HELP_REQUIRING_PASSPHRASE;
21 
28 std::shared_ptr<CWallet>
31  std::string &wallet_name);
32 
33 void EnsureWalletIsUnlocked(const CWallet *);
34 WalletContext &EnsureWalletContext(const std::any &context);
36  bool also_create = false);
37 
38 bool GetAvoidReuseFlag(const CWallet *const wallet, const UniValue &param);
39 bool ParseIncludeWatchonly(const UniValue &include_watchonly,
40  const CWallet &wallet);
41 std::string LabelFromValue(const UniValue &value);
42 
43 std::tuple<std::shared_ptr<CWallet>, std::vector<bilingual_str>>
44 LoadWalletHelper(WalletContext &context, UniValue load_on_start_param,
45  const std::string wallet_name);
46 
47 #endif // BITCOIN_WALLET_RPC_UTIL_H
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition: wallet.h:253
WalletContext struct containing references to state shared between CWallet instances,...
Definition: context.h:23
Bilingual messages:
Definition: translation.h:17
std::shared_ptr< CWallet > GetWalletForJSONRPCRequest(const JSONRPCRequest &request)
Figures out what wallet, if any, to use for a JSONRPCRequest.
Definition: util.cpp:62
WalletContext & EnsureWalletContext(const std::any &context)
Definition: util.cpp:101
std::tuple< std::shared_ptr< CWallet >, std::vector< bilingual_str > > LoadWalletHelper(WalletContext &context, UniValue load_on_start_param, const std::string wallet_name)
Definition: util.cpp:133
bool ParseIncludeWatchonly(const UniValue &include_watchonly, const CWallet &wallet)
Used by RPC commands that have an include_watchonly parameter.
Definition: util.cpp:37
bool GetAvoidReuseFlag(const CWallet *const wallet, const UniValue &param)
Definition: util.cpp:20
const std::string HELP_REQUIRING_PASSPHRASE
Definition: util.cpp:16
LegacyScriptPubKeyMan & EnsureLegacyScriptPubKeyMan(CWallet &wallet, bool also_create=false)
Definition: util.cpp:111
std::string LabelFromValue(const UniValue &value)
Definition: util.cpp:124
bool GetWalletNameFromJSONRPCRequest(const JSONRPCRequest &request, std::string &wallet_name)
Definition: util.cpp:49
void EnsureWalletIsUnlocked(const CWallet *)
Definition: util.cpp:93