forked from ConcealNetwork/conceal-core
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CoreRpcServerCommandsDefinitions.h
977 lines (824 loc) · 21.2 KB
/
CoreRpcServerCommandsDefinitions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
// Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs
// Copyright (c) 2018-2019 Conceal Network & Conceal Devs
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include "CryptoNoteProtocol/CryptoNoteProtocolDefinitions.h"
#include "CryptoNoteCore/CryptoNoteBasic.h"
#include "CryptoNoteCore/Difficulty.h"
#include "crypto/hash.h"
#include "Serialization/SerializationOverloads.h"
namespace CryptoNote {
//-----------------------------------------------
#define CORE_RPC_STATUS_OK "OK"
#define CORE_RPC_STATUS_BUSY "BUSY"
struct EMPTY_STRUCT {
void serialize(ISerializer &s) {}
};
struct STATUS_STRUCT {
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(status)
}
};
struct COMMAND_RPC_GET_HEIGHT {
typedef EMPTY_STRUCT request;
struct response {
uint64_t height;
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(height)
KV_MEMBER(status)
}
};
};
struct COMMAND_RPC_GET_BLOCKS_FAST {
struct request {
std::vector<Crypto::Hash> block_ids; //*first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block */
void serialize(ISerializer &s) {
serializeAsBinary(block_ids, "block_ids", s);
}
};
struct response {
std::vector<block_complete_entry> blocks;
uint64_t start_height;
uint64_t current_height;
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(blocks)
KV_MEMBER(start_height)
KV_MEMBER(current_height)
KV_MEMBER(status)
}
};
};
//-----------------------------------------------
struct COMMAND_RPC_GET_TRANSACTIONS {
struct request {
std::vector<std::string> txs_hashes;
void serialize(ISerializer &s) {
KV_MEMBER(txs_hashes)
}
};
struct response {
std::vector<std::string> txs_as_hex; //transactions blobs as hex
std::vector<std::string> missed_tx; //not found transactions
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(txs_as_hex)
KV_MEMBER(missed_tx)
KV_MEMBER(status)
}
};
};
struct block_short_response
{
uint64_t timestamp;
uint32_t height;
std::string hash;
uint64_t transactions_count;
uint64_t cumulative_size;
difficulty_type difficulty;
void serialize(ISerializer &s)
{
KV_MEMBER(timestamp)
KV_MEMBER(height)
KV_MEMBER(hash)
KV_MEMBER(cumulative_size)
KV_MEMBER(transactions_count)
KV_MEMBER(difficulty)
}
};
//-----------------------------------------------
struct COMMAND_RPC_GET_POOL_CHANGES {
struct request {
Crypto::Hash tailBlockId;
std::vector<Crypto::Hash> knownTxsIds;
void serialize(ISerializer &s) {
KV_MEMBER(tailBlockId)
serializeAsBinary(knownTxsIds, "knownTxsIds", s);
}
};
struct response {
bool isTailBlockActual;
std::vector<BinaryArray> addedTxs; // Added transactions blobs
std::vector<Crypto::Hash> deletedTxsIds; // IDs of not found transactions
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(isTailBlockActual)
KV_MEMBER(addedTxs)
serializeAsBinary(deletedTxsIds, "deletedTxsIds", s);
KV_MEMBER(status)
}
};
};
struct COMMAND_RPC_GET_ALT_BLOCKS_LIST
{
typedef EMPTY_STRUCT request;
struct response
{
std::vector<block_short_response> alt_blocks;
std::string status;
void serialize(ISerializer &s)
{
KV_MEMBER(alt_blocks)
KV_MEMBER(status)
}
};
};
struct COMMAND_RPC_GET_POOL_CHANGES_LITE {
struct request {
Crypto::Hash tailBlockId;
std::vector<Crypto::Hash> knownTxsIds;
void serialize(ISerializer &s) {
KV_MEMBER(tailBlockId)
serializeAsBinary(knownTxsIds, "knownTxsIds", s);
}
};
struct response {
bool isTailBlockActual;
std::vector<TransactionPrefixInfo> addedTxs; // Added transactions blobs
std::vector<Crypto::Hash> deletedTxsIds; // IDs of not found transactions
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(isTailBlockActual)
KV_MEMBER(addedTxs)
serializeAsBinary(deletedTxsIds, "deletedTxsIds", s);
KV_MEMBER(status)
}
};
};
//-----------------------------------------------
struct COMMAND_RPC_GET_TX_GLOBAL_OUTPUTS_INDEXES {
struct request {
Crypto::Hash txid;
void serialize(ISerializer &s) {
KV_MEMBER(txid)
}
};
struct response {
std::vector<uint64_t> o_indexes;
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(o_indexes)
KV_MEMBER(status)
}
};
};
//-----------------------------------------------
struct COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_request {
std::vector<uint64_t> amounts;
uint64_t outs_count;
void serialize(ISerializer &s) {
KV_MEMBER(amounts)
KV_MEMBER(outs_count)
}
};
#pragma pack(push, 1)
struct COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_out_entry {
uint64_t global_amount_index;
Crypto::PublicKey out_key;
};
#pragma pack(pop)
struct COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_outs_for_amount {
uint64_t amount;
std::vector<COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_out_entry> outs;
void serialize(ISerializer &s) {
KV_MEMBER(amount)
serializeAsBinary(outs, "outs", s);
}
};
struct COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_response {
std::vector<COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_outs_for_amount> outs;
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(outs);
KV_MEMBER(status)
}
};
struct COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS {
typedef COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_request request;
typedef COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_response response;
typedef COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_out_entry out_entry;
typedef COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_outs_for_amount outs_for_amount;
};
//-----------------------------------------------
struct COMMAND_RPC_SEND_RAW_TX {
struct request {
std::string tx_as_hex;
request() {}
explicit request(const Transaction &);
void serialize(ISerializer &s) {
KV_MEMBER(tx_as_hex)
}
};
struct response {
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(status)
}
};
};
//-----------------------------------------------
struct COMMAND_RPC_START_MINING {
struct request {
std::string miner_address;
uint64_t threads_count;
void serialize(ISerializer &s) {
KV_MEMBER(miner_address)
KV_MEMBER(threads_count)
}
};
struct response {
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(status)
}
};
};
//-----------------------------------------------
struct COMMAND_RPC_GET_INFO {
typedef EMPTY_STRUCT request;
struct response {
std::string status;
std::string version;
std::string fee_address;
std::string top_block_hash;
uint64_t height;
uint64_t difficulty;
uint64_t tx_count;
uint64_t tx_pool_size;
uint64_t alt_blocks_count;
uint64_t outgoing_connections_count;
uint64_t incoming_connections_count;
uint64_t white_peerlist_size;
uint64_t grey_peerlist_size;
uint8_t block_major_version;
uint8_t block_minor_version;
uint32_t last_known_block_index;
uint64_t full_deposit_amount;
uint64_t last_block_reward;
uint64_t last_block_timestamp;
uint64_t last_block_difficulty;
std::vector<std::string> connections;
void serialize(ISerializer &s) {
KV_MEMBER(status)
KV_MEMBER(height)
KV_MEMBER(version)
KV_MEMBER(difficulty)
KV_MEMBER(top_block_hash)
KV_MEMBER(tx_count)
KV_MEMBER(tx_pool_size)
KV_MEMBER(alt_blocks_count)
KV_MEMBER(outgoing_connections_count)
KV_MEMBER(fee_address)
KV_MEMBER(block_major_version)
KV_MEMBER(block_minor_version)
KV_MEMBER(incoming_connections_count)
KV_MEMBER(white_peerlist_size)
KV_MEMBER(grey_peerlist_size)
KV_MEMBER(last_known_block_index)
KV_MEMBER(full_deposit_amount)
KV_MEMBER(last_block_reward)
KV_MEMBER(last_block_timestamp)
KV_MEMBER(last_block_difficulty)
KV_MEMBER(connections)
}
};
};
//-----------------------------------------------
struct COMMAND_RPC_GET_PEER_LIST {
typedef EMPTY_STRUCT request;
struct response {
std::vector<std::string> peers;
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(peers)
KV_MEMBER(status)
}
};
};
//-----------------------------------------------
struct COMMAND_RPC_STOP_MINING {
typedef EMPTY_STRUCT request;
typedef STATUS_STRUCT response;
};
//-----------------------------------------------
struct COMMAND_RPC_STOP_DAEMON {
typedef EMPTY_STRUCT request;
typedef STATUS_STRUCT response;
};
//
struct COMMAND_RPC_GETBLOCKCOUNT {
typedef std::vector<std::string> request;
struct response {
uint64_t count;
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(count)
KV_MEMBER(status)
}
};
};
struct COMMAND_RPC_GET_FEE_ADDRESS {
typedef EMPTY_STRUCT request;
struct response {
std::string fee_address;
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(fee_address)
KV_MEMBER(status)
}
};
};
struct COMMAND_RPC_GETBLOCKHASH {
typedef std::vector<uint64_t> request;
typedef std::string response;
};
struct COMMAND_RPC_GETBLOCKTEMPLATE {
struct request {
uint64_t reserve_size; //max 255 bytes
std::string wallet_address;
void serialize(ISerializer &s) {
KV_MEMBER(reserve_size)
KV_MEMBER(wallet_address)
}
};
struct response {
uint64_t difficulty;
uint32_t height;
uint64_t reserved_offset;
std::string blocktemplate_blob;
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(difficulty)
KV_MEMBER(height)
KV_MEMBER(reserved_offset)
KV_MEMBER(blocktemplate_blob)
KV_MEMBER(status)
}
};
};
struct COMMAND_RPC_GET_CURRENCY_ID {
typedef EMPTY_STRUCT request;
struct response {
std::string currency_id_blob;
void serialize(ISerializer &s) {
KV_MEMBER(currency_id_blob)
}
};
};
struct COMMAND_RPC_SUBMITBLOCK {
typedef std::vector<std::string> request;
typedef STATUS_STRUCT response;
};
struct block_header_response {
uint8_t major_version;
uint8_t minor_version;
uint64_t timestamp;
std::string prev_hash;
uint32_t nonce;
bool orphan_status;
uint64_t height;
uint64_t depth;
uint64_t deposits;
std::string hash;
difficulty_type difficulty;
uint64_t reward;
void serialize(ISerializer &s) {
KV_MEMBER(major_version)
KV_MEMBER(minor_version)
KV_MEMBER(timestamp)
KV_MEMBER(prev_hash)
KV_MEMBER(nonce)
KV_MEMBER(orphan_status)
KV_MEMBER(height)
KV_MEMBER(depth)
KV_MEMBER(deposits)
KV_MEMBER(hash)
KV_MEMBER(difficulty)
KV_MEMBER(reward)
}
};
struct BLOCK_HEADER_RESPONSE {
std::string status;
block_header_response block_header;
void serialize(ISerializer &s) {
KV_MEMBER(block_header)
KV_MEMBER(status)
}
};
struct f_transaction_short_response {
std::string hash;
uint64_t fee;
uint64_t amount_out;
uint64_t size;
void serialize(ISerializer &s) {
KV_MEMBER(hash)
KV_MEMBER(fee)
KV_MEMBER(amount_out)
KV_MEMBER(size)
}
};
struct f_transaction_details_response {
std::string hash;
size_t size;
std::string paymentId;
uint64_t mixin;
uint64_t fee;
uint64_t amount_out;
void serialize(ISerializer &s) {
KV_MEMBER(hash)
KV_MEMBER(size)
KV_MEMBER(paymentId)
KV_MEMBER(mixin)
KV_MEMBER(fee)
KV_MEMBER(amount_out)
}
};
struct f_block_short_response {
uint64_t timestamp;
uint32_t height;
difficulty_type difficulty;
std::string hash;
uint64_t tx_count;
uint64_t cumul_size;
void serialize(ISerializer &s) {
KV_MEMBER(timestamp)
KV_MEMBER(height)
KV_MEMBER(difficulty)
KV_MEMBER(hash)
KV_MEMBER(cumul_size)
KV_MEMBER(tx_count)
}
};
struct f_block_details_response {
uint8_t major_version;
uint8_t minor_version;
uint64_t timestamp;
std::string prev_hash;
uint32_t nonce;
bool orphan_status;
uint64_t height;
uint64_t depth;
std::string hash;
difficulty_type difficulty;
uint64_t reward;
uint64_t blockSize;
size_t sizeMedian;
uint64_t effectiveSizeMedian;
uint64_t transactionsCumulativeSize;
std::string alreadyGeneratedCoins;
uint64_t alreadyGeneratedTransactions;
uint64_t baseReward;
double penalty;
uint64_t totalFeeAmount;
std::vector<f_transaction_short_response> transactions;
void serialize(ISerializer &s) {
KV_MEMBER(major_version)
KV_MEMBER(minor_version)
KV_MEMBER(timestamp)
KV_MEMBER(prev_hash)
KV_MEMBER(nonce)
KV_MEMBER(orphan_status)
KV_MEMBER(height)
KV_MEMBER(depth)
KV_MEMBER(hash)
KV_MEMBER(difficulty)
KV_MEMBER(reward)
KV_MEMBER(blockSize)
KV_MEMBER(sizeMedian)
KV_MEMBER(effectiveSizeMedian)
KV_MEMBER(transactionsCumulativeSize)
KV_MEMBER(alreadyGeneratedCoins)
KV_MEMBER(alreadyGeneratedTransactions)
KV_MEMBER(baseReward)
KV_MEMBER(penalty)
KV_MEMBER(transactions)
KV_MEMBER(totalFeeAmount)
}
};
struct currency_base_coin {
std::string name;
std::string git;
void serialize(ISerializer &s) {
KV_MEMBER(name)
KV_MEMBER(git)
}
};
struct currency_core {
std::vector<std::string> SEED_NODES;
uint64_t EMISSION_SPEED_FACTOR;
uint64_t DIFFICULTY_TARGET;
uint64_t CRYPTONOTE_DISPLAY_DECIMAL_POINT;
std::string MONEY_SUPPLY;
// uint64_t GENESIS_BLOCK_REWARD;
uint64_t DEFAULT_DUST_THRESHOLD;
uint64_t MINIMUM_FEE;
uint64_t CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW;
uint64_t CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE;
// uint64_t CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1;
uint64_t CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX;
uint64_t P2P_DEFAULT_PORT;
uint64_t RPC_DEFAULT_PORT;
uint64_t MAX_BLOCK_SIZE_INITIAL;
uint64_t EXPECTED_NUMBER_OF_BLOCKS_PER_DAY;
uint64_t UPGRADE_HEIGHT;
uint64_t DIFFICULTY_CUT;
uint64_t DIFFICULTY_LAG;
//std::string BYTECOIN_NETWORK;
std::string CRYPTONOTE_NAME;
std::string GENESIS_COINBASE_TX_HEX;
std::vector<std::string> CHECKPOINTS;
void serialize(ISerializer &s) {
KV_MEMBER(SEED_NODES)
KV_MEMBER(EMISSION_SPEED_FACTOR)
KV_MEMBER(DIFFICULTY_TARGET)
KV_MEMBER(CRYPTONOTE_DISPLAY_DECIMAL_POINT)
KV_MEMBER(MONEY_SUPPLY)
// KV_MEMBER(GENESIS_BLOCK_REWARD)
KV_MEMBER(DEFAULT_DUST_THRESHOLD)
KV_MEMBER(MINIMUM_FEE)
KV_MEMBER(CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW)
KV_MEMBER(CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE)
// KV_MEMBER(CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1)
KV_MEMBER(CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX)
KV_MEMBER(P2P_DEFAULT_PORT)
KV_MEMBER(RPC_DEFAULT_PORT)
KV_MEMBER(MAX_BLOCK_SIZE_INITIAL)
KV_MEMBER(EXPECTED_NUMBER_OF_BLOCKS_PER_DAY)
KV_MEMBER(UPGRADE_HEIGHT)
KV_MEMBER(DIFFICULTY_CUT)
KV_MEMBER(DIFFICULTY_LAG)
// KV_MEMBER(BYTECOIN_NETWORK)
KV_MEMBER(CRYPTONOTE_NAME)
KV_MEMBER(GENESIS_COINBASE_TX_HEX)
KV_MEMBER(CHECKPOINTS)
}
};
struct COMMAND_RPC_GET_LAST_BLOCK_HEADER {
typedef EMPTY_STRUCT request;
typedef BLOCK_HEADER_RESPONSE response;
};
struct COMMAND_RPC_GET_BLOCK_HEADER_BY_HASH {
struct request {
std::string hash;
void serialize(ISerializer &s) {
KV_MEMBER(hash)
}
};
typedef BLOCK_HEADER_RESPONSE response;
};
struct COMMAND_RPC_GET_BLOCK_HEADER_BY_HEIGHT {
struct request {
uint64_t height;
void serialize(ISerializer &s) {
KV_MEMBER(height)
}
};
typedef BLOCK_HEADER_RESPONSE response;
};
struct F_COMMAND_RPC_GET_BLOCKS_LIST {
struct request {
uint64_t height;
void serialize(ISerializer &s) {
KV_MEMBER(height)
}
};
struct response {
std::vector<f_block_short_response> blocks; //transactions blobs as hex
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(blocks)
KV_MEMBER(status)
}
};
};
struct F_COMMAND_RPC_GET_BLOCK_DETAILS {
struct request {
std::string hash;
void serialize(ISerializer &s) {
KV_MEMBER(hash)
}
};
struct response {
f_block_details_response block;
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(block)
KV_MEMBER(status)
}
};
};
struct F_COMMAND_RPC_GET_TRANSACTION_DETAILS {
struct request {
std::string hash;
void serialize(ISerializer &s) {
KV_MEMBER(hash)
}
};
struct response {
Transaction tx;
f_transaction_details_response txDetails;
f_block_short_response block;
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(tx)
KV_MEMBER(txDetails)
KV_MEMBER(block)
KV_MEMBER(status)
}
};
};
struct F_COMMAND_RPC_GET_POOL {
typedef EMPTY_STRUCT request;
struct response {
std::vector<f_transaction_short_response> transactions; //transactions blobs as hex
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(transactions)
KV_MEMBER(status)
}
};
};
struct F_COMMAND_RPC_GET_BLOCKCHAIN_SETTINGS {
typedef EMPTY_STRUCT request;
struct response {
currency_base_coin base_coin;
currency_core core;
std::vector<std::string> extensions;
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(base_coin)
KV_MEMBER(core)
KV_MEMBER(extensions)
KV_MEMBER(status)
}
};
};
struct COMMAND_RPC_QUERY_BLOCKS {
struct request {
std::vector<Crypto::Hash> block_ids; //*first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block */
uint64_t timestamp;
void serialize(ISerializer &s) {
serializeAsBinary(block_ids, "block_ids", s);
KV_MEMBER(timestamp)
}
};
struct response {
std::string status;
uint64_t start_height;
uint64_t current_height;
uint64_t full_offset;
std::vector<BlockFullInfo> items;
void serialize(ISerializer &s) {
KV_MEMBER(status)
KV_MEMBER(start_height)
KV_MEMBER(current_height)
KV_MEMBER(full_offset)
KV_MEMBER(items)
}
};
};
struct COMMAND_RPC_QUERY_BLOCKS_LITE {
struct request {
std::vector<Crypto::Hash> blockIds;
uint64_t timestamp;
void serialize(ISerializer &s) {
serializeAsBinary(blockIds, "block_ids", s);
KV_MEMBER(timestamp)
}
};
struct response {
std::string status;
uint64_t startHeight;
uint64_t currentHeight;
uint64_t fullOffset;
std::vector<BlockShortInfo> items;
void serialize(ISerializer &s) {
KV_MEMBER(status)
KV_MEMBER(startHeight)
KV_MEMBER(currentHeight)
KV_MEMBER(fullOffset)
KV_MEMBER(items)
}
};
};
struct reserve_proof_entry
{
Crypto::Hash txid;
uint64_t index_in_tx;
Crypto::PublicKey shared_secret;
Crypto::KeyImage key_image;
Crypto::Signature shared_secret_sig;
Crypto::Signature key_image_sig;
void serialize(ISerializer& s)
{
KV_MEMBER(txid)
KV_MEMBER(index_in_tx)
KV_MEMBER(shared_secret)
KV_MEMBER(key_image)
KV_MEMBER(shared_secret_sig)
KV_MEMBER(key_image_sig)
}
};
struct reserve_proof {
std::vector<reserve_proof_entry> proofs;
Crypto::Signature signature;
void serialize(ISerializer &s) {
KV_MEMBER(proofs)
KV_MEMBER(signature)
}
};
struct COMMAND_RPC_GET_BLOCK_TIMESTAMP_BY_HEIGHT
{
struct request
{
uint64_t height;
void serialize(ISerializer &s)
{
KV_MEMBER(height)
}
};
struct response
{
uint64_t timestamp;
std::string status;
void serialize(ISerializer &s)
{
KV_MEMBER(timestamp)
KV_MEMBER(status)
}
};
};
struct COMMAND_RPC_GET_BLOCK_DETAILS_BY_HEIGHT
{
struct request
{
uint64_t height;
void serialize(ISerializer &s)
{
KV_MEMBER(height)
}
};
struct response
{
f_block_details_response block;
std::string status;
void serialize(ISerializer &s)
{
KV_MEMBER(status)
KV_MEMBER(block)
}
};
};
struct K_COMMAND_RPC_CHECK_TX_PROOF {
struct request {
std::string tx_id;
std::string dest_address;
std::string signature;
void serialize(ISerializer &s) {
KV_MEMBER(tx_id)
KV_MEMBER(dest_address)
KV_MEMBER(signature)
}
};
struct response {
bool signature_valid;
uint64_t received_amount;
std::vector<TransactionOutput> outputs;
uint32_t confirmations = 0;
std::string status;
void serialize(ISerializer &s) {
KV_MEMBER(signature_valid)
KV_MEMBER(received_amount)
KV_MEMBER(outputs)
KV_MEMBER(confirmations)
KV_MEMBER(status)
}
};
};
struct K_COMMAND_RPC_CHECK_RESERVE_PROOF {
struct request {
std::string address;
std::string message;
std::string signature;
void serialize(ISerializer &s) {
KV_MEMBER(address)
KV_MEMBER(message)
KV_MEMBER(signature)
}
};
struct response {
bool good;
uint64_t total;
uint64_t spent;
void serialize(ISerializer &s) {
KV_MEMBER(good)
KV_MEMBER(total)
KV_MEMBER(spent)
}
};
};
}