Electroneum
Loading...
Searching...
No Matches
daemon_messages.cpp
Go to the documentation of this file.
1// Copyright (c) 2016-2019, The Monero Project
2//
3// All rights reserved.
4//
5// Redistribution and use in source and binary forms, with or without modification, are
6// permitted provided that the following conditions are met:
7//
8// 1. Redistributions of source code must retain the above copyright notice, this list of
9// conditions and the following disclaimer.
10//
11// 2. Redistributions in binary form must reproduce the above copyright notice, this list
12// of conditions and the following disclaimer in the documentation and/or other
13// materials provided with the distribution.
14//
15// 3. Neither the name of the copyright holder nor the names of its contributors may be
16// used to endorse or promote products derived from this software without specific
17// prior written permission.
18//
19// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29#include "daemon_messages.h"
31
32namespace cryptonote
33{
34
35namespace rpc
36{
37
38const char* const GetHeight::name = "get_height";
39const char* const GetBlocksFast::name = "get_blocks_fast";
40const char* const GetHashesFast::name = "get_hashes_fast";
41const char* const GetTransactions::name = "get_transactions";
42const char* const KeyImagesSpent::name = "key_images_spent";
43const char* const GetTxGlobalOutputIndices::name = "get_tx_global_output_indices";
44const char* const SendRawTx::name = "send_raw_tx";
45const char* const SendRawTxHex::name = "send_raw_tx_hex";
46const char* const StartMining::name = "start_mining";
47const char* const StopMining::name = "stop_mining";
48const char* const MiningStatus::name = "mining_status";
49const char* const GetInfo::name = "get_info";
50const char* const SaveBC::name = "save_bc";
51const char* const GetBlockHash::name = "get_block_hash";
52const char* const GetLastBlockHeader::name = "get_last_block_header";
53const char* const GetBlockHeaderByHash::name = "get_block_header_by_hash";
54const char* const GetBlockHeaderByHeight::name = "get_block_header_by_height";
55const char* const GetBlockHeadersByHeight::name = "get_block_headers_by_height";
56const char* const GetPeerList::name = "get_peer_list";
57const char* const SetLogLevel::name = "set_log_level";
58const char* const GetTransactionPool::name = "get_transaction_pool";
59const char* const HardForkInfo::name = "hard_fork_info";
60const char* const GetOutputHistogram::name = "get_output_histogram";
61const char* const GetOutputKeys::name = "get_output_keys";
62const char* const GetRPCVersion::name = "get_rpc_version";
63const char* const GetFeeEstimate::name = "get_dynamic_fee_estimate";
64const char* const GetOutputDistribution::name = "get_output_distribution";
65
66
67
68
69rapidjson::Value GetHeight::Request::toJson(rapidjson::Document& doc) const
70{
71 return Message::toJson(doc);
72}
73
74void GetHeight::Request::fromJson(rapidjson::Value& val)
75{
76}
77
78rapidjson::Value GetHeight::Response::toJson(rapidjson::Document& doc) const
79{
80 auto val = Message::toJson(doc);
81
82 auto& al = doc.GetAllocator();
83
84 val.AddMember("height", height, al);
85
86 return val;
87}
88
89void GetHeight::Response::fromJson(rapidjson::Value& val)
90{
92}
93
94
95rapidjson::Value GetBlocksFast::Request::toJson(rapidjson::Document& doc) const
96{
97 auto val = Message::toJson(doc);
98
99 auto& al = doc.GetAllocator();
100
101 INSERT_INTO_JSON_OBJECT(val, doc, block_ids, block_ids);
102 val.AddMember("start_height", start_height, al);
103 val.AddMember("prune", prune, al);
104
105 return val;
106}
107
108void GetBlocksFast::Request::fromJson(rapidjson::Value& val)
109{
110 GET_FROM_JSON_OBJECT(val, block_ids, block_ids);
111 GET_FROM_JSON_OBJECT(val, start_height, start_height);
112 GET_FROM_JSON_OBJECT(val, prune, prune);
113}
114
115rapidjson::Value GetBlocksFast::Response::toJson(rapidjson::Document& doc) const
116{
117 auto val = Message::toJson(doc);
118
119 auto& al = doc.GetAllocator();
120
121 INSERT_INTO_JSON_OBJECT(val, doc, blocks, blocks);
122 val.AddMember("start_height", start_height, al);
123 val.AddMember("current_height", current_height, al);
124 INSERT_INTO_JSON_OBJECT(val, doc, output_indices, output_indices);
125
126 return val;
127}
128
129void GetBlocksFast::Response::fromJson(rapidjson::Value& val)
130{
131 GET_FROM_JSON_OBJECT(val, blocks, blocks);
132 GET_FROM_JSON_OBJECT(val, start_height, start_height);
133 GET_FROM_JSON_OBJECT(val, current_height, current_height);
134 GET_FROM_JSON_OBJECT(val, output_indices, output_indices);
135}
136
137
138rapidjson::Value GetHashesFast::Request::toJson(rapidjson::Document& doc) const
139{
140 auto val = Message::toJson(doc);
141
142 auto& al = doc.GetAllocator();
143
144 INSERT_INTO_JSON_OBJECT(val, doc, known_hashes, known_hashes);
145 val.AddMember("start_height", start_height, al);
146
147 return val;
148}
149
150void GetHashesFast::Request::fromJson(rapidjson::Value& val)
151{
152 GET_FROM_JSON_OBJECT(val, known_hashes, known_hashes);
153 GET_FROM_JSON_OBJECT(val, start_height, start_height);
154}
155
156rapidjson::Value GetHashesFast::Response::toJson(rapidjson::Document& doc) const
157{
158 auto val = Message::toJson(doc);
159
160 auto& al = doc.GetAllocator();
161
163 val.AddMember("start_height", start_height, al);
164 val.AddMember("current_height", current_height, al);
165
166 return val;
167}
168
169void GetHashesFast::Response::fromJson(rapidjson::Value& val)
170{
172 GET_FROM_JSON_OBJECT(val, start_height, start_height);
173 GET_FROM_JSON_OBJECT(val, current_height, current_height);
174}
175
176
177rapidjson::Value GetTransactions::Request::toJson(rapidjson::Document& doc) const
178{
179 auto val = Message::toJson(doc);
180
181 INSERT_INTO_JSON_OBJECT(val, doc, tx_hashes, tx_hashes);
182
183 return val;
184}
185
186void GetTransactions::Request::fromJson(rapidjson::Value& val)
187{
188 GET_FROM_JSON_OBJECT(val, tx_hashes, tx_hashes);
189}
190
191rapidjson::Value GetTransactions::Response::toJson(rapidjson::Document& doc) const
192{
193 rapidjson::Value val(rapidjson::kObjectType);
194
195 INSERT_INTO_JSON_OBJECT(val, doc, txs, txs);
196 INSERT_INTO_JSON_OBJECT(val, doc, missed_hashes, missed_hashes);
197
198 return val;
199}
200
201void GetTransactions::Response::fromJson(rapidjson::Value& val)
202{
203 GET_FROM_JSON_OBJECT(val, txs, txs);
204 GET_FROM_JSON_OBJECT(val, missed_hashes, missed_hashes);
205}
206
207
208rapidjson::Value KeyImagesSpent::Request::toJson(rapidjson::Document& doc) const
209{
210 auto val = Message::toJson(doc);
211
212 INSERT_INTO_JSON_OBJECT(val, doc, key_images, key_images);
213
214 return val;
215}
216
217void KeyImagesSpent::Request::fromJson(rapidjson::Value& val)
218{
219 GET_FROM_JSON_OBJECT(val, key_images, key_images);
220}
221
222rapidjson::Value KeyImagesSpent::Response::toJson(rapidjson::Document& doc) const
223{
224 auto val = Message::toJson(doc);
225
226 INSERT_INTO_JSON_OBJECT(val, doc, spent_status, spent_status);
227
228 return val;
229}
230
231void KeyImagesSpent::Response::fromJson(rapidjson::Value& val)
232{
233 GET_FROM_JSON_OBJECT(val, spent_status, spent_status);
234}
235
236
237rapidjson::Value GetTxGlobalOutputIndices::Request::toJson(rapidjson::Document& doc) const
238{
239 auto val = Message::toJson(doc);
240
241 INSERT_INTO_JSON_OBJECT(val, doc, tx_hash, tx_hash);
242
243 return val;
244}
245
246void GetTxGlobalOutputIndices::Request::fromJson(rapidjson::Value& val)
247{
248 GET_FROM_JSON_OBJECT(val, tx_hash, tx_hash);
249}
250
251rapidjson::Value GetTxGlobalOutputIndices::Response::toJson(rapidjson::Document& doc) const
252{
253 auto val = Message::toJson(doc);
254
255 INSERT_INTO_JSON_OBJECT(val, doc, output_indices, output_indices);
256
257 return val;
258}
259
260void GetTxGlobalOutputIndices::Response::fromJson(rapidjson::Value& val)
261{
262 GET_FROM_JSON_OBJECT(val, output_indices, output_indices);
263}
264
265rapidjson::Value SendRawTx::Request::toJson(rapidjson::Document& doc) const
266{
267 auto val = Message::toJson(doc);
268
269 INSERT_INTO_JSON_OBJECT(val, doc, tx, tx);
270 INSERT_INTO_JSON_OBJECT(val, doc, relay, relay);
271
272 return val;
273}
274
275void SendRawTx::Request::fromJson(rapidjson::Value& val)
276{
277 GET_FROM_JSON_OBJECT(val, tx, tx);
278 GET_FROM_JSON_OBJECT(val, relay, relay);
279}
280
281rapidjson::Value SendRawTx::Response::toJson(rapidjson::Document& doc) const
282{
283 auto val = Message::toJson(doc);
284
285 INSERT_INTO_JSON_OBJECT(val, doc, relayed, relayed);
286
287 return val;
288}
289
290
291void SendRawTx::Response::fromJson(rapidjson::Value& val)
292{
293 GET_FROM_JSON_OBJECT(val, relayed, relayed);
294}
295
296rapidjson::Value SendRawTxHex::Request::toJson(rapidjson::Document& doc) const
297{
298 auto val = Message::toJson(doc);
299
300 INSERT_INTO_JSON_OBJECT(val, doc, tx_as_hex, tx_as_hex);
301 INSERT_INTO_JSON_OBJECT(val, doc, relay, relay);
302
303 return val;
304}
305
306void SendRawTxHex::Request::fromJson(rapidjson::Value& val)
307{
308 GET_FROM_JSON_OBJECT(val, tx_as_hex, tx_as_hex);
309 GET_FROM_JSON_OBJECT(val, relay, relay);
310}
311
312rapidjson::Value StartMining::Request::toJson(rapidjson::Document& doc) const
313{
314 auto val = Message::toJson(doc);
315
316 INSERT_INTO_JSON_OBJECT(val, doc, miner_address, miner_address);
317 INSERT_INTO_JSON_OBJECT(val, doc, threads_count, threads_count);
318 INSERT_INTO_JSON_OBJECT(val, doc, do_background_mining, do_background_mining);
319 INSERT_INTO_JSON_OBJECT(val, doc, ignore_battery, ignore_battery);
320
321 return val;
322}
323
324void StartMining::Request::fromJson(rapidjson::Value& val)
325{
326 GET_FROM_JSON_OBJECT(val, miner_address, miner_address);
327 GET_FROM_JSON_OBJECT(val, threads_count, threads_count);
328 GET_FROM_JSON_OBJECT(val, do_background_mining, do_background_mining);
329 GET_FROM_JSON_OBJECT(val, ignore_battery, ignore_battery);
330}
331
332rapidjson::Value StartMining::Response::toJson(rapidjson::Document& doc) const
333{
334 return Message::toJson(doc);
335}
336
337void StartMining::Response::fromJson(rapidjson::Value& val)
338{
339}
340
341
342rapidjson::Value StopMining::Request::toJson(rapidjson::Document& doc) const
343{
344 return Message::toJson(doc);
345}
346
347void StopMining::Request::fromJson(rapidjson::Value& val)
348{
349}
350
351rapidjson::Value StopMining::Response::toJson(rapidjson::Document& doc) const
352{
353 return Message::toJson(doc);
354}
355
356void StopMining::Response::fromJson(rapidjson::Value& val)
357{
358}
359
360
361rapidjson::Value MiningStatus::Request::toJson(rapidjson::Document& doc) const
362{
363 return Message::toJson(doc);
364}
365
366void MiningStatus::Request::fromJson(rapidjson::Value& val)
367{
368}
369
370rapidjson::Value MiningStatus::Response::toJson(rapidjson::Document& doc) const
371{
372 auto val = Message::toJson(doc);
373
374 INSERT_INTO_JSON_OBJECT(val, doc, active, active);
375 INSERT_INTO_JSON_OBJECT(val, doc, speed, speed);
376 INSERT_INTO_JSON_OBJECT(val, doc, threads_count, threads_count);
378 INSERT_INTO_JSON_OBJECT(val, doc, is_background_mining_enabled, is_background_mining_enabled);
379
380 return val;
381}
382
383void MiningStatus::Response::fromJson(rapidjson::Value& val)
384{
385 GET_FROM_JSON_OBJECT(val, active, active);
386 GET_FROM_JSON_OBJECT(val, speed, speed);
387 GET_FROM_JSON_OBJECT(val, threads_count, threads_count);
389 GET_FROM_JSON_OBJECT(val, is_background_mining_enabled, is_background_mining_enabled);
390}
391
392
393rapidjson::Value GetInfo::Request::toJson(rapidjson::Document& doc) const
394{
395 return Message::toJson(doc);
396}
397
398void GetInfo::Request::fromJson(rapidjson::Value& val)
399{
400}
401
402rapidjson::Value GetInfo::Response::toJson(rapidjson::Document& doc) const
403{
404 auto val = Message::toJson(doc);
405
407
408 return val;
409}
410
411void GetInfo::Response::fromJson(rapidjson::Value& val)
412{
414}
415
416
417rapidjson::Value SaveBC::Request::toJson(rapidjson::Document& doc) const
418{
419 auto val = Message::toJson(doc);
420
421 return val;
422}
423
424void SaveBC::Request::fromJson(rapidjson::Value& val)
425{
426}
427
428rapidjson::Value SaveBC::Response::toJson(rapidjson::Document& doc) const
429{
430 auto val = Message::toJson(doc);
431
432 return val;
433}
434
435void SaveBC::Response::fromJson(rapidjson::Value& val)
436{
437}
438
439
440rapidjson::Value GetBlockHash::Request::toJson(rapidjson::Document& doc) const
441{
442 auto val = Message::toJson(doc);
443
445
446 return val;
447}
448
449void GetBlockHash::Request::fromJson(rapidjson::Value& val)
450{
452}
453
454rapidjson::Value GetBlockHash::Response::toJson(rapidjson::Document& doc) const
455{
456 auto val = Message::toJson(doc);
457
458 INSERT_INTO_JSON_OBJECT(val, doc, hash, hash);
459
460 return val;
461}
462
463void GetBlockHash::Response::fromJson(rapidjson::Value& val)
464{
465 GET_FROM_JSON_OBJECT(val, hash, hash);
466}
467
468
469rapidjson::Value GetLastBlockHeader::Request::toJson(rapidjson::Document& doc) const
470{
471 auto val = Message::toJson(doc);
472
473 return val;
474}
475
476void GetLastBlockHeader::Request::fromJson(rapidjson::Value& val)
477{
478}
479
480rapidjson::Value GetLastBlockHeader::Response::toJson(rapidjson::Document& doc) const
481{
482 auto val = Message::toJson(doc);
483
484 INSERT_INTO_JSON_OBJECT(val, doc, header, header);
485
486 return val;
487}
488
489void GetLastBlockHeader::Response::fromJson(rapidjson::Value& val)
490{
491 GET_FROM_JSON_OBJECT(val, header, header);
492}
493
494
495rapidjson::Value GetBlockHeaderByHash::Request::toJson(rapidjson::Document& doc) const
496{
497 auto val = Message::toJson(doc);
498
499 INSERT_INTO_JSON_OBJECT(val, doc, hash, hash);
500
501 return val;
502}
503
504void GetBlockHeaderByHash::Request::fromJson(rapidjson::Value& val)
505{
506 GET_FROM_JSON_OBJECT(val, hash, hash);
507}
508
509rapidjson::Value GetBlockHeaderByHash::Response::toJson(rapidjson::Document& doc) const
510{
511 auto val = Message::toJson(doc);
512
513 INSERT_INTO_JSON_OBJECT(val, doc, header, header);
514
515 return val;
516}
517
518void GetBlockHeaderByHash::Response::fromJson(rapidjson::Value& val)
519{
520 GET_FROM_JSON_OBJECT(val, header, header);
521}
522
523
524rapidjson::Value GetBlockHeaderByHeight::Request::toJson(rapidjson::Document& doc) const
525{
526 auto val = Message::toJson(doc);
527
529
530 return val;
531}
532
533void GetBlockHeaderByHeight::Request::fromJson(rapidjson::Value& val)
534{
536}
537
538rapidjson::Value GetBlockHeaderByHeight::Response::toJson(rapidjson::Document& doc) const
539{
540 auto val = Message::toJson(doc);
541
542 INSERT_INTO_JSON_OBJECT(val, doc, header, header);
543
544 return val;
545}
546
547void GetBlockHeaderByHeight::Response::fromJson(rapidjson::Value& val)
548{
549 GET_FROM_JSON_OBJECT(val, header, header);
550}
551
552
553rapidjson::Value GetBlockHeadersByHeight::Request::toJson(rapidjson::Document& doc) const
554{
555 auto val = Message::toJson(doc);
556
557 INSERT_INTO_JSON_OBJECT(val, doc, heights, heights);
558
559 return val;
560}
561
562void GetBlockHeadersByHeight::Request::fromJson(rapidjson::Value& val)
563{
564 GET_FROM_JSON_OBJECT(val, heights, heights);
565}
566
567rapidjson::Value GetBlockHeadersByHeight::Response::toJson(rapidjson::Document& doc) const
568{
569 auto val = Message::toJson(doc);
570
571 INSERT_INTO_JSON_OBJECT(val, doc, headers, headers);
572
573 return val;
574}
575
576void GetBlockHeadersByHeight::Response::fromJson(rapidjson::Value& val)
577{
578 GET_FROM_JSON_OBJECT(val, headers, headers);
579}
580
581
582rapidjson::Value GetPeerList::Request::toJson(rapidjson::Document& doc) const
583{
584 auto val = Message::toJson(doc);
585
586 return val;
587}
588
589void GetPeerList::Request::fromJson(rapidjson::Value& val)
590{
591}
592
593rapidjson::Value GetPeerList::Response::toJson(rapidjson::Document& doc) const
594{
595 auto val = Message::toJson(doc);
596
597 INSERT_INTO_JSON_OBJECT(val, doc, white_list, white_list);
598 INSERT_INTO_JSON_OBJECT(val, doc, gray_list, gray_list);
599
600 return val;
601}
602
603void GetPeerList::Response::fromJson(rapidjson::Value& val)
604{
605 GET_FROM_JSON_OBJECT(val, white_list, white_list);
606 GET_FROM_JSON_OBJECT(val, gray_list, gray_list);
607}
608
609
610rapidjson::Value SetLogLevel::Request::toJson(rapidjson::Document& doc) const
611{
612 auto val = Message::toJson(doc);
613
614 auto& al = doc.GetAllocator();
615
616 val.AddMember("level", level, al);
617
618 return val;
619}
620
621void SetLogLevel::Request::fromJson(rapidjson::Value& val)
622{
623 GET_FROM_JSON_OBJECT(val, level, level);
624}
625
626rapidjson::Value SetLogLevel::Response::toJson(rapidjson::Document& doc) const
627{
628 return Message::toJson(doc);
629}
630
631void SetLogLevel::Response::fromJson(rapidjson::Value& val)
632{
633}
634
635
636rapidjson::Value GetTransactionPool::Request::toJson(rapidjson::Document& doc) const
637{
638 return Message::toJson(doc);
639}
640
641void GetTransactionPool::Request::fromJson(rapidjson::Value& val)
642{
643}
644
645rapidjson::Value GetTransactionPool::Response::toJson(rapidjson::Document& doc) const
646{
647 auto val = Message::toJson(doc);
648
649 INSERT_INTO_JSON_OBJECT(val, doc, transactions, transactions);
650 INSERT_INTO_JSON_OBJECT(val, doc, key_images, key_images);
651
652 return val;
653}
654
655void GetTransactionPool::Response::fromJson(rapidjson::Value& val)
656{
657 GET_FROM_JSON_OBJECT(val, transactions, transactions);
658 GET_FROM_JSON_OBJECT(val, key_images, key_images);
659}
660
661
662rapidjson::Value HardForkInfo::Request::toJson(rapidjson::Document& doc) const
663{
664 auto val = Message::toJson(doc);
665
667
668 return val;
669}
670
671void HardForkInfo::Request::fromJson(rapidjson::Value& val)
672{
674}
675
676rapidjson::Value HardForkInfo::Response::toJson(rapidjson::Document& doc) const
677{
678 auto val = Message::toJson(doc);
679
681
682 return val;
683}
684
685void HardForkInfo::Response::fromJson(rapidjson::Value& val)
686{
688}
689
690
691rapidjson::Value GetOutputHistogram::Request::toJson(rapidjson::Document& doc) const
692{
693 auto val = Message::toJson(doc);
694
695 INSERT_INTO_JSON_OBJECT(val, doc, amounts, amounts);
696 INSERT_INTO_JSON_OBJECT(val, doc, min_count, min_count);
697 INSERT_INTO_JSON_OBJECT(val, doc, max_count, max_count);
698 INSERT_INTO_JSON_OBJECT(val, doc, unlocked, unlocked);
699 INSERT_INTO_JSON_OBJECT(val, doc, recent_cutoff, recent_cutoff);
700
701 return val;
702}
703
704void GetOutputHistogram::Request::fromJson(rapidjson::Value& val)
705{
706 GET_FROM_JSON_OBJECT(val, amounts, amounts);
707 GET_FROM_JSON_OBJECT(val, min_count, min_count);
708 GET_FROM_JSON_OBJECT(val, max_count, max_count);
709 GET_FROM_JSON_OBJECT(val, unlocked, unlocked);
710 GET_FROM_JSON_OBJECT(val, recent_cutoff, recent_cutoff);
711}
712
713rapidjson::Value GetOutputHistogram::Response::toJson(rapidjson::Document& doc) const
714{
715 auto val = Message::toJson(doc);
716
717 INSERT_INTO_JSON_OBJECT(val, doc, histogram, histogram);
718
719 return val;
720}
721
722void GetOutputHistogram::Response::fromJson(rapidjson::Value& val)
723{
724 GET_FROM_JSON_OBJECT(val, histogram, histogram);
725}
726
727
728rapidjson::Value GetOutputKeys::Request::toJson(rapidjson::Document& doc) const
729{
730 auto val = Message::toJson(doc);
731
732 INSERT_INTO_JSON_OBJECT(val, doc, outputs, outputs);
733
734 return val;
735}
736
737void GetOutputKeys::Request::fromJson(rapidjson::Value& val)
738{
739 GET_FROM_JSON_OBJECT(val, outputs, outputs);
740}
741
742rapidjson::Value GetOutputKeys::Response::toJson(rapidjson::Document& doc) const
743{
744 auto val = Message::toJson(doc);
745
746 INSERT_INTO_JSON_OBJECT(val, doc, keys, keys);
747
748 return val;
749}
750
751void GetOutputKeys::Response::fromJson(rapidjson::Value& val)
752{
753 GET_FROM_JSON_OBJECT(val, keys, keys);
754}
755
756
757rapidjson::Value GetRPCVersion::Request::toJson(rapidjson::Document& doc) const
758{
759 return Message::toJson(doc);
760}
761
762void GetRPCVersion::Request::fromJson(rapidjson::Value& val)
763{
764}
765
766rapidjson::Value GetRPCVersion::Response::toJson(rapidjson::Document& doc) const
767{
768 auto val = Message::toJson(doc);
769
771
772 return val;
773}
774
775void GetRPCVersion::Response::fromJson(rapidjson::Value& val)
776{
778}
779
780rapidjson::Value GetFeeEstimate::Request::toJson(rapidjson::Document& doc) const
781{
782 auto val = Message::toJson(doc);
783
784 INSERT_INTO_JSON_OBJECT(val, doc, num_grace_blocks, num_grace_blocks);
785
786 return val;
787}
788
789void GetFeeEstimate::Request::fromJson(rapidjson::Value& val)
790{
791 GET_FROM_JSON_OBJECT(val, num_grace_blocks, num_grace_blocks);
792}
793
794rapidjson::Value GetFeeEstimate::Response::toJson(rapidjson::Document& doc) const
795{
796 auto val = Message::toJson(doc);
797
798 INSERT_INTO_JSON_OBJECT(val, doc, estimated_base_fee, estimated_base_fee);
799 INSERT_INTO_JSON_OBJECT(val, doc, fee_mask, fee_mask);
800 INSERT_INTO_JSON_OBJECT(val, doc, size_scale, size_scale);
801 INSERT_INTO_JSON_OBJECT(val, doc, hard_fork_version, hard_fork_version);
802
803 return val;
804}
805
806void GetFeeEstimate::Response::fromJson(rapidjson::Value& val)
807{
808 GET_FROM_JSON_OBJECT(val, estimated_base_fee, estimated_base_fee);
809 GET_FROM_JSON_OBJECT(val, fee_mask, fee_mask);
810 GET_FROM_JSON_OBJECT(val, size_scale, size_scale);
811 GET_FROM_JSON_OBJECT(val, hard_fork_version, hard_fork_version);
812}
813
814rapidjson::Value GetOutputDistribution::Request::toJson(rapidjson::Document& doc) const
815{
816 auto val = Message::toJson(doc);
817
818 INSERT_INTO_JSON_OBJECT(val, doc, amounts, amounts);
819 INSERT_INTO_JSON_OBJECT(val, doc, from_height, from_height);
820 INSERT_INTO_JSON_OBJECT(val, doc, to_height, to_height);
821 INSERT_INTO_JSON_OBJECT(val, doc, cumulative, cumulative);
822
823 return val;
824}
825
826void GetOutputDistribution::Request::fromJson(rapidjson::Value& val)
827{
828 GET_FROM_JSON_OBJECT(val, amounts, amounts);
829 GET_FROM_JSON_OBJECT(val, from_height, from_height);
830 GET_FROM_JSON_OBJECT(val, to_height, to_height);
831 GET_FROM_JSON_OBJECT(val, cumulative, cumulative);
832}
833
834rapidjson::Value GetOutputDistribution::Response::toJson(rapidjson::Document& doc) const
835{
836 auto val = Message::toJson(doc);
837
838 INSERT_INTO_JSON_OBJECT(val, doc, status, status);
839 INSERT_INTO_JSON_OBJECT(val, doc, distributions, distributions);
840
841 return val;
842}
843
844void GetOutputDistribution::Response::fromJson(rapidjson::Value& val)
845{
846 GET_FROM_JSON_OBJECT(val, status, status);
847 GET_FROM_JSON_OBJECT(val, distributions, distributions);
848}
849
850} // namespace rpc
851
852} // namespace cryptonote
uint64_t height
uint8_t version
virtual rapidjson::Value toJson(rapidjson::Document &doc) const
Definition message.cpp:57
#define GET_FROM_JSON_OBJECT(source, dst, key)
Definition json_object.h:52
#define INSERT_INTO_JSON_OBJECT(jsonVal, doc, key, source)
Definition json_object.h:47
Holds cryptonote related classes and helpers.
Definition ban.cpp:40
CXA_THROW_INFO_T * info
struct hash_func hashes[]
const char * address
Definition multisig.cpp:37