55#include "monero_wallet.h"
56#include "wallet/wallet2.h"
58#include <boost/thread/mutex.hpp>
59#include <boost/thread/thread.hpp>
60#include <boost/thread/condition_variable.hpp>
139 void set_daemon_connection(
const std::string& uri,
const std::string& username =
"",
const std::string& password =
"")
override;
148 std::string
get_path()
const override;
150 std::string
get_seed()
const override;
156 std::string
get_address(
const uint32_t account_idx,
const uint32_t subaddress_idx)
const override;
165 uint64_t
get_height_by_date(uint16_t year, uint8_t month, uint8_t day)
const override;
175 void scan_txs(
const std::vector<std::string>& tx_hashes)
override;
179 uint64_t
get_balance(uint32_t account_idx)
const override;
180 uint64_t
get_balance(uint32_t account_idx, uint32_t subaddress_idx)
const override;
184 std::vector<monero_account>
get_accounts(
bool include_subaddresses,
const std::string& tag)
const override;
187 std::vector<monero_subaddress>
get_subaddresses(
const uint32_t account_idx,
const std::vector<uint32_t>& subaddress_indices)
const override;
189 void set_subaddress_label(uint32_t account_idx, uint32_t subaddress_idx,
const std::string& label =
"")
override;
190 std::vector<std::shared_ptr<monero_tx_wallet>>
get_txs()
const override;
196 std::vector<std::shared_ptr<monero_key_image>>
export_key_images(
bool all =
false)
const override;
197 std::shared_ptr<monero_key_image_import_result>
import_key_images(
const std::vector<std::shared_ptr<monero_key_image>>& key_images)
override;
199 void thaw_output(
const std::string& key_image)
override;
204 std::vector<std::shared_ptr<monero_tx_wallet>>
sweep_dust(
bool relay =
false)
override;
205 std::vector<std::string>
relay_txs(
const std::vector<std::string>& tx_metadatas)
override;
207 std::string
sign_txs(
const std::string& unsigned_tx_hex)
override;
208 std::vector<std::string>
submit_txs(
const std::string& signed_tx_hex)
override;
211 std::string
get_tx_key(
const std::string& tx_hash)
const override;
212 std::shared_ptr<monero_check_tx>
check_tx_key(
const std::string& tx_hash,
const std::string& txKey,
const std::string& address)
const override;
213 std::string
get_tx_proof(
const std::string& tx_hash,
const std::string& address,
const std::string& message)
const override;
214 std::shared_ptr<monero_check_tx>
check_tx_proof(
const std::string& tx_hash,
const std::string& address,
const std::string& message,
const std::string& signature)
const override;
215 std::string
get_spend_proof(
const std::string& tx_hash,
const std::string& message)
const override;
216 bool check_spend_proof(
const std::string& tx_hash,
const std::string& message,
const std::string& signature)
const override;
219 std::shared_ptr<monero_check_reserve>
check_reserve_proof(
const std::string& address,
const std::string& message,
const std::string& signature)
const override;
220 std::string
get_tx_note(
const std::string& tx_hash)
const override;
221 std::vector<std::string>
get_tx_notes(
const std::vector<std::string>& tx_hashes)
const override;
222 void set_tx_note(
const std::string& tx_hash,
const std::string& note)
override;
223 void set_tx_notes(
const std::vector<std::string>& tx_hashes,
const std::vector<std::string>& notes)
override;
224 std::vector<monero_address_book_entry>
get_address_book_entries(
const std::vector<uint64_t>& indices)
const override;
226 void edit_address_book_entry(uint64_t index,
bool set_address,
const std::string& address,
bool set_description,
const std::string& description)
override;
229 std::shared_ptr<monero_tx_config>
parse_payment_uri(
const std::string& uri)
const override;
230 bool get_attribute(
const std::string& key, std::string& value)
const override;
231 void set_attribute(
const std::string& key,
const std::string& val)
override;
232 void start_mining(boost::optional<uint64_t> num_threads, boost::optional<bool> background_mining, boost::optional<bool> ignore_battery)
override;
238 std::string
make_multisig(
const std::vector<std::string>& multisig_hexes,
int threshold,
const std::string& password)
override;
244 void change_password(
const std::string& old_password,
const std::string& new_password)
override;
245 void move_to(
const std::string& path,
const std::string& password)
override;
246 void save()
override;
253 std::string get_cache_file_buffer()
const;
259 std::unique_ptr<tools::wallet2> m_w2;
260 std::unique_ptr<wallet2_listener> m_w2_listener;
261 std::set<monero_wallet_listener*> m_listeners;
268 std::vector<monero_subaddress> get_subaddresses_aux(uint32_t account_idx,
const std::vector<uint32_t>& subaddress_indices,
const std::vector<tools::wallet2::transfer_details>& transfers)
const;
269 std::vector<std::shared_ptr<monero_transfer>> get_transfers_aux(
const monero_transfer_query& query)
const;
270 std::vector<std::shared_ptr<monero_output_wallet>> get_outputs_aux(
const monero_output_query& query)
const;
271 std::vector<std::shared_ptr<monero_tx_wallet>> sweep_account(
const monero_tx_config& config);
274 mutable std::atomic<bool> m_is_synced;
275 mutable std::atomic<bool> m_is_connected;
276 boost::condition_variable m_sync_cv;
277 boost::mutex m_sync_mutex;
278 std::atomic<bool> m_rescan_on_sync;
279 std::atomic<bool> m_syncing_enabled;
280 std::atomic<bool> m_sync_loop_running;
281 std::atomic<int> m_syncing_interval;
282 boost::thread m_syncing_thread;
283 boost::mutex m_syncing_mutex;
284 void run_sync_loop();
285 monero_sync_result lock_and_sync(boost::optional<uint64_t> start_height = boost::none);
Definition: monero_wallet_full.h:77
void start_mining(boost::optional< uint64_t > num_threads, boost::optional< bool > background_mining, boost::optional< bool > ignore_battery) override
Definition: monero_wallet_full.cpp:3221
std::string get_seed() const override
Definition: monero_wallet_full.cpp:1344
std::vector< std::shared_ptr< monero_output_wallet > > get_outputs(const monero_output_query &query) const override
Definition: monero_wallet_full.cpp:1848
static bool wallet_exists(const std::string &path)
Definition: monero_wallet_full.cpp:1041
std::string get_tx_note(const std::string &tx_hash) const override
Definition: monero_wallet_full.cpp:3039
monero_version get_version() const override
Definition: monero_wallet_full.cpp:1329
uint64_t get_restore_height() const override
Definition: monero_wallet_full.cpp:1461
std::string get_private_view_key() const override
Definition: monero_wallet_full.cpp:1368
std::string prepare_multisig() override
Definition: monero_wallet_full.cpp:3303
std::string get_public_view_key() const override
Definition: monero_wallet_full.cpp:1363
std::vector< monero_address_book_entry > get_address_book_entries(const std::vector< uint64_t > &indices) const override
Definition: monero_wallet_full.cpp:3074
monero_account get_account(const uint32_t account_idx, bool include_subaddresses) const override
Definition: monero_wallet_full.cpp:1649
std::vector< std::shared_ptr< monero_tx_wallet > > sweep_dust(bool relay=false) override
Definition: monero_wallet_full.cpp:2456
void set_daemon_proxy(const std::string &uri="") override
Definition: monero_wallet_full.cpp:1282
void set_attribute(const std::string &key, const std::string &val) override
Definition: monero_wallet_full.cpp:3217
void set_tx_notes(const std::vector< std::string > &tx_hashes, const std::vector< std::string > ¬es) override
Definition: monero_wallet_full.cpp:3066
void stop_syncing() override
Definition: monero_wallet_full.cpp:1559
std::string get_path() const override
Definition: monero_wallet_full.cpp:1336
std::vector< monero_subaddress > get_subaddresses(const uint32_t account_idx, const std::vector< uint32_t > &subaddress_indices) const override
Definition: monero_wallet_full.cpp:1681
void set_tx_note(const std::string &tx_hash, const std::string ¬e) override
Definition: monero_wallet_full.cpp:3056
int import_multisig_hex(const std::vector< std::string > &multisig_hexes) override
Definition: monero_wallet_full.cpp:3347
std::vector< std::shared_ptr< monero_key_image > > export_key_images(bool all=false) const override
Definition: monero_wallet_full.cpp:1885
std::shared_ptr< monero_key_image_import_result > import_key_images(const std::vector< std::shared_ptr< monero_key_image > > &key_images) override
Definition: monero_wallet_full.cpp:1900
monero_multisig_sign_result sign_multisig_tx_hex(const std::string &multisig_tx_hex) override
Definition: monero_wallet_full.cpp:3375
void freeze_output(const std::string &key_image) override
Definition: monero_wallet_full.cpp:1927
std::vector< std::string > relay_txs(const std::vector< std::string > &tx_metadatas) override
Definition: monero_wallet_full.cpp:2556
monero_subaddress create_subaddress(uint32_t account_idx, const std::string &label="") override
Definition: monero_wallet_full.cpp:1690
void rescan_blockchain() override
Definition: monero_wallet_full.cpp:1590
bool is_view_only() const override
Definition: monero_wallet_full.h:138
static std::vector< std::string > get_seed_languages()
Definition: monero_wallet_full.cpp:1248
void rescan_spent() override
Definition: monero_wallet_full.cpp:1582
static monero_wallet_full * open_wallet_data(const std::string &password, const monero_network_type, const std::string &keys_data, const std::string &cache_data, const monero_rpc_connection &daemon_connection=monero_rpc_connection(), std::unique_ptr< epee::net_utils::http::http_client_factory > http_client_factory=nullptr)
Definition: monero_wallet_full.cpp:1059
std::string sign_message(const std::string &msg, monero_message_signature_type signature_type, uint32_t account_idx=0, uint32_t subaddress_idx=0) const override
Definition: monero_wallet_full.cpp:2811
static monero_wallet_full * create_wallet(const monero_wallet_config &config, std::unique_ptr< epee::net_utils::http::http_client_factory > http_client_factory=nullptr)
Definition: monero_wallet_full.cpp:1071
std::string get_tx_key(const std::string &tx_hash) const override
Definition: monero_wallet_full.cpp:2850
void thaw_output(const std::string &key_image) override
Definition: monero_wallet_full.cpp:1934
uint64_t get_unlocked_balance() const override
Definition: monero_wallet_full.cpp:1613
monero_subaddress get_address_index(const std::string &address) const override
Definition: monero_wallet_full.cpp:1390
std::vector< std::string > submit_txs(const std::string &signed_tx_hex) override
Definition: monero_wallet_full.cpp:2785
std::vector< std::shared_ptr< monero_tx_wallet > > create_txs(const monero_tx_config &config) override
Definition: monero_wallet_full.cpp:1948
std::shared_ptr< monero_tx_config > parse_payment_uri(const std::string &uri) const override
Definition: monero_wallet_full.cpp:3185
std::shared_ptr< monero_check_reserve > check_reserve_proof(const std::string &address, const std::string &message, const std::string &signature) const override
Definition: monero_wallet_full.cpp:3018
std::vector< std::string > submit_multisig_tx_hex(const std::string &signed_multisig_tx_hex) override
Definition: monero_wallet_full.cpp:3418
std::string get_spend_proof(const std::string &tx_hash, const std::string &message) const override
Definition: monero_wallet_full.cpp:2975
boost::optional< monero_rpc_connection > get_daemon_connection() const override
Definition: monero_wallet_full.cpp:1291
uint64_t get_height_by_date(uint16_t year, uint8_t month, uint8_t day) const override
Definition: monero_wallet_full.cpp:1486
std::string export_outputs(bool all=false) const override
Definition: monero_wallet_full.cpp:1869
monero_integrated_address decode_integrated_address(const std::string &integrated_address) const override
Definition: monero_wallet_full.cpp:1441
std::vector< std::shared_ptr< monero_tx_wallet > > get_txs() const override
Definition: monero_wallet_full.cpp:1716
std::vector< std::shared_ptr< monero_tx_wallet > > sweep_unlocked(const monero_tx_config &config) override
Definition: monero_wallet_full.cpp:2110
monero_tx_set describe_tx_set(const monero_tx_set &tx_set) override
Definition: monero_wallet_full.cpp:2604
int import_outputs(const std::string &outputs_hex) override
Definition: monero_wallet_full.cpp:1873
std::string get_payment_uri(const monero_tx_config &config) const override
Definition: monero_wallet_full.cpp:3162
std::shared_ptr< monero_check_tx > check_tx_proof(const std::string &tx_hash, const std::string &address, const std::string &message, const std::string &signature) const override
Definition: monero_wallet_full.cpp:2943
void start_syncing(uint64_t sync_period_in_ms) override
Definition: monero_wallet_full.cpp:1550
void add_listener(monero_wallet_listener &listener) override
Definition: monero_wallet_full.cpp:1490
void save() override
Definition: monero_wallet_full.cpp:3472
bool is_output_frozen(const std::string &key_image) override
Definition: monero_wallet_full.cpp:1941
monero_multisig_init_result exchange_multisig_keys(const std::vector< std::string > &mutisig_hexes, const std::string &password) override
Definition: monero_wallet_full.cpp:3317
bool is_daemon_synced() const override
Definition: monero_wallet_full.cpp:1314
std::string sign_txs(const std::string &unsigned_tx_hex) override
Definition: monero_wallet_full.cpp:2763
bool is_multisig_import_needed() const override
Definition: monero_wallet_full.cpp:3293
std::string get_reserve_proof_wallet(const std::string &message) const override
Definition: monero_wallet_full.cpp:3004
monero_message_signature_result verify_message(const std::string &msg, const std::string &address, const std::string &signature) const override
Definition: monero_wallet_full.cpp:2817
std::shared_ptr< monero_tx_wallet > sweep_output(const monero_tx_config &config) override
Definition: monero_wallet_full.cpp:2312
std::string get_tx_proof(const std::string &tx_hash, const std::string &address, const std::string &message) const override
Definition: monero_wallet_full.cpp:2925
void stop_mining() override
Definition: monero_wallet_full.cpp:3251
bool get_attribute(const std::string &key, std::string &value) const override
Definition: monero_wallet_full.cpp:3213
~monero_wallet_full()
Definition: monero_wallet_full.cpp:1256
bool is_daemon_trusted() const override
Definition: monero_wallet_full.cpp:1320
std::shared_ptr< monero_check_tx > check_tx_key(const std::string &tx_hash, const std::string &txKey, const std::string &address) const override
Definition: monero_wallet_full.cpp:2875
void scan_txs(const std::vector< std::string > &tx_hashes) override
Definition: monero_wallet_full.cpp:1564
std::string get_address(const uint32_t account_idx, const uint32_t subaddress_idx) const override
Definition: monero_wallet_full.cpp:1386
std::set< monero_wallet_listener * > get_listeners() override
Definition: monero_wallet_full.cpp:1500
bool check_spend_proof(const std::string &tx_hash, const std::string &message, const std::string &signature) const override
Definition: monero_wallet_full.cpp:2988
void delete_address_book_entry(uint64_t index) override
Definition: monero_wallet_full.cpp:3156
uint64_t add_address_book_entry(const std::string &address, const std::string &description) override
Definition: monero_wallet_full.cpp:3106
std::string get_keys_file_buffer(const epee::wipeable_string &password, bool view_only) const
Definition: monero_wallet_full.cpp:3477
bool is_connected_to_daemon() const override
Definition: monero_wallet_full.cpp:1306
void change_password(const std::string &old_password, const std::string &new_password) override
Definition: monero_wallet_full.cpp:3459
static monero_wallet_full * open_wallet(const std::string &path, const std::string &password, const monero_network_type network_type)
Definition: monero_wallet_full.cpp:1049
uint64_t wait_for_next_block() override
Definition: monero_wallet_full.cpp:3261
monero_multisig_info get_multisig_info() const override
Definition: monero_wallet_full.cpp:3297
uint64_t get_balance() const override
Definition: monero_wallet_full.cpp:1599
monero_integrated_address get_integrated_address(const std::string &standard_address="", const std::string &payment_id="") const override
Definition: monero_wallet_full.cpp:1411
void move_to(const std::string &path, const std::string &password) override
Definition: monero_wallet_full.cpp:3467
std::string get_seed_language() const override
Definition: monero_wallet_full.cpp:1358
std::string make_multisig(const std::vector< std::string > &multisig_hexes, int threshold, const std::string &password) override
Definition: monero_wallet_full.cpp:3310
monero_network_type get_network_type() const override
Definition: monero_wallet_full.cpp:1340
monero_account create_account(const std::string &label="") override
Definition: monero_wallet_full.cpp:1666
monero_sync_result sync() override
Definition: monero_wallet_full.cpp:1504
std::string export_multisig_hex() override
Definition: monero_wallet_full.cpp:3340
void remove_listener(monero_wallet_listener &listener) override
Definition: monero_wallet_full.cpp:1495
uint64_t get_height() const override
Definition: monero_wallet_full.cpp:1457
void edit_address_book_entry(uint64_t index, bool set_address, const std::string &address, bool set_description, const std::string &description) override
Definition: monero_wallet_full.cpp:3123
std::string get_private_spend_key() const override
Definition: monero_wallet_full.cpp:1378
void close(bool save=false) override
Definition: monero_wallet_full.cpp:3491
uint64_t get_daemon_max_peer_height() const override
Definition: monero_wallet_full.cpp:1477
void set_subaddress_label(uint32_t account_idx, uint32_t subaddress_idx, const std::string &label="") override
Definition: monero_wallet_full.cpp:1710
uint64_t get_daemon_height() const override
Definition: monero_wallet_full.cpp:1469
std::string get_public_spend_key() const override
Definition: monero_wallet_full.cpp:1373
std::vector< std::shared_ptr< monero_transfer > > get_transfers(const monero_transfer_query &query) const override
Definition: monero_wallet_full.cpp:1827
std::vector< std::string > get_tx_notes(const std::vector< std::string > &tx_hashes) const override
Definition: monero_wallet_full.cpp:3049
bool is_synced() const override
Definition: monero_wallet_full.cpp:1325
std::string get_reserve_proof_account(uint32_t account_idx, uint64_t amount, const std::string &message) const override
Definition: monero_wallet_full.cpp:3010
void set_restore_height(uint64_t restore_height) override
Definition: monero_wallet_full.cpp:1465
void set_daemon_connection(const std::string &uri, const std::string &username="", const std::string &password="") override
Definition: monero_wallet_full.cpp:1261
Definition: monero_wallet.h:71
Definition: monero_wallet.h:123
virtual std::vector< monero_account > get_accounts() const
Definition: monero_wallet.h:583
Definition: monero_daemon.cpp:58
monero_message_signature_type
Definition: monero_wallet_model.h:417
monero_network_type
Definition: monero_daemon_model.h:90
Definition: monero_wallet_model.h:127
Definition: monero_wallet_model.h:354
Definition: monero_wallet_model.h:425
Definition: monero_wallet_model.h:467
Definition: monero_wallet_model.h:481
Definition: monero_wallet_model.h:491
Definition: monero_wallet_model.h:256
Definition: monero_daemon_model.h:109
Definition: monero_wallet_model.h:110
Definition: monero_wallet_model.h:98
Definition: monero_wallet_model.h:214
Definition: monero_wallet_model.h:375
Definition: monero_wallet_model.h:309
Definition: monero_wallet_model.h:340
Definition: monero_daemon_model.h:99
Definition: monero_wallet_model.h:67
Definition: monero_wallet_full.cpp:705