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>
132 [[deprecated(
"monero_wallet_full::create_wallet_random() is deprecated and will be removed soon. Use monero_wallet_full::create_wallet(config) instead")]]
147 [[deprecated(
"monero_wallet_full::create_wallet_from_mnemonic() is deprecated and will be removed soon. Use monero_wallet_full::create_wallet(config) instead")]]
165 [[deprecated(
"monero_wallet_full::create_wallet_from_keys() is deprecated and will be removed soon. Use monero_wallet_full::create_wallet(config) instead")]]
186 void set_daemon_connection(
const std::string& uri,
const std::string& username =
"",
const std::string& password =
"")
override;
195 std::string
get_path()
const override;
203 std::string
get_address(
const uint32_t account_idx,
const uint32_t subaddress_idx)
const override;
212 uint64_t
get_height_by_date(uint16_t year, uint8_t month, uint8_t day)
const override;
222 void scan_txs(
const std::vector<std::string>& tx_hashes)
override;
226 uint64_t
get_balance(uint32_t account_idx)
const override;
227 uint64_t
get_balance(uint32_t account_idx, uint32_t subaddress_idx)
const override;
231 std::vector<monero_account>
get_accounts(
bool include_subaddresses,
const std::string& tag)
const override;
234 std::vector<monero_subaddress>
get_subaddresses(
const uint32_t account_idx,
const std::vector<uint32_t>& subaddress_indices)
const override;
236 void set_subaddress_label(uint32_t account_idx, uint32_t subaddress_idx,
const std::string& label =
"")
override;
237 std::vector<std::shared_ptr<monero_tx_wallet>>
get_txs()
const override;
239 std::vector<std::shared_ptr<monero_tx_wallet>>
get_txs(
const monero_tx_query& query, std::vector<std::string>& missing_tx_hashes)
const override;
244 std::vector<std::shared_ptr<monero_key_image>>
export_key_images(
bool all =
false)
const override;
245 std::shared_ptr<monero_key_image_import_result>
import_key_images(
const std::vector<std::shared_ptr<monero_key_image>>& key_images)
override;
247 void thaw_output(
const std::string& key_image)
override;
252 std::vector<std::shared_ptr<monero_tx_wallet>>
sweep_dust(
bool relay =
false)
override;
253 std::vector<std::string>
relay_txs(
const std::vector<std::string>& tx_metadatas)
override;
255 std::string
sign_txs(
const std::string& unsigned_tx_hex)
override;
256 std::vector<std::string>
submit_txs(
const std::string& signed_tx_hex)
override;
259 std::string
get_tx_key(
const std::string& tx_hash)
const override;
260 std::shared_ptr<monero_check_tx>
check_tx_key(
const std::string& tx_hash,
const std::string& txKey,
const std::string& address)
const override;
261 std::string
get_tx_proof(
const std::string& tx_hash,
const std::string& address,
const std::string& message)
const override;
262 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;
263 std::string
get_spend_proof(
const std::string& tx_hash,
const std::string& message)
const override;
264 bool check_spend_proof(
const std::string& tx_hash,
const std::string& message,
const std::string& signature)
const override;
267 std::shared_ptr<monero_check_reserve>
check_reserve_proof(
const std::string& address,
const std::string& message,
const std::string& signature)
const override;
268 std::string
get_tx_note(
const std::string& tx_hash)
const override;
269 std::vector<std::string>
get_tx_notes(
const std::vector<std::string>& tx_hashes)
const override;
270 void set_tx_note(
const std::string& tx_hash,
const std::string& note)
override;
271 void set_tx_notes(
const std::vector<std::string>& tx_hashes,
const std::vector<std::string>& notes)
override;
272 std::vector<monero_address_book_entry>
get_address_book_entries(
const std::vector<uint64_t>& indices)
const override;
274 void edit_address_book_entry(uint64_t index,
bool set_address,
const std::string& address,
bool set_description,
const std::string& description)
override;
277 std::shared_ptr<monero_tx_config>
parse_payment_uri(
const std::string& uri)
const override;
278 bool get_attribute(
const std::string& key, std::string& value)
const override;
279 void set_attribute(
const std::string& key,
const std::string& val)
override;
280 void start_mining(boost::optional<uint64_t> num_threads, boost::optional<bool> background_mining, boost::optional<bool> ignore_battery)
override;
286 std::string
make_multisig(
const std::vector<std::string>& multisig_hexes,
int threshold,
const std::string& password)
override;
292 void change_password(
const std::string& old_password,
const std::string& new_password)
override;
293 void move_to(
const std::string& path,
const std::string& password)
override;
294 void save()
override;
301 std::string get_cache_file_buffer(
const epee::wipeable_string& password)
const;
307 std::unique_ptr<tools::wallet2> m_w2;
308 std::unique_ptr<wallet2_listener> m_w2_listener;
309 std::set<monero_wallet_listener*> m_listeners;
316 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;
317 std::vector<std::shared_ptr<monero_transfer>> get_transfers_aux(
const monero_transfer_query& query)
const;
318 std::vector<std::shared_ptr<monero_output_wallet>> get_outputs_aux(
const monero_output_query& query)
const;
319 std::vector<std::shared_ptr<monero_tx_wallet>> sweep_account(
const monero_tx_config& config);
322 mutable std::atomic<bool> m_is_synced;
323 mutable std::atomic<bool> m_is_connected;
324 boost::condition_variable m_sync_cv;
325 boost::mutex m_sync_mutex;
326 std::atomic<bool> m_rescan_on_sync;
327 std::atomic<bool> m_syncing_enabled;
328 std::atomic<bool> m_sync_loop_running;
329 std::atomic<int> m_syncing_interval;
330 boost::thread m_syncing_thread;
331 boost::mutex m_syncing_mutex;
332 void run_sync_loop();
333 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:3203
std::vector< std::shared_ptr< monero_output_wallet > > get_outputs(const monero_output_query &query) const override
Definition: monero_wallet_full.cpp:1853
static bool wallet_exists(const std::string &path)
Definition: monero_wallet_full.cpp:1037
std::string get_tx_note(const std::string &tx_hash) const override
Definition: monero_wallet_full.cpp:3021
monero_version get_version() const override
Definition: monero_wallet_full.cpp:1333
uint64_t get_restore_height() const override
Definition: monero_wallet_full.cpp:1464
std::string get_private_view_key() const override
Definition: monero_wallet_full.cpp:1372
std::string prepare_multisig() override
Definition: monero_wallet_full.cpp:3285
std::string get_public_view_key() const override
Definition: monero_wallet_full.cpp:1367
std::vector< monero_address_book_entry > get_address_book_entries(const std::vector< uint64_t > &indices) const override
Definition: monero_wallet_full.cpp:3056
monero_account get_account(const uint32_t account_idx, bool include_subaddresses) const override
Definition: monero_wallet_full.cpp:1652
std::vector< std::shared_ptr< monero_tx_wallet > > sweep_dust(bool relay=false) override
Definition: monero_wallet_full.cpp:2439
void set_daemon_proxy(const std::string &uri="") override
Definition: monero_wallet_full.cpp:1286
void set_attribute(const std::string &key, const std::string &val) override
Definition: monero_wallet_full.cpp:3199
void set_tx_notes(const std::vector< std::string > &tx_hashes, const std::vector< std::string > ¬es) override
Definition: monero_wallet_full.cpp:3048
void stop_syncing() override
Definition: monero_wallet_full.cpp:1562
std::string get_path() const override
Definition: monero_wallet_full.cpp:1340
static monero_wallet_full * create_wallet_random(const std::string &path, const std::string &password, const monero_network_type network_type, const monero_rpc_connection &daemon_connection=monero_rpc_connection(), const std::string &language="English", std::unique_ptr< epee::net_utils::http::http_client_factory > http_client_factory=nullptr)
Definition: monero_wallet_full.cpp:1219
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:1684
void set_tx_note(const std::string &tx_hash, const std::string ¬e) override
Definition: monero_wallet_full.cpp:3038
int import_multisig_hex(const std::vector< std::string > &multisig_hexes) override
Definition: monero_wallet_full.cpp:3329
std::vector< std::shared_ptr< monero_key_image > > export_key_images(bool all=false) const override
Definition: monero_wallet_full.cpp:1890
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:1905
monero_multisig_sign_result sign_multisig_tx_hex(const std::string &multisig_tx_hex) override
Definition: monero_wallet_full.cpp:3357
void freeze_output(const std::string &key_image) override
Definition: monero_wallet_full.cpp:1932
std::vector< std::string > relay_txs(const std::vector< std::string > &tx_metadatas) override
Definition: monero_wallet_full.cpp:2538
static std::vector< std::string > get_mnemonic_languages()
Definition: monero_wallet_full.cpp:1211
static monero_wallet_full * create_wallet_from_mnemonic(const std::string &path, const std::string &password, const monero_network_type network_type, const std::string &mnemonic, const monero_rpc_connection &daemon_connection=monero_rpc_connection(), uint64_t restore_height=0, const std::string &seed_offset="", std::unique_ptr< epee::net_utils::http::http_client_factory > http_client_factory=nullptr)
Definition: monero_wallet_full.cpp:1230
monero_subaddress create_subaddress(uint32_t account_idx, const std::string &label="") override
Definition: monero_wallet_full.cpp:1693
void rescan_blockchain() override
Definition: monero_wallet_full.cpp:1593
bool is_view_only() const override
Definition: monero_wallet_full.h:185
std::string get_mnemonic() const override
Definition: monero_wallet_full.cpp:1348
void rescan_spent() override
Definition: monero_wallet_full.cpp:1585
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:1055
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:2793
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:1067
std::string get_tx_key(const std::string &tx_hash) const override
Definition: monero_wallet_full.cpp:2832
void thaw_output(const std::string &key_image) override
Definition: monero_wallet_full.cpp:1939
uint64_t get_unlocked_balance() const override
Definition: monero_wallet_full.cpp:1616
monero_subaddress get_address_index(const std::string &address) const override
Definition: monero_wallet_full.cpp:1393
std::vector< std::string > submit_txs(const std::string &signed_tx_hex) override
Definition: monero_wallet_full.cpp:2767
std::vector< std::shared_ptr< monero_tx_wallet > > create_txs(const monero_tx_config &config) override
Definition: monero_wallet_full.cpp:1953
std::shared_ptr< monero_tx_config > parse_payment_uri(const std::string &uri) const override
Definition: monero_wallet_full.cpp:3167
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:3000
std::vector< std::string > submit_multisig_tx_hex(const std::string &signed_multisig_tx_hex) override
Definition: monero_wallet_full.cpp:3400
std::string get_spend_proof(const std::string &tx_hash, const std::string &message) const override
Definition: monero_wallet_full.cpp:2957
boost::optional< monero_rpc_connection > get_daemon_connection() const override
Definition: monero_wallet_full.cpp:1295
uint64_t get_height_by_date(uint16_t year, uint8_t month, uint8_t day) const override
Definition: monero_wallet_full.cpp:1489
std::string export_outputs(bool all=false) const override
Definition: monero_wallet_full.cpp:1874
monero_integrated_address decode_integrated_address(const std::string &integrated_address) const override
Definition: monero_wallet_full.cpp:1444
std::vector< std::shared_ptr< monero_tx_wallet > > get_txs() const override
Definition: monero_wallet_full.cpp:1719
std::vector< std::shared_ptr< monero_tx_wallet > > sweep_unlocked(const monero_tx_config &config) override
Definition: monero_wallet_full.cpp:2097
monero_tx_set describe_tx_set(const monero_tx_set &tx_set) override
Definition: monero_wallet_full.cpp:2586
int import_outputs(const std::string &outputs_hex) override
Definition: monero_wallet_full.cpp:1878
std::string get_payment_uri(const monero_tx_config &config) const override
Definition: monero_wallet_full.cpp:3144
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:2925
void start_syncing(uint64_t sync_period_in_ms) override
Definition: monero_wallet_full.cpp:1553
void add_listener(monero_wallet_listener &listener) override
Definition: monero_wallet_full.cpp:1493
void save() override
Definition: monero_wallet_full.cpp:3454
bool is_output_frozen(const std::string &key_image) override
Definition: monero_wallet_full.cpp:1946
std::string get_mnemonic_language() const override
Definition: monero_wallet_full.cpp:1362
monero_multisig_init_result exchange_multisig_keys(const std::vector< std::string > &mutisig_hexes, const std::string &password) override
Definition: monero_wallet_full.cpp:3299
bool is_daemon_synced() const override
Definition: monero_wallet_full.cpp:1318
std::string sign_txs(const std::string &unsigned_tx_hex) override
Definition: monero_wallet_full.cpp:2745
bool is_multisig_import_needed() const override
Definition: monero_wallet_full.cpp:3275
std::string get_reserve_proof_wallet(const std::string &message) const override
Definition: monero_wallet_full.cpp:2986
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:2799
std::shared_ptr< monero_tx_wallet > sweep_output(const monero_tx_config &config) override
Definition: monero_wallet_full.cpp:2297
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:2907
void stop_mining() override
Definition: monero_wallet_full.cpp:3233
bool get_attribute(const std::string &key, std::string &value) const override
Definition: monero_wallet_full.cpp:3195
~monero_wallet_full()
Definition: monero_wallet_full.cpp:1260
bool is_daemon_trusted() const override
Definition: monero_wallet_full.cpp:1324
static monero_wallet_full * create_wallet_from_keys(const std::string &path, const std::string &password, const monero_network_type network_type, const std::string &address, const std::string &view_key, const std::string &spend_key, const monero_rpc_connection &daemon_connection=monero_rpc_connection(), uint64_t restore_height=0, const std::string &language="English", std::unique_ptr< epee::net_utils::http::http_client_factory > http_client_factory=nullptr)
Definition: monero_wallet_full.cpp:1243
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:2857
void scan_txs(const std::vector< std::string > &tx_hashes) override
Definition: monero_wallet_full.cpp:1567
std::string get_address(const uint32_t account_idx, const uint32_t subaddress_idx) const override
Definition: monero_wallet_full.cpp:1389
std::set< monero_wallet_listener * > get_listeners() override
Definition: monero_wallet_full.cpp:1503
bool check_spend_proof(const std::string &tx_hash, const std::string &message, const std::string &signature) const override
Definition: monero_wallet_full.cpp:2970
void delete_address_book_entry(uint64_t index) override
Definition: monero_wallet_full.cpp:3138
uint64_t add_address_book_entry(const std::string &address, const std::string &description) override
Definition: monero_wallet_full.cpp:3088
std::string get_keys_file_buffer(const epee::wipeable_string &password, bool view_only) const
Definition: monero_wallet_full.cpp:3459
bool is_connected_to_daemon() const override
Definition: monero_wallet_full.cpp:1310
void change_password(const std::string &old_password, const std::string &new_password) override
Definition: monero_wallet_full.cpp:3441
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:1045
uint64_t wait_for_next_block() override
Definition: monero_wallet_full.cpp:3243
monero_multisig_info get_multisig_info() const override
Definition: monero_wallet_full.cpp:3279
uint64_t get_balance() const override
Definition: monero_wallet_full.cpp:1602
monero_integrated_address get_integrated_address(const std::string &standard_address="", const std::string &payment_id="") const override
Definition: monero_wallet_full.cpp:1414
void move_to(const std::string &path, const std::string &password) override
Definition: monero_wallet_full.cpp:3449
std::string make_multisig(const std::vector< std::string > &multisig_hexes, int threshold, const std::string &password) override
Definition: monero_wallet_full.cpp:3292
monero_network_type get_network_type() const override
Definition: monero_wallet_full.cpp:1344
monero_account create_account(const std::string &label="") override
Definition: monero_wallet_full.cpp:1669
monero_sync_result sync() override
Definition: monero_wallet_full.cpp:1507
std::string export_multisig_hex() override
Definition: monero_wallet_full.cpp:3322
void remove_listener(monero_wallet_listener &listener) override
Definition: monero_wallet_full.cpp:1498
uint64_t get_height() const override
Definition: monero_wallet_full.cpp:1460
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:3105
std::string get_private_spend_key() const override
Definition: monero_wallet_full.cpp:1382
void close(bool save=false) override
Definition: monero_wallet_full.cpp:3473
uint64_t get_daemon_max_peer_height() const override
Definition: monero_wallet_full.cpp:1480
void set_subaddress_label(uint32_t account_idx, uint32_t subaddress_idx, const std::string &label="") override
Definition: monero_wallet_full.cpp:1713
uint64_t get_daemon_height() const override
Definition: monero_wallet_full.cpp:1472
std::string get_public_spend_key() const override
Definition: monero_wallet_full.cpp:1377
std::vector< std::shared_ptr< monero_transfer > > get_transfers(const monero_transfer_query &query) const override
Definition: monero_wallet_full.cpp:1832
std::vector< std::string > get_tx_notes(const std::vector< std::string > &tx_hashes) const override
Definition: monero_wallet_full.cpp:3031
bool is_synced() const override
Definition: monero_wallet_full.cpp:1329
std::string get_reserve_proof_account(uint32_t account_idx, uint64_t amount, const std::string &message) const override
Definition: monero_wallet_full.cpp:2992
void set_restore_height(uint64_t restore_height) override
Definition: monero_wallet_full.cpp:1468
void set_daemon_connection(const std::string &uri, const std::string &username="", const std::string &password="") override
Definition: monero_wallet_full.cpp:1265
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:415
monero_network_type
Definition: monero_daemon_model.h:90
Definition: monero_wallet_model.h:126
Definition: monero_wallet_model.h:353
Definition: monero_wallet_model.h:423
Definition: monero_wallet_model.h:465
Definition: monero_wallet_model.h:479
Definition: monero_wallet_model.h:489
Definition: monero_wallet_model.h:255
Definition: monero_daemon_model.h:109
Definition: monero_wallet_model.h:109
Definition: monero_wallet_model.h:97
Definition: monero_wallet_model.h:213
Definition: monero_wallet_model.h:374
Definition: monero_wallet_model.h:308
Definition: monero_wallet_model.h:339
Definition: monero_daemon_model.h:99
Definition: monero_wallet_model.h:67
Definition: monero_wallet_full.cpp:699