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_output_wallet>> get_outputs_aux(
const monero_output_query& query)
const;
273 std::vector<std::shared_ptr<monero_transfer>> get_transfers_aux(
const monero_transfer_query& query)
const;
274 std::string query_key(
const std::string& key_type)
const;
275 std::vector<std::shared_ptr<monero_tx_wallet>> sweep_account(
const monero_tx_config &conf);
276 void clear_address_cache();
277 void refresh_listening();
278 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:711
void stop_syncing() override
Definition monero_wallet_rpc.cpp:706
uint64_t get_height_by_date(uint16_t year, uint8_t month, uint8_t day) const override
Definition monero_wallet_rpc.cpp:644
std::vector< std::shared_ptr< monero_tx_wallet > > get_txs() const override
Definition monero_wallet_rpc.cpp:1825
monero_account get_account(const uint32_t account_idx, bool include_subaddresses) const override
Definition monero_wallet_rpc.cpp:759
bool is_view_only() const override
Definition monero_wallet_rpc.cpp:451
uint64_t get_daemon_height() const override
Definition monero_wallet_rpc.cpp:640
std::string get_tx_key(const std::string &tx_hash) const override
Definition monero_wallet_rpc.cpp:1255
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:1135
int import_multisig_hex(const std::vector< std::string > &multisig_hexes, const bool refresh_after_import=true) override
Definition monero_wallet_rpc.cpp:1555
std::string get_seed() const override
Definition monero_wallet_rpc.cpp:535
void close(bool save=false) override
Definition monero_wallet_rpc.cpp:1603
std::vector< std::string > submit_multisig_tx_hex(const std::string &signed_multisig_tx_hex) override
Definition monero_wallet_rpc.cpp:1572
bool check_spend_proof(const std::string &tx_hash, const std::string &message, const std::string &signature) const override
Definition monero_wallet_rpc.cpp:1330
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:1225
monero_multisig_init_result exchange_multisig_keys(const std::vector< std::string > &multisig_hexes, const std::string &password) override
Definition monero_wallet_rpc.cpp:1538
void rescan_spent() override
Definition monero_wallet_rpc.cpp:719
std::shared_ptr< monero_key_image_export_result > export_key_images(bool all=false) const override
Definition monero_wallet_rpc.cpp:954
void thaw_output(const std::string &key_image) override
Definition monero_wallet_rpc.cpp:977
monero_subaddress create_subaddress(uint32_t account_idx, const std::string &label="") override
Definition monero_wallet_rpc.cpp:920
void delete_address_book_entry(uint64_t index) override
Definition monero_wallet_rpc.cpp:1424
int import_outputs(const std::string &outputs_hex) override
Definition monero_wallet_rpc.cpp:948
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:1493
monero_subaddress get_subaddress(const uint32_t account_idx, const uint32_t subaddress_idx) const override
Definition monero_wallet_rpc.cpp:911
monero_wallet_rpc * create_wallet(const std::shared_ptr< monero_wallet_config > &config)
Definition monero_wallet_rpc.cpp:417
void set_tx_note(const std::string &tx_hashes, const std::string ¬es) override
Definition monero_wallet_rpc.cpp:1387
void untag_accounts(const std::vector< uint32_t > &account_indices) override
Definition monero_wallet_rpc.cpp:1434
monero_subaddress get_address_index(const std::string &address) const override
Definition monero_wallet_rpc.cpp:599
std::string get_path() const override
Definition monero_wallet_rpc.cpp:531
bool is_closed() const override
Definition monero_wallet_rpc.cpp:1591
std::string get_spend_proof(const std::string &tx_hash, const std::string &message) const override
Definition monero_wallet_rpc.cpp:1315
std::string get_public_view_key() const override
Definition monero_wallet_rpc.cpp:544
void stop_mining() override
Definition monero_wallet_rpc.cpp:1499
std::vector< std::shared_ptr< monero_tx_wallet > > create_txs(const monero_tx_config &conf) override
Definition monero_wallet_rpc.cpp:993
uint64_t add_address_book_entry(const std::string &address, const std::string &description) override
Definition monero_wallet_rpc.cpp:1411
std::string get_tx_note(const std::string &tx_hash) const override
Definition monero_wallet_rpc.cpp:1369
void freeze_output(const std::string &key_image) override
Definition monero_wallet_rpc.cpp:972
monero_sync_result sync() override
Definition monero_wallet_rpc.cpp:667
std::shared_ptr< monero_rpc_connection > get_daemon_connection() const override
Definition monero_wallet_rpc.cpp:464
std::string make_multisig(const std::vector< std::string > &multisig_hexes, int threshold, const std::string &password) override
Definition monero_wallet_rpc.cpp:1528
std::string prepare_multisig() override
Definition monero_wallet_rpc.cpp:1518
std::string get_address(const uint32_t account_idx, const uint32_t subaddress_idx) const override
Definition monero_wallet_rpc.cpp:568
void save() override
Definition monero_wallet_rpc.cpp:1586
void set_account_tag_label(const std::string &tag, const std::string &label) override
Definition monero_wallet_rpc.cpp:1446
bool is_output_frozen(const std::string &key_image) override
Definition monero_wallet_rpc.cpp:982
monero_multisig_sign_result sign_multisig_tx_hex(const std::string &multisig_tx_hex) override
Definition monero_wallet_rpc.cpp:1564
std::string get_seed_language() const override
Definition monero_wallet_rpc.cpp:540
uint64_t get_balance() const override
Definition monero_wallet_rpc.cpp:729
void stop()
Definition monero_wallet_rpc.cpp:445
std::vector< std::shared_ptr< monero_transfer > > get_transfers(const monero_transfer_query &query) const override
Definition monero_wallet_rpc.cpp:1949
monero_tx_priority get_default_fee_priority() const override
Definition monero_wallet_rpc.cpp:988
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:1231
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:1300
uint64_t get_height() const override
Definition monero_wallet_rpc.cpp:635
std::vector< std::shared_ptr< monero_output_wallet > > get_outputs(const monero_output_query &query) const override
Definition monero_wallet_rpc.cpp:1963
std::vector< std::shared_ptr< monero_tx_wallet > > sweep_dust(bool relay=false) override
Definition monero_wallet_rpc.cpp:1160
bool is_multisig_import_needed() const override
Definition monero_wallet_rpc.cpp:1504
std::string export_outputs(bool all=false) const override
Definition monero_wallet_rpc.cpp:942
std::string get_private_spend_key() const override
Definition monero_wallet_rpc.cpp:562
std::shared_ptr< monero_tx_config > parse_payment_uri(const std::string &uri) const override
Definition monero_wallet_rpc.cpp:1458
monero_multisig_info get_multisig_info() const override
Definition monero_wallet_rpc.cpp:1511
monero_tx_set describe_tx_set(const monero_tx_set &tx_set) override
Definition monero_wallet_rpc.cpp:1195
monero_integrated_address get_integrated_address(const std::string &standard_address="", const std::string &payment_id="") const override
Definition monero_wallet_rpc.cpp:609
void rescan_blockchain() override
Definition monero_wallet_rpc.cpp:724
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:1286
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:1360
std::set< monero_wallet_listener * > get_listeners() override
Definition monero_wallet_rpc.cpp:348
~monero_wallet_rpc()
Definition monero_wallet_rpc.cpp:337
std::string get_payment_uri(const monero_tx_config &config) const override
Definition monero_wallet_rpc.cpp:1451
uint64_t get_unlocked_balance() const override
Definition monero_wallet_rpc.cpp:744
void add_listener(monero_wallet_listener &listener) override
Definition monero_wallet_rpc.cpp:353
std::vector< std::string > submit_txs(const std::string &signed_tx_hex) override
Definition monero_wallet_rpc.cpp:1215
std::vector< std::string > get_tx_notes(const std::vector< std::string > &tx_hashes) const override
Definition monero_wallet_rpc.cpp:1378
std::vector< monero_address_book_entry > get_address_book_entries(const std::vector< uint64_t > &indices) const override
Definition monero_wallet_rpc.cpp:1402
void set_tx_notes(const std::vector< std::string > &tx_hashes, const std::vector< std::string > ¬es) override
Definition monero_wallet_rpc.cpp:1396
std::vector< std::shared_ptr< monero_account_tag > > get_account_tags() const override
Definition monero_wallet_rpc.cpp:1439
std::string get_reserve_proof_wallet(const std::string &message) const override
Definition monero_wallet_rpc.cpp:1346
void remove_listener(monero_wallet_listener &listener) override
Definition monero_wallet_rpc.cpp:361
void start_syncing(uint64_t sync_period_in_ms=10000) override
Definition monero_wallet_rpc.cpp:687
std::vector< std::shared_ptr< monero_tx_wallet > > sweep_unlocked(const monero_tx_config &config) override
Definition monero_wallet_rpc.cpp:1068
void set_attribute(const std::string &key, const std::string &val) override
Definition monero_wallet_rpc.cpp:1467
void set_subaddress_label(uint32_t account_idx, uint32_t subaddress_idx, const std::string &label="") override
Definition monero_wallet_rpc.cpp:936
std::string get_reserve_proof_account(uint32_t account_idx, uint64_t amount, const std::string &message) const override
Definition monero_wallet_rpc.cpp:1353
std::vector< std::string > relay_txs(const std::vector< std::string > &tx_metadatas) override
Definition monero_wallet_rpc.cpp:1176
std::string get_public_spend_key() const override
Definition monero_wallet_rpc.cpp:556
bool get_attribute(const std::string &key, std::string &value) const override
Definition monero_wallet_rpc.cpp:1472
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:1418
std::string export_multisig_hex() override
Definition monero_wallet_rpc.cpp:1547
monero_account create_account(const std::string &label="") override
Definition monero_wallet_rpc.cpp:828
std::string get_private_view_key() const override
Definition monero_wallet_rpc.cpp:550
monero_tx_set sign_txs(const std::string &unsigned_tx_hex) override
Definition monero_wallet_rpc.cpp:1205
void tag_accounts(const std::string &tag, const std::vector< uint32_t > &account_indices) override
Definition monero_wallet_rpc.cpp:1429
std::vector< std::string > get_seed_languages() const
Definition monero_wallet_rpc.cpp:438
monero_integrated_address decode_integrated_address(const std::string &integrated_address) const override
Definition monero_wallet_rpc.cpp:625
void change_password(const std::string &old_password, const std::string &new_password) override
Definition monero_wallet_rpc.cpp:1580
void set_poll_period_in_ms(uint64_t period_ms)
Definition monero_wallet_rpc.cpp:342
monero_version get_version() const override
Definition monero_wallet_rpc.cpp:524
bool is_connected_to_daemon() const override
Definition monero_wallet_rpc.cpp:513
monero_wallet_rpc * open_wallet(const std::shared_ptr< monero_wallet_config > &config)
Definition monero_wallet_rpc.cpp:380
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:963
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:1270
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:444
monero_tx_priority
Definition monero_wallet_model.h:381
Definition monero_wallet_model.h:127
Definition monero_wallet_model.h:369
Definition monero_wallet_model.h:452
Definition monero_wallet_model.h:497
Definition monero_wallet_model.h:512
Definition monero_wallet_model.h:523
Definition monero_wallet_model.h:259
Definition monero_wallet_model.h:109
Definition monero_wallet_model.h:97
Definition monero_wallet_model.h:216
Definition monero_wallet_model.h:391
Definition monero_wallet_model.h:313
Definition monero_wallet_model.h:353
Definition monero_daemon_model.h:140
Definition monero_daemon_model.h:93