ledger-core
Public Member Functions | Static Public Attributes | List of all members
ledger::core::api::Account Class Referenceabstract

#include <Account.hpp>

+ Inheritance diagram for ledger::core::api::Account:

Public Member Functions

virtual int32_t getIndex ()=0
 
virtual std::shared_ptr< OperationQueryqueryOperations ()=0
 
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 std::shared_ptr< PreferencesgetPreferences ()=0
 
virtual std::shared_ptr< LoggergetLogger ()=0
 
virtual std::shared_ptr< PreferencesgetOperationPreferences (const std::string &uid)=0
 
virtual std::shared_ptr< BitcoinLikeAccountasBitcoinLikeAccount ()=0
 
virtual std::shared_ptr< EthereumLikeAccountasEthereumLikeAccount ()=0
 
virtual std::shared_ptr< RippleLikeAccountasRippleLikeAccount ()=0
 
virtual std::shared_ptr< TezosLikeAccountasTezosLikeAccount ()=0
 
virtual bool isInstanceOfBitcoinLikeAccount ()=0
 
virtual bool isInstanceOfEthereumLikeAccount ()=0
 
virtual bool isInstanceOfRippleLikeAccount ()=0
 
virtual void getFreshPublicAddresses (const std::shared_ptr< AddressListCallback > &callback)=0
 
virtual WalletType getWalletType ()=0
 
virtual std::shared_ptr< EventBusgetEventBus ()=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
 

Static Public Attributes

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"}
 

Detailed Description

Class representing an account.

Member Function Documentation

◆ asBitcoinLikeAccount()

virtual std::shared_ptr<BitcoinLikeAccount> ledger::core::api::Account::asBitcoinLikeAccount ( )
pure virtual

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

Implemented in ledger::core::BitcoinLikeAccount, and ledger::core::AbstractAccount.

◆ asEthereumLikeAccount()

virtual std::shared_ptr<EthereumLikeAccount> ledger::core::api::Account::asEthereumLikeAccount ( )
pure virtual

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

Implemented in ledger::core::EthereumLikeAccount, and ledger::core::AbstractAccount.

◆ asRippleLikeAccount()

virtual std::shared_ptr<RippleLikeAccount> ledger::core::api::Account::asRippleLikeAccount ( )
pure virtual

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

Implemented in ledger::core::AbstractAccount.

◆ asTezosLikeAccount()

virtual std::shared_ptr<TezosLikeAccount> ledger::core::api::Account::asTezosLikeAccount ( )
pure virtual

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

Implemented in ledger::core::AbstractAccount.

◆ eraseDataSince()

virtual void ledger::core::api::Account::eraseDataSince ( const std::chrono::system_clock::time_point &  date,
const std::shared_ptr< ErrorCodeCallback > &  callback 
)
pure virtual

Erase data (in user's DB) relative to wallet since given date.

Parameters
date,startdate of data deletion

◆ getBalance()

virtual void ledger::core::api::Account::getBalance ( const std::shared_ptr< AmountCallback > &  callback)
pure virtual

Get balance of account.

Parameters
callback,ifgetBalacne, Callback returning an Amount object which represents account's balance

◆ getBalanceHistory()

virtual void ledger::core::api::Account::getBalanceHistory ( const std::string &  start,
const std::string &  end,
TimePeriod  period,
const std::shared_ptr< AmountListCallback > &  callback 
)
pure virtual

Get balance of account at a precise interval with a certain granularity.

Parameters
start,lowerbound of search range
end,upperbound of search range
precision,granularityat which we want results
callback,ListCallbackreturning a list of Amount object which represents account's balance

◆ getEventBus()

virtual std::shared_ptr<EventBus> ledger::core::api::Account::getEventBus ( )
pure virtual

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

Returns
EventBus object

Implemented in ledger::core::AbstractAccount.

◆ getFreshPublicAddresses()

virtual void ledger::core::api::Account::getFreshPublicAddresses ( const std::shared_ptr< AddressListCallback > &  callback)
pure virtual

TODO

◆ getIndex()

virtual int32_t ledger::core::api::Account::getIndex ( )
pure virtual

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

Implemented in ledger::core::AbstractAccount.

◆ getLastBlock()

virtual void ledger::core::api::Account::getLastBlock ( const std::shared_ptr< BlockCallback > &  callback)
pure virtual

Get Last block of blockchain on which account operates.

Parameters
callback,Callbackreturning, if getLastBlock succeeds, a Block object

◆ getLogger()

virtual std::shared_ptr<Logger> ledger::core::api::Account::getLogger ( )
pure virtual

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

Returns
Logger Object

Implemented in ledger::core::AbstractAccount.

◆ getOperationPreferences()

virtual std::shared_ptr<Preferences> ledger::core::api::Account::getOperationPreferences ( const std::string &  uid)
pure virtual

Return operation for a specific operation.

Parameters
uid,stringof operation id

Implemented in ledger::core::AbstractAccount.

◆ getPreferences()

virtual std::shared_ptr<Preferences> ledger::core::api::Account::getPreferences ( )
pure virtual

Return account's preferences.

Returns
Preferences object

Implemented in ledger::core::AbstractAccount.

◆ getRestoreKey()

virtual std::string ledger::core::api::Account::getRestoreKey ( )
pure virtual

◆ getWalletType()

virtual WalletType ledger::core::api::Account::getWalletType ( )
pure virtual

Get type of wallet to which account belongs.

Returns
WalletType object

Implemented in ledger::core::AbstractAccount.

◆ isInstanceOfBitcoinLikeAccount()

virtual bool ledger::core::api::Account::isInstanceOfBitcoinLikeAccount ( )
pure virtual

Check if account is a Bitcoin one.

Returns
bool

Implemented in ledger::core::AbstractAccount.

◆ isInstanceOfEthereumLikeAccount()

virtual bool ledger::core::api::Account::isInstanceOfEthereumLikeAccount ( )
pure virtual

Check if account is an Ethereum one.

Returns
bool

Implemented in ledger::core::AbstractAccount.

◆ isInstanceOfRippleLikeAccount()

virtual bool ledger::core::api::Account::isInstanceOfRippleLikeAccount ( )
pure virtual

Check if account is a Ripple one.

Returns
bool

Implemented in ledger::core::AbstractAccount.

◆ isObservingBlockchain()

virtual bool ledger::core::api::Account::isObservingBlockchain ( )
pure virtual

◆ isSynchronizing()

virtual bool ledger::core::api::Account::isSynchronizing ( )
pure virtual

◆ queryOperations()

virtual std::shared_ptr<OperationQuery> ledger::core::api::Account::queryOperations ( )
pure virtual

◆ startBlockchainObservation()

virtual void ledger::core::api::Account::startBlockchainObservation ( )
pure virtual

Start observing blockchain on which account synchronizes and send/receive transactions.

Implemented in ledger::core::TezosLikeAccount, ledger::core::EthereumLikeAccount, ledger::core::RippleLikeAccount, and ledger::core::BitcoinLikeAccount.

◆ stopBlockchainObservation()

virtual void ledger::core::api::Account::stopBlockchainObservation ( )
pure virtual

◆ synchronize()

virtual std::shared_ptr<EventBus> ledger::core::api::Account::synchronize ( )
pure virtual

Start synchronization of account.

Returns
EventBus, handler will be notified of synchronization outcome

Implemented in ledger::core::TezosLikeAccount, ledger::core::BitcoinLikeAccount, ledger::core::EthereumLikeAccount, and ledger::core::RippleLikeAccount.

Member Data Documentation

◆ EV_NEW_BLOCK_CURRENCY_NAME

std::string const ledger::core::api::Account::EV_NEW_BLOCK_CURRENCY_NAME = {"EV_NEW_BLOCK_CURRENCY_NAME"}
static

TODO

◆ EV_NEW_OP_WALLET_NAME

std::string const ledger::core::api::Account::EV_NEW_OP_WALLET_NAME = {"EV_NEW_OP_WALLET_NAME"}
static

TODO

◆ EV_SYNC_DURATION_MS

std::string const ledger::core::api::Account::EV_SYNC_DURATION_MS = {"EV_SYNC_DURATION_MS"}
static

Key of the synchronization duration time in the synchronize event payload. The value is stored in a int 64 time expressed in miliseconds.

◆ EV_SYNC_ERROR_CODE

std::string const ledger::core::api::Account::EV_SYNC_ERROR_CODE = {"EV_SYNC_ERROR_CODE"}
static

Key of the synchronization error code. The code is a stringified version of the value in the ErrorCode enum.

◆ EV_SYNC_ERROR_MESSAGE

std::string const ledger::core::api::Account::EV_SYNC_ERROR_MESSAGE = {"EV_SYNC_ERROR_MESSAGE"}
static

Key of the synchronization error message. The message is stored as a string.


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