56#include "common/monero_rpc_connection.h"
67 monero_rpc_ban(
const std::shared_ptr<monero_ban> &ban);
69 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
77 struct monero_get_blocks_by_height_request :
public monero_rpc_request {
78 std::vector<uint64_t> m_heights;
80 monero_get_blocks_by_height_request(uint64_t num_blocks);
81 monero_get_blocks_by_height_request(
const std::vector<uint64_t>& heights): m_heights(heights) { m_method =
"get_blocks_by_height.bin"; }
83 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
89 boost::optional<std::string> m_command;
90 boost::optional<std::string> m_path;
92 monero_download_update_params(
const std::string& command =
"download",
const std::string& path =
"");
94 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
98 boost::optional<std::string> m_tx_hex;
99 boost::optional<bool> m_do_not_relay;
100 std::vector<std::string> m_tx_hashes;
102 monero_submit_tx_params(
const std::vector<std::string>& tx_hashes): m_tx_hashes(tx_hashes) { }
103 monero_submit_tx_params(
const std::string& tx_hex,
bool do_not_relay): m_tx_hex(tx_hex), m_do_not_relay(do_not_relay) { }
105 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
109 boost::optional<int> m_in_peers;
110 boost::optional<int> m_out_peers;
112 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
116 std::vector<std::string> m_tx_hashes;
117 boost::optional<bool> m_decode_as_json;
118 boost::optional<bool> m_prune;
120 monero_get_txs_params(
const std::vector<std::string> &tx_hashes,
bool prune,
bool decode_as_json =
true): m_tx_hashes(tx_hashes), m_prune(prune), m_decode_as_json(decode_as_json) { }
122 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
126 std::vector<std::string> m_key_images;
128 monero_is_key_image_spent_params(
const std::vector<std::string>& key_images): m_key_images(key_images) { }
130 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
136 boost::optional<std::string> m_miner_address;
137 boost::optional<uint64_t> m_num_threads;
138 boost::optional<bool> m_is_background;
139 boost::optional<bool> m_ignore_battery;
141 monero_start_mining_params(
const boost::optional<std::string>& address,
const boost::optional<uint64_t>& num_threads,
const boost::optional<bool>& is_background,
const boost::optional<bool>& ignore_battery): m_miner_address(address), m_num_threads(num_threads), m_is_background(is_background), m_ignore_battery(ignore_battery) { }
142 monero_start_mining_params(
const boost::optional<uint64_t>& num_threads,
const boost::optional<bool>& is_background,
const boost::optional<bool>& ignore_battery): m_num_threads(num_threads), m_is_background(is_background), m_ignore_battery(ignore_battery) { }
144 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
148 boost::optional<std::string> m_wallet_address;
149 boost::optional<uint64_t> m_num_blocks;
150 boost::optional<std::string> m_prev_block_hash;
151 boost::optional<uint32_t> m_starting_nonce;
153 monero_generate_blocks_params(
const std::string& wallet_address, uint64_t num_blocks,
const boost::optional<std::string>& prev_block_hash,
const boost::optional<uint32_t>& starting_nonce): m_wallet_address(wallet_address), m_num_blocks(num_blocks), m_prev_block_hash(prev_block_hash), m_starting_nonce(starting_nonce) { }
155 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
159 boost::optional<bool> m_check;
161 monero_prune_blockchain_params(
bool check =
true): m_check(check) { }
163 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
167 std::vector<std::string> m_block_blobs;
169 monero_submit_blocks_params(
const std::vector<std::string>& block_blobs): m_block_blobs(block_blobs) { }
171 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
175 boost::optional<uint64_t> m_height;
176 boost::optional<std::string> m_hash;
177 boost::optional<bool> m_fill_pow_hash;
178 boost::optional<uint64_t> m_start_height;
179 boost::optional<uint64_t> m_end_height;
180 boost::optional<std::string> m_wallet_address;
181 boost::optional<int> m_reserve_size;
183 monero_get_block_params(uint64_t height,
bool fill_pow_hash =
false): m_height(height), m_fill_pow_hash(fill_pow_hash) { }
184 monero_get_block_params(
const std::string& hash,
bool fill_pow_hash =
false): m_hash(hash), m_fill_pow_hash(fill_pow_hash) { }
185 monero_get_block_params(uint64_t start_height, uint64_t end_height): m_start_height(start_height), m_end_height(end_height) { }
186 monero_get_block_params(
const std::string& wallet_address,
const boost::optional<int>& reserve_size): m_wallet_address(wallet_address), m_reserve_size(reserve_size) { }
188 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
192 boost::optional<uint64_t> m_height;
194 monero_get_block_hash_params(uint64_t height): m_height(height) { }
196 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
200 boost::optional<uint64_t> m_height;
201 boost::optional<uint64_t> m_count;
203 monero_get_miner_tx_sum_params(uint64_t height, uint64_t count): m_height(height), m_count(count) { }
205 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
209 boost::optional<uint64_t> m_grace_blocks;
211 monero_get_fee_estimate_params(uint64_t grace_blocks = 0): m_grace_blocks(grace_blocks) { }
213 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
217 std::vector<std::shared_ptr<monero_rpc_ban>> m_bans;
219 monero_set_bans_params(
const std::vector<std::shared_ptr<monero_ban>>& bans);
221 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
225 std::vector<uint64_t> m_amounts;
226 boost::optional<int> m_min_count;
227 boost::optional<int> m_max_count;
228 boost::optional<bool> m_is_unlocked;
229 boost::optional<int> m_recent_cutoff;
231 monero_get_output_histogram_params(
const std::vector<uint64_t>& amounts,
const boost::optional<int>& min_count,
const boost::optional<int>& max_count,
const boost::optional<bool>& is_unlocked,
const boost::optional<int>& recent_cutoff) : m_amounts(amounts), m_min_count(min_count), m_max_count(max_count), m_is_unlocked(is_unlocked), m_recent_cutoff(recent_cutoff) { }
233 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
237 std::vector<uint64_t> m_amounts;
238 boost::optional<bool> m_cumulative;
239 boost::optional<bool> m_binary;
240 boost::optional<uint64_t> m_from_height;
241 boost::optional<uint64_t> m_to_height;
243 monero_get_output_distribution_params(
const std::vector<uint64_t>& amounts,
const boost::optional<bool>& cumulative,
const boost::optional<uint64_t>& from_height,
const boost::optional<uint64_t>& to_height) : m_amounts(amounts), m_cumulative(cumulative), m_from_height(from_height), m_to_height(to_height), m_binary(
false) { }
245 rapidjson::Value
to_rapidjson_val(rapidjson::Document::AllocatorType& allocator)
const override;
251 boost::optional<uint64_t> m_count;
252 boost::optional<uint64_t> m_height;
253 boost::optional<bool> m_untrusted;
255 static void from_property_tree(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_get_block_result>& result);
260 void deserialize_version(
const boost::property_tree::ptree& node,
monero_version& version);
261 void deserialize_block_header(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_block_header>& header);
262 void deserialize_block_headers(
const boost::property_tree::ptree& node, std::vector<std::shared_ptr<monero_block_header>>& headers);
263 void deserialize_block(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_block>& block,
bool is_nested =
false);
264 void deserialize_blocks(
const boost::property_tree::ptree& node,
const std::vector<uint64_t>& heights, std::vector<std::shared_ptr<monero_block>>& blocks);
265 void deserialize_alt_block_hashes(
const boost::property_tree::ptree& node, std::vector<std::string>& block_hashes);
266 void deserialize_txs(
const boost::property_tree::ptree& node, std::vector<std::shared_ptr<monero_tx>>& txs);
267 void deserialize_tx_hashes(
const boost::property_tree::ptree& node, std::vector<std::string>& tx_hashes);
268 void deserialize_key_image_spent_status(
const boost::property_tree::ptree& node, std::vector<monero_key_image_spent_status>& statuses);
269 void deserialize_alt_chains(
const boost::property_tree::ptree& node, std::vector<std::shared_ptr<monero_alt_chain>>& alt_chains);
270 void deserialize_bans(
const boost::property_tree::ptree& node, std::vector<std::shared_ptr<monero_ban>>& bans);
271 void deserialize_prune_result(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_prune_result>& result);
272 void deserialize_mining_status(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_mining_status>& status);
273 void deserialize_generate_blocks_result(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_generate_blocks_result>& result);
274 void deserialize_miner_tx_sum(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_miner_tx_sum>& sum);
275 void deserialize_block_template(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_block_template>& tmplt);
276 void deserialize_peers(
const boost::property_tree::ptree& node, std::vector<std::shared_ptr<monero_peer>>& peers);
277 void deserialize_submit_tx_result(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_submit_tx_result>& result);
278 void deserialize_output_distribution_entries(
const boost::property_tree::ptree& node, std::vector<std::shared_ptr<monero_output_distribution_entry>>& entries);
279 void deserialize_output_histogram_entries(
const boost::property_tree::ptree& node, std::vector<std::shared_ptr<monero_output_histogram_entry>>& entries);
280 void deserialize_tx_pool_stats(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_tx_pool_stats>& stats);
281 void deserialize_update_check_result(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_daemon_update_check_result>& check);
282 void deserialize_update_download_result(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_daemon_update_download_result>& check);
283 void deserialize_fee_estimate(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_fee_estimate>& estimate);
284 void deserialize_daemon_info(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_daemon_info>& info);
285 void deserialize_daemon_sync_info(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_daemon_sync_info>& info);
286 void deserialize_hard_fork_info(
const boost::property_tree::ptree& node,
const std::shared_ptr<monero_hard_fork_info>& info);
Definition monero_error.h:61
Definition monero_daemon_model.h:321
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:110
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:235
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:299
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:274
Definition monero_daemon_rpc_model.h:250
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:98
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:322
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:307
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:375
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:353
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:183
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:200
Definition monero_daemon_rpc_model.h:108
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:168
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:255
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:70
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:340
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:213
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:268
rapidjson::Value to_rapidjson_val(rapidjson::Document::AllocatorType &allocator) const override
Definition monero_daemon_rpc_model.cpp:148
Definition monero_daemon_model.h:140
Definition monero_daemon_model.h:70