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;
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;
258 std::unique_ptr<tools::wallet2> m_w2;
266 std::unique_ptr<wallet2_listener> m_w2_listener;
267 std::set<monero_wallet_listener*> m_listeners;
273 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;
274 std::vector<std::shared_ptr<monero_transfer>> get_transfers_aux(
const monero_transfer_query& query)
const;
275 std::vector<std::shared_ptr<monero_output_wallet>> get_outputs_aux(
const monero_output_query& query)
const;
276 std::vector<std::shared_ptr<monero_tx_wallet>> sweep_account(
const monero_tx_config& config);
279 mutable std::atomic<bool> m_is_synced;
280 mutable std::atomic<bool> m_is_connected;
281 boost::condition_variable m_sync_cv;
282 boost::mutex m_sync_mutex;
283 std::atomic<bool> m_rescan_on_sync;
284 std::atomic<bool> m_syncing_enabled;
285 std::atomic<bool> m_sync_loop_running;
286 std::atomic<int> m_syncing_interval;
287 boost::thread m_syncing_thread;
288 boost::mutex m_syncing_mutex;
289 void run_sync_loop();
290 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:3245
std::string get_seed() const override
Definition monero_wallet_full.cpp:1351
std::vector< std::shared_ptr< monero_output_wallet > > get_outputs(const monero_output_query &query) const override
Definition monero_wallet_full.cpp:1858
static bool wallet_exists(const std::string &path)
Definition monero_wallet_full.cpp:1048
std::string get_tx_note(const std::string &tx_hash) const override
Definition monero_wallet_full.cpp:3063
monero_version get_version() const override
Definition monero_wallet_full.cpp:1336
uint64_t get_restore_height() const override
Definition monero_wallet_full.cpp:1468
std::string get_private_view_key() const override
Definition monero_wallet_full.cpp:1375
std::string prepare_multisig() override
Definition monero_wallet_full.cpp:3327
std::string get_public_view_key() const override
Definition monero_wallet_full.cpp:1370
std::vector< monero_address_book_entry > get_address_book_entries(const std::vector< uint64_t > &indices) const override
Definition monero_wallet_full.cpp:3098
monero_account get_account(const uint32_t account_idx, bool include_subaddresses) const override
Definition monero_wallet_full.cpp:1657
std::vector< std::shared_ptr< monero_tx_wallet > > sweep_dust(bool relay=false) override
Definition monero_wallet_full.cpp:2463
void set_daemon_proxy(const std::string &uri="") override
Definition monero_wallet_full.cpp:1289
void set_attribute(const std::string &key, const std::string &val) override
Definition monero_wallet_full.cpp:3241
void set_tx_notes(const std::vector< std::string > &tx_hashes, const std::vector< std::string > ¬es) override
Definition monero_wallet_full.cpp:3090
void stop_syncing() override
Definition monero_wallet_full.cpp:1566
std::string get_path() const override
Definition monero_wallet_full.cpp:1343
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:1689
void set_tx_note(const std::string &tx_hash, const std::string ¬e) override
Definition monero_wallet_full.cpp:3080
int import_multisig_hex(const std::vector< std::string > &multisig_hexes) override
Definition monero_wallet_full.cpp:3371
std::vector< std::shared_ptr< monero_key_image > > export_key_images(bool all=false) const override
Definition monero_wallet_full.cpp:1895
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:1910
monero_multisig_sign_result sign_multisig_tx_hex(const std::string &multisig_tx_hex) override
Definition monero_wallet_full.cpp:3399
void freeze_output(const std::string &key_image) override
Definition monero_wallet_full.cpp:1937
std::vector< std::string > relay_txs(const std::vector< std::string > &tx_metadatas) override
Definition monero_wallet_full.cpp:2563
monero_subaddress create_subaddress(uint32_t account_idx, const std::string &label="") override
Definition monero_wallet_full.cpp:1698
void rescan_blockchain() override
Definition monero_wallet_full.cpp:1598
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:1255
void rescan_spent() override
Definition monero_wallet_full.cpp:1590
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:1066
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:2835
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:1078
std::string get_tx_key(const std::string &tx_hash) const override
Definition monero_wallet_full.cpp:2874
void thaw_output(const std::string &key_image) override
Definition monero_wallet_full.cpp:1944
uint64_t get_unlocked_balance() const override
Definition monero_wallet_full.cpp:1621
monero_subaddress get_address_index(const std::string &address) const override
Definition monero_wallet_full.cpp:1397
std::vector< std::string > submit_txs(const std::string &signed_tx_hex) override
Definition monero_wallet_full.cpp:2809
std::vector< std::shared_ptr< monero_tx_wallet > > create_txs(const monero_tx_config &config) override
Definition monero_wallet_full.cpp:1958
std::shared_ptr< monero_tx_config > parse_payment_uri(const std::string &uri) const override
Definition monero_wallet_full.cpp:3209
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:3042
std::vector< std::string > submit_multisig_tx_hex(const std::string &signed_multisig_tx_hex) override
Definition monero_wallet_full.cpp:3442
std::string get_spend_proof(const std::string &tx_hash, const std::string &message) const override
Definition monero_wallet_full.cpp:2999
boost::optional< monero_rpc_connection > get_daemon_connection() const override
Definition monero_wallet_full.cpp:1298
uint64_t get_height_by_date(uint16_t year, uint8_t month, uint8_t day) const override
Definition monero_wallet_full.cpp:1493
std::string export_outputs(bool all=false) const override
Definition monero_wallet_full.cpp:1879
monero_integrated_address decode_integrated_address(const std::string &integrated_address) const override
Definition monero_wallet_full.cpp:1448
monero_tx_set sign_txs(const std::string &unsigned_tx_hex) override
Definition monero_wallet_full.cpp:2770
std::vector< std::shared_ptr< monero_tx_wallet > > get_txs() const override
Definition monero_wallet_full.cpp:1724
std::vector< std::shared_ptr< monero_tx_wallet > > sweep_unlocked(const monero_tx_config &config) override
Definition monero_wallet_full.cpp:2119
monero_tx_set describe_tx_set(const monero_tx_set &tx_set) override
Definition monero_wallet_full.cpp:2611
int import_outputs(const std::string &outputs_hex) override
Definition monero_wallet_full.cpp:1883
std::string get_payment_uri(const monero_tx_config &config) const override
Definition monero_wallet_full.cpp:3186
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:2967
void start_syncing(uint64_t sync_period_in_ms) override
Definition monero_wallet_full.cpp:1557
void add_listener(monero_wallet_listener &listener) override
Definition monero_wallet_full.cpp:1497
void save() override
Definition monero_wallet_full.cpp:3496
bool is_output_frozen(const std::string &key_image) override
Definition monero_wallet_full.cpp:1951
monero_multisig_init_result exchange_multisig_keys(const std::vector< std::string > &mutisig_hexes, const std::string &password) override
Definition monero_wallet_full.cpp:3341
bool is_daemon_synced() const override
Definition monero_wallet_full.cpp:1321
bool is_multisig_import_needed() const override
Definition monero_wallet_full.cpp:3317
std::string get_reserve_proof_wallet(const std::string &message) const override
Definition monero_wallet_full.cpp:3028
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:2841
std::shared_ptr< monero_tx_wallet > sweep_output(const monero_tx_config &config) override
Definition monero_wallet_full.cpp:2320
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:2949
void stop_mining() override
Definition monero_wallet_full.cpp:3275
bool get_attribute(const std::string &key, std::string &value) const override
Definition monero_wallet_full.cpp:3237
~monero_wallet_full()
Definition monero_wallet_full.cpp:1263
bool is_daemon_trusted() const override
Definition monero_wallet_full.cpp:1327
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:2899
void scan_txs(const std::vector< std::string > &tx_hashes) override
Definition monero_wallet_full.cpp:1571
std::string get_address(const uint32_t account_idx, const uint32_t subaddress_idx) const override
Definition monero_wallet_full.cpp:1393
std::set< monero_wallet_listener * > get_listeners() override
Definition monero_wallet_full.cpp:1507
bool check_spend_proof(const std::string &tx_hash, const std::string &message, const std::string &signature) const override
Definition monero_wallet_full.cpp:3012
void delete_address_book_entry(uint64_t index) override
Definition monero_wallet_full.cpp:3180
uint64_t add_address_book_entry(const std::string &address, const std::string &description) override
Definition monero_wallet_full.cpp:3130
std::string get_keys_file_buffer(const epee::wipeable_string &password, bool view_only) const
Definition monero_wallet_full.cpp:3501
bool is_connected_to_daemon() const override
Definition monero_wallet_full.cpp:1313
void change_password(const std::string &old_password, const std::string &new_password) override
Definition monero_wallet_full.cpp:3483
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:1056
uint64_t wait_for_next_block() override
Definition monero_wallet_full.cpp:3285
monero_multisig_info get_multisig_info() const override
Definition monero_wallet_full.cpp:3321
uint64_t get_balance() const override
Definition monero_wallet_full.cpp:1607
monero_integrated_address get_integrated_address(const std::string &standard_address="", const std::string &payment_id="") const override
Definition monero_wallet_full.cpp:1418
void move_to(const std::string &path, const std::string &password) override
Definition monero_wallet_full.cpp:3491
std::string get_seed_language() const override
Definition monero_wallet_full.cpp:1365
std::string make_multisig(const std::vector< std::string > &multisig_hexes, int threshold, const std::string &password) override
Definition monero_wallet_full.cpp:3334
monero_network_type get_network_type() const override
Definition monero_wallet_full.cpp:1347
monero_account create_account(const std::string &label="") override
Definition monero_wallet_full.cpp:1674
monero_sync_result sync() override
Definition monero_wallet_full.cpp:1511
std::string export_multisig_hex() override
Definition monero_wallet_full.cpp:3364
void remove_listener(monero_wallet_listener &listener) override
Definition monero_wallet_full.cpp:1502
uint64_t get_height() const override
Definition monero_wallet_full.cpp:1464
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:3147
std::string get_private_spend_key() const override
Definition monero_wallet_full.cpp:1385
void close(bool save=false) override
Definition monero_wallet_full.cpp:3515
uint64_t get_daemon_max_peer_height() const override
Definition monero_wallet_full.cpp:1484
void set_subaddress_label(uint32_t account_idx, uint32_t subaddress_idx, const std::string &label="") override
Definition monero_wallet_full.cpp:1718
uint64_t get_daemon_height() const override
Definition monero_wallet_full.cpp:1476
std::string get_public_spend_key() const override
Definition monero_wallet_full.cpp:1380
std::vector< std::shared_ptr< monero_transfer > > get_transfers(const monero_transfer_query &query) const override
Definition monero_wallet_full.cpp:1837
std::vector< std::string > get_tx_notes(const std::vector< std::string > &tx_hashes) const override
Definition monero_wallet_full.cpp:3073
bool is_synced() const override
Definition monero_wallet_full.cpp:1332
std::string get_reserve_proof_account(uint32_t account_idx, uint64_t amount, const std::string &message) const override
Definition monero_wallet_full.cpp:3034
void set_restore_height(uint64_t restore_height) override
Definition monero_wallet_full.cpp:1472
void set_daemon_connection(const std::string &uri, const std::string &username="", const std::string &password="") override
Definition monero_wallet_full.cpp:1268
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:412
monero_network_type
Definition monero_daemon_model.h:90
Definition monero_wallet_model.h:123
Definition monero_wallet_model.h:350
Definition monero_wallet_model.h:420
Definition monero_wallet_model.h:462
Definition monero_wallet_model.h:476
Definition monero_wallet_model.h:486
Definition monero_wallet_model.h:252
Definition monero_daemon_model.h:109
Definition monero_wallet_model.h:106
Definition monero_wallet_model.h:94
Definition monero_wallet_model.h:210
Definition monero_wallet_model.h:371
Definition monero_wallet_model.h:305
Definition monero_wallet_model.h:336
Definition monero_daemon_model.h:99
Definition monero_wallet_model.h:67
Definition monero_wallet_full.cpp:705