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);
140 void set_daemon_connection(
const std::shared_ptr<monero_rpc_connection>& connection,
bool is_trusted,
const boost::optional<ssl_options>&
ssl_options);
141 void set_daemon_connection(
const std::shared_ptr<monero_rpc_connection>& connection,
const boost::optional<bool>& is_trusted = boost::none)
override;
142 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;
145 std::string
get_path()
const override;
146 std::string
get_seed()
const override;
152 std::string
get_address(
const uint32_t account_idx,
const uint32_t subaddress_idx)
const override;
158 uint64_t
get_height_by_date(uint16_t year, uint8_t month, uint8_t day)
const override;
163 void start_syncing(uint64_t sync_period_in_ms = 10000)
override;
165 void scan_txs(
const std::vector<std::string>& tx_hashes)
override;
169 uint64_t
get_balance(uint32_t account_index)
const override;
170 uint64_t
get_balance(uint32_t account_idx, uint32_t subaddress_idx)
const override;
176 std::vector<monero_account>
get_accounts(
bool include_subaddresses,
const std::string& tag)
const override;
177 std::vector<monero_account>
get_accounts(
bool include_subaddresses,
const std::string& tag,
bool skip_balances)
const;
179 std::vector<monero_subaddress> get_subaddresses(
const uint32_t account_idx,
const std::vector<uint32_t>& subaddress_indices,
bool skip_balances)
const;
180 std::vector<monero_subaddress> get_subaddresses(uint32_t account_idx,
const std::vector<uint32_t>& subaddress_indices)
const override;
181 std::vector<monero_subaddress> get_subaddresses(
const uint32_t account_idx)
const override;
184 void set_subaddress_label(uint32_t account_idx, uint32_t subaddress_idx,
const std::string& label =
"")
override;
185 std::vector<std::shared_ptr<monero_tx_wallet>>
get_txs()
const override;
191 std::shared_ptr<monero_key_image_export_result>
export_key_images(
bool all =
false)
const override;
192 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;
194 void thaw_output(
const std::string& key_image)
override;
199 std::vector<std::shared_ptr<monero_tx_wallet>>
sweep_dust(
bool relay =
false)
override;
201 std::vector<std::string>
relay_txs(
const std::vector<std::string>& tx_metadatas)
override;
204 std::vector<std::string>
submit_txs(
const std::string& signed_tx_hex)
override;
207 std::string
get_tx_key(
const std::string& tx_hash)
const override;
208 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;
209 std::string
get_tx_proof(
const std::string& tx_hash,
const std::string& address,
const std::string& message)
const override;
210 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;
211 std::string
get_spend_proof(
const std::string& tx_hash,
const std::string& message)
const override;
212 bool check_spend_proof(
const std::string& tx_hash,
const std::string& message,
const std::string& signature)
const override;
215 std::shared_ptr<monero_check_reserve>
check_reserve_proof(
const std::string& address,
const std::string& message,
const std::string& signature)
const override;
216 std::string
get_tx_note(
const std::string& tx_hash)
const override;
217 std::vector<std::string>
get_tx_notes(
const std::vector<std::string>& tx_hashes)
const override;
218 void set_tx_note(
const std::string& tx_hashes,
const std::string& notes)
override;
219 void set_tx_notes(
const std::vector<std::string>& tx_hashes,
const std::vector<std::string>& notes)
override;
220 std::vector<monero_address_book_entry>
get_address_book_entries(
const std::vector<uint64_t>& indices)
const override;
222 void edit_address_book_entry(uint64_t index,
bool set_address,
const std::string& address,
bool set_description,
const std::string& description)
override;
224 void tag_accounts(
const std::string& tag,
const std::vector<uint32_t>& account_indices)
override;
225 void untag_accounts(
const std::vector<uint32_t>& account_indices)
override;
226 std::vector<std::shared_ptr<monero_account_tag>>
get_account_tags()
const override;
229 std::shared_ptr<monero_tx_config>
parse_payment_uri(
const std::string& uri)
const override;
230 void set_attribute(
const std::string& key,
const std::string& val)
override;
231 bool get_attribute(
const std::string& key, std::string& value)
const override;
232 void start_mining(boost::optional<uint64_t> num_threads, boost::optional<bool> background_mining, boost::optional<bool> ignore_battery)
override;
237 std::string
make_multisig(
const std::vector<std::string>& multisig_hexes,
int threshold,
const std::string& password)
override;
240 int import_multisig_hex(
const std::vector<std::string>& multisig_hexes,
const bool refresh_after_import =
true)
override;
243 void change_password(
const std::string& old_password,
const std::string& new_password)
override;
244 void save()
override;
247 std::shared_ptr<monero_subaddress> get_balances(
const boost::optional<uint32_t>& account_idx,
const boost::optional<uint32_t>& subaddress_idx)
const;
253 boost::optional<uint64_t> m_sync_period_in_ms;
254 std::string m_path =
"";
255 std::shared_ptr<monero_rpc_connection> m_rpc;
256 std::shared_ptr<monero_rpc_connection> m_daemon_connection;
257 mutable boost::recursive_mutex m_listeners_mutex;
258 std::set<monero_wallet_listener*> m_listeners;
260 mutable boost::recursive_mutex m_sync_mutex;
261 mutable boost::mutex m_address_cache_mutex;
262 mutable std::unordered_map<uint32_t, std::unordered_map<uint32_t, std::string>> m_address_cache;
263 boost::mutex m_poller_mutex;
264 std::unique_ptr<monero_wallet_poller> m_poller;
266 monero_wallet_rpc* create_wallet_random(
const std::shared_ptr<monero_wallet_config> &config);
267 monero_wallet_rpc* create_wallet_from_seed(
const std::shared_ptr<monero_wallet_config> &config);
268 monero_wallet_rpc* create_wallet_from_keys(
const std::shared_ptr<monero_wallet_config> &config);
272 std::map<uint32_t, std::vector<uint32_t>> get_account_indices(
bool get_subaddress_indices)
const;
273 std::vector<uint32_t> get_subaddress_indices(uint32_t account_idx)
const;
274 std::vector<std::shared_ptr<monero_tx_wallet>> get_txs_aux(
const monero_tx_query& query,
int max_attempts)
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_transfer>> get_transfers_aux(
const monero_transfer_query& query)
const;
277 std::string query_key(
const std::string& key_type)
const;
278 std::vector<std::shared_ptr<monero_tx_wallet>> sweep_account(
const monero_tx_config &conf);
279 void clear_address_cache();
280 void refresh_listening();
281 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:753
void stop_syncing() override
Definition monero_wallet_rpc.cpp:748
uint64_t get_height_by_date(uint16_t year, uint8_t month, uint8_t day) const override
Definition monero_wallet_rpc.cpp:686
std::vector< std::shared_ptr< monero_tx_wallet > > get_txs() const override
Definition monero_wallet_rpc.cpp:1877
monero_account get_account(const uint32_t account_idx, bool include_subaddresses) const override
Definition monero_wallet_rpc.cpp:801
bool is_view_only() const override
Definition monero_wallet_rpc.cpp:487
uint64_t get_daemon_height() const override
Definition monero_wallet_rpc.cpp:682
std::string get_tx_key(const std::string &tx_hash) const override
Definition monero_wallet_rpc.cpp:1300
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:1177
int import_multisig_hex(const std::vector< std::string > &multisig_hexes, const bool refresh_after_import=true) override
Definition monero_wallet_rpc.cpp:1603
std::string get_seed() const override
Definition monero_wallet_rpc.cpp:577
void close(bool save=false) override
Definition monero_wallet_rpc.cpp:1651
std::vector< std::string > submit_multisig_tx_hex(const std::string &signed_multisig_tx_hex) override
Definition monero_wallet_rpc.cpp:1620
bool check_spend_proof(const std::string &tx_hash, const std::string &message, const std::string &signature) const override
Definition monero_wallet_rpc.cpp:1376
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:1267
monero_multisig_init_result exchange_multisig_keys(const std::vector< std::string > &multisig_hexes, const std::string &password) override
Definition monero_wallet_rpc.cpp:1586
void rescan_spent() override
Definition monero_wallet_rpc.cpp:761
std::shared_ptr< monero_key_image_export_result > export_key_images(bool all=false) const override
Definition monero_wallet_rpc.cpp:996
void thaw_output(const std::string &key_image) override
Definition monero_wallet_rpc.cpp:1019
monero_subaddress create_subaddress(uint32_t account_idx, const std::string &label="") override
Definition monero_wallet_rpc.cpp:962
void delete_address_book_entry(uint64_t index) override
Definition monero_wallet_rpc.cpp:1472
int import_outputs(const std::string &outputs_hex) override
Definition monero_wallet_rpc.cpp:990
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:1541
monero_subaddress get_subaddress(const uint32_t account_idx, const uint32_t subaddress_idx) const override
Definition monero_wallet_rpc.cpp:953
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:1435
void untag_accounts(const std::vector< uint32_t > &account_indices) override
Definition monero_wallet_rpc.cpp:1482
monero_subaddress get_address_index(const std::string &address) const override
Definition monero_wallet_rpc.cpp:641
std::string get_path() const override
Definition monero_wallet_rpc.cpp:573
bool is_closed() const override
Definition monero_wallet_rpc.cpp:1639
std::string get_spend_proof(const std::string &tx_hash, const std::string &message) const override
Definition monero_wallet_rpc.cpp:1361
std::string get_public_view_key() const override
Definition monero_wallet_rpc.cpp:586
void stop_mining() override
Definition monero_wallet_rpc.cpp:1547
std::vector< std::shared_ptr< monero_tx_wallet > > create_txs(const monero_tx_config &conf) override
Definition monero_wallet_rpc.cpp:1035
uint64_t add_address_book_entry(const std::string &address, const std::string &description) override
Definition monero_wallet_rpc.cpp:1459
std::string get_tx_note(const std::string &tx_hash) const override
Definition monero_wallet_rpc.cpp:1417
void freeze_output(const std::string &key_image) override
Definition monero_wallet_rpc.cpp:1014
monero_sync_result sync() override
Definition monero_wallet_rpc.cpp:709
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:1576
std::string prepare_multisig() override
Definition monero_wallet_rpc.cpp:1566
std::string get_address(const uint32_t account_idx, const uint32_t subaddress_idx) const override
Definition monero_wallet_rpc.cpp:610
void save() override
Definition monero_wallet_rpc.cpp:1634
void set_account_tag_label(const std::string &tag, const std::string &label) override
Definition monero_wallet_rpc.cpp:1494
bool is_output_frozen(const std::string &key_image) override
Definition monero_wallet_rpc.cpp:1024
monero_multisig_sign_result sign_multisig_tx_hex(const std::string &multisig_tx_hex) override
Definition monero_wallet_rpc.cpp:1612
std::string get_seed_language() const override
Definition monero_wallet_rpc.cpp:582
uint64_t get_balance() const override
Definition monero_wallet_rpc.cpp:771
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:2006
monero_tx_priority get_default_fee_priority() const override
Definition monero_wallet_rpc.cpp:1030
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:1273
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:1345
uint64_t get_height() const override
Definition monero_wallet_rpc.cpp:677
std::vector< std::shared_ptr< monero_output_wallet > > get_outputs(const monero_output_query &query) const override
Definition monero_wallet_rpc.cpp:2020
std::vector< std::shared_ptr< monero_tx_wallet > > sweep_dust(bool relay=false) override
Definition monero_wallet_rpc.cpp:1202
bool is_multisig_import_needed() const override
Definition monero_wallet_rpc.cpp:1552
std::string export_outputs(bool all=false) const override
Definition monero_wallet_rpc.cpp:984
std::string get_private_spend_key() const override
Definition monero_wallet_rpc.cpp:604
std::shared_ptr< monero_tx_config > parse_payment_uri(const std::string &uri) const override
Definition monero_wallet_rpc.cpp:1506
monero_multisig_info get_multisig_info() const override
Definition monero_wallet_rpc.cpp:1559
monero_tx_set describe_tx_set(const monero_tx_set &tx_set) override
Definition monero_wallet_rpc.cpp:1237
monero_integrated_address get_integrated_address(const std::string &standard_address="", const std::string &payment_id="") const override
Definition monero_wallet_rpc.cpp:651
void rescan_blockchain() override
Definition monero_wallet_rpc.cpp:766
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:1331
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:1407
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:1499
uint64_t get_unlocked_balance() const override
Definition monero_wallet_rpc.cpp:786
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:1257
std::vector< std::string > get_tx_notes(const std::vector< std::string > &tx_hashes) const override
Definition monero_wallet_rpc.cpp:1426
std::vector< monero_address_book_entry > get_address_book_entries(const std::vector< uint64_t > &indices) const override
Definition monero_wallet_rpc.cpp:1450
void set_tx_notes(const std::vector< std::string > &tx_hashes, const std::vector< std::string > ¬es) override
Definition monero_wallet_rpc.cpp:1444
std::vector< std::shared_ptr< monero_account_tag > > get_account_tags() const override
Definition monero_wallet_rpc.cpp:1487
std::string get_reserve_proof_wallet(const std::string &message) const override
Definition monero_wallet_rpc.cpp:1393
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:729
std::vector< std::shared_ptr< monero_tx_wallet > > sweep_unlocked(const monero_tx_config &config) override
Definition monero_wallet_rpc.cpp:1110
void set_attribute(const std::string &key, const std::string &val) override
Definition monero_wallet_rpc.cpp:1515
void set_subaddress_label(uint32_t account_idx, uint32_t subaddress_idx, const std::string &label="") override
Definition monero_wallet_rpc.cpp:978
std::string get_reserve_proof_account(uint32_t account_idx, uint64_t amount, const std::string &message) const override
Definition monero_wallet_rpc.cpp:1400
std::vector< std::string > relay_txs(const std::vector< std::string > &tx_metadatas) override
Definition monero_wallet_rpc.cpp:1218
std::string get_public_spend_key() const override
Definition monero_wallet_rpc.cpp:598
bool get_attribute(const std::string &key, std::string &value) const override
Definition monero_wallet_rpc.cpp:1520
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:1466
std::string export_multisig_hex() override
Definition monero_wallet_rpc.cpp:1595
monero_account create_account(const std::string &label="") override
Definition monero_wallet_rpc.cpp:870
std::string get_private_view_key() const override
Definition monero_wallet_rpc.cpp:592
monero_tx_set sign_txs(const std::string &unsigned_tx_hex) override
Definition monero_wallet_rpc.cpp:1247
void tag_accounts(const std::string &tag, const std::vector< uint32_t > &account_indices) override
Definition monero_wallet_rpc.cpp:1477
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:667
void change_password(const std::string &old_password, const std::string &new_password) override
Definition monero_wallet_rpc.cpp:1628
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:566
bool is_connected_to_daemon() const override
Definition monero_wallet_rpc.cpp:555
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:1005
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:1315
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