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

Public Types

using BitcoinLikeAccountSynchronizerFactory = std::function< std::shared_ptr< BitcoinLikeAccountSynchronizer >()>
 

Public Member Functions

 BitcoinLikeWallet (const std::string &name, const std::shared_ptr< BitcoinLikeBlockchainExplorer > &explorer, const std::shared_ptr< BitcoinLikeBlockchainObserver > &observer, const std::shared_ptr< BitcoinLikeKeychainFactory > &keychainFactory, const BitcoinLikeAccountSynchronizerFactory &synchronizerFactory, const std::shared_ptr< WalletPool > &pool, const api::Currency &network, const std::shared_ptr< DynamicObject > &configuration, const DerivationScheme &scheme)
 
bool isSynchronizing () override
 
std::shared_ptr< api::EventBussynchronize () override
 
FuturePtr< ledger::core::api::AccountnewAccountWithInfo (const api::AccountCreationInfo &info) override
 
FuturePtr< ledger::core::api::AccountnewAccountWithExtendedKeyInfo (const api::ExtendedKeyAccountCreationInfo &info) override
 
Future< api::ExtendedKeyAccountCreationInfogetExtendedKeyAccountCreationInfo (int32_t accountIndex) override
 
Future< api::AccountCreationInfogetAccountCreationInfo (int32_t accountIndex) override
 
std::shared_ptr< BitcoinLikeBlockchainExplorergetBlockchainExplorer ()
 
- Public Member Functions inherited from ledger::core::AbstractWallet
 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 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 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
 

Static Public Attributes

static const api::WalletType type = api::WalletType::BITCOIN
 

Protected Member Functions

std::shared_ptr< AbstractAccountcreateAccountInstance (soci::session &sql, const std::string &accountUid) override
 
- Protected Member Functions inherited from ledger::core::AbstractWallet
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

◆ isSynchronizing()

bool ledger::core::BitcoinLikeWallet::isSynchronizing ( )
overridevirtual

Return synchronization status wallet, true if at least one of accounts is synchronizing.

Returns
bool

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

◆ synchronize()

std::shared_ptr< api::EventBus > ledger::core::BitcoinLikeWallet::synchronize ( )
overridevirtual

Start synchronization of all accounts under wallet.

Returns
EventBus object through which wallet get notified of account's synchronization status

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


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