55 #include "daemon/monero_daemon_model.h"
68 uint64_t m_num_blocks_fetched;
69 bool m_received_money;
71 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) {}
73 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
80 boost::optional<uint32_t> m_account_index;
81 boost::optional<uint32_t> m_index;
82 boost::optional<std::string> m_address;
83 boost::optional<std::string> m_label;
84 boost::optional<uint64_t> m_balance;
85 boost::optional<uint64_t> m_unlocked_balance;
86 boost::optional<uint64_t> m_num_unspent_outputs;
87 boost::optional<bool> m_is_used;
88 boost::optional<uint64_t> m_num_blocks_to_unlock;
90 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
97 boost::optional<uint32_t> m_index;
98 boost::optional<std::string> m_primary_address;
99 boost::optional<uint64_t> m_balance;
100 boost::optional<uint64_t> m_unlocked_balance;
101 boost::optional<std::string> m_tag;
102 std::vector<monero_subaddress> m_subaddresses;
104 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
111 boost::optional<std::string> m_address;
112 boost::optional<uint64_t> m_amount;
114 monero_destination(boost::optional<std::string> address = boost::none, boost::optional<uint64_t> amount = boost::none) : m_address(address), m_amount(amount) {}
115 rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
116 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_destination>& destination);
117 std::shared_ptr<monero_destination> copy(
const std::shared_ptr<monero_destination>& src,
const std::shared_ptr<monero_destination>& tgt)
const;
131 std::shared_ptr<monero_tx_wallet> m_tx;
132 boost::optional<uint64_t> m_amount;
133 boost::optional<uint32_t> m_account_index;
135 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
136 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_transfer>& transfer);
137 virtual boost::optional<bool> is_incoming()
const = 0;
138 std::shared_ptr<monero_transfer> copy(
const std::shared_ptr<monero_transfer>& src,
const std::shared_ptr<monero_transfer>& tgt)
const;
139 boost::optional<bool> is_outgoing()
const {
140 if (is_incoming() == boost::none)
return boost::none;
141 return !(*is_incoming());
143 void merge(
const std::shared_ptr<monero_transfer>&
self,
const std::shared_ptr<monero_transfer>& other);
150 boost::optional<uint32_t> m_subaddress_index;
151 boost::optional<std::string> m_address;
152 boost::optional<uint64_t> m_num_suggested_confirmations;
154 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
155 std::shared_ptr<monero_incoming_transfer> copy(
const std::shared_ptr<monero_transfer>& src,
const std::shared_ptr<monero_transfer>& tgt)
const;
156 std::shared_ptr<monero_incoming_transfer> copy(
const std::shared_ptr<monero_incoming_transfer>& src,
const std::shared_ptr<monero_incoming_transfer>& tgt)
const;
157 boost::optional<bool> is_incoming()
const;
158 void merge(
const std::shared_ptr<monero_transfer>&
self,
const std::shared_ptr<monero_transfer>& other);
159 void merge(
const std::shared_ptr<monero_incoming_transfer>&
self,
const std::shared_ptr<monero_incoming_transfer>& other);
166 std::vector<uint32_t> m_subaddress_indices;
167 std::vector<std::string> m_addresses;
168 std::vector<std::shared_ptr<monero_destination>> m_destinations;
170 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
171 std::shared_ptr<monero_outgoing_transfer> copy(
const std::shared_ptr<monero_transfer>& src,
const std::shared_ptr<monero_transfer>& tgt)
const;
172 std::shared_ptr<monero_outgoing_transfer> copy(
const std::shared_ptr<monero_outgoing_transfer>& src,
const std::shared_ptr<monero_outgoing_transfer>& tgt)
const;
173 boost::optional<bool> is_incoming()
const;
174 void merge(
const std::shared_ptr<monero_transfer>&
self,
const std::shared_ptr<monero_transfer>& other);
175 void merge(
const std::shared_ptr<monero_outgoing_transfer>&
self,
const std::shared_ptr<monero_outgoing_transfer>& other);
184 boost::optional<bool> m_is_incoming;
185 boost::optional<std::string> m_address;
186 std::vector<std::string> m_addresses;
187 boost::optional<uint32_t> m_subaddress_index;
188 std::vector<uint32_t> m_subaddress_indices;
189 std::vector<std::shared_ptr<monero_destination>> m_destinations;
190 boost::optional<bool> m_has_destinations;
191 boost::optional<std::shared_ptr<monero_tx_query>> m_tx_query;
193 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
194 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_transfer_query>& transfer_query);
195 static std::shared_ptr<monero_transfer_query> deserialize_from_block(
const std::string& transfer_query_json);
196 std::shared_ptr<monero_transfer_query> copy(
const std::shared_ptr<monero_transfer>& src,
const std::shared_ptr<monero_transfer>& tgt)
const;
197 std::shared_ptr<monero_transfer_query> copy(
const std::shared_ptr<monero_transfer_query>& src,
const std::shared_ptr<monero_transfer_query>& tgt)
const;
198 boost::optional<bool> is_incoming()
const;
199 bool meets_criteria(
monero_transfer* transfer,
bool query_parent =
true)
const;
206 boost::optional<uint32_t> m_account_index;
207 boost::optional<uint32_t> m_subaddress_index;
208 boost::optional<bool> m_is_spent;
209 boost::optional<bool> m_is_frozen;
211 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
212 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_output_wallet>& output_wallet);
213 std::shared_ptr<monero_output_wallet> copy(
const std::shared_ptr<monero_output>& src,
const std::shared_ptr<monero_output>& tgt)
const;
214 std::shared_ptr<monero_output_wallet> copy(
const std::shared_ptr<monero_output_wallet>& src,
const std::shared_ptr<monero_output_wallet>& tgt)
const;
215 void merge(
const std::shared_ptr<monero_output>&
self,
const std::shared_ptr<monero_output>& other);
216 void merge(
const std::shared_ptr<monero_output_wallet>&
self,
const std::shared_ptr<monero_output_wallet>& other);
226 std::vector<uint32_t> m_subaddress_indices;
227 boost::optional<uint64_t> m_min_amount;
228 boost::optional<uint64_t> m_max_amount;
229 boost::optional<std::shared_ptr<monero_tx_query>> m_tx_query;
232 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
233 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_output_query>& output_query);
234 static std::shared_ptr<monero_output_query> deserialize_from_block(
const std::string& output_query_json);
235 std::shared_ptr<monero_output_query> copy(
const std::shared_ptr<monero_output>& src,
const std::shared_ptr<monero_output>& tgt)
const;
236 std::shared_ptr<monero_output_query> copy(
const std::shared_ptr<monero_output_wallet>& src,
const std::shared_ptr<monero_output_wallet>& tgt)
const;
237 std::shared_ptr<monero_output_query> copy(
const std::shared_ptr<monero_output_query>& src,
const std::shared_ptr<monero_output_query>& tgt)
const;
245 boost::optional<std::shared_ptr<monero_tx_set>> m_tx_set;
246 boost::optional<bool> m_is_incoming;
247 boost::optional<bool> m_is_outgoing;
248 std::vector<std::shared_ptr<monero_incoming_transfer>> m_incoming_transfers;
249 boost::optional<std::shared_ptr<monero_outgoing_transfer>> m_outgoing_transfer;
250 boost::optional<std::string> m_note;
251 boost::optional<bool> m_is_locked;
252 boost::optional<uint64_t> m_input_sum;
253 boost::optional<uint64_t> m_output_sum;
254 boost::optional<std::string> m_change_address;
255 boost::optional<uint64_t> m_change_amount;
256 boost::optional<uint32_t> m_num_dummy_outputs;
257 boost::optional<std::string> m_extra_hex;
259 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
260 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_tx_wallet>& tx_wallet);
261 std::shared_ptr<monero_tx_wallet> copy(
const std::shared_ptr<monero_tx>& src,
const std::shared_ptr<monero_tx>& tgt)
const;
262 std::shared_ptr<monero_tx_wallet> copy(
const std::shared_ptr<monero_tx_wallet>& src,
const std::shared_ptr<monero_tx_wallet>& tgt)
const;
263 void merge(
const std::shared_ptr<monero_tx>&
self,
const std::shared_ptr<monero_tx>& other);
264 void merge(
const std::shared_ptr<monero_tx_wallet>&
self,
const std::shared_ptr<monero_tx_wallet>& other);
265 std::vector<std::shared_ptr<monero_transfer>> get_transfers()
const;
266 std::vector<std::shared_ptr<monero_transfer>> get_transfers(
const monero_transfer_query& query)
const;
268 std::vector<std::shared_ptr<monero_output_wallet>> get_outputs_wallet()
const;
269 std::vector<std::shared_ptr<monero_output_wallet>> get_outputs_wallet(
const monero_output_query& query)
const;
270 std::vector<std::shared_ptr<monero_output_wallet>> filter_outputs_wallet(
const monero_output_query& query);
279 boost::optional<bool> m_is_outgoing;
280 boost::optional<bool> m_is_incoming;
281 std::vector<std::string> m_hashes;
282 boost::optional<bool> m_has_payment_id;
283 std::vector<std::string> m_payment_ids;
284 boost::optional<uint64_t> m_height;
285 boost::optional<uint64_t> m_min_height;
286 boost::optional<uint64_t> m_max_height;
287 boost::optional<uint64_t> m_include_outputs;
288 boost::optional<std::shared_ptr<monero_transfer_query>> m_transfer_query;
289 boost::optional<std::shared_ptr<monero_output_query>> m_output_query;
291 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
292 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_tx_query>& tx_query);
293 static std::shared_ptr<monero_tx_query> deserialize_from_block(
const std::string& tx_query_json);
294 std::shared_ptr<monero_tx_query> copy(
const std::shared_ptr<monero_tx>& src,
const std::shared_ptr<monero_tx>& tgt)
const;
295 std::shared_ptr<monero_tx_query> copy(
const std::shared_ptr<monero_tx_wallet>& src,
const std::shared_ptr<monero_tx_wallet>& tgt)
const;
296 std::shared_ptr<monero_tx_query> copy(
const std::shared_ptr<monero_tx_query>& src,
const std::shared_ptr<monero_tx_query>& tgt)
const;
297 bool meets_criteria(
monero_tx_wallet* tx,
bool query_children =
true)
const;
309 std::vector<std::shared_ptr<monero_tx_wallet>> m_txs;
310 boost::optional<std::string> m_signed_tx_hex;
311 boost::optional<std::string> m_unsigned_tx_hex;
312 boost::optional<std::string> m_multisig_tx_hex;
315 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
316 static monero_tx_set deserialize(
const std::string& tx_set_json);
323 std::string m_standard_address;
324 std::string m_payment_id;
325 std::string m_integrated_address;
327 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
344 boost::optional<std::string> m_address;
345 boost::optional<uint64_t> m_amount;
346 std::vector<std::shared_ptr<monero_destination>> m_destinations;
347 boost::optional<std::string> m_payment_id;
348 boost::optional<monero_tx_priority> m_priority;
349 boost::optional<uint32_t> m_ring_size;
350 boost::optional<uint64_t> m_fee;
351 boost::optional<uint32_t> m_account_index;
352 std::vector<uint32_t> m_subaddress_indices;
353 boost::optional<uint64_t> m_unlock_height;
354 boost::optional<bool> m_can_split;
355 boost::optional<bool> m_relay;
356 boost::optional<std::string> m_note;
357 boost::optional<std::string> m_recipient_name;
358 boost::optional<uint64_t> m_below_amount;
359 boost::optional<bool> m_sweep_each_subaddress;
360 boost::optional<std::string> m_key_image;
365 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
366 static std::shared_ptr<monero_tx_config> deserialize(
const std::string& config_json);
367 std::vector<std::shared_ptr<monero_destination>> get_normalized_destinations()
const;
374 boost::optional<uint64_t> m_height;
375 boost::optional<uint64_t> m_spent_amount;
376 boost::optional<uint64_t> m_unspent_amount;
378 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
387 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
394 boost::optional<bool> m_in_tx_pool;
395 boost::optional<uint64_t> m_num_confirmations;
396 boost::optional<uint64_t> m_received_amount;
398 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
405 boost::optional<uint64_t> m_total_amount;
406 boost::optional<uint64_t> m_unconfirmed_spent_amount;
408 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
417 uint32_t m_threshold;
418 uint32_t m_num_participants;
420 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
429 boost::optional<std::string> m_address;
430 boost::optional<std::string> m_multisig_hex;
432 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
439 boost::optional<std::string> m_signed_multisig_tx_hex;
440 std::vector<std::string> m_tx_hashes;
442 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;
449 boost::optional<uint64_t> m_index;
450 boost::optional<std::string> m_address;
451 boost::optional<std::string> m_description;
452 boost::optional<std::string> m_payment_id;
455 monero_address_book_entry(uint64_t index,
const std::string& address,
const std::string& description) : m_index(index), m_address(address), m_description(description) {}
456 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) {}
457 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const;