56#include "monero_wallet.h"
76 monero_wallet_rpc(
const std::shared_ptr<monero_rpc_connection>& rpc_connection);
77 monero_wallet_rpc(
const std::string& uri =
"",
const std::string& username =
"",
const std::string& password =
"",
const std::string& proxy_uri =
"",
const std::string& zmq_uri =
"",
const boost::optional<uint32_t>& timeout = boost::none);
92 monero_wallet_rpc*
open_wallet(
const std::shared_ptr<monero_wallet_config> &config);
101 monero_wallet_rpc*
open_wallet(
const std::string& name,
const std::string& password);
109 monero_wallet_rpc*
create_wallet(
const std::shared_ptr<monero_wallet_config> &config);
138 void set_daemon_connection(
const std::shared_ptr<monero_rpc_connection>& connection,
bool is_trusted,
const boost::optional<ssl_options>&
ssl_options);
139 void set_daemon_connection(
const std::shared_ptr<monero_rpc_connection>& connection,
const boost::optional<bool>& is_trusted = boost::none)
override;
140 void set_daemon_connection(
const std::string& uri,
const std::string& username =
"",
const std::string& password =
"",
const std::string& proxy_uri =
"",
const boost::optional<bool>& is_trusted = boost::none)
override;
143 std::string
get_path()
const override;
144 std::string
get_seed()
const override;
150 std::string
get_address(
const uint32_t account_idx,
const uint32_t subaddress_idx)
const override;
156 uint64_t
get_height_by_date(uint16_t year, uint8_t month, uint8_t day)
const override;
161 void start_syncing(uint64_t sync_period_in_ms = 10000)
override;
163 void scan_txs(
const std::vector<std::string>& tx_hashes)
override;
167 uint64_t
get_balance(uint32_t account_index)
const override;
168 uint64_t
get_balance(uint32_t account_idx, uint32_t subaddress_idx)
const override;
174 std::vector<monero_account>
get_accounts(
bool include_subaddresses,
const std::string& tag)
const override;
175 std::vector<monero_account>
get_accounts(
bool include_subaddresses,
const std::string& tag,
bool skip_balances)
const;
177 std::vector<monero_subaddress> get_subaddresses(
const uint32_t account_idx,
const std::vector<uint32_t>& subaddress_indices,
bool skip_balances)
const;
178 std::vector<monero_subaddress> get_subaddresses(uint32_t account_idx,
const std::vector<uint32_t>& subaddress_indices)
const override;
179 std::vector<monero_subaddress> get_subaddresses(
const uint32_t account_idx)
const override;
182 void set_subaddress_label(uint32_t account_idx, uint32_t subaddress_idx,
const std::string& label =
"")
override;
183 std::vector<std::shared_ptr<monero_tx_wallet>>
get_txs()
const override;
189 std::shared_ptr<monero_key_image_export_result>
export_key_images(
bool all =
false)
const override;
190 std::shared_ptr<monero_key_image_import_result>
import_key_images(
const std::vector<std::shared_ptr<monero_key_image>>& key_images, uint64_t offset = 0)
override;
192 void thaw_output(
const std::string& key_image)
override;
197 std::vector<std::shared_ptr<monero_tx_wallet>>
sweep_dust(
bool relay =
false)
override;
199 std::vector<std::string>
relay_txs(
const std::vector<std::string>& tx_metadatas)
override;
202 std::vector<std::string>
submit_txs(
const std::string& signed_tx_hex)
override;
205 std::string
get_tx_key(
const std::string& tx_hash)
const override;
206 std::shared_ptr<monero_check_tx>
check_tx_key(
const std::string& tx_hash,
const std::string& tx_key,
const std::string& address)
const override;
207 std::string
get_tx_proof(
const std::string& tx_hash,
const std::string& address,
const std::string& message)
const override;
208 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;
209 std::string
get_spend_proof(
const std::string& tx_hash,
const std::string& message)
const override;
210 bool check_spend_proof(
const std::string& tx_hash,
const std::string& message,
const std::string& signature)
const override;
213 std::shared_ptr<monero_check_reserve>
check_reserve_proof(
const std::string& address,
const std::string& message,
const std::string& signature)
const override;
214 std::string
get_tx_note(
const std::string& tx_hash)
const override;
215 std::vector<std::string>
get_tx_notes(
const std::vector<std::string>& tx_hashes)
const override;
216 void set_tx_note(
const std::string& tx_hashes,
const std::string& notes)
override;
217 void set_tx_notes(
const std::vector<std::string>& tx_hashes,
const std::vector<std::string>& notes)
override;
218 std::vector<monero_address_book_entry>
get_address_book_entries(
const std::vector<uint64_t>& indices)
const override;
220 void edit_address_book_entry(uint64_t index,
bool set_address,
const std::string& address,
bool set_description,
const std::string& description)
override;
222 void tag_accounts(
const std::string& tag,
const std::vector<uint32_t>& account_indices)
override;
223 void untag_accounts(
const std::vector<uint32_t>& account_indices)
override;
224 std::vector<std::shared_ptr<monero_account_tag>>
get_account_tags()
const override;
227 std::shared_ptr<monero_tx_config>
parse_payment_uri(
const std::string& uri)
const override;
228 void set_attribute(
const std::string& key,
const std::string& val)
override;
229 bool get_attribute(
const std::string& key, std::string& value)
const override;
230 void start_mining(boost::optional<uint64_t> num_threads, boost::optional<bool> background_mining, boost::optional<bool> ignore_battery)
override;
235 std::string
make_multisig(
const std::vector<std::string>& multisig_hexes,
int threshold,
const std::string& password)
override;
238 int import_multisig_hex(
const std::vector<std::string>& multisig_hexes,
const bool refresh_after_import =
true)
override;
241 void change_password(
const std::string& old_password,
const std::string& new_password)
override;
242 void save()
override;
245 std::shared_ptr<monero_subaddress> get_balances(
const boost::optional<uint32_t>& account_idx,
const boost::optional<uint32_t>& subaddress_idx)
const;
251 boost::optional<uint64_t> m_sync_period_in_ms;
252 std::string m_path =
"";
253 std::shared_ptr<monero_rpc_connection> m_rpc;
254 std::shared_ptr<monero_rpc_connection> m_daemon_connection;
255 mutable boost::recursive_mutex m_listeners_mutex;
256 std::set<monero_wallet_listener*> m_listeners;
258 mutable boost::recursive_mutex m_sync_mutex;
259 mutable boost::mutex m_address_cache_mutex;
260 mutable std::unordered_map<uint32_t, std::unordered_map<uint32_t, std::string>> m_address_cache;
261 boost::mutex m_poller_mutex;
262 std::unique_ptr<monero_wallet_poller> m_poller;
264 monero_wallet_rpc* create_wallet_random(
const std::shared_ptr<monero_wallet_config> &config);
265 monero_wallet_rpc* create_wallet_from_seed(
const std::shared_ptr<monero_wallet_config> &config);
266 monero_wallet_rpc* create_wallet_from_keys(
const std::shared_ptr<monero_wallet_config> &config);
270 std::map<uint32_t, std::vector<uint32_t>> get_account_indices(
bool get_subaddress_indices)
const;
271 std::vector<uint32_t> get_subaddress_indices(uint32_t account_idx)
const;
272 std::vector<std::shared_ptr<monero_tx_wallet>> get_txs_aux(
const monero_tx_query& query,
int max_attempts)
const;
273 std::vector<std::shared_ptr<monero_output_wallet>> get_outputs_aux(
const monero_output_query& query)
const;
274 std::vector<std::shared_ptr<monero_transfer>> get_transfers_aux(
const monero_transfer_query& query)
const;
275 std::string query_key(
const std::string& key_type)
const;
276 std::vector<std::shared_ptr<monero_tx_wallet>> sweep_account(
const monero_tx_config &conf);
277 void clear_address_cache();
278 void refresh_listening();
279 void wait_for_listener_callbacks_idle();
Definition monero_wallet.h:71
Definition monero_wallet_rpc.cpp:79
Definition monero_wallet_rpc.h:69
void scan_txs(const std::vector< std::string > &tx_hashes) override
Definition monero_wallet_rpc.cpp:747
void stop_syncing() override
Definition monero_wallet_rpc.cpp:742
uint64_t get_height_by_date(uint16_t year, uint8_t month, uint8_t day) const override
Definition monero_wallet_rpc.cpp:680
std::vector< std::shared_ptr< monero_tx_wallet > > get_txs() const override
Definition monero_wallet_rpc.cpp:1871
monero_account get_account(const uint32_t account_idx, bool include_subaddresses) const override
Definition monero_wallet_rpc.cpp:795
bool is_view_only() const override
Definition monero_wallet_rpc.cpp:487
uint64_t get_daemon_height() const override
Definition monero_wallet_rpc.cpp:676
std::string get_tx_key(const std::string &tx_hash) const override
Definition monero_wallet_rpc.cpp:1294
std::shared_ptr< monero_rpc_connection > get_rpc_connection() const
Definition monero_wallet_rpc.h:116
std::shared_ptr< monero_tx_wallet > sweep_output(const monero_tx_config &config) override
Definition monero_wallet_rpc.cpp:1171
int import_multisig_hex(const std::vector< std::string > &multisig_hexes, const bool refresh_after_import=true) override
Definition monero_wallet_rpc.cpp:1597
std::string get_seed() const override
Definition monero_wallet_rpc.cpp:571
void close(bool save=false) override
Definition monero_wallet_rpc.cpp:1645
std::vector< std::string > submit_multisig_tx_hex(const std::string &signed_multisig_tx_hex) override
Definition monero_wallet_rpc.cpp:1614
bool check_spend_proof(const std::string &tx_hash, const std::string &message, const std::string &signature) const override
Definition monero_wallet_rpc.cpp:1370
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_rpc.cpp:1261
monero_multisig_init_result exchange_multisig_keys(const std::vector< std::string > &multisig_hexes, const std::string &password) override
Definition monero_wallet_rpc.cpp:1580
void rescan_spent() override
Definition monero_wallet_rpc.cpp:755
std::shared_ptr< monero_key_image_export_result > export_key_images(bool all=false) const override
Definition monero_wallet_rpc.cpp:990
void thaw_output(const std::string &key_image) override
Definition monero_wallet_rpc.cpp:1013
monero_subaddress create_subaddress(uint32_t account_idx, const std::string &label="") override
Definition monero_wallet_rpc.cpp:956
void delete_address_book_entry(uint64_t index) override
Definition monero_wallet_rpc.cpp:1466
int import_outputs(const std::string &outputs_hex) override
Definition monero_wallet_rpc.cpp:984
void start_mining(boost::optional< uint64_t > num_threads, boost::optional< bool > background_mining, boost::optional< bool > ignore_battery) override
Definition monero_wallet_rpc.cpp:1535
monero_subaddress get_subaddress(const uint32_t account_idx, const uint32_t subaddress_idx) const override
Definition monero_wallet_rpc.cpp:947
monero_wallet_rpc * create_wallet(const std::shared_ptr< monero_wallet_config > &config)
Definition monero_wallet_rpc.cpp:453
void set_tx_note(const std::string &tx_hashes, const std::string ¬es) override
Definition monero_wallet_rpc.cpp:1429
void untag_accounts(const std::vector< uint32_t > &account_indices) override
Definition monero_wallet_rpc.cpp:1476
monero_subaddress get_address_index(const std::string &address) const override
Definition monero_wallet_rpc.cpp:635
std::string get_path() const override
Definition monero_wallet_rpc.cpp:567
bool is_closed() const override
Definition monero_wallet_rpc.cpp:1633
std::string get_spend_proof(const std::string &tx_hash, const std::string &message) const override
Definition monero_wallet_rpc.cpp:1355
std::string get_public_view_key() const override
Definition monero_wallet_rpc.cpp:580
void stop_mining() override
Definition monero_wallet_rpc.cpp:1541
std::vector< std::shared_ptr< monero_tx_wallet > > create_txs(const monero_tx_config &conf) override
Definition monero_wallet_rpc.cpp:1029
uint64_t add_address_book_entry(const std::string &address, const std::string &description) override
Definition monero_wallet_rpc.cpp:1453
std::string get_tx_note(const std::string &tx_hash) const override
Definition monero_wallet_rpc.cpp:1411
void freeze_output(const std::string &key_image) override
Definition monero_wallet_rpc.cpp:1008
monero_sync_result sync() override
Definition monero_wallet_rpc.cpp:703
std::shared_ptr< monero_rpc_connection > get_daemon_connection() const override
Definition monero_wallet_rpc.cpp:500
std::string make_multisig(const std::vector< std::string > &multisig_hexes, int threshold, const std::string &password) override
Definition monero_wallet_rpc.cpp:1570
std::string prepare_multisig() override
Definition monero_wallet_rpc.cpp:1560
std::string get_address(const uint32_t account_idx, const uint32_t subaddress_idx) const override
Definition monero_wallet_rpc.cpp:604
void save() override
Definition monero_wallet_rpc.cpp:1628
void set_account_tag_label(const std::string &tag, const std::string &label) override
Definition monero_wallet_rpc.cpp:1488
bool is_output_frozen(const std::string &key_image) override
Definition monero_wallet_rpc.cpp:1018
monero_multisig_sign_result sign_multisig_tx_hex(const std::string &multisig_tx_hex) override
Definition monero_wallet_rpc.cpp:1606
std::string get_seed_language() const override
Definition monero_wallet_rpc.cpp:576
uint64_t get_balance() const override
Definition monero_wallet_rpc.cpp:765
void stop()
Definition monero_wallet_rpc.cpp:481
std::vector< std::shared_ptr< monero_transfer > > get_transfers(const monero_transfer_query &query) const override
Definition monero_wallet_rpc.cpp:2000
monero_tx_priority get_default_fee_priority() const override
Definition monero_wallet_rpc.cpp:1024
monero_message_signature_result verify_message(const std::string &msg, const std::string &address, const std::string &signature) const override
Definition monero_wallet_rpc.cpp:1267
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_rpc.cpp:1339
uint64_t get_height() const override
Definition monero_wallet_rpc.cpp:671
std::vector< std::shared_ptr< monero_output_wallet > > get_outputs(const monero_output_query &query) const override
Definition monero_wallet_rpc.cpp:2014
std::vector< std::shared_ptr< monero_tx_wallet > > sweep_dust(bool relay=false) override
Definition monero_wallet_rpc.cpp:1196
bool is_multisig_import_needed() const override
Definition monero_wallet_rpc.cpp:1546
std::string export_outputs(bool all=false) const override
Definition monero_wallet_rpc.cpp:978
std::string get_private_spend_key() const override
Definition monero_wallet_rpc.cpp:598
std::shared_ptr< monero_tx_config > parse_payment_uri(const std::string &uri) const override
Definition monero_wallet_rpc.cpp:1500
monero_multisig_info get_multisig_info() const override
Definition monero_wallet_rpc.cpp:1553
monero_tx_set describe_tx_set(const monero_tx_set &tx_set) override
Definition monero_wallet_rpc.cpp:1231
monero_integrated_address get_integrated_address(const std::string &standard_address="", const std::string &payment_id="") const override
Definition monero_wallet_rpc.cpp:645
void rescan_blockchain() override
Definition monero_wallet_rpc.cpp:760
std::string get_tx_proof(const std::string &tx_hash, const std::string &address, const std::string &message) const override
Definition monero_wallet_rpc.cpp:1325
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_rpc.cpp:1401
std::set< monero_wallet_listener * > get_listeners() override
Definition monero_wallet_rpc.cpp:384
~monero_wallet_rpc()
Definition monero_wallet_rpc.cpp:373
std::string get_payment_uri(const monero_tx_config &config) const override
Definition monero_wallet_rpc.cpp:1493
uint64_t get_unlocked_balance() const override
Definition monero_wallet_rpc.cpp:780
void add_listener(monero_wallet_listener &listener) override
Definition monero_wallet_rpc.cpp:389
std::vector< std::string > submit_txs(const std::string &signed_tx_hex) override
Definition monero_wallet_rpc.cpp:1251
std::vector< std::string > get_tx_notes(const std::vector< std::string > &tx_hashes) const override
Definition monero_wallet_rpc.cpp:1420
std::vector< monero_address_book_entry > get_address_book_entries(const std::vector< uint64_t > &indices) const override
Definition monero_wallet_rpc.cpp:1444
void set_tx_notes(const std::vector< std::string > &tx_hashes, const std::vector< std::string > ¬es) override
Definition monero_wallet_rpc.cpp:1438
std::vector< std::shared_ptr< monero_account_tag > > get_account_tags() const override
Definition monero_wallet_rpc.cpp:1481
std::string get_reserve_proof_wallet(const std::string &message) const override
Definition monero_wallet_rpc.cpp:1387
void remove_listener(monero_wallet_listener &listener) override
Definition monero_wallet_rpc.cpp:397
void start_syncing(uint64_t sync_period_in_ms=10000) override
Definition monero_wallet_rpc.cpp:723
std::vector< std::shared_ptr< monero_tx_wallet > > sweep_unlocked(const monero_tx_config &config) override
Definition monero_wallet_rpc.cpp:1104
void set_attribute(const std::string &key, const std::string &val) override
Definition monero_wallet_rpc.cpp:1509
void set_subaddress_label(uint32_t account_idx, uint32_t subaddress_idx, const std::string &label="") override
Definition monero_wallet_rpc.cpp:972
std::string get_reserve_proof_account(uint32_t account_idx, uint64_t amount, const std::string &message) const override
Definition monero_wallet_rpc.cpp:1394
std::vector< std::string > relay_txs(const std::vector< std::string > &tx_metadatas) override
Definition monero_wallet_rpc.cpp:1212
std::string get_public_spend_key() const override
Definition monero_wallet_rpc.cpp:592
bool get_attribute(const std::string &key, std::string &value) const override
Definition monero_wallet_rpc.cpp:1514
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_rpc.cpp:1460
std::string export_multisig_hex() override
Definition monero_wallet_rpc.cpp:1589
monero_account create_account(const std::string &label="") override
Definition monero_wallet_rpc.cpp:864
std::string get_private_view_key() const override
Definition monero_wallet_rpc.cpp:586
monero_tx_set sign_txs(const std::string &unsigned_tx_hex) override
Definition monero_wallet_rpc.cpp:1241
void tag_accounts(const std::string &tag, const std::vector< uint32_t > &account_indices) override
Definition monero_wallet_rpc.cpp:1471
std::vector< std::string > get_seed_languages() const
Definition monero_wallet_rpc.cpp:474
monero_integrated_address decode_integrated_address(const std::string &integrated_address) const override
Definition monero_wallet_rpc.cpp:661
void change_password(const std::string &old_password, const std::string &new_password) override
Definition monero_wallet_rpc.cpp:1622
void set_poll_period_in_ms(uint64_t period_ms)
Definition monero_wallet_rpc.cpp:378
monero_version get_version() const override
Definition monero_wallet_rpc.cpp:560
bool is_connected_to_daemon() const override
Definition monero_wallet_rpc.cpp:549
monero_wallet_rpc * open_wallet(const std::shared_ptr< monero_wallet_config > &config)
Definition monero_wallet_rpc.cpp:416
std::shared_ptr< monero_key_image_import_result > import_key_images(const std::vector< std::shared_ptr< monero_key_image > > &key_images, uint64_t offset=0) override
Definition monero_wallet_rpc.cpp:999
std::shared_ptr< monero_check_tx > check_tx_key(const std::string &tx_hash, const std::string &tx_key, const std::string &address) const override
Definition monero_wallet_rpc.cpp:1309
Definition monero_wallet.h:123
virtual std::vector< monero_account > get_accounts() const
Definition monero_wallet.h:579
Definition monero_error.h:61
monero_message_signature_type
Definition monero_wallet_model.h:465
monero_tx_priority
Definition monero_wallet_model.h:399
Definition monero_wallet_model.h:131
Definition monero_wallet_model.h:386
Definition monero_wallet_model.h:473
Definition monero_wallet_model.h:523
Definition monero_wallet_model.h:539
Definition monero_wallet_model.h:551
Definition monero_wallet_model.h:271
Definition monero_wallet_model.h:112
Definition monero_wallet_model.h:98
Definition monero_wallet_model.h:226
Definition monero_wallet_model.h:409
Definition monero_wallet_model.h:331
Definition monero_wallet_model.h:370
Definition monero_daemon_model.h:142
Definition monero_daemon_model.h:93