Bitcoin Core  31.0.0
P2P Digital Currency
wallet.h
Go to the documentation of this file.
1 // Copyright (c) 2018-present 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_INTERFACES_WALLET_H
6 #define BITCOIN_INTERFACES_WALLET_H
7 
8 #include <addresstype.h>
9 #include <common/signmessage.h>
10 #include <consensus/amount.h>
11 #include <interfaces/chain.h>
13 #include <pubkey.h>
14 #include <script/script.h>
16 #include <util/fs.h>
17 #include <util/result.h>
18 #include <util/ui_change_type.h>
19 
20 #include <cstdint>
21 #include <functional>
22 #include <map>
23 #include <memory>
24 #include <string>
25 #include <tuple>
26 #include <type_traits>
27 #include <utility>
28 #include <vector>
29 
30 class CFeeRate;
31 class CKey;
32 enum class FeeReason;
33 enum class OutputType;
35 struct bilingual_str;
36 namespace common {
37 enum class PSBTError;
38 } // namespace common
39 namespace node {
40 enum class TransactionError;
41 } // namespace node
42 namespace wallet {
43 struct CreatedTransactionResult;
44 class CCoinControl;
45 class CWallet;
46 enum class AddressPurpose;
47 struct CRecipient;
48 struct WalletContext;
49 } // namespace wallet
50 
51 namespace interfaces {
52 
53 class Handler;
54 struct WalletAddress;
55 struct WalletBalances;
56 struct WalletTx;
57 struct WalletTxOut;
58 struct WalletTxStatus;
59 struct WalletMigrationResult;
60 
61 using WalletOrderForm = std::vector<std::pair<std::string, std::string>>;
62 using WalletValueMap = std::map<std::string, std::string>;
63 
65 class Wallet
66 {
67 public:
68  virtual ~Wallet() = default;
69 
71  virtual bool encryptWallet(const SecureString& wallet_passphrase) = 0;
72 
74  virtual bool isCrypted() = 0;
75 
77  virtual bool lock() = 0;
78 
80  virtual bool unlock(const SecureString& wallet_passphrase) = 0;
81 
83  virtual bool isLocked() = 0;
84 
86  virtual bool changeWalletPassphrase(const SecureString& old_wallet_passphrase,
87  const SecureString& new_wallet_passphrase) = 0;
88 
90  virtual void abortRescan() = 0;
91 
93  virtual bool backupWallet(const std::string& filename) = 0;
94 
96  virtual std::string getWalletName() = 0;
97 
98  // Get a new address.
99  virtual util::Result<CTxDestination> getNewDestination(OutputType type, const std::string& label) = 0;
100 
102  virtual bool getPubKey(const CScript& script, const CKeyID& address, CPubKey& pub_key) = 0;
103 
105  virtual SigningResult signMessage(const std::string& message, const PKHash& pkhash, std::string& str_sig) = 0;
106 
108  virtual bool isSpendable(const CTxDestination& dest) = 0;
109 
111  virtual bool setAddressBook(const CTxDestination& dest, const std::string& name, const std::optional<wallet::AddressPurpose>& purpose) = 0;
112 
113  // Remove address.
114  virtual bool delAddressBook(const CTxDestination& dest) = 0;
115 
117  virtual bool getAddress(const CTxDestination& dest,
118  std::string* name,
119  wallet::AddressPurpose* purpose) = 0;
120 
122  virtual std::vector<WalletAddress> getAddresses() = 0;
123 
125  virtual std::vector<std::string> getAddressReceiveRequests() = 0;
126 
128  virtual bool setAddressReceiveRequest(const CTxDestination& dest, const std::string& id, const std::string& value) = 0;
129 
131  virtual util::Result<void> displayAddress(const CTxDestination& dest) = 0;
132 
134  virtual bool lockCoin(const COutPoint& output, bool write_to_db) = 0;
135 
137  virtual bool unlockCoin(const COutPoint& output) = 0;
138 
140  virtual bool isLockedCoin(const COutPoint& output) = 0;
141 
143  virtual void listLockedCoins(std::vector<COutPoint>& outputs) = 0;
144 
146  virtual util::Result<wallet::CreatedTransactionResult> createTransaction(const std::vector<wallet::CRecipient>& recipients,
147  const wallet::CCoinControl& coin_control,
148  bool sign,
149  std::optional<unsigned int> change_pos) = 0;
150 
152  virtual void commitTransaction(CTransactionRef tx,
153  WalletValueMap value_map,
154  WalletOrderForm order_form) = 0;
155 
157  virtual bool transactionCanBeAbandoned(const Txid& txid) = 0;
158 
160  virtual bool abandonTransaction(const Txid& txid) = 0;
161 
163  virtual bool transactionCanBeBumped(const Txid& txid) = 0;
164 
166  virtual bool createBumpTransaction(const Txid& txid,
167  const wallet::CCoinControl& coin_control,
168  std::vector<bilingual_str>& errors,
169  CAmount& old_fee,
170  CAmount& new_fee,
171  CMutableTransaction& mtx) = 0;
172 
174  virtual bool signBumpTransaction(CMutableTransaction& mtx) = 0;
175 
177  virtual bool commitBumpTransaction(const Txid& txid,
178  CMutableTransaction&& mtx,
179  std::vector<bilingual_str>& errors,
180  Txid& bumped_txid) = 0;
181 
183  virtual CTransactionRef getTx(const Txid& txid) = 0;
184 
186  virtual WalletTx getWalletTx(const Txid& txid) = 0;
187 
189  virtual std::set<WalletTx> getWalletTxs() = 0;
190 
192  virtual bool tryGetTxStatus(const Txid& txid,
193  WalletTxStatus& tx_status,
194  int& num_blocks,
195  int64_t& block_time) = 0;
196 
198  virtual WalletTx getWalletTxDetails(const Txid& txid,
199  WalletTxStatus& tx_status,
200  WalletOrderForm& order_form,
201  bool& in_mempool,
202  int& num_blocks) = 0;
203 
205  virtual std::optional<common::PSBTError> fillPSBT(std::optional<int> sighash_type,
206  bool sign,
207  bool bip32derivs,
208  size_t* n_signed,
210  bool& complete) = 0;
211 
213  virtual WalletBalances getBalances() = 0;
214 
216  virtual bool tryGetBalances(WalletBalances& balances, uint256& block_hash) = 0;
217 
219  virtual CAmount getBalance() = 0;
220 
222  virtual CAmount getAvailableBalance(const wallet::CCoinControl& coin_control) = 0;
223 
225  virtual bool txinIsMine(const CTxIn& txin) = 0;
226 
228  virtual bool txoutIsMine(const CTxOut& txout) = 0;
229 
231  virtual CAmount getDebit(const CTxIn& txin) = 0;
232 
234  virtual CAmount getCredit(const CTxOut& txout) = 0;
235 
238  using CoinsList = std::map<CTxDestination, std::vector<std::tuple<COutPoint, WalletTxOut>>>;
239  virtual CoinsList listCoins() = 0;
240 
242  virtual std::vector<WalletTxOut> getCoins(const std::vector<COutPoint>& outputs) = 0;
243 
245  virtual CAmount getRequiredFee(unsigned int tx_bytes) = 0;
246 
248  virtual CAmount getMinimumFee(unsigned int tx_bytes,
249  const wallet::CCoinControl& coin_control,
250  int* returned_target,
251  FeeReason* reason) = 0;
252 
254  virtual unsigned int getConfirmTarget() = 0;
255 
256  // Return whether HD enabled.
257  virtual bool hdEnabled() = 0;
258 
259  // Return whether the wallet is blank.
260  virtual bool canGetAddresses() = 0;
261 
262  // Return whether private keys enabled.
263  virtual bool privateKeysDisabled() = 0;
264 
265  // Return whether the wallet contains a Taproot scriptPubKeyMan
266  virtual bool taprootEnabled() = 0;
267 
268  // Return whether wallet uses an external signer.
269  virtual bool hasExternalSigner() = 0;
270 
271  // Get default address type.
272  virtual OutputType getDefaultAddressType() = 0;
273 
275  virtual CAmount getDefaultMaxTxFee() = 0;
276 
277  // Remove wallet.
278  virtual void remove() = 0;
279 
281  using UnloadFn = std::function<void()>;
282  virtual std::unique_ptr<Handler> handleUnload(UnloadFn fn) = 0;
283 
285  using ShowProgressFn = std::function<void(const std::string& title, int progress)>;
286  virtual std::unique_ptr<Handler> handleShowProgress(ShowProgressFn fn) = 0;
287 
289  using StatusChangedFn = std::function<void()>;
290  virtual std::unique_ptr<Handler> handleStatusChanged(StatusChangedFn fn) = 0;
291 
293  using AddressBookChangedFn = std::function<void(const CTxDestination& address,
294  const std::string& label,
295  bool is_mine,
296  wallet::AddressPurpose purpose,
297  ChangeType status)>;
298  virtual std::unique_ptr<Handler> handleAddressBookChanged(AddressBookChangedFn fn) = 0;
299 
301  using TransactionChangedFn = std::function<void(const Txid& txid, ChangeType status)>;
302  virtual std::unique_ptr<Handler> handleTransactionChanged(TransactionChangedFn fn) = 0;
303 
305  using CanGetAddressesChangedFn = std::function<void()>;
306  virtual std::unique_ptr<Handler> handleCanGetAddressesChanged(CanGetAddressesChangedFn fn) = 0;
307 
309  virtual wallet::CWallet* wallet() { return nullptr; }
310 };
311 
315 class WalletLoader : public ChainClient
316 {
317 public:
319  virtual util::Result<std::unique_ptr<Wallet>> createWallet(const std::string& name, const SecureString& passphrase, uint64_t wallet_creation_flags, std::vector<bilingual_str>& warnings) = 0;
320 
322  virtual util::Result<std::unique_ptr<Wallet>> loadWallet(const std::string& name, std::vector<bilingual_str>& warnings) = 0;
323 
325  virtual std::string getWalletDir() = 0;
326 
328  virtual util::Result<std::unique_ptr<Wallet>> restoreWallet(const fs::path& backup_file, const std::string& wallet_name, std::vector<bilingual_str>& warnings, bool load_after_restore) = 0;
329 
331  virtual util::Result<WalletMigrationResult> migrateWallet(const std::string& name, const SecureString& passphrase) = 0;
332 
334  virtual bool isEncrypted(const std::string& wallet_name) = 0;
335 
337  virtual std::vector<std::pair<std::string, std::string>> listWalletDir() = 0;
338 
340  virtual std::vector<std::unique_ptr<Wallet>> getWallets() = 0;
341 
345  using LoadWalletFn = std::function<void(std::unique_ptr<Wallet> wallet)>;
346  virtual std::unique_ptr<Handler> handleLoadWallet(LoadWalletFn fn) = 0;
347 
349  virtual wallet::WalletContext* context() { return nullptr; }
350 };
351 
354 {
356  bool is_mine;
358  std::string name;
359 
361  : dest(std::move(dest)), is_mine(is_mine), purpose(std::move(purpose)), name(std::move(name))
362  {
363  }
364 };
365 
368 {
372 
373  bool balanceChanged(const WalletBalances& prev) const
374  {
375  return balance != prev.balance || unconfirmed_balance != prev.unconfirmed_balance ||
377  }
378 };
379 
380 // Wallet transaction information.
381 struct WalletTx
382 {
384  std::vector<bool> txin_is_mine;
385  std::vector<bool> txout_is_mine;
386  std::vector<bool> txout_is_change;
387  std::vector<CTxDestination> txout_address;
388  std::vector<bool> txout_address_is_mine;
392  int64_t time;
393  std::map<std::string, std::string> value_map;
395 
396  bool operator<(const WalletTx& a) const { return tx->GetHash() < a.tx->GetHash(); }
397 };
398 
401 {
405  unsigned int time_received;
406  uint32_t lock_time;
411 };
412 
415 {
417  int64_t time;
419  bool is_spent = false;
420 };
421 
424 {
425  std::unique_ptr<Wallet> wallet;
426  std::optional<std::string> watchonly_wallet_name;
427  std::optional<std::string> solvables_wallet_name;
429 };
430 
433 std::unique_ptr<Wallet> MakeWallet(wallet::WalletContext& context, const std::shared_ptr<wallet::CWallet>& wallet);
434 
437 std::unique_ptr<WalletLoader> MakeWalletLoader(Chain& chain, ArgsManager& args);
438 
439 } // namespace interfaces
440 
441 #endif // BITCOIN_INTERFACES_WALLET_H
std::shared_ptr< const CTransaction > CTransactionRef
Definition: transaction.h:403
virtual bool isCrypted()=0
Return whether wallet is encrypted.
virtual bool privateKeysDisabled()=0
virtual bool txoutIsMine(const CTxOut &txout)=0
Return whether transaction output belongs to wallet.
TransactionError
Definition: types.h:28
PSBTError
Definition: types.h:17
virtual bool tryGetTxStatus(const Txid &txid, WalletTxStatus &tx_status, int &num_blocks, int64_t &block_time)=0
Try to get updated status for a particular transaction, if possible without blocking.
virtual CoinsList listCoins()=0
std::function< void(const CTxDestination &address, const std::string &label, bool is_mine, wallet::AddressPurpose purpose, ChangeType status)> AddressBookChangedFn
Register handler for address book changed messages.
Definition: wallet.h:297
virtual bool canGetAddresses()=0
std::vector< CTxDestination > txout_address
Definition: wallet.h:387
virtual bool isLocked()=0
Return whether wallet is locked.
virtual OutputType getDefaultAddressType()=0
unsigned int time_received
Definition: wallet.h:405
Bilingual messages:
Definition: translation.h:24
virtual bool txinIsMine(const CTxIn &txin)=0
Return whether transaction input belongs to wallet.
virtual util::Result< std::unique_ptr< Wallet > > loadWallet(const std::string &name, std::vector< bilingual_str > &warnings)=0
Load existing wallet.
virtual std::unique_ptr< Handler > handleAddressBookChanged(AddressBookChangedFn fn)=0
virtual bool getPubKey(const CScript &script, const CKeyID &address, CPubKey &pub_key)=0
Get public key.
std::vector< bool > txout_is_mine
Definition: wallet.h:385
virtual CAmount getDefaultMaxTxFee()=0
Get max tx fee.
std::function< void()> UnloadFn
Register handler for unload message.
Definition: wallet.h:281
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
Definition: secure.h:53
virtual std::optional< common::PSBTError > fillPSBT(std::optional< int > sighash_type, bool sign, bool bip32derivs, size_t *n_signed, PartiallySignedTransaction &psbtx, bool &complete)=0
Fill PSBT.
virtual bool backupWallet(const std::string &filename)=0
Back up wallet.
virtual util::Result< void > displayAddress(const CTxDestination &dest)=0
Display address on external signer.
std::function< void()> CanGetAddressesChangedFn
Register handler for keypool changed messages.
Definition: wallet.h:305
Definition: common.h:29
std::unique_ptr< Wallet > MakeWallet(wallet::WalletContext &context, const std::shared_ptr< wallet::CWallet > &wallet)
Return implementation of Wallet interface.
Definition: interfaces.cpp:668
virtual WalletTx getWalletTxDetails(const Txid &txid, WalletTxStatus &tx_status, WalletOrderForm &order_form, bool &in_mempool, int &num_blocks)=0
Get transaction details.
CTransactionRef tx
Definition: wallet.h:383
A version of CTransaction with the PSBT format.
Definition: psbt.h:1138
std::function< void(const Txid &txid, ChangeType status)> TransactionChangedFn
Register handler for transaction changed messages.
Definition: wallet.h:301
wallet::AddressPurpose purpose
Definition: wallet.h:357
SigningResult
Definition: signmessage.h:43
std::map< std::string, std::string > WalletValueMap
Definition: wallet.h:62
virtual SigningResult signMessage(const std::string &message, const PKHash &pkhash, std::string &str_sig)=0
Sign message.
virtual util::Result< wallet::CreatedTransactionResult > createTransaction(const std::vector< wallet::CRecipient > &recipients, const wallet::CCoinControl &coin_control, bool sign, std::optional< unsigned int > change_pos)=0
Create transaction.
virtual bool changeWalletPassphrase(const SecureString &old_wallet_passphrase, const SecureString &new_wallet_passphrase)=0
Change wallet passphrase.
virtual bool isSpendable(const CTxDestination &dest)=0
Return whether wallet has private key.
OutputType
Definition: outputtype.h:18
std::function< void()> StatusChangedFn
Register handler for status changed messages.
Definition: wallet.h:289
virtual bool hasExternalSigner()=0
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
std::map< CTxDestination, std::vector< std::tuple< COutPoint, WalletTxOut > >> CoinsList
Return AvailableCoins + LockedCoins grouped by wallet address.
Definition: wallet.h:238
std::vector< bool > txout_is_change
Definition: wallet.h:386
virtual std::unique_ptr< Handler > handleUnload(UnloadFn fn)=0
std::optional< std::string > watchonly_wallet_name
Definition: wallet.h:426
CTxDestination dest
Definition: wallet.h:355
virtual wallet::WalletContext * context()
Return pointer to internal context, useful for testing.
Definition: wallet.h:349
AddressPurpose
Address purpose field that has been been stored with wallet sending and receiving addresses since BIP...
Definition: types.h:28
std::unique_ptr< WalletLoader > MakeWalletLoader(Chain &chain, ArgsManager &args)
Return implementation of ChainClient interface for a wallet loader.
Definition: dummywallet.cpp:59
virtual std::vector< std::pair< std::string, std::string > > listWalletDir()=0
Return available wallets in wallet directory.
virtual util::Result< std::unique_ptr< Wallet > > createWallet(const std::string &name, const SecureString &passphrase, uint64_t wallet_creation_flags, std::vector< bilingual_str > &warnings)=0
Create new wallet.
virtual std::unique_ptr< Handler > handleTransactionChanged(TransactionChangedFn fn)=0
virtual bool hdEnabled()=0
std::optional< std::string > solvables_wallet_name
Definition: wallet.h:427
virtual std::unique_ptr< Handler > handleShowProgress(ShowProgressFn fn)=0
ArgsManager & args
Definition: bitcoind.cpp:277
virtual bool lockCoin(const COutPoint &output, bool write_to_db)=0
Lock coin.
virtual std::unique_ptr< Handler > handleCanGetAddressesChanged(CanGetAddressesChangedFn fn)=0
virtual std::unique_ptr< Handler > handleStatusChanged(StatusChangedFn fn)=0
Collection of wallet balances.
Definition: wallet.h:367
virtual bool unlockCoin(const COutPoint &output)=0
Unlock coin.
An input of a transaction.
Definition: transaction.h:61
virtual bool setAddressReceiveRequest(const CTxDestination &dest, const std::string &id, const std::string &value)=0
Save or remove receive request.
virtual bool getAddress(const CTxDestination &dest, std::string *name, wallet::AddressPurpose *purpose)=0
Look up address in wallet, return whether exists.
const char * name
Definition: rest.cpp:48
An encapsulated public key.
Definition: pubkey.h:33
Interface for accessing a wallet.
Definition: wallet.h:65
virtual bool encryptWallet(const SecureString &wallet_passphrase)=0
Encrypt wallet.
virtual ~Wallet()=default
std::unique_ptr< Wallet > wallet
Definition: wallet.h:425
virtual bool isEncrypted(const std::string &wallet_name)=0
Returns true if wallet stores encryption keys.
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition: wallet.h:309
WalletAddress(CTxDestination dest, bool is_mine, wallet::AddressPurpose purpose, std::string name)
Definition: wallet.h:360
An output of a transaction.
Definition: transaction.h:139
virtual CTransactionRef getTx(const Txid &txid)=0
Get a transaction.
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: transaction.h:28
Wallet chain client that in addition to having chain client methods for starting up, shutting down, and registering RPCs, also has additional methods (called by the GUI) to load and create wallets.
Definition: wallet.h:315
virtual wallet::CWallet * wallet()
Return pointer to internal wallet class, useful for testing.
Definition: wallet.h:309
virtual std::vector< std::unique_ptr< Wallet > > getWallets()=0
Return interfaces for accessing wallets (if any).
Definition: messages.h:21
Definition: init.cpp:17
virtual std::vector< WalletTxOut > getCoins(const std::vector< COutPoint > &outputs)=0
Return wallet transaction output information.
virtual CAmount getAvailableBalance(const wallet::CCoinControl &coin_control)=0
Get available balance.
static int sign(const secp256k1_context *ctx, struct signer_secrets *signer_secrets, struct signer *signer, const secp256k1_musig_keyagg_cache *cache, const unsigned char *msg32, unsigned char *sig64)
Definition: musig.c:106
virtual std::set< WalletTx > getWalletTxs()=0
Get list of all wallet transactions.
256-bit opaque blob.
Definition: uint256.h:195
virtual CAmount getDebit(const CTxIn &txin)=0
Return debit amount if transaction input belongs to wallet.
virtual bool taprootEnabled()=0
virtual bool signBumpTransaction(CMutableTransaction &mtx)=0
Sign bump transaction.
virtual bool delAddressBook(const CTxDestination &dest)=0
Migrated wallet info.
Definition: wallet.h:423
Interface to let node manage chain clients (wallets, or maybe tools for monitoring and analysis in th...
Definition: chain.h:397
Interface giving clients (wallet processes, maybe other analysis tools in the future) ability to acce...
Definition: chain.h:117
virtual void listLockedCoins(std::vector< COutPoint > &outputs)=0
List locked coins.
std::vector< bool > txin_is_mine
Definition: wallet.h:384
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:404
std::vector< bool > txout_address_is_mine
Definition: wallet.h:388
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
Definition: addresstype.h:143
virtual bool tryGetBalances(WalletBalances &balances, uint256 &block_hash)=0
Get balances if possible without blocking.
A reference to a CKey: the Hash160 of its serialized public key.
Definition: pubkey.h:23
virtual std::string getWalletDir()=0
Return default wallet directory.
std::function< void(const std::string &title, int progress)> ShowProgressFn
Register handler for show progress messages.
Definition: wallet.h:285
virtual util::Result< CTxDestination > getNewDestination(OutputType type, const std::string &label)=0
virtual std::unique_ptr< Handler > handleLoadWallet(LoadWalletFn fn)=0
WalletContext struct containing references to state shared between CWallet instances, like the reference to the chain interface, and the list of opened wallets.
Definition: context.h:36
Fee rate in satoshis per virtualbyte: CAmount / vB the feerate is represented internally as FeeFrac...
Definition: feerate.h:31
virtual bool isLockedCoin(const COutPoint &output)=0
Return whether coin is locked.
std::vector< std::pair< std::string, std::string > > WalletOrderForm
Definition: wallet.h:61
Information about one wallet address.
Definition: wallet.h:353
virtual bool lock()=0
Lock wallet.
A mutable version of CTransaction.
Definition: transaction.h:357
virtual bool setAddressBook(const CTxDestination &dest, const std::string &name, const std::optional< wallet::AddressPurpose > &purpose)=0
Add or update address.
virtual unsigned int getConfirmTarget()=0
Get tx confirm target.
virtual CAmount getBalance()=0
Get balance.
virtual std::vector< std::string > getAddressReceiveRequests()=0
Get receive requests.
std::map< std::string, std::string > value_map
Definition: wallet.h:393
virtual bool transactionCanBeAbandoned(const Txid &txid)=0
Return whether transaction can be abandoned.
bool operator<(const WalletTx &a) const
Definition: wallet.h:396
An encapsulated private key.
Definition: key.h:35
virtual void abortRescan()=0
Abort a rescan.
virtual void commitTransaction(CTransactionRef tx, WalletValueMap value_map, WalletOrderForm order_form)=0
Commit transaction.
virtual WalletBalances getBalances()=0
Get balances.
virtual bool abandonTransaction(const Txid &txid)=0
Abandon transaction.
virtual CAmount getCredit(const CTxOut &txout)=0
Return credit amount if transaction input belongs to wallet.
ChangeType
General change type (added, updated, removed).
Definition: ui_change_type.h:9
virtual util::Result< std::unique_ptr< Wallet > > restoreWallet(const fs::path &backup_file, const std::string &wallet_name, std::vector< bilingual_str > &warnings, bool load_after_restore)=0
Restore backup wallet.
Wallet transaction output.
Definition: wallet.h:414
virtual WalletTx getWalletTx(const Txid &txid)=0
Get transaction information.
virtual CAmount getRequiredFee(unsigned int tx_bytes)=0
Get required fee.
bool balanceChanged(const WalletBalances &prev) const
Definition: wallet.h:373
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
Definition: fs.h:33
virtual std::string getWalletName()=0
Get wallet name.
Updated transaction status.
Definition: wallet.h:400
virtual CAmount getMinimumFee(unsigned int tx_bytes, const wallet::CCoinControl &coin_control, int *returned_target, FeeReason *reason)=0
Get minimum fee.
Coin Control Features.
Definition: coincontrol.h:83
virtual bool createBumpTransaction(const Txid &txid, const wallet::CCoinControl &coin_control, std::vector< bilingual_str > &errors, CAmount &old_fee, CAmount &new_fee, CMutableTransaction &mtx)=0
Create bump transaction.
std::function< void(std::unique_ptr< Wallet > wallet)> LoadWalletFn
Register handler for load wallet messages.
Definition: wallet.h:345
virtual bool commitBumpTransaction(const Txid &txid, CMutableTransaction &&mtx, std::vector< bilingual_str > &errors, Txid &bumped_txid)=0
Commit bump transaction.
virtual bool transactionCanBeBumped(const Txid &txid)=0
Return whether transaction can be bumped.
virtual bool unlock(const SecureString &wallet_passphrase)=0
Unlock wallet.
virtual std::vector< WalletAddress > getAddresses()=0
Get wallet address list.
virtual util::Result< WalletMigrationResult > migrateWallet(const std::string &name, const SecureString &passphrase)=0
Migrate a wallet.