ledger-core
Public Member Functions | List of all members
ledger::core::api::Wallet Class Referenceabstract

#include <Wallet.hpp>

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

Public Member Functions

virtual std::string getName ()=0
 
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 std::shared_ptr< EventBusgetEventBus ()=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< PreferencesgetAccountPreferences (int32_t index)=0
 
virtual std::shared_ptr< BitcoinLikeWalletasBitcoinLikeWallet ()=0
 
virtual Currency getCurrency ()=0
 
virtual bool isInstanceOfBitcoinLikeWallet ()=0
 
virtual bool isInstanceOfEthereumLikeWallet ()=0
 
virtual bool isInstanceOfRippleLikeWallet ()=0
 
virtual WalletType getWalletType ()=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
 
virtual std::shared_ptr< DynamicObjectgetConfiguration ()=0
 

Detailed Description

Class representing a wallet.

Member Function Documentation

◆ asBitcoinLikeWallet()

virtual std::shared_ptr<BitcoinLikeWallet> ledger::core::api::Wallet::asBitcoinLikeWallet ( )
pure virtual

Convert wallet to a Bitcoin one.

Returns
BitcoinWallet object

Implemented in ledger::core::AbstractWallet.

◆ eraseDataSince()

virtual void ledger::core::api::Wallet::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

◆ getAccount()

virtual void ledger::core::api::Wallet::getAccount ( int32_t  index,
const std::shared_ptr< AccountCallback > &  callback 
)
pure virtual

Get account with specific index.

Parameters
index,32-bitinteger, index of account in wallet
callback,Callbackreturning, if getAccount succeed, an Account object with given index

◆ getAccountCount()

virtual void ledger::core::api::Wallet::getAccountCount ( const std::shared_ptr< I32Callback > &  callback)
pure virtual

Get number of accounts instanciated under wallet.

Parameters
callback,Callbackreturning, if getAccountCount succeed, a 32-bit integer representing number of accounts

◆ getAccountCreationInfo()

virtual void ledger::core::api::Wallet::getAccountCreationInfo ( int32_t  accountIndex,
const std::shared_ptr< AccountCreationInfoCallback > &  callback 
)
pure virtual

Return infos about the creation of specific account.

Parameters
accountIndex,32-bitaccount, index of account in wallet
callback,Callbackreturning an AccountCreationInfo

◆ getAccountPreferences()

virtual std::shared_ptr<Preferences> ledger::core::api::Wallet::getAccountPreferences ( int32_t  index)
pure virtual

Get preferences of specific account.

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

Implemented in ledger::core::AbstractWallet.

◆ getAccounts()

virtual void ledger::core::api::Wallet::getAccounts ( int32_t  offset,
int32_t  count,
const std::shared_ptr< AccountListCallback > &  callback 
)
pure virtual

Get list of accounts instanciated under wallet in a given range.

Parameters
offset,32-bitinteger from which we retrieve accounts
count,32-bitinteger, number of accounts to retrieve
callback,ListCallbackreturning, if getAccounts succeed, list of Accounts object

◆ getConfiguration()

virtual std::shared_ptr<DynamicObject> ledger::core::api::Wallet::getConfiguration ( )
pure virtual

Return wallet's configuration

Implemented in ledger::core::AbstractWallet.

◆ getCurrency()

virtual Currency ledger::core::api::Wallet::getCurrency ( )
pure virtual

Get currency of wallet.

Returns
Currency object

Implemented in ledger::core::AbstractWallet.

◆ getEventBus()

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

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

Returns
EventBus object

Implemented in ledger::core::AbstractWallet.

◆ getExtendedKeyAccountCreationInfo()

virtual void ledger::core::api::Wallet::getExtendedKeyAccountCreationInfo ( int32_t  accountIndex,
const std::shared_ptr< ExtendedKeyAccountCreationInfoCallback > &  callback 
)
pure virtual

TODO

◆ getLastBlock()

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

Get last block of blockchain the wallet operates on.

Parameters
callback,Callbackreturning a Block object

◆ getLogger()

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

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

Returns
Logger Object

Implemented in ledger::core::AbstractWallet.

◆ getName()

virtual std::string ledger::core::api::Wallet::getName ( )
pure virtual

Get name of wallet.

Returns
string

Implemented in ledger::core::AbstractWallet.

◆ getNextAccountCreationInfo()

virtual void ledger::core::api::Wallet::getNextAccountCreationInfo ( const std::shared_ptr< AccountCreationInfoCallback > &  callback)
pure virtual

Return infos about the next created account.

Parameters
callback,Callbackreturning an AccountCreationInfo

◆ getNextAccountIndex()

virtual void ledger::core::api::Wallet::getNextAccountIndex ( const std::shared_ptr< I32Callback > &  callback)
pure virtual

Get index of next account to create.

Returns
callback, Callback returning a 32-bit integer

◆ getNextExtendedKeyAccountCreationInfo()

virtual void ledger::core::api::Wallet::getNextExtendedKeyAccountCreationInfo ( const std::shared_ptr< ExtendedKeyAccountCreationInfoCallback > &  callback)
pure virtual

TODO

◆ getPreferences()

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

Get wallet preferences.

Returns
Preferences object

Implemented in ledger::core::AbstractWallet.

◆ getWalletType()

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

Get wallet type.

Returns
WalletType object

Implemented in ledger::core::AbstractWallet.

◆ isInstanceOfBitcoinLikeWallet()

virtual bool ledger::core::api::Wallet::isInstanceOfBitcoinLikeWallet ( )
pure virtual

Tell whether wallet is a Bitcoin one.

Returns
bool

Implemented in ledger::core::AbstractWallet.

◆ isInstanceOfEthereumLikeWallet()

virtual bool ledger::core::api::Wallet::isInstanceOfEthereumLikeWallet ( )
pure virtual

Tell whether wallet is a Ethereum one.

Returns
bool

Implemented in ledger::core::AbstractWallet.

◆ isInstanceOfRippleLikeWallet()

virtual bool ledger::core::api::Wallet::isInstanceOfRippleLikeWallet ( )
pure virtual

Tell whether wallet is a Ripple one.

Returns
bool

Implemented in ledger::core::AbstractWallet.

◆ isSynchronizing()

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

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

Returns
bool

Implemented in ledger::core::BitcoinLikeWallet, ledger::core::RippleLikeWallet, ledger::core::EthereumLikeWallet, and ledger::core::TezosLikeWallet.

◆ newAccountWithExtendedKeyInfo()

virtual void ledger::core::api::Wallet::newAccountWithExtendedKeyInfo ( const ExtendedKeyAccountCreationInfo extendedKeyAccountCreationInfo,
const std::shared_ptr< AccountCallback > &  callback 
)
pure virtual

TODO

◆ newAccountWithInfo()

virtual void ledger::core::api::Wallet::newAccountWithInfo ( const AccountCreationInfo accountCreationInfo,
const std::shared_ptr< AccountCallback > &  callback 
)
pure virtual

Get account from given account creation infos.

Parameters
accountCreationInfo,AccountCreationInfoobject
callback,Callbackreturning an Account object with given creation infos

◆ synchronize()

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

Start synchronization of all accounts under wallet.

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

Implemented in ledger::core::BitcoinLikeWallet, ledger::core::RippleLikeWallet, ledger::core::TezosLikeWallet, and ledger::core::EthereumLikeWallet.


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