ledger-core
Public Member Functions | Protected Member Functions | List of all members
ledger::core::AbstractWallet Class Referenceabstract
+ Inheritance diagram for ledger::core::AbstractWallet:
+ Collaboration diagram for ledger::core::AbstractWallet:

Public Member Functions

 AbstractWallet (const std::string &walletName, const api::Currency &currency, const std::shared_ptr< WalletPool > &pool, const std::shared_ptr< DynamicObject > &configuration, const DerivationScheme &derivationScheme)
 
std::shared_ptr< api::EventBusgetEventBus () override
 
std::shared_ptr< api::PreferencesgetPreferences () override
 
bool isInstanceOfBitcoinLikeWallet () override
 
bool isInstanceOfEthereumLikeWallet () override
 
bool isInstanceOfRippleLikeWallet () override
 
std::shared_ptr< api::LoggergetLogger () override
 
api::WalletType getWalletType () override
 
std::shared_ptr< api::PreferencesgetAccountPreferences (int32_t index) override
 
std::shared_ptr< WalletPoolgetPool () const
 
std::shared_ptr< api::BitcoinLikeWalletasBitcoinLikeWallet () override
 
api::Currency getCurrency () override
 
const api::CurrencygetCurrency () const
 
std::string getName () override
 
void getNextAccountIndex (const std::shared_ptr< api::I32Callback > &callback) override
 
Future< int32_t > getNextAccountIndex ()
 
Future< int32_t > getAccountCount ()
 
void getAccountCount (const std::shared_ptr< api::I32Callback > &callback) override
 
void getLastBlock (const std::shared_ptr< api::BlockCallback > &callback) override
 
Future< api::BlockgetLastBlock ()
 
template<typename T >
std::shared_ptr< T > asInstanceOf ()
 
void getAccount (int32_t index, const std::shared_ptr< api::AccountCallback > &callback) override
 
FuturePtr< api::AccountgetAccount (int32_t index)
 
void getAccounts (int32_t offset, int32_t count, const std::shared_ptr< api::AccountListCallback > &callback) override
 
Future< std::vector< std::shared_ptr< api::Account > > > getAccounts (int32_t offset, int32_t count)
 
void getNextAccountCreationInfo (const std::shared_ptr< api::AccountCreationInfoCallback > &callback) override
 
void getNextExtendedKeyAccountCreationInfo (const std::shared_ptr< api::ExtendedKeyAccountCreationInfoCallback > &callback) override
 
void getAccountCreationInfo (int32_t accountIndex, const std::shared_ptr< api::AccountCreationInfoCallback > &callback) override
 
void getExtendedKeyAccountCreationInfo (int32_t accountIndex, const std::shared_ptr< api::ExtendedKeyAccountCreationInfoCallback > &callback) override
 
void newAccountWithInfo (const api::AccountCreationInfo &accountCreationInfo, const std::shared_ptr< api::AccountCallback > &callback) override
 
void newAccountWithExtendedKeyInfo (const api::ExtendedKeyAccountCreationInfo &extendedKeyAccountCreationInfo, const std::shared_ptr< api::AccountCallback > &callback) override
 
void eraseDataSince (const std::chrono::system_clock::time_point &date, const std::shared_ptr< api::ErrorCodeCallback > &callback) override
 
Future< api::ErrorCodeeraseDataSince (const std::chrono::system_clock::time_point &date)
 
std::shared_ptr< api::DynamicObjectgetConfiguration () override
 
Option< AmountgetBalanceFromCache (size_t accountIndex)
 
void updateBalanceCache (size_t accountIndex, Amount balance)
 
virtual FuturePtr< api::AccountnewAccountWithInfo (const api::AccountCreationInfo &info)=0
 
virtual FuturePtr< api::AccountnewAccountWithExtendedKeyInfo (const api::ExtendedKeyAccountCreationInfo &info)=0
 
virtual Future< api::ExtendedKeyAccountCreationInfogetExtendedKeyAccountCreationInfo (int32_t accountIndex)=0
 
virtual Future< api::AccountCreationInfogetAccountCreationInfo (int32_t accountIndex)=0
 
virtual Future< api::AccountCreationInfogetNextAccountCreationInfo ()
 
virtual Future< api::ExtendedKeyAccountCreationInfogetNextExtendedKeyAccountCreationInfo ()
 
virtual std::shared_ptr< PreferencesgetAccountExternalPreferences (int32_t index)
 
virtual std::shared_ptr< PreferencesgetAccountInternalPreferences (int32_t index)
 
virtual std::shared_ptr< PreferencesgetInternalPreferences () const
 
virtual std::shared_ptr< PreferencesgetExternalPreferences () const
 
virtual std::shared_ptr< EventPublishergetEventPublisher () const
 
virtual std::shared_ptr< spdlog::logger > logger () const
 
virtual std::shared_ptr< DatabaseSessionPoolgetDatabase () const
 
virtual std::shared_ptr< api::ExecutionContextgetMainExecutionContext () const
 
virtual std::string getWalletUid () const
 
virtual std::shared_ptr< DynamicObjectgetConfig () const
 
virtual const DerivationSchemegetDerivationScheme () const
 
- Public Member Functions inherited from ledger::core::api::Wallet
virtual void getAccount (int32_t index, const std::shared_ptr< AccountCallback > &callback)=0
 
virtual void getAccountCount (const std::shared_ptr< I32Callback > &callback)=0
 
virtual void getAccounts (int32_t offset, int32_t count, const std::shared_ptr< AccountListCallback > &callback)=0
 
virtual void getNextAccountIndex (const std::shared_ptr< I32Callback > &callback)=0
 
virtual bool isSynchronizing ()=0
 
virtual std::shared_ptr< EventBussynchronize ()=0
 
virtual void getLastBlock (const std::shared_ptr< BlockCallback > &callback)=0
 
virtual void getAccountCreationInfo (int32_t accountIndex, const std::shared_ptr< AccountCreationInfoCallback > &callback)=0
 
virtual void getExtendedKeyAccountCreationInfo (int32_t accountIndex, const std::shared_ptr< ExtendedKeyAccountCreationInfoCallback > &callback)=0
 
virtual void getNextAccountCreationInfo (const std::shared_ptr< AccountCreationInfoCallback > &callback)=0
 
virtual void getNextExtendedKeyAccountCreationInfo (const std::shared_ptr< ExtendedKeyAccountCreationInfoCallback > &callback)=0
 
virtual void newAccountWithInfo (const AccountCreationInfo &accountCreationInfo, const std::shared_ptr< AccountCallback > &callback)=0
 
virtual void newAccountWithExtendedKeyInfo (const ExtendedKeyAccountCreationInfo &extendedKeyAccountCreationInfo, const std::shared_ptr< AccountCallback > &callback)=0
 
virtual void eraseDataSince (const std::chrono::system_clock::time_point &date, const std::shared_ptr< ErrorCodeCallback > &callback)=0
 
- 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
 

Protected Member Functions

virtual std::shared_ptr< AbstractAccountcreateAccountInstance (soci::session &sql, const std::string &accountUid)=0
 
void addAccountInstanceToInstanceCache (const std::shared_ptr< AbstractAccount > &account)
 

Additional Inherited Members

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

Member Function Documentation

◆ asBitcoinLikeWallet()

std::shared_ptr< api::BitcoinLikeWallet > ledger::core::AbstractWallet::asBitcoinLikeWallet ( )
overridevirtual

Convert wallet to a Bitcoin one.

Returns
BitcoinWallet object

Implements ledger::core::api::Wallet.

◆ getAccountPreferences()

std::shared_ptr< api::Preferences > ledger::core::AbstractWallet::getAccountPreferences ( int32_t  index)
overridevirtual

Get preferences of specific account.

Parameters
index,32-bitinteger, account's index
Returns
Preferences object

Implements ledger::core::api::Wallet.

◆ getConfiguration()

std::shared_ptr< api::DynamicObject > ledger::core::AbstractWallet::getConfiguration ( )
overridevirtual

Return wallet's configuration

Implements ledger::core::api::Wallet.

◆ getCurrency()

api::Currency ledger::core::AbstractWallet::getCurrency ( )
overridevirtual

Get currency of wallet.

Returns
Currency object

Implements ledger::core::api::Wallet.

◆ getEventBus()

std::shared_ptr< api::EventBus > ledger::core::AbstractWallet::getEventBus ( )
overridevirtual

Return event bus through which wallet synchronizes it's accounts and interact with blockchain.

Returns
EventBus object

Implements ledger::core::api::Wallet.

◆ getLogger()

std::shared_ptr< api::Logger > ledger::core::AbstractWallet::getLogger ( )
overridevirtual

Return account's logger which provides all needed (e.g. database) logs.

Returns
Logger Object

Implements ledger::core::api::Wallet.

◆ getName()

std::string ledger::core::AbstractWallet::getName ( )
overridevirtual

Get name of wallet.

Returns
string

Implements ledger::core::api::Wallet.

◆ getPreferences()

std::shared_ptr< api::Preferences > ledger::core::AbstractWallet::getPreferences ( )
overridevirtual

Get wallet preferences.

Returns
Preferences object

Implements ledger::core::api::Wallet.

◆ getWalletType()

api::WalletType ledger::core::AbstractWallet::getWalletType ( )
overridevirtual

Get wallet type.

Returns
WalletType object

Implements ledger::core::api::Wallet.

◆ isInstanceOfBitcoinLikeWallet()

bool ledger::core::AbstractWallet::isInstanceOfBitcoinLikeWallet ( )
overridevirtual

Tell whether wallet is a Bitcoin one.

Returns
bool

Implements ledger::core::api::Wallet.

◆ isInstanceOfEthereumLikeWallet()

bool ledger::core::AbstractWallet::isInstanceOfEthereumLikeWallet ( )
overridevirtual

Tell whether wallet is a Ethereum one.

Returns
bool

Implements ledger::core::api::Wallet.

◆ isInstanceOfRippleLikeWallet()

bool ledger::core::AbstractWallet::isInstanceOfRippleLikeWallet ( )
overridevirtual

Tell whether wallet is a Ripple one.

Returns
bool

Implements ledger::core::api::Wallet.


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