39 #include <boost/thread/mutex.hpp> 40 #include <boost/thread/thread.hpp> 41 #include <boost/thread/condition_variable.hpp> 45 class TransactionHistoryImpl;
46 class PendingTransactionImpl;
47 class UnsignedTransactionImpl;
48 class AddressBookImpl;
49 struct Wallet2CallbackImpl;
56 bool create(
const std::string &
path,
const std::string &password,
57 const std::string &language);
59 const std::string &language)
const;
60 bool open(
const std::string &
path,
const std::string &password);
63 const std::string &language,
64 const std::string &address_string,
65 const std::string &viewkey_string,
66 const std::string &spendkey_string =
"");
68 std::string
seed()
const;
77 std::string
path()
const;
85 bool init(
const std::string &daemon_address, uint64_t upper_transaction_size_limit = 0,
const std::string &daemon_username =
"",
const std::string &daemon_password =
"");
96 bool synchronized()
const;
123 virtual bool setUserNote(
const std::string &txid,
const std::string ¬e);
124 virtual std::string
getUserNote(
const std::string &txid)
const;
125 virtual std::string
getTxKey(
const std::string &txid)
const;
126 virtual std::string
signMessage(
const std::string &message);
130 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);
140 bool doInit(
const std::string &daemon_address, uint64_t upper_transaction_size_limit);
WalletImpl(bool testnet=false)
Definition: wallet.cpp:273
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)
Definition: wallet.cpp:1399
virtual void setListener(WalletListener *l)
Definition: wallet.cpp:1164
void setSeedLanguage(const std::string &arg)
Definition: wallet.cpp:582
Definition: wallet2_api.h:72
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="")
Definition: wallet.cpp:394
uint64_t unlockedBalance() const
Definition: wallet.cpp:700
std::string getSeedLanguage() const
Definition: wallet.cpp:577
std::string publicViewKey() const
publicViewKey - returns public view key
Definition: wallet.cpp:634
virtual void disposeTransaction(PendingTransaction *t)
disposeTransaction - destroys transaction object
Definition: wallet.cpp:1149
Wallet2CallbackImpl * m_wallet2Callback
Definition: wallet.h:156
boost::mutex m_refreshMutex
Definition: wallet.h:164
bool rescanSpent()
Definition: wallet.cpp:1409
boost::thread m_refreshThread
Definition: wallet.h:169
uint64_t approximateBlockChainHeight() const
approximateBlockChainHeight - returns approximate blockchain height calculated from date/time ...
Definition: wallet.cpp:709
void refreshAsync()
refreshAsync - refreshes wallet asynchronously.
Definition: wallet.cpp:774
int status() const
returns wallet status (Status_Ok | Status_Error)
Definition: wallet.cpp:587
std::atomic< bool > m_rebuildWalletCache
Definition: wallet.h:175
virtual bool verifySignedMessage(const std::string &message, const std::string &address, const std::string &signature) const
verifySignedMessage - verify a signature matches a given message
Definition: wallet.cpp:1216
WalletListener * m_walletListener
Definition: wallet.h:155
std::string publicSpendKey() const
publicSpendKey - returns public spend key
Definition: wallet.cpp:644
Definition: wallet.cpp:66
std::string integratedAddress(const std::string &payment_id) const
integratedAddress - returns integrated address for current wallet address and given payment_id...
Definition: wallet.cpp:615
uint64_t balance() const
Definition: wallet.cpp:695
std::string path() const
Definition: wallet.cpp:624
virtual PendingTransaction * createSweepUnmixableTransaction()
createSweepUnmixableTransaction creates transaction with unmixable outputs.
Definition: wallet.cpp:1057
bool recover(const std::string &path, const std::string &seed)
Definition: wallet.cpp:512
Definition: wallet2_api.h:48
bool daemonSynced() const
Definition: wallet.cpp:754
Priority
Definition: wallet2_api.h:71
void setAutoRefreshInterval(int millis)
setAutoRefreshInterval - setup interval for automatic refresh.
Definition: wallet.cpp:781
virtual UnsignedTransaction * loadUnsignedTx(const std::string &unsigned_filename)
loadUnsignedTx - creates transaction from unsigned tx file
Definition: wallet.cpp:797
ConnectionStatus connected() const
connected - checks if the wallet connected to the daemon
Definition: wallet.cpp:1240
void setRefreshFromBlockHeight(uint64_t refresh_from_block_height)
setRefreshFromBlockHeight - start refresh from block height on recover
Definition: wallet.cpp:685
Definition: unsigned_transaction.h:42
Definition: pending_transaction.h:42
bool setPassword(const std::string &password)
Definition: wallet.cpp:597
std::atomic< int > m_status
Definition: wallet.h:150
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...
Definition: wallet.cpp:677
boost::optional< epee::net_utils::http::login > m_daemon_login
Definition: wallet.h:178
uint64_t daemonBlockChainTargetHeight() const
daemonBlockChainTargetHeight - returns daemon blockchain target height
Definition: wallet.cpp:732
ConnectionStatus
Definition: wallet2_api.h:283
void refreshThreadFunc()
Definition: wallet.cpp:1272
bool store(const std::string &path)
store - stores wallet to file.
Definition: wallet.cpp:649
std::string secretSpendKey() const
secretSpendKey - returns secret spend key
Definition: wallet.cpp:639
bool importKeyImages(const std::string &filename)
importKeyImages - imports key images from file
Definition: wallet.cpp:864
virtual void startRefresh()
StartRefresh - Start/resume refresh thread (refresh every 10 seconds)
Definition: wallet.cpp:1333
void setTrustedDaemon(bool arg)
Definition: wallet.cpp:1251
std::string address() const
Definition: wallet.cpp:610
std::string errorString() const
in case error status, returns error string
Definition: wallet.cpp:592
void stopRefresh()
Definition: wallet.cpp:1344
std::atomic< bool > m_is_connected
Definition: wallet.h:177
int autoRefreshInterval() const
autoRefreshInterval - returns automatic refresh interval in millis
Definition: wallet.cpp:792
Interface for wallet operations. TODO: check if /include/IWallet.h is still actual.
Definition: wallet2_api.h:274
bool trustedDaemon() const
Definition: wallet.cpp:1256
std::string seed() const
Definition: wallet.cpp:569
TransactionHistoryImpl * m_history
Definition: wallet.h:153
Transaction-like interface for sending money.
Definition: wallet2_api.h:63
std::atomic< bool > m_refreshEnabled
Definition: wallet.h:160
void clearStatus() const
Definition: wallet.cpp:1266
AddressBookImpl * m_addressBook
Definition: wallet.h:157
boost::condition_variable m_refreshCV
Definition: wallet.h:168
virtual std::string getTxKey(const std::string &txid) const
Definition: wallet.cpp:1191
bool isNewWallet() const
Definition: wallet.cpp:1364
std::string m_errorString
Definition: wallet.h:151
void doRefresh()
Definition: wallet.cpp:1302
bool refresh()
refresh - refreshes the wallet, updating transactions from daemon
Definition: wallet.cpp:767
virtual std::string signMessage(const std::string &message)
Definition: wallet.cpp:1211
std::atomic< bool > m_refreshThreadDone
Definition: wallet.h:161
std::atomic< bool > m_synchronized
Definition: wallet.h:174
Definition: address_book.cpp:41
int l
Definition: base.py:3
bool close()
Definition: wallet.cpp:543
std::string secretViewKey() const
secretViewKey - returns secret view key
Definition: wallet.cpp:629
uint64_t blockChainHeight() const
blockChainHeight - returns current blockchain height
Definition: wallet.cpp:705
bool createWatchOnly(const std::string &path, const std::string &password, const std::string &language) const
createWatchOnly - Creates a watch only wallet
Definition: wallet.cpp:354
uint8_t version
Definition: blockchain.cpp:86
Definition: address_book.h:39
void hardForkInfo(uint8_t &version, uint64_t &earliest_height) const
returns current hard fork info
Definition: wallet.cpp:1429
bool connectToDaemon()
connectToDaemon - connects to the daemon. TODO: check if it can be removed
Definition: wallet.cpp:1228
tools::wallet2 * m_wallet
Definition: wallet.h:149
POD_CLASS signature
Definition: crypto.h:99
virtual bool setUserNote(const std::string &txid, const std::string ¬e)
Definition: wallet.cpp:1170
internal::NamedArgWithType< char, T > arg(StringRef name, const T &arg)
Definition: format.h:3450
std::string keysFilename() const
keysFilename - returns keys filename. usually this formed as "wallet_filename".keys ...
Definition: wallet.cpp:672
bool exportKeyImages(const std::string &filename)
exportKeyImages - exports key images to file
Definition: wallet.cpp:836
bool create(const std::string &path, const std::string &password, const std::string &language)
Definition: wallet.cpp:317
virtual std::string getUserNote(const std::string &txid) const
getUserNote - return an arbitrary string note attached to a txid
Definition: wallet.cpp:1181
Definition: wallet2_api.h:227
bool submitTransaction(const std::string &fileName)
submitTransaction - submits transaction in signed tx file
Definition: wallet.cpp:816
bool testnet() const
Definition: wallet.h:106
void setRecoveringFromSeed(bool recoveringFromSeed)
setRecoveringFromSeed - set state recover form seed
Definition: wallet.cpp:690
The TransactionHistory - interface for displaying transaction history.
Definition: wallet2_api.h:171
virtual AddressBook * addressBook() const
Definition: wallet.cpp:1159
bool open(const std::string &path, const std::string &password)
Definition: wallet.cpp:487
Definition: transaction_history.h:39
uint64_t getRefreshFromBlockHeight() const
getRestoreHeight - get wallet creation height
Definition: wallet.h:102
bool useForkRules(uint8_t version, int64_t early_blocks) const
check if hard fork rules should be used
Definition: wallet.cpp:1434
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 ...
Definition: wallet.cpp:894
bool watchOnly() const
watchOnly - checks if wallet is watch only
Definition: wallet.cpp:1261
uint64_t daemonBlockChainHeight() const
daemonBlockChainHeight - returns daemon blockchain height
Definition: wallet.cpp:713
bool doInit(const std::string &daemon_address, uint64_t upper_transaction_size_limit)
Definition: wallet.cpp:1374
std::atomic< int > m_refreshIntervalMillis
Definition: wallet.h:162
virtual TransactionHistory * history() const
Definition: wallet.cpp:1154
virtual std::string getDefaultDataDir() const
Definition: wallet.cpp:1404
Transaction-like interface for sending money.
Definition: wallet2_api.h:97
virtual void pauseRefresh()
pauseRefresh - pause refresh thread
Definition: wallet.cpp:1354
std::string filename() const
filename - returns wallet filename
Definition: wallet.cpp:667
std::string m_password
Definition: wallet.h:152
~WalletImpl()
Definition: wallet.cpp:300
The AddressBook - interface for Book.
Definition: wallet2_api.h:209
boost::mutex m_refreshMutex2
Definition: wallet.h:167
bool m_trustedDaemon
Definition: wallet.h:154
std::atomic< bool > m_recoveringFromSeed
Definition: wallet.h:173