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

Public Types

using AddressList = std::vector< std::shared_ptr< api::Address > >
 

Public Member Functions

 AbstractAccount (const std::shared_ptr< AbstractWallet > &wallet, int32_t index)
 
int32_t getIndex () override
 
std::shared_ptr< api::PreferencesgetPreferences () override
 
std::shared_ptr< api::LoggergetLogger () override
 
bool isInstanceOfBitcoinLikeAccount () override
 
bool isInstanceOfEthereumLikeAccount () override
 
bool isInstanceOfRippleLikeAccount () override
 
api::WalletType getWalletType () override
 
std::shared_ptr< api::PreferencesgetOperationPreferences (const std::string &uid) override
 
std::shared_ptr< api::BitcoinLikeAccountasBitcoinLikeAccount () override
 
std::shared_ptr< api::EthereumLikeAccountasEthereumLikeAccount () override
 
std::shared_ptr< api::RippleLikeAccountasRippleLikeAccount () override
 
std::shared_ptr< api::TezosLikeAccountasTezosLikeAccount () override
 
virtual std::shared_ptr< PreferencesgetOperationExternalPreferences (const std::string &uid)
 
virtual std::shared_ptr< PreferencesgetOperationInternalPreferences (const std::string &uid)
 
virtual std::shared_ptr< PreferencesgetInternalPreferences () const
 
virtual std::shared_ptr< PreferencesgetExternalPreferences () const
 
virtual std::shared_ptr< spdlog::logger > logger () const
 
virtual const std::string & getAccountUid () const
 
virtual std::shared_ptr< AbstractWalletgetWallet () const
 
virtual std::shared_ptr< AbstractWalletgetWallet ()
 
const std::shared_ptr< api::ExecutionContextgetMainExecutionContext () const
 
void getLastBlock (const std::shared_ptr< api::BlockCallback > &callback) override
 
Future< api::BlockgetLastBlock ()
 
void getBalance (const std::shared_ptr< api::AmountCallback > &callback) override
 
virtual FuturePtr< AmountgetBalance ()=0
 
void getFreshPublicAddresses (const std::shared_ptr< api::AddressListCallback > &callback) override
 
virtual Future< AddressList > getFreshPublicAddresses ()=0
 
void getBalanceHistory (const std::string &start, const std::string &end, api::TimePeriod precision, const std::shared_ptr< api::AmountListCallback > &callback) override
 
virtual Future< std::vector< std::shared_ptr< api::Amount > > > getBalanceHistory (const std::string &start, const std::string &end, api::TimePeriod precision)=0
 
std::shared_ptr< api::OperationQueryqueryOperations () override
 
std::shared_ptr< api::EventBusgetEventBus () override
 
void emitEventsNow ()
 
void eraseDataSince (const std::chrono::system_clock::time_point &date, const std::shared_ptr< api::ErrorCodeCallback > &callback) override
 
virtual Future< api::ErrorCodeeraseDataSince (const std::chrono::system_clock::time_point &date)=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
 
- Public Member Functions inherited from ledger::core::api::Account
virtual void getBalance (const std::shared_ptr< AmountCallback > &callback)=0
 
virtual void getBalanceHistory (const std::string &start, const std::string &end, TimePeriod period, const std::shared_ptr< AmountListCallback > &callback)=0
 
virtual bool isSynchronizing ()=0
 
virtual std::shared_ptr< EventBussynchronize ()=0
 
virtual void getFreshPublicAddresses (const std::shared_ptr< AddressListCallback > &callback)=0
 
virtual void startBlockchainObservation ()=0
 
virtual void stopBlockchainObservation ()=0
 
virtual bool isObservingBlockchain ()=0
 
virtual void getLastBlock (const std::shared_ptr< BlockCallback > &callback)=0
 
virtual std::string getRestoreKey ()=0
 
virtual void eraseDataSince (const std::chrono::system_clock::time_point &date, const std::shared_ptr< ErrorCodeCallback > &callback)=0
 

Protected Member Functions

void emitNewOperationEvent (const Operation &operation)
 
void emitNewBlockEvent (const Block &block)
 
void pushEvent (const std::shared_ptr< api::Event > &event)
 

Additional Inherited Members

- Static Public Attributes inherited from ledger::core::api::Account
static std::string const EV_SYNC_DURATION_MS = {"EV_SYNC_DURATION_MS"}
 
static std::string const EV_SYNC_ERROR_CODE = {"EV_SYNC_ERROR_CODE"}
 
static std::string const EV_SYNC_ERROR_CODE_INT = {"EV_SYNC_ERROR_CODE_INT"}
 
static std::string const EV_SYNC_ERROR_MESSAGE = {"EV_SYNC_ERROR_MESSAGE"}
 
static std::string const EV_NEW_BLOCK_CURRENCY_NAME = {"EV_NEW_BLOCK_CURRENCY_NAME"}
 
static std::string const EV_NEW_BLOCK_HASH = {"EV_NEW_BLOCK_HASH"}
 
static std::string const EV_NEW_BLOCK_HEIGHT = {"EV_NEW_BLOCK_HEIGHT"}
 
static std::string const EV_NEW_OP_WALLET_NAME = {"EV_NEW_OP_WALLET_NAME"}
 
static std::string const EV_NEW_OP_ACCOUNT_INDEX = {"EV_NEW_OP_ACCOUNT_INDEX"}
 
static std::string const EV_NEW_OP_UID = {"EV_NEW_OP_UID"}
 
- Protected Attributes inherited from ledger::core::DedicatedContext
std::shared_ptr< api::ExecutionContext_executionContext
 

Member Function Documentation

◆ asBitcoinLikeAccount()

std::shared_ptr< api::BitcoinLikeAccount > ledger::core::AbstractAccount::asBitcoinLikeAccount ( )
overridevirtual

Turn the account into an Bitcoin one, allowing operations to be performed on the Bitcoin network.

Implements ledger::core::api::Account.

◆ asEthereumLikeAccount()

std::shared_ptr< api::EthereumLikeAccount > ledger::core::AbstractAccount::asEthereumLikeAccount ( )
overridevirtual

Turn the account into an Ethereum one, allowing operations to be performrd on the Ethereum network.

Implements ledger::core::api::Account.

Reimplemented in ledger::core::EthereumLikeAccount.

◆ asRippleLikeAccount()

std::shared_ptr< api::RippleLikeAccount > ledger::core::AbstractAccount::asRippleLikeAccount ( )
overridevirtual

Turn the account into a Ripple one, allowing operations to be performed on the Ripple network.

Implements ledger::core::api::Account.

◆ asTezosLikeAccount()

std::shared_ptr< api::TezosLikeAccount > ledger::core::AbstractAccount::asTezosLikeAccount ( )
overridevirtual

Turn the account into a Tezos one, allowing operations to be performed on the Tezos network.

Implements ledger::core::api::Account.

◆ getEventBus()

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

Get event bus through which account is notified on synchronization status.

Returns
EventBus object

Implements ledger::core::api::Account.

◆ getIndex()

int32_t ledger::core::AbstractAccount::getIndex ( )
overridevirtual

Get index of account in user's wallet 32-bit integer

Implements ledger::core::api::Account.

◆ getLogger()

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

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

Returns
Logger Object

Implements ledger::core::api::Account.

◆ getOperationPreferences()

std::shared_ptr< api::Preferences > ledger::core::AbstractAccount::getOperationPreferences ( const std::string &  uid)
overridevirtual

Return operation for a specific operation.

Parameters
uid,stringof operation id

Implements ledger::core::api::Account.

◆ getPreferences()

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

Return account's preferences.

Returns
Preferences object

Implements ledger::core::api::Account.

◆ getWalletType()

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

Get type of wallet to which account belongs.

Returns
WalletType object

Implements ledger::core::api::Account.

◆ isInstanceOfBitcoinLikeAccount()

bool ledger::core::AbstractAccount::isInstanceOfBitcoinLikeAccount ( )
overridevirtual

Check if account is a Bitcoin one.

Returns
bool

Implements ledger::core::api::Account.

◆ isInstanceOfEthereumLikeAccount()

bool ledger::core::AbstractAccount::isInstanceOfEthereumLikeAccount ( )
overridevirtual

Check if account is an Ethereum one.

Returns
bool

Implements ledger::core::api::Account.

◆ isInstanceOfRippleLikeAccount()

bool ledger::core::AbstractAccount::isInstanceOfRippleLikeAccount ( )
overridevirtual

Check if account is a Ripple one.

Returns
bool

Implements ledger::core::api::Account.

◆ queryOperations()

std::shared_ptr< api::OperationQuery > ledger::core::AbstractAccount::queryOperations ( )
overridevirtual

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