Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
WalletLoader Class Referenceabstract

#include <wallet.h>

Inheritance diagram for WalletLoader:
[legend]
Collaboration diagram for WalletLoader:
[legend]

Public Types

using LoadWalletFn = std::function<void(std::unique_ptr<Wallet> wallet)>

Public Member Functions

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 util::Result< std::unique_ptr< Wallet > > loadWallet (const std::string &name, std::vector< bilingual_str > &warnings)=0
 Load existing wallet.
virtual std::string getWalletDir ()=0
 Return default wallet directory.
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.
virtual util::Result< WalletMigrationResultmigrateWallet (const std::string &name, const SecureString &passphrase)=0
 Migrate a wallet.
virtual bool isEncrypted (const std::string &wallet_name)=0
 Returns true if wallet stores encryption keys.
virtual std::vector< std::pair< std::string, std::string > > listWalletDir ()=0
 Return available wallets in wallet directory.
virtual std::vector< std::unique_ptr< Wallet > > getWallets ()=0
 Return interfaces for accessing wallets (if any).
virtual std::unique_ptr< HandlerhandleLoadWallet (LoadWalletFn fn)=0
virtual wallet::WalletContextcontext ()
 Return pointer to internal context, useful for testing.
Public Member Functions inherited from interfaces::ChainClient
virtual ~ChainClient ()=default
virtual void registerRpcs ()=0
 Register rpcs.
virtual bool verify ()=0
 Check for errors before loading.
virtual bool load ()=0
 Load saved state.
virtual void start (CScheduler &scheduler)=0
 Start client execution and provide a scheduler.
virtual void stop ()=0
 Shut down client.
virtual void setMockTime (int64_t time)=0
 Set mock time.
virtual void schedulerMockForward (std::chrono::seconds delta_seconds)=0
 Mock the scheduler to fast forward in time.

Detailed Description

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 at line 315 of file wallet.h.

Member Typedef Documentation

◆ LoadWalletFn

using interfaces::WalletLoader::LoadWalletFn = std::function<void(std::unique_ptr<Wallet> wallet)>

Register handler for load wallet messages. This callback is triggered by createWallet and loadWallet above, and also triggered when wallets are loaded at startup or by RPC.

Definition at line 345 of file wallet.h.

Member Function Documentation

◆ context()

Return pointer to internal context, useful for testing.

Definition at line 349 of file wallet.h.

◆ createWallet()

virtual util::Result< std::unique_ptr< Wallet > > interfaces::WalletLoader::createWallet ( const std::string & name,
const SecureString & passphrase,
uint64_t wallet_creation_flags,
std::vector< bilingual_str > & warnings )
pure virtual

Create new wallet.

◆ getWalletDir()

virtual std::string interfaces::WalletLoader::getWalletDir ( )
pure virtual

Return default wallet directory.

◆ getWallets()

virtual std::vector< std::unique_ptr< Wallet > > interfaces::WalletLoader::getWallets ( )
pure virtual

Return interfaces for accessing wallets (if any).

◆ handleLoadWallet()

virtual std::unique_ptr< Handler > interfaces::WalletLoader::handleLoadWallet ( LoadWalletFn fn)
pure virtual

◆ isEncrypted()

virtual bool interfaces::WalletLoader::isEncrypted ( const std::string & wallet_name)
pure virtual

Returns true if wallet stores encryption keys.

◆ listWalletDir()

virtual std::vector< std::pair< std::string, std::string > > interfaces::WalletLoader::listWalletDir ( )
pure virtual

Return available wallets in wallet directory.

◆ loadWallet()

virtual util::Result< std::unique_ptr< Wallet > > interfaces::WalletLoader::loadWallet ( const std::string & name,
std::vector< bilingual_str > & warnings )
pure virtual

Load existing wallet.

◆ migrateWallet()

virtual util::Result< WalletMigrationResult > interfaces::WalletLoader::migrateWallet ( const std::string & name,
const SecureString & passphrase )
pure virtual

Migrate a wallet.

◆ restoreWallet()

virtual util::Result< std::unique_ptr< Wallet > > interfaces::WalletLoader::restoreWallet ( const fs::path & backup_file,
const std::string & wallet_name,
std::vector< bilingual_str > & warnings,
bool load_after_restore )
pure virtual

Restore backup wallet.


The documentation for this class was generated from the following file: