|
Electroneum
|
#include <wallet.h>


Public Member Functions | |
| WalletImpl (bool testnet=false) | |
| ~WalletImpl () | |
| bool | create (const std::string &path, const std::string &password, const std::string &language) |
| bool | createWatchOnly (const std::string &path, const std::string &password, const std::string &language) const |
| createWatchOnly - Creates a watch only wallet More... | |
| bool | open (const std::string &path, const std::string &password) |
| bool | recover (const std::string &path, const std::string &seed) |
| bool | recoverFromKeys (const std::string &path, const std::string &language, const std::string &address_string, const std::string &viewkey_string, const std::string &spendkey_string="") |
| bool | close () |
| std::string | seed () const |
| std::string | getSeedLanguage () const |
| void | setSeedLanguage (const std::string &arg) |
| int | status () const |
| returns wallet status (Status_Ok | Status_Error) More... | |
| std::string | errorString () const |
| in case error status, returns error string More... | |
| bool | setPassword (const std::string &password) |
| std::string | address () const |
| std::string | integratedAddress (const std::string &payment_id) const |
| 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... | |
| std::string | path () const |
| std::string | secretViewKey () const |
| secretViewKey - returns secret view key More... | |
| std::string | publicViewKey () const |
| publicViewKey - returns public view key More... | |
| std::string | secretSpendKey () const |
| secretSpendKey - returns secret spend key More... | |
| std::string | publicSpendKey () const |
| publicSpendKey - returns public spend key More... | |
| bool | store (const std::string &path) |
| store - stores wallet to file. More... | |
| std::string | filename () const |
| filename - returns wallet filename More... | |
| std::string | keysFilename () const |
| keysFilename - returns keys filename. usually this formed as "wallet_filename".keys More... | |
| bool | init (const std::string &daemon_address, uint64_t upper_transaction_size_limit=0, const std::string &daemon_username="", const std::string &daemon_password="") |
| 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... | |
| bool | connectToDaemon () |
| connectToDaemon - connects to the daemon. TODO: check if it can be removed More... | |
| ConnectionStatus | connected () const |
| connected - checks if the wallet connected to the daemon More... | |
| void | setTrustedDaemon (bool arg) |
| bool | trustedDaemon () const |
| uint64_t | balance () const |
| uint64_t | unlockedBalance () const |
| uint64_t | blockChainHeight () const |
| blockChainHeight - returns current blockchain height More... | |
| uint64_t | approximateBlockChainHeight () const |
| approximateBlockChainHeight - returns approximate blockchain height calculated from date/time More... | |
| uint64_t | daemonBlockChainHeight () const |
| daemonBlockChainHeight - returns daemon blockchain height More... | |
| uint64_t | daemonBlockChainTargetHeight () const |
| daemonBlockChainTargetHeight - returns daemon blockchain target height More... | |
| bool | synchronized () const |
| synchronized - checks if wallet was ever synchronized More... | |
| bool | refresh () |
| refresh - refreshes the wallet, updating transactions from daemon More... | |
| void | refreshAsync () |
| refreshAsync - refreshes wallet asynchronously. More... | |
| void | setAutoRefreshInterval (int millis) |
| setAutoRefreshInterval - setup interval for automatic refresh. More... | |
| int | autoRefreshInterval () const |
| autoRefreshInterval - returns automatic refresh interval in millis More... | |
| void | setRefreshFromBlockHeight (uint64_t refresh_from_block_height) |
| setRefreshFromBlockHeight - start refresh from block height on recover More... | |
| uint64_t | getRefreshFromBlockHeight () const |
| getRestoreHeight - get wallet creation height More... | |
| void | setRecoveringFromSeed (bool recoveringFromSeed) |
| setRecoveringFromSeed - set state recover form seed More... | |
| bool | watchOnly () const |
| watchOnly - checks if wallet is watch only More... | |
| bool | rescanSpent () |
| bool | testnet () const |
| void | hardForkInfo (uint8_t &version, uint64_t &earliest_height) const |
| returns current hard fork info More... | |
| bool | useForkRules (uint8_t version, int64_t early_blocks) const |
| check if hard fork rules should be used More... | |
| PendingTransaction * | createTransaction (const std::string &dst_addr, const std::string &payment_id, optional< uint64_t > amount, uint32_t mixin_count, PendingTransaction::Priority priority=PendingTransaction::Priority_Low) |
| createTransaction creates transaction. if dst_addr is an integrated address, payment_id is ignored More... | |
| virtual PendingTransaction * | createSweepUnmixableTransaction () |
| createSweepUnmixableTransaction creates transaction with unmixable outputs. More... | |
| bool | submitTransaction (const std::string &fileName) |
| submitTransaction - submits transaction in signed tx file More... | |
| virtual UnsignedTransaction * | loadUnsignedTx (const std::string &unsigned_filename) |
| loadUnsignedTx - creates transaction from unsigned tx file More... | |
| bool | exportKeyImages (const std::string &filename) |
| exportKeyImages - exports key images to file More... | |
| bool | importKeyImages (const std::string &filename) |
| importKeyImages - imports key images from file More... | |
| virtual void | disposeTransaction (PendingTransaction *t) |
| disposeTransaction - destroys transaction object More... | |
| virtual TransactionHistory * | history () const |
| virtual AddressBook * | addressBook () const |
| virtual void | setListener (WalletListener *l) |
| virtual bool | setUserNote (const std::string &txid, const std::string ¬e) |
| virtual std::string | getUserNote (const std::string &txid) const |
| getUserNote - return an arbitrary string note attached to a txid More... | |
| virtual std::string | getTxKey (const std::string &txid) const |
| virtual std::string | signMessage (const std::string &message) |
| virtual bool | verifySignedMessage (const std::string &message, const std::string &address, const std::string &signature) const |
| verifySignedMessage - verify a signature matches a given message More... | |
| virtual void | startRefresh () |
| StartRefresh - Start/resume refresh thread (refresh every 10 seconds) More... | |
| virtual void | pauseRefresh () |
| pauseRefresh - pause refresh thread 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) |
| virtual std::string | getDefaultDataDir () const |
Public Member Functions inherited from Electroneum::Wallet | |
| virtual | ~Wallet ()=0 |
Private Member Functions | |
| void | clearStatus () const |
| void | refreshThreadFunc () |
| void | doRefresh () |
| bool | daemonSynced () const |
| void | stopRefresh () |
| bool | isNewWallet () const |
| bool | doInit (const std::string &daemon_address, uint64_t upper_transaction_size_limit) |
Private Attributes | |
| tools::wallet2 * | m_wallet |
| std::atomic< int > | m_status |
| std::string | m_errorString |
| std::string | m_password |
| TransactionHistoryImpl * | m_history |
| bool | m_trustedDaemon |
| WalletListener * | m_walletListener |
| Wallet2CallbackImpl * | m_wallet2Callback |
| AddressBookImpl * | m_addressBook |
| std::atomic< bool > | m_refreshEnabled |
| std::atomic< bool > | m_refreshThreadDone |
| std::atomic< int > | m_refreshIntervalMillis |
| boost::mutex | m_refreshMutex |
| boost::mutex | m_refreshMutex2 |
| boost::condition_variable | m_refreshCV |
| boost::thread | m_refreshThread |
| std::atomic< bool > | m_recoveringFromSeed |
| std::atomic< bool > | m_synchronized |
| std::atomic< bool > | m_rebuildWalletCache |
| std::atomic< bool > | m_is_connected |
| boost::optional< epee::net_utils::http::login > | m_daemon_login {} |
Friends | |
| class | PendingTransactionImpl |
| class | UnsignedTransactionImpl |
| class | TransactionHistoryImpl |
| struct | Wallet2CallbackImpl |
| class | AddressBookImpl |
Additional Inherited Members | |
Public Types inherited from Electroneum::Wallet | |
| enum | Status { Status_Ok, Status_Error, Status_Critical } |
| enum | ConnectionStatus { ConnectionStatus_Disconnected, ConnectionStatus_Connected, ConnectionStatus_WrongVersion } |
Static Public Member Functions inherited from Electroneum::Wallet | |
| 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, bool testnet) |
| 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, bool testnet) |
| static uint64_t | maximumAllowedAmount () |
| static void | init (const char *argv0, const char *default_log_base_name) |
| static void | debug (const std::string &str) |
| Electroneum::WalletImpl::~WalletImpl | ( | ) |
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
approximateBlockChainHeight - returns approximate blockchain height calculated from date/time
Implements Electroneum::Wallet.
|
virtual |
autoRefreshInterval - returns automatic refresh interval in millis
Implements Electroneum::Wallet.
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
|
private |
| bool Electroneum::WalletImpl::close | ( | ) |
|
virtual |
connected - checks if the wallet connected to the daemon
Implements Electroneum::Wallet.
|
virtual |
connectToDaemon - connects to the daemon. TODO: check if it can be removed
Implements Electroneum::Wallet.
| bool Electroneum::WalletImpl::create | ( | const std::string & | path, |
| const std::string & | password, | ||
| const std::string & | language | ||
| ) |
|
virtual |
createSweepUnmixableTransaction creates transaction with unmixable outputs.
Implements Electroneum::Wallet.
|
virtual |
createTransaction creates transaction. if dst_addr is an integrated address, payment_id is ignored
| dst_addr | destination address as string |
| payment_id | optional payment_id, can be empty string |
| amount | amount |
| mixin_count | mixin count. if 0 passed, wallet will use default value |
| priority |
Implements Electroneum::Wallet.
|
virtual |
createWatchOnly - Creates a watch only wallet
| path | - where to store the wallet |
| password | |
| language |
Implements Electroneum::Wallet.
|
virtual |
daemonBlockChainHeight - returns daemon blockchain height
Implements Electroneum::Wallet.
|
virtual |
daemonBlockChainTargetHeight - returns daemon blockchain target height
Implements Electroneum::Wallet.
|
private |
|
virtual |
disposeTransaction - destroys transaction object
| t | - pointer to the "PendingTransaction" object. Pointer is not valid after function returned; |
Implements Electroneum::Wallet.
|
private |
|
private |
|
virtual |
in case error status, returns error string
Implements Electroneum::Wallet.
|
virtual |
exportKeyImages - exports key images to file
| filename |
Implements Electroneum::Wallet.
|
virtual |
|
virtual |
Implements Electroneum::Wallet.
|
inlinevirtual |
getRestoreHeight - get wallet creation height
Implements Electroneum::Wallet.
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
getUserNote - return an arbitrary string note attached to a txid
| txid | - the transaction id to attach the note to |
Implements Electroneum::Wallet.
|
virtual |
returns current hard fork info
Implements Electroneum::Wallet.
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
importKeyImages - imports key images from file
| filename |
Implements Electroneum::Wallet.
|
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.
| daemon_address | - daemon address in "hostname:port" format |
| upper_transaction_size_limit |
Implements Electroneum::Wallet.
|
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
| payment_id | - 16 characters hexadecimal string or empty string if new random payment id needs to be generated |
Implements Electroneum::Wallet.
|
private |
|
virtual |
keysFilename - returns keys filename. usually this formed as "wallet_filename".keys
Implements Electroneum::Wallet.
|
virtual |
loadUnsignedTx - creates transaction from unsigned tx file
Implements Electroneum::Wallet.
| bool Electroneum::WalletImpl::open | ( | const std::string & | path, |
| const std::string & | password | ||
| ) |
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
pauseRefresh - pause refresh thread
Implements Electroneum::Wallet.
|
virtual |
|
virtual |
| bool Electroneum::WalletImpl::recover | ( | const std::string & | path, |
| const std::string & | seed | ||
| ) |
| bool Electroneum::WalletImpl::recoverFromKeys | ( | const std::string & | path, |
| const std::string & | language, | ||
| const std::string & | address_string, | ||
| const std::string & | viewkey_string, | ||
| const std::string & | spendkey_string = "" |
||
| ) |
|
virtual |
refresh - refreshes the wallet, updating transactions from daemon
Implements Electroneum::Wallet.
|
virtual |
refreshAsync - refreshes wallet asynchronously.
Implements Electroneum::Wallet.
|
private |
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
|
virtual |
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
setAutoRefreshInterval - setup interval for automatic refresh.
| seconds | - interval in millis. if zero or less than zero - automatic refresh disabled; |
Implements Electroneum::Wallet.
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
setRecoveringFromSeed - set state recover form seed
| recoveringFromSeed | - true/false |
Implements Electroneum::Wallet.
|
virtual |
setRefreshFromBlockHeight - start refresh from block height on recover
| refresh_from_block_height | - blockchain start height |
Implements Electroneum::Wallet.
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
StartRefresh - Start/resume refresh thread (refresh every 10 seconds)
Implements Electroneum::Wallet.
|
virtual |
returns wallet status (Status_Ok | Status_Error)
Implements Electroneum::Wallet.
|
private |
|
virtual |
store - stores wallet to file.
| path | - main filename to store wallet to. additionally stores address file and keys file. to store to the same file - just pass empty string; |
Implements Electroneum::Wallet.
|
virtual |
submitTransaction - submits transaction in signed tx file
Implements Electroneum::Wallet.
|
virtual |
|
inlinevirtual |
Implements Electroneum::Wallet.
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
Implements Electroneum::Wallet.
|
virtual |
check if hard fork rules should be used
Implements Electroneum::Wallet.
|
virtual |
verifySignedMessage - verify a signature matches a given message
| message | - the message (arbitrary byte data) |
| address | - the address the signature claims to be made with |
| signature | - the signature |
Implements Electroneum::Wallet.
|
virtual |
watchOnly - checks if wallet is watch only
Implements Electroneum::Wallet.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
|
private |
|
mutableprivate |
|
private |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
1.8.14