ledger-core
Public Member Functions | Static Public Member Functions | List of all members
ledger::core::WalletPool Class Reference
+ Inheritance diagram for ledger::core::WalletPool:
+ Collaboration diagram for ledger::core::WalletPool:

Public Member Functions

std::shared_ptr< HttpClientgetHttpClient (const std::string &baseUrl)
 
std::shared_ptr< WebSocketClientgetWebSocketClient () const
 
std::shared_ptr< PreferencesgetExternalPreferences () const
 
std::shared_ptr< PreferencesgetInternalPreferences () const
 
std::shared_ptr< api::PathResolvergetPathResolver () const
 
std::shared_ptr< api::RandomNumberGeneratorrng () const
 
std::shared_ptr< api::ThreadDispatchergetDispatcher () const
 
std::shared_ptr< spdlog::logger > logger () const
 
std::shared_ptr< DatabaseSessionPoolgetDatabaseSessionPool () const
 
std::shared_ptr< DynamicObjectgetConfiguration () const
 
std::shared_ptr< api::EventBusgetEventBus () const
 
const std::string & getName () const
 
const std::string getPassword () const
 
std::shared_ptr< AbstractWalletFactorygetFactory (const std::string &currencyName) const
 
Future< int64_t > getWalletCount ()
 
Future< std::vector< std::shared_ptr< AbstractWallet > > > getWallets (int64_t from, int64_t size)
 
FuturePtr< AbstractWalletgetWallet (const std::string &name)
 
Future< api::ErrorCodeupdateWalletConfig (const std::string &name, const std::shared_ptr< api::DynamicObject > &configuration)
 
Future< std::vector< std::string > > getWalletNames (int64_t from, int64_t size) const
 
FuturePtr< AbstractWalletcreateWallet (const std::string &name, const std::string &currencyName, const std::shared_ptr< api::DynamicObject > &configuration)
 
Future< UnitdeleteWallet (const std::string &name)
 
Future< api::BlockgetLastBlock (const std::string &currencyName)
 
Future< api::ErrorCodeeraseDataSince (const std::chrono::system_clock::time_point &date)
 
Future< api::ErrorCodechangePassword (const std::string &oldPassword, const std::string &newPassword)
 
Option< api::CurrencygetCurrency (const std::string &name) const
 
const std::vector< api::Currency > & getCurrencies () const
 
Future< UnitaddCurrency (const api::Currency &currency)
 
Future< UnitremoveCurrency (const std::string &currencyName)
 
Future< api::ErrorCodefreshResetAll ()
 
Option< api::BlockgetBlockFromCache (const std::string &currencyName)
 
std::shared_ptr< api::ExecutionContextgetThreadPoolExecutionContext () const
 
- Public Member Functions inherited from ledger::core::DedicatedContext
 DedicatedContext (const std::shared_ptr< api::ExecutionContext > &context)
 
template<typename T >
Future< T > async (std::function< T()> f)
 
template<typename T >
Future< T > async (std::function< T()> f) const
 
Future< Unitrun (std::function< void()> f)
 
std::shared_ptr< api::ExecutionContextgetContext () const
 

Static Public Member Functions

static std::shared_ptr< WalletPoolnewInstance (const std::string &name, const std::string &password, const std::shared_ptr< api::HttpClient > &httpClient, const std::shared_ptr< api::WebSocketClient > &webSocketClient, const std::shared_ptr< api::PathResolver > &pathResolver, const std::shared_ptr< api::LogPrinter > &logPrinter, const std::shared_ptr< api::ThreadDispatcher > &dispatcher, const std::shared_ptr< api::RandomNumberGenerator > &rng, const std::shared_ptr< api::DatabaseBackend > &backend, const std::shared_ptr< api::DynamicObject > &configuration)
 

Additional Inherited Members

- Protected Attributes inherited from ledger::core::DedicatedContext
std::shared_ptr< api::ExecutionContext_executionContext
 

Member Function Documentation

◆ freshResetAll()

Future< api::ErrorCode > ledger::core::WalletPool::freshResetAll ( )

Reset wallet pool.

Resetting the wallet pool is an irreversible fresh reset of the whole wallet pool and all of its created (sub-)objects (wallets, accounts, transactions, etc.). Please consider a less destructive option before opting to use this. However, if you’re looking for a way to end up as if you were in a “fresh install” situation, this is the function to go to.

Final warning: this function effectively swipes off everything. You’ve been warned.

Note: when calling that function, you must re-create a WalletPool as all objects got destroyed. Consider restarting / exiting your application right after calling that function. You are also highly advised to run that function on a code path that doesn’t include having lots of objects in memory.


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