Electroneum
Loading...
Searching...
No Matches
wallet.h
Go to the documentation of this file.
1// Copyrights(c) 2017-2021, The Electroneum Project
2// Copyrights(c) 2014-2019, The Monero Project
3//
4// All rights reserved.
5//
6// Redistribution and use in source and binary forms, with or without modification, are
7// permitted provided that the following conditions are met:
8//
9// 1. Redistributions of source code must retain the above copyright notice, this list of
10// conditions and the following disclaimer.
11//
12// 2. Redistributions in binary form must reproduce the above copyright notice, this list
13// of conditions and the following disclaimer in the documentation and/or other
14// materials provided with the distribution.
15//
16// 3. Neither the name of the copyright holder nor the names of its contributors may be
17// used to endorse or promote products derived from this software without specific
18// prior written permission.
19//
20// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
21// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
23// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
28// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29//
30// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
31
32#ifndef WALLET_IMPL_H
33#define WALLET_IMPL_H
34
36#include "wallet/wallet2.h"
37
38#include <string>
39#include <boost/thread/mutex.hpp>
40#include <boost/thread/thread.hpp>
41#include <boost/thread/condition_variable.hpp>
42
43
44namespace Electroneum {
48class AddressBookImpl;
49class SubaddressImpl;
52
53class WalletImpl : public Wallet
54{
55public:
58 bool create(const std::string &path, const std::string &password,
59 const std::string &language);
60 bool createWatchOnly(const std::string &path, const std::string &password,
61 const std::string &language) const override;
62 bool open(const std::string &path, const std::string &password);
63 bool recover(const std::string &path,const std::string &password,
64 const std::string &seed);
65 bool recoverFromKeysWithPassword(const std::string &path,
66 const std::string &password,
67 const std::string &language,
68 const std::string &address_string,
69 const std::string &viewkey_string,
70 const std::string &spendkey_string = "");
71 // following two methods are deprecated since they create passwordless wallets
72 // use the two equivalent methods above
73 bool recover(const std::string &path, const std::string &seed);
74 // deprecated: use recoverFromKeysWithPassword() instead
75 bool recoverFromKeys(const std::string &path,
76 const std::string &language,
77 const std::string &address_string,
78 const std::string &viewkey_string,
79 const std::string &spendkey_string = "");
80 bool recoverFromDevice(const std::string &path,
81 const std::string &password,
82 const std::string &device_name);
83 Device getDeviceType() const override;
84 bool close(bool store = true);
85 std::string seed() const override;
86 std::string getSeedLanguage() const override;
87 void setSeedLanguage(const std::string &arg) override;
88 // void setListener(Listener *) {}
89 int status() const override;
90 std::string errorString() const override;
91 void statusWithErrorString(int& status, std::string& errorString) const override;
92 bool setPassword(const std::string &password) override;
93 bool setDevicePin(const std::string &password) override;
94 bool setDevicePassphrase(const std::string &password) override;
95 std::string address(uint32_t accountIndex = 0, uint32_t addressIndex = 0) const override;
96 std::string integratedAddress(const std::string &payment_id) const override;
97 std::string secretViewKey() const override;
98 std::string publicViewKey() const override;
99 std::string secretSpendKey() const override;
100 std::string publicSpendKey() const override;
101 std::string publicMultisigSignerKey() const override;
102 std::string path() const override;
103 bool store(const std::string &path) override;
104 std::string filename() const override;
105 std::string keysFilename() const override;
106 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) override;
107 bool connectToDaemon() override;
108 ConnectionStatus connected() const override;
109 void setTrustedDaemon(bool arg) override;
110 bool trustedDaemon() const override;
111 uint64_t balance(uint32_t accountIndex = 0, bool public_blockchain = false) const override;
112 uint64_t unlockedBalance(uint32_t accountIndex = 0, bool public_blockchain = false) const override;
113 uint64_t blockChainHeight() const override;
114 uint64_t approximateBlockChainHeight() const override;
115 uint64_t estimateBlockChainHeight() const override;
116 uint64_t daemonBlockChainHeight() const override;
117 uint64_t daemonBlockChainTargetHeight() const override;
118 bool synchronized() const override;
119 bool refresh() override;
120 void refreshAsync() override;
121 bool rescanBlockchain() override;
122 void rescanBlockchainAsync() override;
123 void setAutoRefreshInterval(int millis) override;
124 int autoRefreshInterval() const override;
125 void setRefreshFromBlockHeight(uint64_t refresh_from_block_height) override;
126 uint64_t getRefreshFromBlockHeight() const override { return m_wallet->get_refresh_from_block_height(); };
127 void setRecoveringFromSeed(bool recoveringFromSeed) override;
128 void setRecoveringFromDevice(bool recoveringFromDevice) override;
129 void setSubaddressLookahead(uint32_t major, uint32_t minor) override;
130 bool watchOnly() const override;
131 bool rescanSpent() override;
132 NetworkType nettype() const override {return static_cast<NetworkType>(m_wallet->nettype());}
133 void hardForkInfo(uint8_t &version, uint64_t &earliest_height) const override;
134 bool useForkRules(uint8_t version, int64_t early_blocks) const override;
135
136 void addSubaddressAccount(const std::string& label) override;
137 size_t numSubaddressAccounts() const override;
138 size_t numSubaddresses(uint32_t accountIndex) const override;
139 void addSubaddress(uint32_t accountIndex, const std::string& label) override;
140 std::string getSubaddressLabel(uint32_t accountIndex, uint32_t addressIndex) const override;
141 void setSubaddressLabel(uint32_t accountIndex, uint32_t addressIndex, const std::string &label) override;
142
143 MultisigState multisig() const override;
144 std::string getMultisigInfo() const override;
145 std::string makeMultisig(const std::vector<std::string>& info, uint32_t threshold) override;
146 std::string exchangeMultisigKeys(const std::vector<std::string> &info) override;
147 bool finalizeMultisig(const std::vector<std::string>& extraMultisigInfo) override;
148 bool exportMultisigImages(std::string& images) override;
149 size_t importMultisigImages(const std::vector<std::string>& images) override;
150 bool hasMultisigPartialKeyImages() const override;
151 PendingTransaction* restoreMultisigTransaction(const std::string& signData) override;
152
153 PendingTransaction * createTransaction(const std::string &dst_addr, const std::string &payment_id,
154 optional<uint64_t> amount, uint32_t mixin_count,
156 uint32_t subaddr_account = 0,
157 std::set<uint32_t> subaddr_indices = {}) override;
158 virtual PendingTransaction * createSweepUnmixableTransaction() override;
159 bool submitTransaction(const std::string &fileName) override;
160 virtual UnsignedTransaction * loadUnsignedTx(const std::string &unsigned_filename) override;
161 bool exportKeyImages(const std::string &filename) override;
162 bool importKeyImages(const std::string &filename) override;
163
164 virtual void disposeTransaction(PendingTransaction * t) override;
165 virtual TransactionHistory * history() override;
166 virtual AddressBook * addressBook() override;
167 virtual Subaddress * subaddress() override;
168 virtual SubaddressAccount * subaddressAccount() override;
169 virtual void setListener(WalletListener * l) override;
170 virtual uint32_t defaultMixin() const override;
171 virtual void setDefaultMixin(uint32_t arg) override;
172 virtual bool setUserNote(const std::string &txid, const std::string &note) override;
173 virtual std::string getUserNote(const std::string &txid) const override;
174 virtual std::string getTxKey(const std::string &txid) const override;
175 virtual bool checkTxKey(const std::string &txid, std::string tx_key, const std::string &address, uint64_t &received, bool &in_pool, uint64_t &confirmations) override;
176 virtual std::string getTxProof(const std::string &txid, const std::string &address, const std::string &message) const override;
177 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) override;
178 virtual std::string getSpendProof(const std::string &txid, const std::string &message) const override;
179 virtual bool checkSpendProof(const std::string &txid, const std::string &message, const std::string &signature, bool &good) const override;
180 virtual std::string getReserveProof(bool all, uint32_t account_index, uint64_t amount, const std::string &message) const override;
181 virtual bool checkReserveProof(const std::string &address, const std::string &message, const std::string &signature, bool &good, uint64_t &total, uint64_t &spent) const override;
182 virtual std::string signMessage(const std::string &message) override;
183 virtual bool verifySignedMessage(const std::string &message, const std::string &address, const std::string &signature) const override;
184 virtual std::string signMultisigParticipant(const std::string &message) const override;
185 virtual bool verifyMessageWithPublicKey(const std::string &message, const std::string &publicKey, const std::string &signature) const override;
186 virtual void startRefresh() override;
187 virtual void pauseRefresh() override;
188 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) override;
189 virtual std::string getDefaultDataDir() const override;
190 virtual bool lightWalletLogin(bool &isNewWallet) const override;
191 virtual bool lightWalletImportWalletRequest(std::string &payment_id, uint64_t &fee, bool &new_request, bool &request_fulfilled, std::string &payment_address, std::string &status) override;
192 virtual bool blackballOutputs(const std::vector<std::string> &outputs, bool add) override;
193 virtual bool blackballOutput(const std::string &amount, const std::string &offset) override;
194 virtual bool unblackballOutput(const std::string &amount, const std::string &offset) override;
195 virtual bool getRing(const std::string &key_image, std::vector<uint64_t> &ring) const override;
196 virtual bool getRings(const std::string &txid, std::vector<std::pair<std::string, std::vector<uint64_t>>> &rings) const override;
197 virtual bool setRing(const std::string &key_image, const std::vector<uint64_t> &ring, bool relative) override;
198 virtual void segregatePreForkOutputs(bool segregate) override;
199 virtual void segregationHeight(uint64_t height) override;
200 virtual void keyReuseMitigation2(bool mitigation) override;
201 virtual bool lockKeysFile() override;
202 virtual bool unlockKeysFile() override;
203 virtual bool isKeysFileLocked() override;
204 virtual uint64_t coldKeyImageSync(uint64_t &spent, uint64_t &unspent) override;
205
206private:
207 void clearStatus() const;
208 void setStatusError(const std::string& message) const;
209 void setStatusCritical(const std::string& message) const;
210 void setStatus(int status, const std::string& message) const;
211 void refreshThreadFunc();
212 void doRefresh();
213 bool daemonSynced() const;
214 void stopRefresh();
215 bool isNewWallet() const;
216 void pendingTxPostProcess(PendingTransactionImpl * pending);
217 bool doInit(const std::string &daemon_address, uint64_t upper_transaction_size_limit = 0, bool ssl = false);
218
219private:
223 friend struct Wallet2CallbackImpl;
224 friend class AddressBookImpl;
225 friend class SubaddressImpl;
227
228 std::unique_ptr<tools::wallet2> m_wallet;
229 mutable boost::mutex m_statusMutex;
230 mutable int m_status;
231 mutable std::string m_errorString;
232 std::string m_password;
233 std::unique_ptr<TransactionHistoryImpl> m_history;
234 std::unique_ptr<Wallet2CallbackImpl> m_wallet2Callback;
235 std::unique_ptr<AddressBookImpl> m_addressBook;
236 std::unique_ptr<SubaddressImpl> m_subaddress;
237 std::unique_ptr<SubaddressAccountImpl> m_subaddressAccount;
238
239 // multi-threaded refresh stuff
240 std::atomic<bool> m_refreshEnabled;
241 std::atomic<bool> m_refreshThreadDone;
242 std::atomic<int> m_refreshIntervalMillis;
243 std::atomic<bool> m_refreshShouldRescan;
244 // synchronizing refresh loop;
245 boost::mutex m_refreshMutex;
246
247 // synchronizing sync and async refresh
248 boost::mutex m_refreshMutex2;
249 boost::condition_variable m_refreshCV;
250 boost::thread m_refreshThread;
251 // flag indicating wallet is recovering from seed
252 // so it shouldn't be considered as new and pull blocks (slow-refresh)
253 // instead of pulling hashes (fast-refresh)
254 std::atomic<bool> m_recoveringFromSeed;
255 std::atomic<bool> m_recoveringFromDevice;
256 std::atomic<bool> m_synchronized;
257 std::atomic<bool> m_rebuildWalletCache;
258 // cache connection status to avoid unnecessary RPC calls
259 mutable std::atomic<bool> m_is_connected;
260 boost::optional<epee::net_utils::http::login> m_daemon_login{};
261};
262
263
264} // namespace
265
266namespace Bitelectroneum = Electroneum;
267
268#endif
269
uint64_t height
uint8_t version
uint8_t threshold
virtual std::string signMultisigParticipant(const std::string &message) const override
signMultisigParticipant signs given message with the multisig public signer key
Definition wallet.cpp:1965
friend class SubaddressAccountImpl
Definition wallet.h:226
void addSubaddressAccount(const std::string &label) override
addSubaddressAccount - appends a new subaddress account at the end of the last major index of existin...
Definition wallet.cpp:1206
virtual AddressBook * addressBook() override
Definition wallet.cpp:1679
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) override
Definition wallet.cpp:2222
virtual SubaddressAccount * subaddressAccount() override
Definition wallet.cpp:1689
int status() const override
returns wallet status (Status_Ok | Status_Error)
Definition wallet.cpp:808
virtual UnsignedTransaction * loadUnsignedTx(const std::string &unsigned_filename) override
loadUnsignedTx - creates transaction from unsigned tx file
Definition wallet.cpp:1123
std::string path() const override
Definition wallet.cpp:904
void hardForkInfo(uint8_t &version, uint64_t &earliest_height) const override
returns current hard fork info
Definition wallet.cpp:2250
size_t numSubaddressAccounts() const override
numSubaddressAccounts - returns the number of existing subaddress accounts
Definition wallet.cpp:1210
void rescanBlockchainAsync() override
rescanBlockchainAsync - rescans wallet asynchronously, starting from genesys
Definition wallet.cpp:1101
friend class SubaddressImpl
Definition wallet.h:225
virtual uint64_t coldKeyImageSync(uint64_t &spent, uint64_t &unspent) override
cold-device protocol key image sync
Definition wallet.cpp:2428
void statusWithErrorString(int &status, std::string &errorString) const override
returns both error and error string atomically. suggested to use in instead of status() and errorStri...
Definition wallet.cpp:820
uint64_t getRefreshFromBlockHeight() const override
getRestoreHeight - get wallet creation height
Definition wallet.h:126
virtual std::string getTxKey(const std::string &txid) const override
Definition wallet.cpp:1731
uint64_t daemonBlockChainTargetHeight() const override
daemonBlockChainTargetHeight - returns daemon blockchain target height
Definition wallet.cpp:1042
std::string makeMultisig(const std::vector< std::string > &info, uint32_t threshold) override
makeMultisig - switches wallet in multisig state. The one and only creation phase for N / N wallets
Definition wallet.cpp:1267
bool open(const std::string &path, const std::string &password)
Definition wallet.cpp:699
bool trustedDaemon() const override
Definition wallet.cpp:2038
virtual void segregatePreForkOutputs(bool segregate) override
sets whether pre-fork outs are to be segregated
Definition wallet.cpp:2398
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:572
virtual void startRefresh() override
StartRefresh - Start/resume refresh thread (refresh every 10 seconds).
Definition wallet.cpp:2140
bool setPassword(const std::string &password) override
Definition wallet.cpp:826
bool recover(const std::string &path, const std::string &password, const std::string &seed)
Definition wallet.cpp:730
bool createWatchOnly(const std::string &path, const std::string &password, const std::string &language) const override
createWatchOnly - Creates a watch only wallet
Definition wallet.cpp:506
virtual bool checkTxKey(const std::string &txid, std::string tx_key, const std::string &address, uint64_t &received, bool &in_pool, uint64_t &confirmations) override
Definition wallet.cpp:1758
bool setDevicePassphrase(const std::string &password) override
Definition wallet.cpp:849
virtual uint32_t defaultMixin() const override
defaultMixin - returns number of mixins used in transactions
Definition wallet.cpp:1700
std::string publicMultisigSignerKey() const override
publicMultisigSignerKey - returns public signer key
Definition wallet.cpp:894
bool store(const std::string &path) override
store - stores wallet to file.
Definition wallet.cpp:909
bool importKeyImages(const std::string &filename) override
importKeyImages - imports key images from file
Definition wallet.cpp:1183
virtual void segregationHeight(uint64_t height) override
sets the height where segregation should occur
Definition wallet.cpp:2403
std::string secretViewKey() const override
secretViewKey - returns secret view key
Definition wallet.cpp:874
uint64_t approximateBlockChainHeight() const override
approximateBlockChainHeight - returns approximate blockchain height calculated from date/time
Definition wallet.cpp:1013
virtual void disposeTransaction(PendingTransaction *t) override
disposeTransaction - destroys transaction object
Definition wallet.cpp:1669
virtual Subaddress * subaddress() override
Definition wallet.cpp:1684
uint64_t unlockedBalance(uint32_t accountIndex=0, bool public_blockchain=false) const override
Definition wallet.cpp:1001
bool rescanBlockchain() override
rescanBlockchain - rescans the wallet, updating transactions from daemon
Definition wallet.cpp:1093
virtual bool getRings(const std::string &txid, std::vector< std::pair< std::string, std::vector< uint64_t > > > &rings) const override
gets the rings used for a txid, if any
Definition wallet.cpp:2359
bool setDevicePin(const std::string &password) override
Definition wallet.cpp:838
PendingTransaction * restoreMultisigTransaction(const std::string &signData) override
restoreMultisigTransaction creates PendingTransaction from signData
Definition wallet.cpp:1374
std::string keysFilename() const override
keysFilename - returns keys filename. usually this formed as "wallet_filename".keys
Definition wallet.cpp:932
void setSubaddressLookahead(uint32_t major, uint32_t minor) override
setSubaddressLookahead - set size of subaddress lookahead
Definition wallet.cpp:991
virtual bool checkSpendProof(const std::string &txid, const std::string &message, const std::string &signature, bool &good) const override
Definition wallet.cpp:1883
virtual std::string getTxProof(const std::string &txid, const std::string &address, const std::string &message) const override
Definition wallet.cpp:1806
NetworkType nettype() const override
Definition wallet.h:132
virtual bool lockKeysFile() override
locks/unlocks the keys file; returns true on success
Definition wallet.cpp:2413
int autoRefreshInterval() const override
autoRefreshInterval - returns automatic refresh interval in millis
Definition wallet.cpp:1118
WalletImpl(NetworkType nettype=MAINNET, uint64_t kdf_rounds=1)
Definition wallet.cpp:420
virtual std::string getSpendProof(const std::string &txid, const std::string &message) const override
Definition wallet.cpp:1863
friend class PendingTransactionImpl
Definition wallet.h:220
virtual bool verifyMessageWithPublicKey(const std::string &message, const std::string &publicKey, const std::string &signature) const override
verifyMessageWithPublicKey verifies that message was signed with the given public key
Definition wallet.cpp:1986
std::string exchangeMultisigKeys(const std::vector< std::string > &info) override
exchange_multisig_keys - provides additional key exchange round for arbitrary multisig schemes (like ...
Definition wallet.cpp:1284
bool hasMultisigPartialKeyImages() const override
hasMultisigPartialKeyImages - checks if wallet needs to import multisig key images from other partici...
Definition wallet.cpp:1360
friend struct Wallet2CallbackImpl
Definition wallet.h:223
virtual bool checkReserveProof(const std::string &address, const std::string &message, const std::string &signature, bool &good, uint64_t &total, uint64_t &spent) const override
Definition wallet.cpp:1923
virtual bool setRing(const std::string &key_image, const std::vector< uint64_t > &ring, bool relative) override
sets the ring used for a key image
Definition wallet.cpp:2381
virtual bool unblackballOutput(const std::string &amount, const std::string &offset) override
unblackballs an output
Definition wallet.cpp:2320
void setRefreshFromBlockHeight(uint64_t refresh_from_block_height) override
setRefreshFromBlockHeight - start refresh from block height on recover
Definition wallet.cpp:976
Device getDeviceType() const override
Queries backing device for wallet keys.
Definition wallet.cpp:694
virtual bool blackballOutput(const std::string &amount, const std::string &offset) override
blackballs an output
Definition wallet.cpp:2298
virtual std::string getUserNote(const std::string &txid) const override
getUserNote - return an arbitrary string note attached to a txid
Definition wallet.cpp:1721
bool watchOnly() const override
watchOnly - checks if wallet is watch only
Definition wallet.cpp:2043
virtual void keyReuseMitigation2(bool mitigation) override
secondary key reuse mitigation
Definition wallet.cpp:2408
virtual bool blackballOutputs(const std::vector< std::string > &outputs, bool add) override
blackballs a set of outputs
Definition wallet.cpp:2260
std::string publicViewKey() const override
publicViewKey - returns public view key
Definition wallet.cpp:879
void setRecoveringFromSeed(bool recoveringFromSeed) override
setRecoveringFromSeed - set state recover form seed
Definition wallet.cpp:981
uint64_t balance(uint32_t accountIndex=0, bool public_blockchain=false) const override
Definition wallet.cpp:996
virtual bool verifySignedMessage(const std::string &message, const std::string &address, const std::string &signature) const override
verifySignedMessage - verify a signature matches a given message
Definition wallet.cpp:1955
std::string getSeedLanguage() const override
Definition wallet.cpp:798
std::string errorString() const override
in case error status, returns error string
Definition wallet.cpp:814
bool refresh() override
refresh - refreshes the wallet, updating transactions from daemon
Definition wallet.cpp:1077
std::string getSubaddressLabel(uint32_t accountIndex, uint32_t addressIndex) const override
getSubaddressLabel - gets the label of the specified subaddress
Definition wallet.cpp:1222
virtual std::string getReserveProof(bool all, uint32_t account_index, uint64_t amount, const std::string &message) const override
getReserveProof - Generates a proof that proves the reserve of unspent funds Parameters account_index...
Definition wallet.cpp:1905
std::string getMultisigInfo() const override
getMultisigInfo
Definition wallet.cpp:1255
uint64_t estimateBlockChainHeight() const override
estimateBlockChainHeight - returns estimate blockchain height. More accurate than approximateBlockCha...
Definition wallet.cpp:1018
void setSeedLanguage(const std::string &arg) override
Definition wallet.cpp:803
virtual void setListener(WalletListener *l) override
Definition wallet.cpp:1694
bool useForkRules(uint8_t version, int64_t early_blocks) const override
check if hard fork rules should be used
Definition wallet.cpp:2255
bool recoverFromDevice(const std::string &path, const std::string &password, const std::string &device_name)
Definition wallet.cpp:677
uint64_t daemonBlockChainHeight() const override
daemonBlockChainHeight - returns daemon blockchain height
Definition wallet.cpp:1023
virtual bool unlockKeysFile() override
Definition wallet.cpp:2418
std::string secretSpendKey() const override
secretSpendKey - returns secret spend key
Definition wallet.cpp:884
bool close(bool store=true)
Definition wallet.cpp:762
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, uint32_t subaddr_account=0, std::set< uint32_t > subaddr_indices={}) override
createTransaction creates transaction. if dst_addr is an integrated address, payment_id is ignored
Definition wallet.cpp:1412
void addSubaddress(uint32_t accountIndex, const std::string &label) override
addSubaddress - appends a new subaddress at the end of the last minor index of the specified subaddre...
Definition wallet.cpp:1218
friend class UnsignedTransactionImpl
Definition wallet.h:221
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) override
Definition wallet.cpp:1834
void setTrustedDaemon(bool arg) override
Definition wallet.cpp:2033
void setSubaddressLabel(uint32_t accountIndex, uint32_t addressIndex, const std::string &label) override
setSubaddressLabel - sets the label of the specified subaddress
Definition wallet.cpp:1235
void refreshAsync() override
refreshAsync - refreshes wallet asynchronously.
Definition wallet.cpp:1086
virtual bool getRing(const std::string &key_image, std::vector< uint64_t > &ring) const override
gets the ring used for a key image, if any
Definition wallet.cpp:2342
friend class TransactionHistoryImpl
Definition wallet.h:222
virtual bool lightWalletLogin(bool &isNewWallet) const override
Light wallet authenticate and login.
Definition wallet.cpp:946
bool rescanSpent() override
Definition wallet.cpp:2232
bool create(const std::string &path, const std::string &password, const std::string &language)
Definition wallet.cpp:469
virtual PendingTransaction * createSweepUnmixableTransaction() override
createSweepUnmixableTransaction creates transaction with unmixable outputs.
Definition wallet.cpp:1587
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) override
init - initializes wallet with daemon connection params. if daemon_address is local address,...
Definition wallet.cpp:937
std::string integratedAddress(const std::string &payment_id) const override
integratedAddress - returns integrated address for current wallet address and given payment_id....
Definition wallet.cpp:865
ConnectionStatus connected() const override
connected - checks if the wallet connected to the daemon
Definition wallet.cpp:2021
friend class AddressBookImpl
Definition wallet.h:224
void setRecoveringFromDevice(bool recoveringFromDevice) override
setRecoveringFromDevice - set state to recovering from device
Definition wallet.cpp:986
virtual void pauseRefresh() override
pauseRefresh - pause refresh thread
Definition wallet.cpp:2161
virtual std::string signMessage(const std::string &message) override
Definition wallet.cpp:1950
uint64_t blockChainHeight() const override
blockChainHeight - returns current blockchain height
Definition wallet.cpp:1006
bool submitTransaction(const std::string &fileName) override
submitTransaction - submits transaction in signed tx file
Definition wallet.cpp:1140
bool exportMultisigImages(std::string &images) override
exportMultisigImages - exports transfers' key images
Definition wallet.cpp:1316
bool recoverFromKeysWithPassword(const std::string &path, const std::string &password, const std::string &language, const std::string &address_string, const std::string &viewkey_string, const std::string &spendkey_string="")
Definition wallet.cpp:581
virtual bool setUserNote(const std::string &txid, const std::string &note) override
setUserNote - attach an arbitrary string note to a txid
Definition wallet.cpp:1710
MultisigState multisig() const override
multisig - returns current state of multisig wallet creation process
Definition wallet.cpp:1248
virtual bool lightWalletImportWalletRequest(std::string &payment_id, uint64_t &fee, bool &new_request, bool &request_fulfilled, std::string &payment_address, std::string &status) override
Initiates a light wallet import wallet request.
Definition wallet.cpp:951
virtual void setDefaultMixin(uint32_t arg) override
setDefaultMixin - setum number of mixins to be used for new transactions
Definition wallet.cpp:1705
bool finalizeMultisig(const std::vector< std::string > &extraMultisigInfo) override
finalizeMultisig - finalizes N - 1 / N multisig wallets creation
Definition wallet.cpp:1298
std::string filename() const override
filename - returns wallet filename
Definition wallet.cpp:927
virtual TransactionHistory * history() override
Definition wallet.cpp:1674
size_t numSubaddresses(uint32_t accountIndex) const override
numSubaddresses - returns the number of existing subaddresses associated with the specified subaddres...
Definition wallet.cpp:1214
bool connectToDaemon() override
connectToDaemon - connects to the daemon. TODO: check if it can be removed
Definition wallet.cpp:2009
std::string seed() const override
Definition wallet.cpp:790
bool exportKeyImages(const std::string &filename) override
exportKeyImages - exports key images to file
Definition wallet.cpp:1158
virtual bool isKeysFileLocked() override
returns true if the keys file is locked
Definition wallet.cpp:2423
void setAutoRefreshInterval(int millis) override
setAutoRefreshInterval - setup interval for automatic refresh.
Definition wallet.cpp:1107
virtual std::string getDefaultDataDir() const override
Definition wallet.cpp:2227
std::string publicSpendKey() const override
publicSpendKey - returns public spend key
Definition wallet.cpp:889
size_t importMultisigImages(const std::vector< std::string > &images) override
importMultisigImages - imports other participants' multisig images
Definition wallet.cpp:1332
std::string publicKey
std::string message("Message requiring signing")
CXA_THROW_INFO_T * info
signed __int64 int64_t
Definition stdint.h:135
unsigned int uint32_t
Definition stdint.h:126
unsigned char uint8_t
Definition stdint.h:124
unsigned __int64 uint64_t
Definition stdint.h:136
Transaction-like interface for sending etn.
Definition wallet2_api.h:73
Interface for wallet operations. TODO: check if /include/IWallet.h is still actual.
static void error(const std::string &category, const std::string &str)
Definition wallet.cpp:415
const char * address
Definition multisig.cpp:37
string daemon_address
Definition transfers.cpp:42