Electroneum
Electroneum::Wallet Struct Referenceabstract

Interface for wallet operations. TODO: check if /include/IWallet.h is still actual. More...

#include <wallet2_api.h>

Inheritance diagram for Electroneum::Wallet:

Public Types

enum  Device { Device_Software = 0, Device_Ledger = 1, Device_Trezor = 2 }
 
enum  Status { Status_Ok, Status_Error, Status_Critical }
 
enum  ConnectionStatus { ConnectionStatus_Disconnected, ConnectionStatus_Connected, ConnectionStatus_WrongVersion }
 

Public Member Functions

virtual ~Wallet ()=0
 
virtual std::string seed () const =0
 
virtual std::string getSeedLanguage () const =0
 
virtual void setSeedLanguage (const std::string &arg)=0
 
virtual int status () const =0
 returns wallet status (Status_Ok | Status_Error) More...
 
virtual std::string errorString () const =0
 in case error status, returns error string More...
 
virtual void statusWithErrorString (int &status, std::string &errorString) const =0
 returns both error and error string atomically. suggested to use in instead of status() and errorString() More...
 
virtual bool setPassword (const std::string &password)=0
 
virtual bool setDevicePin (const std::string &pin)
 
virtual bool setDevicePassphrase (const std::string &passphrase)
 
virtual std::string address (uint32_t accountIndex=0, uint32_t addressIndex=0) const =0
 
std::string mainAddress () const
 
virtual std::string path () const =0
 
virtual NetworkType nettype () const =0
 
bool mainnet () const
 
bool testnet () const
 
bool stagenet () const
 
virtual void hardForkInfo (uint8_t &version, uint64_t &earliest_height) const =0
 returns current hard fork info More...
 
virtual bool useForkRules (uint8_t version, int64_t early_blocks) const =0
 check if hard fork rules should be used More...
 
virtual std::string integratedAddress (const std::string &payment_id) const =0
 integratedAddress - returns integrated address for current wallet address and given payment_id. if passed "payment_id" param is an empty string or not-valid payment id string (16 characters hexadecimal string) - random payment_id will be generated More...
 
virtual std::string secretViewKey () const =0
 secretViewKey - returns secret view key More...
 
virtual std::string publicViewKey () const =0
 publicViewKey - returns public view key More...
 
virtual std::string secretSpendKey () const =0
 secretSpendKey - returns secret spend key More...
 
virtual std::string publicSpendKey () const =0
 publicSpendKey - returns public spend key More...
 
virtual std::string publicMultisigSignerKey () const =0
 publicMultisigSignerKey - returns public signer key More...
 
virtual bool store (const std::string &path)=0
 store - stores wallet to file. More...
 
virtual std::string filename () const =0
 filename - returns wallet filename More...
 
virtual std::string keysFilename () const =0
 keysFilename - returns keys filename. usually this formed as "wallet_filename".keys More...
 
virtual bool init (const std::string &daemon_address, uint64_t upper_transaction_size_limit=0, const std::string &daemon_username="", const std::string &daemon_password="", bool use_ssl=false, bool lightWallet=false)=0
 init - initializes wallet with daemon connection params. if daemon_address is local address, "trusted daemon" will be set to true forcibly startRefresh() should be called when wallet is initialized. More...
 
virtual bool createWatchOnly (const std::string &path, const std::string &password, const std::string &language) const =0
 createWatchOnly - Creates a watch only wallet More...
 
virtual void setRefreshFromBlockHeight (uint64_t refresh_from_block_height)=0
 setRefreshFromBlockHeight - start refresh from block height on recover More...
 
virtual uint64_t getRefreshFromBlockHeight () const =0
 getRestoreHeight - get wallet creation height More...
 
virtual void setRecoveringFromSeed (bool recoveringFromSeed)=0
 setRecoveringFromSeed - set state recover form seed More...
 
virtual void setRecoveringFromDevice (bool recoveringFromDevice)=0
 setRecoveringFromDevice - set state to recovering from device More...
 
virtual void setSubaddressLookahead (uint32_t major, uint32_t minor)=0
 setSubaddressLookahead - set size of subaddress lookahead More...
 
virtual bool connectToDaemon ()=0
 connectToDaemon - connects to the daemon. TODO: check if it can be removed More...
 
virtual ConnectionStatus connected () const =0
 connected - checks if the wallet connected to the daemon More...
 
virtual void setTrustedDaemon (bool arg)=0
 
virtual bool trustedDaemon () const =0
 
virtual uint64_t balance (uint32_t accountIndex=0, bool public_blockchain=false) const =0
 
uint64_t balanceAll (bool public_blockchain) const
 
virtual uint64_t unlockedBalance (uint32_t accountIndex=0, bool public_blockchain=false) const =0
 
uint64_t unlockedBalanceAll (bool public_blockchain) const
 
virtual bool watchOnly () const =0
 watchOnly - checks if wallet is watch only More...
 
virtual uint64_t blockChainHeight () const =0
 blockChainHeight - returns current blockchain height More...
 
virtual uint64_t approximateBlockChainHeight () const =0
 approximateBlockChainHeight - returns approximate blockchain height calculated from date/time More...
 
virtual uint64_t estimateBlockChainHeight () const =0
 estimateBlockChainHeight - returns estimate blockchain height. More accurate than approximateBlockChainHeight, uses daemon height and falls back to calculation from date/time More...
 
virtual uint64_t daemonBlockChainHeight () const =0
 daemonBlockChainHeight - returns daemon blockchain height More...
 
virtual uint64_t daemonBlockChainTargetHeight () const =0
 daemonBlockChainTargetHeight - returns daemon blockchain target height More...
 
virtual bool synchronized () const =0
 synchronized - checks if wallet was ever synchronized More...
 
virtual void startRefresh ()=0
 StartRefresh - Start/resume refresh thread (refresh every 10 seconds) More...
 
virtual void pauseRefresh ()=0
 pauseRefresh - pause refresh thread More...
 
virtual bool refresh ()=0
 refresh - refreshes the wallet, updating transactions from daemon More...
 
virtual void refreshAsync ()=0
 refreshAsync - refreshes wallet asynchronously. More...
 
virtual bool rescanBlockchain ()=0
 rescanBlockchain - rescans the wallet, updating transactions from daemon More...
 
virtual void rescanBlockchainAsync ()=0
 rescanBlockchainAsync - rescans wallet asynchronously, starting from genesys More...
 
virtual void setAutoRefreshInterval (int millis)=0
 setAutoRefreshInterval - setup interval for automatic refresh. More...
 
virtual int autoRefreshInterval () const =0
 autoRefreshInterval - returns automatic refresh interval in millis More...
 
virtual void addSubaddressAccount (const std::string &label)=0
 addSubaddressAccount - appends a new subaddress account at the end of the last major index of existing subaddress accounts More...
 
virtual size_t numSubaddressAccounts () const =0
 numSubaddressAccounts - returns the number of existing subaddress accounts More...
 
virtual size_t numSubaddresses (uint32_t accountIndex) const =0
 numSubaddresses - returns the number of existing subaddresses associated with the specified subaddress account More...
 
virtual void addSubaddress (uint32_t accountIndex, const std::string &label)=0
 addSubaddress - appends a new subaddress at the end of the last minor index of the specified subaddress account More...
 
virtual std::string getSubaddressLabel (uint32_t accountIndex, uint32_t addressIndex) const =0
 getSubaddressLabel - gets the label of the specified subaddress More...
 
virtual void setSubaddressLabel (uint32_t accountIndex, uint32_t addressIndex, const std::string &label)=0
 setSubaddressLabel - sets the label of the specified subaddress More...
 
virtual MultisigState multisig () const =0
 multisig - returns current state of multisig wallet creation process More...
 
virtual std::string getMultisigInfo () const =0
 getMultisigInfo More...
 
virtual std::string makeMultisig (const std::vector< std::string > &info, uint32_t threshold)=0
 makeMultisig - switches wallet in multisig state. The one and only creation phase for N / N wallets More...
 
virtual std::string exchangeMultisigKeys (const std::vector< std::string > &info)=0
 exchange_multisig_keys - provides additional key exchange round for arbitrary multisig schemes (like N-1/N, M/N) More...
 
virtual bool finalizeMultisig (const std::vector< std::string > &extraMultisigInfo)=0
 finalizeMultisig - finalizes N - 1 / N multisig wallets creation More...
 
virtual bool exportMultisigImages (std::string &images)=0
 exportMultisigImages - exports transfers' key images More...
 
virtual size_t importMultisigImages (const std::vector< std::string > &images)=0
 importMultisigImages - imports other participants' multisig images More...
 
virtual bool hasMultisigPartialKeyImages () const =0
 hasMultisigPartialKeyImages - checks if wallet needs to import multisig key images from other participants More...
 
virtual PendingTransactionrestoreMultisigTransaction (const std::string &signData)=0
 restoreMultisigTransaction creates PendingTransaction from signData More...
 
virtual PendingTransactioncreateTransaction (const std::string &dst_addr, const std::string &payment_id, optional< uint64_t > amount, uint32_t mixin_count, PendingTransaction::Priority=PendingTransaction::Priority_Low, uint32_t subaddr_account=0, std::set< uint32_t > subaddr_indices={})=0
 createTransaction creates transaction. if dst_addr is an integrated address, payment_id is ignored More...
 
virtual PendingTransactioncreateSweepUnmixableTransaction ()=0
 createSweepUnmixableTransaction creates transaction with unmixable outputs. More...
 
virtual UnsignedTransactionloadUnsignedTx (const std::string &unsigned_filename)=0
 loadUnsignedTx - creates transaction from unsigned tx file More...
 
virtual bool submitTransaction (const std::string &fileName)=0
 submitTransaction - submits transaction in signed tx file More...
 
virtual void disposeTransaction (PendingTransaction *t)=0
 disposeTransaction - destroys transaction object More...
 
virtual bool exportKeyImages (const std::string &filename)=0
 exportKeyImages - exports key images to file More...
 
virtual bool importKeyImages (const std::string &filename)=0
 importKeyImages - imports key images from file More...
 
virtual TransactionHistoryhistory ()=0
 
virtual AddressBookaddressBook ()=0
 
virtual Subaddresssubaddress ()=0
 
virtual SubaddressAccountsubaddressAccount ()=0
 
virtual void setListener (WalletListener *)=0
 
virtual uint32_t defaultMixin () const =0
 defaultMixin - returns number of mixins used in transactions More...
 
virtual void setDefaultMixin (uint32_t arg)=0
 setDefaultMixin - setum number of mixins to be used for new transactions More...
 
virtual bool setUserNote (const std::string &txid, const std::string &note)=0
 setUserNote - attach an arbitrary string note to a txid More...
 
virtual std::string getUserNote (const std::string &txid) const =0
 getUserNote - return an arbitrary string note attached to a txid More...
 
virtual std::string getTxKey (const std::string &txid) const =0
 
virtual bool checkTxKey (const std::string &txid, std::string tx_key, const std::string &address, uint64_t &received, bool &in_pool, uint64_t &confirmations)=0
 
virtual std::string getTxProof (const std::string &txid, const std::string &address, const std::string &message) const =0
 
virtual bool checkTxProof (const std::string &txid, const std::string &address, const std::string &message, const std::string &signature, bool &good, uint64_t &received, bool &in_pool, uint64_t &confirmations)=0
 
virtual std::string getSpendProof (const std::string &txid, const std::string &message) const =0
 
virtual bool checkSpendProof (const std::string &txid, const std::string &message, const std::string &signature, bool &good) const =0
 
virtual std::string getReserveProof (bool all, uint32_t account_index, uint64_t amount, const std::string &message) const =0
 getReserveProof - Generates a proof that proves the reserve of unspent funds Parameters account_index and amount are ignored when all is true More...
 
virtual bool checkReserveProof (const std::string &address, const std::string &message, const std::string &signature, bool &good, uint64_t &total, uint64_t &spent) const =0
 
virtual std::string signMessage (const std::string &message)=0
 
virtual bool verifySignedMessage (const std::string &message, const std::string &addres, const std::string &signature) const =0
 verifySignedMessage - verify a signature matches a given message More...
 
virtual std::string signMultisigParticipant (const std::string &message) const =0
 signMultisigParticipant signs given message with the multisig public signer key More...
 
virtual bool verifyMessageWithPublicKey (const std::string &message, const std::string &publicKey, const std::string &signature) const =0
 verifyMessageWithPublicKey verifies that message was signed with the given public key More...
 
virtual bool parse_uri (const std::string &uri, std::string &address, std::string &payment_id, uint64_t &amount, std::string &tx_description, std::string &recipient_name, std::vector< std::string > &unknown_parameters, std::string &error)=0
 
virtual std::string getDefaultDataDir () const =0
 
virtual bool rescanSpent ()=0
 
virtual bool blackballOutputs (const std::vector< std::string > &outputs, bool add)=0
 blackballs a set of outputs More...
 
virtual bool blackballOutput (const std::string &amount, const std::string &offset)=0
 blackballs an output More...
 
virtual bool unblackballOutput (const std::string &amount, const std::string &offset)=0
 unblackballs an output More...
 
virtual bool getRing (const std::string &key_image, std::vector< uint64_t > &ring) const =0
 gets the ring used for a key image, if any More...
 
virtual bool getRings (const std::string &txid, std::vector< std::pair< std::string, std::vector< uint64_t >>> &rings) const =0
 gets the rings used for a txid, if any More...
 
virtual bool setRing (const std::string &key_image, const std::vector< uint64_t > &ring, bool relative)=0
 sets the ring used for a key image More...
 
virtual void segregatePreForkOutputs (bool segregate)=0
 sets whether pre-fork outs are to be segregated More...
 
virtual void segregationHeight (uint64_t height)=0
 sets the height where segregation should occur More...
 
virtual void keyReuseMitigation2 (bool mitigation)=0
 secondary key reuse mitigation More...
 
virtual bool lightWalletLogin (bool &isNewWallet) const =0
 Light wallet authenticate and login. More...
 
virtual bool lightWalletImportWalletRequest (std::string &payment_id, uint64_t &fee, bool &new_request, bool &request_fulfilled, std::string &payment_address, std::string &status)=0
 Initiates a light wallet import wallet request. More...
 
virtual bool lockKeysFile ()=0
 locks/unlocks the keys file; returns true on success More...
 
virtual bool unlockKeysFile ()=0
 
virtual bool isKeysFileLocked ()=0
 returns true if the keys file is locked More...
 
virtual Device getDeviceType () const =0
 Queries backing device for wallet keys. More...
 
virtual uint64_t coldKeyImageSync (uint64_t &spent, uint64_t &unspent)=0
 cold-device protocol key image sync More...
 

Static Public Member Functions

static std::string displayAmount (uint64_t amount)
 
static uint64_t amountFromString (const std::string &amount)
 
static uint64_t amountFromDouble (double amount)
 
static std::string genPaymentId ()
 
static bool paymentIdValid (const std::string &paiment_id)
 
static bool addressValid (const std::string &str, NetworkType nettype)
 
static bool addressValid (const std::string &str, bool testnet)
 
static bool keyValid (const std::string &secret_key_string, const std::string &address_string, bool isViewKey, NetworkType nettype, std::string &error)
 
static bool keyValid (const std::string &secret_key_string, const std::string &address_string, bool isViewKey, bool testnet, std::string &error)
 
static std::string paymentIdFromAddress (const std::string &str, NetworkType nettype)
 
static std::string paymentIdFromAddress (const std::string &str, bool testnet)
 
static uint64_t maximumAllowedAmount ()
 
static void init (const char *argv0, const char *default_log_base_name)
 
static void init (const char *argv0, const char *default_log_base_name, const std::string &log_path, bool console)
 
static void debug (const std::string &category, const std::string &str)
 
static void info (const std::string &category, const std::string &str)
 
static void warning (const std::string &category, const std::string &str)
 
static void error (const std::string &category, const std::string &str)
 

Detailed Description

Interface for wallet operations. TODO: check if /include/IWallet.h is still actual.

Definition at line 430 of file wallet2_api.h.

Member Enumeration Documentation

◆ ConnectionStatus

◆ Device

Enumerator
Device_Software 
Device_Ledger 
Device_Trezor 

Definition at line 432 of file wallet2_api.h.

◆ Status

Enumerator
Status_Ok 
Status_Error 
Status_Critical 

Definition at line 438 of file wallet2_api.h.

Constructor & Destructor Documentation

◆ ~Wallet()

Electroneum::Wallet::~Wallet ( )
pure virtual

Definition at line 294 of file wallet.cpp.

294 {}

Member Function Documentation

◆ address()

virtual std::string Electroneum::Wallet::address ( uint32_t  accountIndex = 0,
uint32_t  addressIndex = 0 
) const
pure virtual

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ addressBook()

virtual AddressBook* Electroneum::Wallet::addressBook ( )
pure virtual

Implemented in Electroneum::WalletImpl.

◆ addressValid() [1/2]

bool Electroneum::Wallet::addressValid ( const std::string &  str,
NetworkType  nettype 
)
static

Definition at line 336 of file wallet.cpp.

337 {
339  return get_account_address_from_str(info, static_cast<cryptonote::network_type>(nettype), str);
340 }
virtual NetworkType nettype() const =0
bool get_account_address_from_str(address_parse_info &info, network_type nettype, std::string const &str)
static void info(const std::string &category, const std::string &str)
Definition: wallet.cpp:407
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addressValid() [2/2]

static bool Electroneum::Wallet::addressValid ( const std::string &  str,
bool  testnet 
)
inlinestatic

Definition at line 668 of file wallet2_api.h.

669  {
670  return addressValid(str, testnet ? TESTNET : MAINNET);
671  }
bool testnet() const
Definition: wallet2_api.h:468
static bool addressValid(const std::string &str, NetworkType nettype)
Definition: wallet.cpp:336
Here is the call graph for this function:

◆ addSubaddress()

virtual void Electroneum::Wallet::addSubaddress ( uint32_t  accountIndex,
const std::string &  label 
)
pure virtual

addSubaddress - appends a new subaddress at the end of the last minor index of the specified subaddress account

Parameters
accountIndex- the major index specifying the subaddress account
label- the label for the new subaddress

Implemented in Electroneum::WalletImpl.

◆ addSubaddressAccount()

virtual void Electroneum::Wallet::addSubaddressAccount ( const std::string &  label)
pure virtual

addSubaddressAccount - appends a new subaddress account at the end of the last major index of existing subaddress accounts

Parameters
label- the label for the new account (which is the as the label of the primary address (accountIndex,0))

Implemented in Electroneum::WalletImpl.

◆ amountFromDouble()

uint64_t Electroneum::Wallet::amountFromDouble ( double  amount)
static

Definition at line 311 of file wallet.cpp.

312 {
313  std::stringstream ss;
314  ss << std::fixed << std::setprecision(CRYPTONOTE_DISPLAY_DECIMAL_POINT) << amount;
315  return amountFromString(ss.str());
316 }
#define CRYPTONOTE_DISPLAY_DECIMAL_POINT
static uint64_t amountFromString(const std::string &amount)
Definition: wallet.cpp:304
Here is the caller graph for this function:

◆ amountFromString()

uint64_t Electroneum::Wallet::amountFromString ( const std::string &  amount)
static

Definition at line 304 of file wallet.cpp.

305 {
306  uint64_t result = 0;
307  cryptonote::parse_amount(result, amount);
308  return result;
309 }
bool parse_amount(uint64_t &amount, const std::string &str_amount_)
unsigned __int64 uint64_t
Definition: stdint.h:136
Here is the call graph for this function:
Here is the caller graph for this function:

◆ approximateBlockChainHeight()

virtual uint64_t Electroneum::Wallet::approximateBlockChainHeight ( ) const
pure virtual

approximateBlockChainHeight - returns approximate blockchain height calculated from date/time

Returns

Implemented in Electroneum::WalletImpl.

◆ autoRefreshInterval()

virtual int Electroneum::Wallet::autoRefreshInterval ( ) const
pure virtual

autoRefreshInterval - returns automatic refresh interval in millis

Returns

Implemented in Electroneum::WalletImpl.

◆ balance()

virtual uint64_t Electroneum::Wallet::balance ( uint32_t  accountIndex = 0,
bool  public_blockchain = false 
) const
pure virtual

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ balanceAll()

uint64_t Electroneum::Wallet::balanceAll ( bool  public_blockchain) const
inline

Definition at line 604 of file wallet2_api.h.

604  {
605  uint64_t result = 0;
606  for (uint32_t i = 0; i < numSubaddressAccounts(); ++i)
607  result += balance(i, public_blockchain);
608  return result;
609  }
unsigned int uint32_t
Definition: stdint.h:126
unsigned __int64 uint64_t
Definition: stdint.h:136
virtual uint64_t balance(uint32_t accountIndex=0, bool public_blockchain=false) const =0
virtual size_t numSubaddressAccounts() const =0
numSubaddressAccounts - returns the number of existing subaddress accounts
Here is the call graph for this function:

◆ blackballOutput()

virtual bool Electroneum::Wallet::blackballOutput ( const std::string &  amount,
const std::string &  offset 
)
pure virtual

blackballs an output

Implemented in Electroneum::WalletImpl.

◆ blackballOutputs()

virtual bool Electroneum::Wallet::blackballOutputs ( const std::vector< std::string > &  outputs,
bool  add 
)
pure virtual

blackballs a set of outputs

Implemented in Electroneum::WalletImpl.

◆ blockChainHeight()

virtual uint64_t Electroneum::Wallet::blockChainHeight ( ) const
pure virtual

blockChainHeight - returns current blockchain height

Returns

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ checkReserveProof()

virtual bool Electroneum::Wallet::checkReserveProof ( const std::string &  address,
const std::string &  message,
const std::string &  signature,
bool good,
uint64_t total,
uint64_t spent 
) const
pure virtual

Implemented in Electroneum::WalletImpl.

◆ checkSpendProof()

virtual bool Electroneum::Wallet::checkSpendProof ( const std::string &  txid,
const std::string &  message,
const std::string &  signature,
bool good 
) const
pure virtual

Implemented in Electroneum::WalletImpl.

◆ checkTxKey()

virtual bool Electroneum::Wallet::checkTxKey ( const std::string &  txid,
std::string  tx_key,
const std::string &  address,
uint64_t received,
bool in_pool,
uint64_t confirmations 
)
pure virtual

Implemented in Electroneum::WalletImpl.

◆ checkTxProof()

virtual bool Electroneum::Wallet::checkTxProof ( const std::string &  txid,
const std::string &  address,
const std::string &  message,
const std::string &  signature,
bool good,
uint64_t received,
bool in_pool,
uint64_t confirmations 
)
pure virtual

Implemented in Electroneum::WalletImpl.

◆ coldKeyImageSync()

virtual uint64_t Electroneum::Wallet::coldKeyImageSync ( uint64_t spent,
uint64_t unspent 
)
pure virtual

cold-device protocol key image sync

Implemented in Electroneum::WalletImpl.

◆ connected()

virtual ConnectionStatus Electroneum::Wallet::connected ( ) const
pure virtual

connected - checks if the wallet connected to the daemon

Returns
- true if connected

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ connectToDaemon()

virtual bool Electroneum::Wallet::connectToDaemon ( )
pure virtual

connectToDaemon - connects to the daemon. TODO: check if it can be removed

Returns

Implemented in Electroneum::WalletImpl.

◆ createSweepUnmixableTransaction()

virtual PendingTransaction* Electroneum::Wallet::createSweepUnmixableTransaction ( )
pure virtual

createSweepUnmixableTransaction creates transaction with unmixable outputs.

Returns
PendingTransaction object. caller is responsible to check PendingTransaction::status() after object returned

Implemented in Electroneum::WalletImpl.

◆ createTransaction()

virtual PendingTransaction* Electroneum::Wallet::createTransaction ( const std::string &  dst_addr,
const std::string &  payment_id,
optional< uint64_t amount,
uint32_t  mixin_count,
PendingTransaction::Priority  = PendingTransaction::Priority_Low,
uint32_t  subaddr_account = 0,
std::set< uint32_t subaddr_indices = {} 
)
pure virtual

createTransaction creates transaction. if dst_addr is an integrated address, payment_id is ignored

Parameters
dst_addrdestination address as string
payment_idoptional payment_id, can be empty string
amountamount
mixin_countmixin count. if 0 passed, wallet will use default value
subaddr_accountsubaddress account from which the input funds are taken
subaddr_indicesset of subaddress indices to use for transfer or sweeping. if set empty, all are chosen when sweeping, and one or more are automatically chosen when transferring. after execution, returns the set of actually used indices
priority
Returns
PendingTransaction object. caller is responsible to check PendingTransaction::status() after object returned

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ createWatchOnly()

virtual bool Electroneum::Wallet::createWatchOnly ( const std::string &  path,
const std::string &  password,
const std::string &  language 
) const
pure virtual

createWatchOnly - Creates a watch only wallet

Parameters
path- where to store the wallet
password
language
Returns
- true if created successfully

Implemented in Electroneum::WalletImpl.

◆ daemonBlockChainHeight()

virtual uint64_t Electroneum::Wallet::daemonBlockChainHeight ( ) const
pure virtual

daemonBlockChainHeight - returns daemon blockchain height

Returns
0 - in case error communicating with the daemon. status() will return Status_Error and errorString() will return verbose error description

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ daemonBlockChainTargetHeight()

virtual uint64_t Electroneum::Wallet::daemonBlockChainTargetHeight ( ) const
pure virtual

daemonBlockChainTargetHeight - returns daemon blockchain target height

Returns
0 - in case error communicating with the daemon. status() will return Status_Error and errorString() will return verbose error description

Implemented in Electroneum::WalletImpl.

◆ debug()

void Electroneum::Wallet::debug ( const std::string &  category,
const std::string &  str 
)
static

Definition at line 403 of file wallet.cpp.

403  {
404  MCDEBUG(category.empty() ? ELECTRONEUM_DEFAULT_LOG_CATEGORY : category.c_str(), str);
405 }
#define MCDEBUG(cat, x)
Definition: misc_log_ex.h:54
#define ELECTRONEUM_DEFAULT_LOG_CATEGORY
Definition: wallet.cpp:59

◆ defaultMixin()

virtual uint32_t Electroneum::Wallet::defaultMixin ( ) const
pure virtual

defaultMixin - returns number of mixins used in transactions

Returns

Implemented in Electroneum::WalletImpl.

◆ displayAmount()

string Electroneum::Wallet::displayAmount ( uint64_t  amount)
static

Definition at line 299 of file wallet.cpp.

300 {
301  return cryptonote::print_etn(amount);
302 }
std::string print_etn(uint64_t amount, unsigned int decimal_point)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ disposeTransaction()

virtual void Electroneum::Wallet::disposeTransaction ( PendingTransaction t)
pure virtual

disposeTransaction - destroys transaction object

Parameters
t- pointer to the "PendingTransaction" object. Pointer is not valid after function returned;

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ error()

void Electroneum::Wallet::error ( const std::string &  category,
const std::string &  str 
)
static

Definition at line 415 of file wallet.cpp.

415  {
416  MCERROR(category.empty() ? ELECTRONEUM_DEFAULT_LOG_CATEGORY : category.c_str(), str);
417 }
#define MCERROR(cat, x)
Definition: misc_log_ex.h:51
#define ELECTRONEUM_DEFAULT_LOG_CATEGORY
Definition: wallet.cpp:59
Here is the caller graph for this function:

◆ errorString()

virtual std::string Electroneum::Wallet::errorString ( ) const
pure virtual

in case error status, returns error string

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ estimateBlockChainHeight()

virtual uint64_t Electroneum::Wallet::estimateBlockChainHeight ( ) const
pure virtual

estimateBlockChainHeight - returns estimate blockchain height. More accurate than approximateBlockChainHeight, uses daemon height and falls back to calculation from date/time

Returns

Implemented in Electroneum::WalletImpl.

◆ exchangeMultisigKeys()

virtual std::string Electroneum::Wallet::exchangeMultisigKeys ( const std::vector< std::string > &  info)
pure virtual

exchange_multisig_keys - provides additional key exchange round for arbitrary multisig schemes (like N-1/N, M/N)

Parameters
info- base58 encoded key derivations returned by makeMultisig or exchangeMultisigKeys function call
Returns
new info string if more rounds required or an empty string if wallet creation is done

Implemented in Electroneum::WalletImpl.

◆ exportKeyImages()

virtual bool Electroneum::Wallet::exportKeyImages ( const std::string &  filename)
pure virtual

exportKeyImages - exports key images to file

Parameters
filename
Returns
- true on success

Implemented in Electroneum::WalletImpl.

◆ exportMultisigImages()

virtual bool Electroneum::Wallet::exportMultisigImages ( std::string &  images)
pure virtual

exportMultisigImages - exports transfers' key images

Parameters
images- output paramter for hex encoded array of images
Returns
true if success

Implemented in Electroneum::WalletImpl.

◆ filename()

virtual std::string Electroneum::Wallet::filename ( ) const
pure virtual

filename - returns wallet filename

Returns

Implemented in Electroneum::WalletImpl.

◆ finalizeMultisig()

virtual bool Electroneum::Wallet::finalizeMultisig ( const std::vector< std::string > &  extraMultisigInfo)
pure virtual

finalizeMultisig - finalizes N - 1 / N multisig wallets creation

Parameters
extraMultisigInfo- wallet participants' extra multisig info obtained with makeMultisig call
Returns
true if success

Implemented in Electroneum::WalletImpl.

◆ genPaymentId()

std::string Electroneum::Wallet::genPaymentId ( )
static

Definition at line 318 of file wallet.cpp.

319 {
320  crypto::hash8 payment_id = crypto::rand<crypto::hash8>();
321  return epee::string_tools::pod_to_hex(payment_id);
322 
323 }
std::string pod_to_hex(const t_pod_type &s)
Definition: string_tools.h:317
POD_CLASS hash8
Definition: hash.h:53
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDefaultDataDir()

virtual std::string Electroneum::Wallet::getDefaultDataDir ( ) const
pure virtual

Implemented in Electroneum::WalletImpl.

◆ getDeviceType()

virtual Device Electroneum::Wallet::getDeviceType ( ) const
pure virtual

Queries backing device for wallet keys.

Returns
Device they are on

Implemented in Electroneum::WalletImpl.

◆ getMultisigInfo()

virtual std::string Electroneum::Wallet::getMultisigInfo ( ) const
pure virtual

getMultisigInfo

Returns
serialized and signed multisig info string

Implemented in Electroneum::WalletImpl.

◆ getRefreshFromBlockHeight()

virtual uint64_t Electroneum::Wallet::getRefreshFromBlockHeight ( ) const
pure virtual

getRestoreHeight - get wallet creation height

Implemented in Electroneum::WalletImpl.

◆ getReserveProof()

virtual std::string Electroneum::Wallet::getReserveProof ( bool  all,
uint32_t  account_index,
uint64_t  amount,
const std::string &  message 
) const
pure virtual

getReserveProof - Generates a proof that proves the reserve of unspent funds Parameters account_index and amount are ignored when all is true

Implemented in Electroneum::WalletImpl.

◆ getRing()

virtual bool Electroneum::Wallet::getRing ( const std::string &  key_image,
std::vector< uint64_t > &  ring 
) const
pure virtual

gets the ring used for a key image, if any

Implemented in Electroneum::WalletImpl.

◆ getRings()

virtual bool Electroneum::Wallet::getRings ( const std::string &  txid,
std::vector< std::pair< std::string, std::vector< uint64_t >>> &  rings 
) const
pure virtual

gets the rings used for a txid, if any

Implemented in Electroneum::WalletImpl.

◆ getSeedLanguage()

virtual std::string Electroneum::Wallet::getSeedLanguage ( ) const
pure virtual

Implemented in Electroneum::WalletImpl.

◆ getSpendProof()

virtual std::string Electroneum::Wallet::getSpendProof ( const std::string &  txid,
const std::string &  message 
) const
pure virtual

Implemented in Electroneum::WalletImpl.

◆ getSubaddressLabel()

virtual std::string Electroneum::Wallet::getSubaddressLabel ( uint32_t  accountIndex,
uint32_t  addressIndex 
) const
pure virtual

getSubaddressLabel - gets the label of the specified subaddress

Parameters
accountIndex- the major index specifying the subaddress account
addressIndex- the minor index specifying the subaddress

Implemented in Electroneum::WalletImpl.

◆ getTxKey()

virtual std::string Electroneum::Wallet::getTxKey ( const std::string &  txid) const
pure virtual

Implemented in Electroneum::WalletImpl.

◆ getTxProof()

virtual std::string Electroneum::Wallet::getTxProof ( const std::string &  txid,
const std::string &  address,
const std::string &  message 
) const
pure virtual

Implemented in Electroneum::WalletImpl.

◆ getUserNote()

virtual std::string Electroneum::Wallet::getUserNote ( const std::string &  txid) const
pure virtual

getUserNote - return an arbitrary string note attached to a txid

Parameters
txid- the transaction id to attach the note to
Returns
the attached note, or empty string if there is none

Implemented in Electroneum::WalletImpl.

◆ hardForkInfo()

virtual void Electroneum::Wallet::hardForkInfo ( uint8_t version,
uint64_t earliest_height 
) const
pure virtual

returns current hard fork info

Implemented in Electroneum::WalletImpl.

◆ hasMultisigPartialKeyImages()

virtual bool Electroneum::Wallet::hasMultisigPartialKeyImages ( ) const
pure virtual

hasMultisigPartialKeyImages - checks if wallet needs to import multisig key images from other participants

Returns
true if there are partial key images

Implemented in Electroneum::WalletImpl.

◆ history()

virtual TransactionHistory* Electroneum::Wallet::history ( )
pure virtual

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ importKeyImages()

virtual bool Electroneum::Wallet::importKeyImages ( const std::string &  filename)
pure virtual

importKeyImages - imports key images from file

Parameters
filename
Returns
- true on success

Implemented in Electroneum::WalletImpl.

◆ importMultisigImages()

virtual size_t Electroneum::Wallet::importMultisigImages ( const std::vector< std::string > &  images)
pure virtual

importMultisigImages - imports other participants' multisig images

Parameters
images- array of hex encoded arrays of images obtained with exportMultisigImages
Returns
number of imported images

Implemented in Electroneum::WalletImpl.

◆ info()

void Electroneum::Wallet::info ( const std::string &  category,
const std::string &  str 
)
static

Definition at line 407 of file wallet.cpp.

407  {
408  MCINFO(category.empty() ? ELECTRONEUM_DEFAULT_LOG_CATEGORY : category.c_str(), str);
409 }
#define MCINFO(cat, x)
Definition: misc_log_ex.h:53
#define ELECTRONEUM_DEFAULT_LOG_CATEGORY
Definition: wallet.cpp:59
Here is the caller graph for this function:

◆ init() [1/3]

virtual bool Electroneum::Wallet::init ( const std::string &  daemon_address,
uint64_t  upper_transaction_size_limit = 0,
const std::string &  daemon_username = "",
const std::string &  daemon_password = "",
bool  use_ssl = false,
bool  lightWallet = false 
)
pure virtual

init - initializes wallet with daemon connection params. if daemon_address is local address, "trusted daemon" will be set to true forcibly startRefresh() should be called when wallet is initialized.

Parameters
daemon_address- daemon address in "hostname:port" format
upper_transaction_size_limit
daemon_username
daemon_password
lightWallet- start wallet in light mode, connect to a openmonero compatible server.
Returns
- true on success

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ init() [2/3]

static void Electroneum::Wallet::init ( const char *  argv0,
const char *  default_log_base_name 
)
inlinestatic

Definition at line 684 of file wallet2_api.h.

684 { init(argv0, default_log_base_name, "", true); }
virtual bool init(const std::string &daemon_address, uint64_t upper_transaction_size_limit=0, const std::string &daemon_username="", const std::string &daemon_password="", bool use_ssl=false, bool lightWallet=false)=0
init - initializes wallet with daemon connection params. if daemon_address is local address...
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init() [3/3]

void Electroneum::Wallet::init ( const char *  argv0,
const char *  default_log_base_name,
const std::string &  log_path,
bool  console 
)
static

Definition at line 393 of file wallet.cpp.

393  {
394 #ifdef WIN32
395  // Activate UTF-8 support for Boost filesystem classes on Windows
396  std::locale::global(boost::locale::generator().generate(""));
397  boost::filesystem::path::imbue(std::locale());
398 #endif
400  mlog_configure(log_path.empty() ? mlog_get_default_log_path(default_log_base_name) : log_path.c_str(), console);
401 }
bool set_module_name_and_folder(const std::string &path_to_process_)
Definition: string_tools.h:249
std::string mlog_get_default_log_path(const char *default_filename)
Definition: mlog.cpp:72
void mlog_configure(const std::string &filename_base, bool console, const std::size_t max_log_file_size=MAX_LOG_FILE_SIZE, const std::size_t max_log_files=MAX_LOG_FILES)
Definition: mlog.cpp:148
Here is the call graph for this function:

◆ integratedAddress()

virtual std::string Electroneum::Wallet::integratedAddress ( const std::string &  payment_id) const
pure virtual

integratedAddress - returns integrated address for current wallet address and given payment_id. if passed "payment_id" param is an empty string or not-valid payment id string (16 characters hexadecimal string) - random payment_id will be generated

Parameters
payment_id- 16 characters hexadecimal string or empty string if new random payment id needs to be generated
Returns
- 106 characters string representing integrated address

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ isKeysFileLocked()

virtual bool Electroneum::Wallet::isKeysFileLocked ( )
pure virtual

returns true if the keys file is locked

Implemented in Electroneum::WalletImpl.

◆ keyReuseMitigation2()

virtual void Electroneum::Wallet::keyReuseMitigation2 ( bool  mitigation)
pure virtual

secondary key reuse mitigation

Implemented in Electroneum::WalletImpl.

◆ keysFilename()

virtual std::string Electroneum::Wallet::keysFilename ( ) const
pure virtual

keysFilename - returns keys filename. usually this formed as "wallet_filename".keys

Returns

Implemented in Electroneum::WalletImpl.

◆ keyValid() [1/2]

bool Electroneum::Wallet::keyValid ( const std::string &  secret_key_string,
const std::string &  address_string,
bool  isViewKey,
NetworkType  nettype,
std::string &  error 
)
static

Definition at line 342 of file wallet.cpp.

343 {
345  if(!get_account_address_from_str(info, static_cast<cryptonote::network_type>(nettype), address_string)) {
346  error = tr("Failed to parse address");
347  return false;
348  }
349 
350  cryptonote::blobdata key_data;
351  if(!epee::string_tools::parse_hexstr_to_binbuff(secret_key_string, key_data) || key_data.size() != sizeof(crypto::secret_key))
352  {
353  error = tr("Failed to parse key");
354  return false;
355  }
356  crypto::secret_key key = *reinterpret_cast<const crypto::secret_key*>(key_data.data());
357 
358  // check the key match the given address
359  crypto::public_key pkey;
361  error = tr("failed to verify key");
362  return false;
363  }
364  bool matchAddress = false;
365  if(isViewKey)
366  matchAddress = info.address.m_view_public_key == pkey;
367  else
368  matchAddress = info.address.m_spend_public_key == pkey;
369 
370  if(!matchAddress) {
371  error = tr("key does not match address");
372  return false;
373  }
374 
375  return true;
376 }
#define tr(x)
Definition: common_defines.h:4
const char * key
Definition: hmac_keccak.cpp:39
epee::mlocked< tools::scrubbed< ec_scalar > > secret_key
Definition: crypto.h:82
virtual NetworkType nettype() const =0
static void error(const std::string &category, const std::string &str)
Definition: wallet.cpp:415
POD_CLASS public_key
Definition: crypto.h:76
std::string blobdata
Definition: blobdatatype.h:39
bool get_account_address_from_str(address_parse_info &info, network_type nettype, std::string const &str)
static void info(const std::string &category, const std::string &str)
Definition: wallet.cpp:407
bool secret_key_to_public_key(const secret_key &sec, public_key &pub)
Definition: crypto.h:262
bool parse_hexstr_to_binbuff(const epee::span< const char > s, epee::span< char > &res)
Definition: string_tools.h:92
Here is the call graph for this function:
Here is the caller graph for this function:

◆ keyValid() [2/2]

static bool Electroneum::Wallet::keyValid ( const std::string &  secret_key_string,
const std::string &  address_string,
bool  isViewKey,
bool  testnet,
std::string &  error 
)
inlinestatic

Definition at line 673 of file wallet2_api.h.

674  {
675  return keyValid(secret_key_string, address_string, isViewKey, testnet ? TESTNET : MAINNET, error);
676  }
static void error(const std::string &category, const std::string &str)
Definition: wallet.cpp:415
bool testnet() const
Definition: wallet2_api.h:468
static bool keyValid(const std::string &secret_key_string, const std::string &address_string, bool isViewKey, NetworkType nettype, std::string &error)
Definition: wallet.cpp:342
Here is the call graph for this function:

◆ lightWalletImportWalletRequest()

virtual bool Electroneum::Wallet::lightWalletImportWalletRequest ( std::string &  payment_id,
uint64_t fee,
bool new_request,
bool request_fulfilled,
std::string &  payment_address,
std::string &  status 
)
pure virtual

Initiates a light wallet import wallet request.

Implemented in Electroneum::WalletImpl.

◆ lightWalletLogin()

virtual bool Electroneum::Wallet::lightWalletLogin ( bool isNewWallet) const
pure virtual

Light wallet authenticate and login.

Implemented in Electroneum::WalletImpl.

◆ loadUnsignedTx()

virtual UnsignedTransaction* Electroneum::Wallet::loadUnsignedTx ( const std::string &  unsigned_filename)
pure virtual

loadUnsignedTx - creates transaction from unsigned tx file

Returns
- UnsignedTransaction object. caller is responsible to check UnsignedTransaction::status() after object returned

Implemented in Electroneum::WalletImpl.

◆ lockKeysFile()

virtual bool Electroneum::Wallet::lockKeysFile ( )
pure virtual

locks/unlocks the keys file; returns true on success

Implemented in Electroneum::WalletImpl.

◆ mainAddress()

std::string Electroneum::Wallet::mainAddress ( ) const
inline

Definition at line 464 of file wallet2_api.h.

464 { return address(0, 0); }
virtual std::string address(uint32_t accountIndex=0, uint32_t addressIndex=0) const =0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mainnet()

bool Electroneum::Wallet::mainnet ( ) const
inline

Definition at line 467 of file wallet2_api.h.

467 { return nettype() == MAINNET; }
virtual NetworkType nettype() const =0
Here is the call graph for this function:

◆ makeMultisig()

virtual std::string Electroneum::Wallet::makeMultisig ( const std::vector< std::string > &  info,
uint32_t  threshold 
)
pure virtual

makeMultisig - switches wallet in multisig state. The one and only creation phase for N / N wallets

Parameters
info- vector of multisig infos from other participants obtained with getMulitisInfo call
threshold- number of required signers to make valid transaction. Must be equal to number of participants (N) or N - 1
Returns
in case of N / N wallets returns empty string since no more key exchanges needed. For N - 1 / N wallets returns base58 encoded extra multisig info

Implemented in Electroneum::WalletImpl.

◆ maximumAllowedAmount()

uint64_t Electroneum::Wallet::maximumAllowedAmount ( )
static

Definition at line 388 of file wallet.cpp.

389 {
390  return std::numeric_limits<uint64_t>::max();
391 }
Here is the caller graph for this function:

◆ multisig()

virtual MultisigState Electroneum::Wallet::multisig ( ) const
pure virtual

multisig - returns current state of multisig wallet creation process

Returns
MultisigState struct

Implemented in Electroneum::WalletImpl.

◆ nettype()

virtual NetworkType Electroneum::Wallet::nettype ( ) const
pure virtual

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ numSubaddressAccounts()

virtual size_t Electroneum::Wallet::numSubaddressAccounts ( ) const
pure virtual

numSubaddressAccounts - returns the number of existing subaddress accounts

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ numSubaddresses()

virtual size_t Electroneum::Wallet::numSubaddresses ( uint32_t  accountIndex) const
pure virtual

numSubaddresses - returns the number of existing subaddresses associated with the specified subaddress account

Parameters
accountIndex- the major index specifying the subaddress account

Implemented in Electroneum::WalletImpl.

◆ parse_uri()

virtual bool Electroneum::Wallet::parse_uri ( const std::string &  uri,
std::string &  address,
std::string &  payment_id,
uint64_t amount,
std::string &  tx_description,
std::string &  recipient_name,
std::vector< std::string > &  unknown_parameters,
std::string &  error 
)
pure virtual

Implemented in Electroneum::WalletImpl.

◆ path()

virtual std::string Electroneum::Wallet::path ( ) const
pure virtual

Implemented in Electroneum::WalletImpl.

◆ pauseRefresh()

virtual void Electroneum::Wallet::pauseRefresh ( )
pure virtual

pauseRefresh - pause refresh thread

Implemented in Electroneum::WalletImpl.

◆ paymentIdFromAddress() [1/2]

std::string Electroneum::Wallet::paymentIdFromAddress ( const std::string &  str,
NetworkType  nettype 
)
static

Definition at line 378 of file wallet.cpp.

379 {
381  if (!get_account_address_from_str(info, static_cast<cryptonote::network_type>(nettype), str))
382  return "";
383  if (!info.has_payment_id)
384  return "";
385  return epee::string_tools::pod_to_hex(info.payment_id);
386 }
virtual NetworkType nettype() const =0
std::string pod_to_hex(const t_pod_type &s)
Definition: string_tools.h:317
bool get_account_address_from_str(address_parse_info &info, network_type nettype, std::string const &str)
static void info(const std::string &category, const std::string &str)
Definition: wallet.cpp:407
Here is the call graph for this function:
Here is the caller graph for this function:

◆ paymentIdFromAddress() [2/2]

static std::string Electroneum::Wallet::paymentIdFromAddress ( const std::string &  str,
bool  testnet 
)
inlinestatic

Definition at line 678 of file wallet2_api.h.

679  {
680  return paymentIdFromAddress(str, testnet ? TESTNET : MAINNET);
681  }
static std::string paymentIdFromAddress(const std::string &str, NetworkType nettype)
Definition: wallet.cpp:378
bool testnet() const
Definition: wallet2_api.h:468
Here is the call graph for this function:

◆ paymentIdValid()

bool Electroneum::Wallet::paymentIdValid ( const std::string &  paiment_id)
static

Definition at line 325 of file wallet.cpp.

326 {
327  crypto::hash8 pid8;
328  if (tools::wallet2::parse_short_payment_id(paiment_id, pid8))
329  return true;
330  crypto::hash pid;
331  if (tools::wallet2::parse_long_payment_id(paiment_id, pid))
332  return true;
333  return false;
334 }
static bool parse_long_payment_id(const std::string &payment_id_str, crypto::hash &payment_id)
Definition: wallet2.cpp:5712
static bool parse_short_payment_id(const std::string &payment_id_str, crypto::hash8 &payment_id)
Definition: wallet2.cpp:5725
POD_CLASS hash8
Definition: hash.h:53
POD_CLASS hash
Definition: hash.h:50
Here is the call graph for this function:

◆ publicMultisigSignerKey()

virtual std::string Electroneum::Wallet::publicMultisigSignerKey ( ) const
pure virtual

publicMultisigSignerKey - returns public signer key

Returns
- public multisignature signer key or empty string if wallet is not multisig

Implemented in Electroneum::WalletImpl.

◆ publicSpendKey()

virtual std::string Electroneum::Wallet::publicSpendKey ( ) const
pure virtual

publicSpendKey - returns public spend key

Returns
- public spend key

Implemented in Electroneum::WalletImpl.

◆ publicViewKey()

virtual std::string Electroneum::Wallet::publicViewKey ( ) const
pure virtual

publicViewKey - returns public view key

Returns
- public view key

Implemented in Electroneum::WalletImpl.

◆ refresh()

virtual bool Electroneum::Wallet::refresh ( )
pure virtual

refresh - refreshes the wallet, updating transactions from daemon

Returns
- true if refreshed successfully;

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ refreshAsync()

virtual void Electroneum::Wallet::refreshAsync ( )
pure virtual

refreshAsync - refreshes wallet asynchronously.

Implemented in Electroneum::WalletImpl.

◆ rescanBlockchain()

virtual bool Electroneum::Wallet::rescanBlockchain ( )
pure virtual

rescanBlockchain - rescans the wallet, updating transactions from daemon

Returns
- true if refreshed successfully;

Implemented in Electroneum::WalletImpl.

◆ rescanBlockchainAsync()

virtual void Electroneum::Wallet::rescanBlockchainAsync ( )
pure virtual

rescanBlockchainAsync - rescans wallet asynchronously, starting from genesys

Implemented in Electroneum::WalletImpl.

◆ rescanSpent()

virtual bool Electroneum::Wallet::rescanSpent ( )
pure virtual

Implemented in Electroneum::WalletImpl.

◆ restoreMultisigTransaction()

virtual PendingTransaction* Electroneum::Wallet::restoreMultisigTransaction ( const std::string &  signData)
pure virtual

restoreMultisigTransaction creates PendingTransaction from signData

Parameters
signDataencrypted unsigned transaction. Obtained with PendingTransaction::multisigSignData
Returns
PendingTransaction

Implemented in Electroneum::WalletImpl.

◆ secretSpendKey()

virtual std::string Electroneum::Wallet::secretSpendKey ( ) const
pure virtual

secretSpendKey - returns secret spend key

Returns
- secret spend key

Implemented in Electroneum::WalletImpl.

◆ secretViewKey()

virtual std::string Electroneum::Wallet::secretViewKey ( ) const
pure virtual

secretViewKey - returns secret view key

Returns
- secret view key

Implemented in Electroneum::WalletImpl.

◆ seed()

virtual std::string Electroneum::Wallet::seed ( ) const
pure virtual

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ segregatePreForkOutputs()

virtual void Electroneum::Wallet::segregatePreForkOutputs ( bool  segregate)
pure virtual

sets whether pre-fork outs are to be segregated

Implemented in Electroneum::WalletImpl.

◆ segregationHeight()

virtual void Electroneum::Wallet::segregationHeight ( uint64_t  height)
pure virtual

sets the height where segregation should occur

Implemented in Electroneum::WalletImpl.

◆ setAutoRefreshInterval()

virtual void Electroneum::Wallet::setAutoRefreshInterval ( int  millis)
pure virtual

setAutoRefreshInterval - setup interval for automatic refresh.

Parameters
seconds- interval in millis. if zero or less than zero - automatic refresh disabled;

Implemented in Electroneum::WalletImpl.

◆ setDefaultMixin()

virtual void Electroneum::Wallet::setDefaultMixin ( uint32_t  arg)
pure virtual

setDefaultMixin - setum number of mixins to be used for new transactions

Parameters
arg

Implemented in Electroneum::WalletImpl.

◆ setDevicePassphrase()

virtual bool Electroneum::Wallet::setDevicePassphrase ( const std::string &  passphrase)
inlinevirtual

Reimplemented in Electroneum::WalletImpl.

Definition at line 462 of file wallet2_api.h.

462 { (void)passphrase; return false; };

◆ setDevicePin()

virtual bool Electroneum::Wallet::setDevicePin ( const std::string &  pin)
inlinevirtual

Reimplemented in Electroneum::WalletImpl.

Definition at line 461 of file wallet2_api.h.

461 { (void)pin; return false; };

◆ setListener()

virtual void Electroneum::Wallet::setListener ( WalletListener )
pure virtual

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ setPassword()

virtual bool Electroneum::Wallet::setPassword ( const std::string &  password)
pure virtual

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ setRecoveringFromDevice()

virtual void Electroneum::Wallet::setRecoveringFromDevice ( bool  recoveringFromDevice)
pure virtual

setRecoveringFromDevice - set state to recovering from device

Parameters
recoveringFromDevice- true/false

Implemented in Electroneum::WalletImpl.

◆ setRecoveringFromSeed()

virtual void Electroneum::Wallet::setRecoveringFromSeed ( bool  recoveringFromSeed)
pure virtual

setRecoveringFromSeed - set state recover form seed

Parameters
recoveringFromSeed- true/false

Implemented in Electroneum::WalletImpl.

◆ setRefreshFromBlockHeight()

virtual void Electroneum::Wallet::setRefreshFromBlockHeight ( uint64_t  refresh_from_block_height)
pure virtual

setRefreshFromBlockHeight - start refresh from block height on recover

Parameters
refresh_from_block_height- blockchain start height

Implemented in Electroneum::WalletImpl.

◆ setRing()

virtual bool Electroneum::Wallet::setRing ( const std::string &  key_image,
const std::vector< uint64_t > &  ring,
bool  relative 
)
pure virtual

sets the ring used for a key image

Implemented in Electroneum::WalletImpl.

◆ setSeedLanguage()

virtual void Electroneum::Wallet::setSeedLanguage ( const std::string &  arg)
pure virtual

Implemented in Electroneum::WalletImpl.

◆ setSubaddressLabel()

virtual void Electroneum::Wallet::setSubaddressLabel ( uint32_t  accountIndex,
uint32_t  addressIndex,
const std::string &  label 
)
pure virtual

setSubaddressLabel - sets the label of the specified subaddress

Parameters
accountIndex- the major index specifying the subaddress account
addressIndex- the minor index specifying the subaddress
label- the new label for the specified subaddress

Implemented in Electroneum::WalletImpl.

◆ setSubaddressLookahead()

virtual void Electroneum::Wallet::setSubaddressLookahead ( uint32_t  major,
uint32_t  minor 
)
pure virtual

setSubaddressLookahead - set size of subaddress lookahead

Parameters
major- size fot the major index
minor- size fot the minor index

Implemented in Electroneum::WalletImpl.

◆ setTrustedDaemon()

virtual void Electroneum::Wallet::setTrustedDaemon ( bool  arg)
pure virtual

Implemented in Electroneum::WalletImpl.

◆ setUserNote()

virtual bool Electroneum::Wallet::setUserNote ( const std::string &  txid,
const std::string &  note 
)
pure virtual

setUserNote - attach an arbitrary string note to a txid

Parameters
txid- the transaction id to attach the note to
note- the note
Returns
true if successful, false otherwise

Implemented in Electroneum::WalletImpl.

◆ signMessage()

virtual std::string Electroneum::Wallet::signMessage ( const std::string &  message)
pure virtual

Implemented in Electroneum::WalletImpl.

◆ signMultisigParticipant()

virtual std::string Electroneum::Wallet::signMultisigParticipant ( const std::string &  message) const
pure virtual

signMultisigParticipant signs given message with the multisig public signer key

Parameters
messagemessage to sign
Returns
signature in case of success. Sets status to Error and return empty string in case of error

Implemented in Electroneum::WalletImpl.

◆ stagenet()

bool Electroneum::Wallet::stagenet ( ) const
inline

Definition at line 469 of file wallet2_api.h.

469 { return nettype() == STAGENET; }
virtual NetworkType nettype() const =0
Here is the call graph for this function:

◆ startRefresh()

virtual void Electroneum::Wallet::startRefresh ( )
pure virtual

StartRefresh - Start/resume refresh thread (refresh every 10 seconds)

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ status()

virtual int Electroneum::Wallet::status ( ) const
pure virtual

returns wallet status (Status_Ok | Status_Error)

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ statusWithErrorString()

virtual void Electroneum::Wallet::statusWithErrorString ( int &  status,
std::string &  errorString 
) const
pure virtual

returns both error and error string atomically. suggested to use in instead of status() and errorString()

Implemented in Electroneum::WalletImpl.

◆ store()

virtual bool Electroneum::Wallet::store ( const std::string &  path)
pure virtual

store - stores wallet to file.

Parameters
path- main filename to store wallet to. additionally stores address file and keys file. to store to the same file - just pass empty string;
Returns

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ subaddress()

virtual Subaddress* Electroneum::Wallet::subaddress ( )
pure virtual

Implemented in Electroneum::WalletImpl.

◆ subaddressAccount()

virtual SubaddressAccount* Electroneum::Wallet::subaddressAccount ( )
pure virtual

Implemented in Electroneum::WalletImpl.

◆ submitTransaction()

virtual bool Electroneum::Wallet::submitTransaction ( const std::string &  fileName)
pure virtual

submitTransaction - submits transaction in signed tx file

Returns
- true on success

Implemented in Electroneum::WalletImpl.

◆ synchronized()

virtual bool Electroneum::Wallet::synchronized ( ) const
pure virtual

synchronized - checks if wallet was ever synchronized

Returns

Implemented in Electroneum::WalletImpl.

◆ testnet()

bool Electroneum::Wallet::testnet ( ) const
inline

Definition at line 468 of file wallet2_api.h.

468 { return nettype() == TESTNET; }
virtual NetworkType nettype() const =0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ trustedDaemon()

virtual bool Electroneum::Wallet::trustedDaemon ( ) const
pure virtual

Implemented in Electroneum::WalletImpl.

◆ unblackballOutput()

virtual bool Electroneum::Wallet::unblackballOutput ( const std::string &  amount,
const std::string &  offset 
)
pure virtual

unblackballs an output

Implemented in Electroneum::WalletImpl.

◆ unlockedBalance()

virtual uint64_t Electroneum::Wallet::unlockedBalance ( uint32_t  accountIndex = 0,
bool  public_blockchain = false 
) const
pure virtual

Implemented in Electroneum::WalletImpl.

Here is the caller graph for this function:

◆ unlockedBalanceAll()

uint64_t Electroneum::Wallet::unlockedBalanceAll ( bool  public_blockchain) const
inline

Definition at line 611 of file wallet2_api.h.

611  {
612  uint64_t result = 0;
613  for (uint32_t i = 0; i < numSubaddressAccounts(); ++i)
614  result += unlockedBalance(i, public_blockchain);
615  return result;
616  }
virtual uint64_t unlockedBalance(uint32_t accountIndex=0, bool public_blockchain=false) const =0
unsigned int uint32_t
Definition: stdint.h:126
unsigned __int64 uint64_t
Definition: stdint.h:136
virtual size_t numSubaddressAccounts() const =0
numSubaddressAccounts - returns the number of existing subaddress accounts
Here is the call graph for this function:

◆ unlockKeysFile()

virtual bool Electroneum::Wallet::unlockKeysFile ( )
pure virtual

Implemented in Electroneum::WalletImpl.

◆ useForkRules()

virtual bool Electroneum::Wallet::useForkRules ( uint8_t  version,
int64_t  early_blocks 
) const
pure virtual

check if hard fork rules should be used

Implemented in Electroneum::WalletImpl.

◆ verifyMessageWithPublicKey()

virtual bool Electroneum::Wallet::verifyMessageWithPublicKey ( const std::string &  message,
const std::string &  publicKey,
const std::string &  signature 
) const
pure virtual

verifyMessageWithPublicKey verifies that message was signed with the given public key

Parameters
messagemessage
publicKeyhex encoded public key
signaturesignature of the message
Returns
true if the signature is correct. false and sets error state in case of error

Implemented in Electroneum::WalletImpl.

◆ verifySignedMessage()

virtual bool Electroneum::Wallet::verifySignedMessage ( const std::string &  message,
const std::string &  addres,
const std::string &  signature 
) const
pure virtual

verifySignedMessage - verify a signature matches a given message

Parameters
message- the message (arbitrary byte data)
address- the address the signature claims to be made with
signature- the signature
Returns
true if the signature verified, false otherwise

Implemented in Electroneum::WalletImpl.

◆ warning()

void Electroneum::Wallet::warning ( const std::string &  category,
const std::string &  str 
)
static

Definition at line 411 of file wallet.cpp.

411  {
412  MCWARNING(category.empty() ? ELECTRONEUM_DEFAULT_LOG_CATEGORY : category.c_str(), str);
413 }
#define MCWARNING(cat, x)
Definition: misc_log_ex.h:52
#define ELECTRONEUM_DEFAULT_LOG_CATEGORY
Definition: wallet.cpp:59

◆ watchOnly()

virtual bool Electroneum::Wallet::watchOnly ( ) const
pure virtual

watchOnly - checks if wallet is watch only

Returns
- true if watch only

Implemented in Electroneum::WalletImpl.


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