55#include "daemon/monero_daemon_model.h"
68 boost::optional<std::string> m_path;
69 boost::optional<std::string> m_password;
70 boost::optional<monero_network_type> m_network_type;
71 boost::optional<std::string> m_server_uri;
72 boost::optional<std::string> m_server_username;
73 boost::optional<std::string> m_server_password;
74 boost::optional<std::string> m_seed;
75 boost::optional<std::string> m_seed_offset;
76 boost::optional<std::string> m_primary_address;
77 boost::optional<std::string> m_private_view_key;
78 boost::optional<std::string> m_private_spend_key;
79 boost::optional<uint64_t> m_restore_height;
80 boost::optional<std::string> m_language;
81 boost::optional<bool> m_save_current;
82 boost::optional<uint64_t> m_account_lookahead;
83 boost::optional<uint64_t> m_subaddress_lookahead;
84 boost::optional<bool> m_is_multisig;
89 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
90 static std::shared_ptr<monero_wallet_config> deserialize(
const std::string& config_json);
99 uint64_t m_num_blocks_fetched;
100 bool m_received_money;
102 monero_sync_result(
const uint64_t num_blocks_fetched,
const bool received_money) : m_num_blocks_fetched(num_blocks_fetched), m_received_money(received_money) {}
104 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
111 boost::optional<uint32_t> m_account_index;
112 boost::optional<uint32_t> m_index;
113 boost::optional<std::string> m_address;
114 boost::optional<std::string> m_label;
115 boost::optional<uint64_t> m_balance;
116 boost::optional<uint64_t> m_unlocked_balance;
117 boost::optional<uint64_t> m_num_unspent_outputs;
118 boost::optional<bool> m_is_used;
119 boost::optional<uint64_t> m_num_blocks_to_unlock;
121 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
128 boost::optional<uint32_t> m_index;
129 boost::optional<std::string> m_primary_address;
130 boost::optional<uint64_t> m_balance;
131 boost::optional<uint64_t> m_unlocked_balance;
132 boost::optional<std::string> m_tag;
133 std::vector<monero_subaddress> m_subaddresses;
135 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
142 boost::optional<std::string> m_address;
143 boost::optional<uint64_t> m_amount;
145 monero_destination(boost::optional<std::string> address = boost::none, boost::optional<uint64_t> amount = boost::none) : m_address(address), m_amount(amount) {}
146 rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
147 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_destination>& destination);
148 std::shared_ptr<monero_destination> copy(
const std::shared_ptr<monero_destination>& src,
const std::shared_ptr<monero_destination>& tgt)
const;
162 std::shared_ptr<monero_tx_wallet> m_tx;
163 boost::optional<uint64_t> m_amount;
164 boost::optional<uint32_t> m_account_index;
166 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
167 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_transfer>& transfer);
168 virtual boost::optional<bool> is_incoming()
const = 0;
169 std::shared_ptr<monero_transfer> copy(
const std::shared_ptr<monero_transfer>& src,
const std::shared_ptr<monero_transfer>& tgt)
const;
170 boost::optional<bool> is_outgoing()
const {
171 if (is_incoming() == boost::none)
return boost::none;
172 return !(*is_incoming());
174 void merge(
const std::shared_ptr<monero_transfer>& self,
const std::shared_ptr<monero_transfer>& other);
181 boost::optional<uint32_t> m_subaddress_index;
182 boost::optional<std::string> m_address;
183 boost::optional<uint64_t> m_num_suggested_confirmations;
185 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
186 std::shared_ptr<monero_incoming_transfer> copy(
const std::shared_ptr<monero_transfer>& src,
const std::shared_ptr<monero_transfer>& tgt)
const;
187 std::shared_ptr<monero_incoming_transfer> copy(
const std::shared_ptr<monero_incoming_transfer>& src,
const std::shared_ptr<monero_incoming_transfer>& tgt)
const;
188 boost::optional<bool> is_incoming()
const;
189 void merge(
const std::shared_ptr<monero_transfer>& self,
const std::shared_ptr<monero_transfer>& other);
190 void merge(
const std::shared_ptr<monero_incoming_transfer>& self,
const std::shared_ptr<monero_incoming_transfer>& other);
197 std::vector<uint32_t> m_subaddress_indices;
198 std::vector<std::string> m_addresses;
199 std::vector<std::shared_ptr<monero_destination>> m_destinations;
201 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
202 std::shared_ptr<monero_outgoing_transfer> copy(
const std::shared_ptr<monero_transfer>& src,
const std::shared_ptr<monero_transfer>& tgt)
const;
203 std::shared_ptr<monero_outgoing_transfer> copy(
const std::shared_ptr<monero_outgoing_transfer>& src,
const std::shared_ptr<monero_outgoing_transfer>& tgt)
const;
204 boost::optional<bool> is_incoming()
const;
205 void merge(
const std::shared_ptr<monero_transfer>& self,
const std::shared_ptr<monero_transfer>& other);
206 void merge(
const std::shared_ptr<monero_outgoing_transfer>& self,
const std::shared_ptr<monero_outgoing_transfer>& other);
215 boost::optional<bool> m_is_incoming;
216 boost::optional<std::string> m_address;
217 std::vector<std::string> m_addresses;
218 boost::optional<uint32_t> m_subaddress_index;
219 std::vector<uint32_t> m_subaddress_indices;
220 std::vector<std::shared_ptr<monero_destination>> m_destinations;
221 boost::optional<bool> m_has_destinations;
222 boost::optional<std::shared_ptr<monero_tx_query>> m_tx_query;
224 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
225 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_transfer_query>& transfer_query);
226 static std::shared_ptr<monero_transfer_query> deserialize_from_block(
const std::string& transfer_query_json);
227 std::shared_ptr<monero_transfer_query> copy(
const std::shared_ptr<monero_transfer>& src,
const std::shared_ptr<monero_transfer>& tgt)
const;
228 std::shared_ptr<monero_transfer_query> copy(
const std::shared_ptr<monero_transfer_query>& src,
const std::shared_ptr<monero_transfer_query>& tgt)
const;
229 boost::optional<bool> is_incoming()
const;
230 bool meets_criteria(
monero_transfer* transfer,
bool query_parent =
true)
const;
237 boost::optional<uint32_t> m_account_index;
238 boost::optional<uint32_t> m_subaddress_index;
239 boost::optional<bool> m_is_spent;
240 boost::optional<bool> m_is_frozen;
242 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
243 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_output_wallet>& output_wallet);
244 std::shared_ptr<monero_output_wallet> copy(
const std::shared_ptr<monero_output>& src,
const std::shared_ptr<monero_output>& tgt)
const;
245 std::shared_ptr<monero_output_wallet> copy(
const std::shared_ptr<monero_output_wallet>& src,
const std::shared_ptr<monero_output_wallet>& tgt)
const;
246 void merge(
const std::shared_ptr<monero_output>& self,
const std::shared_ptr<monero_output>& other);
247 void merge(
const std::shared_ptr<monero_output_wallet>& self,
const std::shared_ptr<monero_output_wallet>& other);
257 std::vector<uint32_t> m_subaddress_indices;
258 boost::optional<uint64_t> m_min_amount;
259 boost::optional<uint64_t> m_max_amount;
260 boost::optional<std::shared_ptr<monero_tx_query>> m_tx_query;
263 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
264 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_output_query>& output_query);
265 static std::shared_ptr<monero_output_query> deserialize_from_block(
const std::string& output_query_json);
266 std::shared_ptr<monero_output_query> copy(
const std::shared_ptr<monero_output>& src,
const std::shared_ptr<monero_output>& tgt)
const;
267 std::shared_ptr<monero_output_query> copy(
const std::shared_ptr<monero_output_wallet>& src,
const std::shared_ptr<monero_output_wallet>& tgt)
const;
268 std::shared_ptr<monero_output_query> copy(
const std::shared_ptr<monero_output_query>& src,
const std::shared_ptr<monero_output_query>& tgt)
const;
276 boost::optional<std::shared_ptr<monero_tx_set>> m_tx_set;
277 boost::optional<bool> m_is_incoming;
278 boost::optional<bool> m_is_outgoing;
279 std::vector<std::shared_ptr<monero_incoming_transfer>> m_incoming_transfers;
280 boost::optional<std::shared_ptr<monero_outgoing_transfer>> m_outgoing_transfer;
281 boost::optional<std::string> m_note;
282 boost::optional<bool> m_is_locked;
283 boost::optional<uint64_t> m_input_sum;
284 boost::optional<uint64_t> m_output_sum;
285 boost::optional<std::string> m_change_address;
286 boost::optional<uint64_t> m_change_amount;
287 boost::optional<uint32_t> m_num_dummy_outputs;
288 boost::optional<std::string> m_extra_hex;
290 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
291 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_tx_wallet>& tx_wallet);
292 std::shared_ptr<monero_tx_wallet> copy(
const std::shared_ptr<monero_tx>& src,
const std::shared_ptr<monero_tx>& tgt)
const;
293 std::shared_ptr<monero_tx_wallet> copy(
const std::shared_ptr<monero_tx_wallet>& src,
const std::shared_ptr<monero_tx_wallet>& tgt)
const;
294 void merge(
const std::shared_ptr<monero_tx>& self,
const std::shared_ptr<monero_tx>& other);
295 void merge(
const std::shared_ptr<monero_tx_wallet>& self,
const std::shared_ptr<monero_tx_wallet>& other);
296 std::vector<std::shared_ptr<monero_transfer>> get_transfers()
const;
297 std::vector<std::shared_ptr<monero_transfer>> get_transfers(
const monero_transfer_query& query)
const;
299 std::vector<std::shared_ptr<monero_output_wallet>> get_outputs_wallet()
const;
300 std::vector<std::shared_ptr<monero_output_wallet>> get_outputs_wallet(
const monero_output_query& query)
const;
301 std::vector<std::shared_ptr<monero_output_wallet>> filter_outputs_wallet(
const monero_output_query& query);
310 boost::optional<bool> m_is_outgoing;
311 boost::optional<bool> m_is_incoming;
312 std::vector<std::string> m_hashes;
313 boost::optional<bool> m_has_payment_id;
314 std::vector<std::string> m_payment_ids;
315 boost::optional<uint64_t> m_height;
316 boost::optional<uint64_t> m_min_height;
317 boost::optional<uint64_t> m_max_height;
318 boost::optional<uint64_t> m_include_outputs;
319 boost::optional<std::shared_ptr<monero_transfer_query>> m_transfer_query;
320 boost::optional<std::shared_ptr<monero_output_query>> m_input_query;
321 boost::optional<std::shared_ptr<monero_output_query>> m_output_query;
323 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
324 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_tx_query>& tx_query);
325 static std::shared_ptr<monero_tx_query> deserialize_from_block(
const std::string& tx_query_json);
326 std::shared_ptr<monero_tx_query> copy(
const std::shared_ptr<monero_tx>& src,
const std::shared_ptr<monero_tx>& tgt)
const;
327 std::shared_ptr<monero_tx_query> copy(
const std::shared_ptr<monero_tx_wallet>& src,
const std::shared_ptr<monero_tx_wallet>& tgt)
const;
328 std::shared_ptr<monero_tx_query> copy(
const std::shared_ptr<monero_tx_query>& src,
const std::shared_ptr<monero_tx_query>& tgt)
const;
329 bool meets_criteria(
monero_tx_wallet* tx,
bool query_children =
true)
const;
341 std::vector<std::shared_ptr<monero_tx_wallet>> m_txs;
342 boost::optional<std::string> m_signed_tx_hex;
343 boost::optional<std::string> m_unsigned_tx_hex;
344 boost::optional<std::string> m_multisig_tx_hex;
347 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
348 static monero_tx_set deserialize(
const std::string& tx_set_json);
355 std::string m_standard_address;
356 std::string m_payment_id;
357 std::string m_integrated_address;
359 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
376 boost::optional<std::string> m_address;
377 boost::optional<uint64_t> m_amount;
378 std::vector<std::shared_ptr<monero_destination>> m_destinations;
379 std::vector<uint32_t> m_subtract_fee_from;
380 boost::optional<std::string> m_payment_id;
381 boost::optional<monero_tx_priority> m_priority;
382 boost::optional<uint32_t> m_ring_size;
383 boost::optional<uint64_t> m_fee;
384 boost::optional<uint32_t> m_account_index;
385 std::vector<uint32_t> m_subaddress_indices;
386 boost::optional<uint64_t> m_unlock_time;
387 boost::optional<bool> m_can_split;
388 boost::optional<bool> m_relay;
389 boost::optional<std::string> m_note;
390 boost::optional<std::string> m_recipient_name;
391 boost::optional<uint64_t> m_below_amount;
392 boost::optional<bool> m_sweep_each_subaddress;
393 boost::optional<std::string> m_key_image;
398 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
399 static std::shared_ptr<monero_tx_config> deserialize(
const std::string& config_json);
400 std::vector<std::shared_ptr<monero_destination>> get_normalized_destinations()
const;
407 boost::optional<uint64_t> m_height;
408 boost::optional<uint64_t> m_spent_amount;
409 boost::optional<uint64_t> m_unspent_amount;
411 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
418 SIGN_WITH_SPEND_KEY = 0,
431 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
440 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
447 boost::optional<bool> m_in_tx_pool;
448 boost::optional<uint64_t> m_num_confirmations;
449 boost::optional<uint64_t> m_received_amount;
451 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
458 boost::optional<uint64_t> m_total_amount;
459 boost::optional<uint64_t> m_unconfirmed_spent_amount;
461 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
470 uint32_t m_threshold;
471 uint32_t m_num_participants;
473 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
482 boost::optional<std::string> m_address;
483 boost::optional<std::string> m_multisig_hex;
485 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
492 boost::optional<std::string> m_signed_multisig_tx_hex;
493 std::vector<std::string> m_tx_hashes;
495 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
502 boost::optional<uint64_t> m_index;
503 boost::optional<std::string> m_address;
504 boost::optional<std::string> m_description;
505 boost::optional<std::string> m_payment_id;
508 monero_address_book_entry(uint64_t index,
const std::string& address,
const std::string& description) : m_index(index), m_address(address), m_description(description) {}
509 monero_address_book_entry(uint64_t index,
const std::string& address,
const std::string& description,
const std::string& payment_id) : m_index(index), m_address(address), m_description(description), m_payment_id(payment_id) {}
510 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
Definition: monero_daemon.cpp:58
monero_message_signature_type
Definition: monero_wallet_model.h:417
monero_tx_priority
Definition: monero_wallet_model.h:365
Definition: monero_wallet_model.h:127
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:227
Definition: monero_wallet_model.h:501
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:1558
Definition: monero_wallet_model.h:457
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:1493
Definition: monero_wallet_model.h:446
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:1474
Definition: monero_wallet_model.h:437
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:1460
Definition: monero_wallet_model.h:141
Definition: monero_wallet_model.h:180
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:814
Definition: monero_wallet_model.h:354
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:1403
Definition: monero_wallet_model.h:406
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:1420
Definition: monero_wallet_model.h:425
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:1437
Definition: monero_wallet_model.h:467
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:1509
Definition: monero_wallet_model.h:481
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:1527
Definition: monero_wallet_model.h:491
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:1541
Definition: monero_wallet_model.h:196
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:861
Definition: monero_wallet_model.h:256
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:1166
Definition: monero_wallet_model.h:236
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:1096
Definition: monero_daemon_model.h:235
Definition: monero_daemon_model.h:109
Definition: monero_wallet_model.h:110
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:252
Definition: monero_wallet_model.h:98
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:209
Definition: monero_wallet_model.h:214
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:921
Definition: monero_wallet_model.h:161
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:758
Definition: monero_wallet_model.h:375
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:1307
Definition: monero_wallet_model.h:309
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:475
Definition: monero_wallet_model.h:340
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:711
Definition: monero_wallet_model.h:275
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:280
Definition: monero_daemon_model.h:170
Definition: monero_wallet_model.h:67
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const
Definition: monero_wallet_model.cpp:119
Definition: monero_daemon_model.h:69