@eosrio/node-abieos 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/README.md +4 -1
  2. package/dist/abieos.node +0 -0
  3. package/lib/abieos.d.ts +19 -0
  4. package/lib/abieos.d.ts.map +1 -0
  5. package/lib/abieos.js +100 -0
  6. package/lib/abieos.ts +107 -0
  7. package/package.json +13 -8
  8. package/.idea/modules.xml +0 -8
  9. package/.idea/node-abieos.iml +0 -12
  10. package/.idea/vcs.xml +0 -9
  11. package/.idea/workspace.xml +0 -66
  12. package/CMakeLists.txt +0 -35
  13. package/abieos.d.ts +0 -21
  14. package/abieos.js +0 -59
  15. package/eosio.json +0 -1596
  16. package/include/.clang-format +0 -76
  17. package/include/eosio/abi.hpp +0 -393
  18. package/include/eosio/asset.hpp +0 -458
  19. package/include/eosio/bytes.hpp +0 -27
  20. package/include/eosio/chain_conversions.hpp +0 -450
  21. package/include/eosio/chain_types.hpp +0 -14
  22. package/include/eosio/check.hpp +0 -178
  23. package/include/eosio/convert.hpp +0 -95
  24. package/include/eosio/crypto.hpp +0 -148
  25. package/include/eosio/eosio_outcome.hpp +0 -41
  26. package/include/eosio/fixed_bytes.hpp +0 -250
  27. package/include/eosio/float.hpp +0 -35
  28. package/include/eosio/for_each_field.hpp +0 -48
  29. package/include/eosio/fpconv.c +0 -336
  30. package/include/eosio/fpconv.h +0 -41
  31. package/include/eosio/fpconv.license +0 -23
  32. package/include/eosio/from_bin.hpp +0 -272
  33. package/include/eosio/from_json.hpp +0 -749
  34. package/include/eosio/from_string.hpp +0 -28
  35. package/include/eosio/map_macro.h +0 -64
  36. package/include/eosio/murmur.hpp +0 -55
  37. package/include/eosio/name.hpp +0 -178
  38. package/include/eosio/opaque.hpp +0 -184
  39. package/include/eosio/operators.hpp +0 -71
  40. package/include/eosio/powers.h +0 -76
  41. package/include/eosio/reflection.hpp +0 -61
  42. package/include/eosio/ship_protocol.hpp +0 -971
  43. package/include/eosio/stream.hpp +0 -235
  44. package/include/eosio/symbol.hpp +0 -300
  45. package/include/eosio/time.hpp +0 -264
  46. package/include/eosio/to_bin.hpp +0 -189
  47. package/include/eosio/to_json.hpp +0 -334
  48. package/include/eosio/to_key.hpp +0 -305
  49. package/include/eosio/types.hpp +0 -103
  50. package/include/eosio/varint.hpp +0 -452
  51. package/include/outcome-basic.hpp +0 -6836
  52. package/include/rapidjson/allocators.h +0 -284
  53. package/include/rapidjson/cursorstreamwrapper.h +0 -78
  54. package/include/rapidjson/document.h +0 -2646
  55. package/include/rapidjson/encodedstream.h +0 -299
  56. package/include/rapidjson/encodings.h +0 -716
  57. package/include/rapidjson/error/en.h +0 -74
  58. package/include/rapidjson/error/error.h +0 -161
  59. package/include/rapidjson/filereadstream.h +0 -99
  60. package/include/rapidjson/filewritestream.h +0 -104
  61. package/include/rapidjson/fwd.h +0 -151
  62. package/include/rapidjson/internal/biginteger.h +0 -290
  63. package/include/rapidjson/internal/diyfp.h +0 -271
  64. package/include/rapidjson/internal/dtoa.h +0 -245
  65. package/include/rapidjson/internal/ieee754.h +0 -78
  66. package/include/rapidjson/internal/itoa.h +0 -308
  67. package/include/rapidjson/internal/meta.h +0 -186
  68. package/include/rapidjson/internal/pow10.h +0 -55
  69. package/include/rapidjson/internal/regex.h +0 -732
  70. package/include/rapidjson/internal/stack.h +0 -231
  71. package/include/rapidjson/internal/strfunc.h +0 -69
  72. package/include/rapidjson/internal/strtod.h +0 -290
  73. package/include/rapidjson/internal/swap.h +0 -46
  74. package/include/rapidjson/istreamwrapper.h +0 -113
  75. package/include/rapidjson/memorybuffer.h +0 -70
  76. package/include/rapidjson/memorystream.h +0 -71
  77. package/include/rapidjson/msinttypes/inttypes.h +0 -316
  78. package/include/rapidjson/msinttypes/stdint.h +0 -300
  79. package/include/rapidjson/ostreamwrapper.h +0 -81
  80. package/include/rapidjson/pointer.h +0 -1357
  81. package/include/rapidjson/prettywriter.h +0 -277
  82. package/include/rapidjson/rapidjson.h +0 -654
  83. package/include/rapidjson/reader.h +0 -2230
  84. package/include/rapidjson/schema.h +0 -2494
  85. package/include/rapidjson/stream.h +0 -223
  86. package/include/rapidjson/stringbuffer.h +0 -121
  87. package/include/rapidjson/writer.h +0 -710
  88. package/src/abi.cpp +0 -274
  89. package/src/abieos.cpp +0 -334
  90. package/src/abieos.h +0 -91
  91. package/src/abieos.hpp +0 -1011
  92. package/src/abieos_exception.hpp +0 -89
  93. package/src/abieos_numeric.hpp +0 -94
  94. package/src/abieos_ripemd160.hpp +0 -417
  95. package/src/crypto.cpp +0 -215
  96. package/src/main.cpp +0 -242
  97. package/src/ship.abi.cpp +0 -695
  98. package/tools/CMakeLists.txt +0 -9
  99. package/tools/name.cpp +0 -86
@@ -1,971 +0,0 @@
1
- #pragma once
2
-
3
- #include "check.hpp"
4
- #include "crypto.hpp"
5
- #include "fixed_bytes.hpp"
6
- #include "float.hpp"
7
- #include "name.hpp"
8
- #include "opaque.hpp"
9
- #include "stream.hpp"
10
- #include "time.hpp"
11
- #include "varint.hpp"
12
-
13
- // todo: move
14
- namespace eosio {
15
- template <typename S>
16
- void to_json(const input_stream& data, S& stream) {
17
- return to_json_hex(data.pos, data.end - data.pos, stream);
18
- }
19
-
20
- constexpr const char* get_type_name(const input_stream*) { return "bytes"; }
21
- } // namespace eosio
22
-
23
- namespace eosio { namespace ship_protocol {
24
-
25
- typedef __uint128_t uint128_t;
26
-
27
- #ifdef __eosio_cdt__
28
- # pragma clang diagnostic push
29
- # pragma clang diagnostic ignored "-Winvalid-noreturn"
30
- [[noreturn]] inline void report_error(const std::string& s) { eosio::check(false, s); }
31
- # pragma clang diagnostic pop
32
- #else
33
- [[noreturn]] inline void report_error(const std::string& s) { throw std::runtime_error(s); }
34
- #endif
35
-
36
- struct extension {
37
- uint16_t type = {};
38
- eosio::input_stream data = {};
39
- };
40
-
41
- EOSIO_REFLECT(extension, type, data)
42
-
43
- enum class transaction_status : uint8_t {
44
- executed = 0, // succeed, no error handler executed
45
- soft_fail = 1, // objectively failed (not executed), error handler executed
46
- hard_fail = 2, // objectively failed and error handler objectively failed thus no state change
47
- delayed = 3, // transaction delayed/deferred/scheduled for future execution
48
- expired = 4, // transaction expired and storage space refunded to user
49
- };
50
-
51
- // todo: switch to eosio::result. switch to new serializer string support.
52
- inline std::string to_string(transaction_status status) {
53
- switch (status) {
54
- case transaction_status::executed: return "executed";
55
- case transaction_status::soft_fail: return "soft_fail";
56
- case transaction_status::hard_fail: return "hard_fail";
57
- case transaction_status::delayed: return "delayed";
58
- case transaction_status::expired: return "expired";
59
- }
60
- report_error("unknown status: " + std::to_string((uint8_t)status));
61
- }
62
-
63
- // todo: switch to eosio::result. switch to new serializer string support.
64
- inline transaction_status get_transaction_status(const std::string& s) {
65
- if (s == "executed")
66
- return transaction_status::executed;
67
- if (s == "soft_fail")
68
- return transaction_status::soft_fail;
69
- if (s == "hard_fail")
70
- return transaction_status::hard_fail;
71
- if (s == "delayed")
72
- return transaction_status::delayed;
73
- if (s == "expired")
74
- return transaction_status::expired;
75
- report_error("unknown status: " + s);
76
- }
77
-
78
- struct get_status_request_v0 {};
79
-
80
- EOSIO_REFLECT(get_status_request_v0)
81
-
82
- struct block_position {
83
- uint32_t block_num = {};
84
- eosio::checksum256 block_id = {};
85
- };
86
-
87
- EOSIO_REFLECT(block_position, block_num, block_id)
88
-
89
- struct get_status_result_v0 {
90
- block_position head = {};
91
- block_position last_irreversible = {};
92
- uint32_t trace_begin_block = {};
93
- uint32_t trace_end_block = {};
94
- uint32_t chain_state_begin_block = {};
95
- uint32_t chain_state_end_block = {};
96
- eosio::checksum256 chain_id = {}; // todo: switch to binary extension
97
- };
98
-
99
- EOSIO_REFLECT(get_status_result_v0, head, last_irreversible, trace_begin_block, trace_end_block,
100
- chain_state_begin_block, chain_state_end_block, chain_id)
101
-
102
- // When using `get_blocks_request_v1`, `get_blocks_result_v0` will be returned for EOS version 2.0.x and before and
103
- // `get_blocks_result_v1` will be returned for EOS version 2.1 RC bug not stable.
104
- struct get_blocks_request_v0 {
105
- uint32_t start_block_num = {};
106
- uint32_t end_block_num = {};
107
- uint32_t max_messages_in_flight = {};
108
- std::vector<block_position> have_positions = {};
109
- bool irreversible_only = {};
110
- bool fetch_block = {};
111
- bool fetch_traces = {};
112
- bool fetch_deltas = {};
113
- };
114
-
115
- EOSIO_REFLECT(get_blocks_request_v0, start_block_num, end_block_num, max_messages_in_flight, have_positions,
116
- irreversible_only, fetch_block, fetch_traces, fetch_deltas)
117
-
118
- // When using `get_blocks_request_v1`, only `get_blocks_result_v2` will be returned
119
- struct get_blocks_request_v1 : get_blocks_request_v0 {
120
- bool fetch_block_header = {};
121
- };
122
-
123
- EOSIO_REFLECT(get_blocks_request_v1, base get_blocks_request_v0, fetch_block_header)
124
-
125
- struct get_blocks_ack_request_v0 {
126
- uint32_t num_messages = {};
127
- };
128
-
129
- EOSIO_REFLECT(get_blocks_ack_request_v0, num_messages)
130
-
131
- using request = std::variant<get_status_request_v0, get_blocks_request_v0, get_blocks_ack_request_v0, get_blocks_request_v1>;
132
-
133
- struct get_blocks_result_base {
134
- block_position head = {};
135
- block_position last_irreversible = {};
136
- std::optional<block_position> this_block = {};
137
- std::optional<block_position> prev_block = {};
138
- };
139
-
140
- EOSIO_REFLECT(get_blocks_result_base, head, last_irreversible, this_block, prev_block)
141
-
142
- struct get_blocks_result_v0 : get_blocks_result_base {
143
- std::optional<eosio::input_stream> block = {};
144
- std::optional<eosio::input_stream> traces = {};
145
- std::optional<eosio::input_stream> deltas = {};
146
- };
147
-
148
- EOSIO_REFLECT(get_blocks_result_v0, base get_blocks_result_base, block, traces, deltas)
149
-
150
- struct row_v0 {
151
- bool present = {}; // false (not present), true (present, old / new)
152
- eosio::input_stream data = {};
153
- };
154
-
155
- EOSIO_REFLECT(row_v0, present, data)
156
-
157
- struct table_delta_v0 {
158
- std::string name = {};
159
- std::vector<row_v0> rows = {};
160
- };
161
-
162
- EOSIO_REFLECT(table_delta_v0, name, rows)
163
-
164
- struct row_v1 {
165
- uint8_t present = {}; // 0 (not present), 1 (present, old), 2 (present, new)
166
- eosio::input_stream data = {};
167
- };
168
-
169
- EOSIO_REFLECT(row_v1, present, data)
170
-
171
- struct table_delta_v1 {
172
- std::string name = {};
173
- std::vector<row_v1> rows = {};
174
- };
175
-
176
- EOSIO_REFLECT(table_delta_v1, name, rows)
177
-
178
- using table_delta = std::variant<table_delta_v0, table_delta_v1>;
179
-
180
- struct permission_level {
181
- eosio::name actor = {};
182
- eosio::name permission = {};
183
- };
184
-
185
- EOSIO_REFLECT(permission_level, actor, permission)
186
-
187
- struct action {
188
- eosio::name account = {};
189
- eosio::name name = {};
190
- std::vector<permission_level> authorization = {};
191
- eosio::input_stream data = {};
192
- };
193
-
194
- EOSIO_REFLECT(action, account, name, authorization, data)
195
-
196
- struct account_auth_sequence {
197
- eosio::name account = {};
198
- uint64_t sequence = {};
199
- };
200
-
201
- EOSIO_REFLECT(account_auth_sequence, account, sequence)
202
- EOSIO_COMPARE(account_auth_sequence);
203
-
204
- struct action_receipt_v0 {
205
- eosio::name receiver = {};
206
- eosio::checksum256 act_digest = {};
207
- uint64_t global_sequence = {};
208
- uint64_t recv_sequence = {};
209
- std::vector<account_auth_sequence> auth_sequence = {};
210
- eosio::varuint32 code_sequence = {};
211
- eosio::varuint32 abi_sequence = {};
212
- };
213
-
214
- EOSIO_REFLECT(action_receipt_v0, receiver, act_digest, global_sequence, recv_sequence, auth_sequence, code_sequence,
215
- abi_sequence)
216
-
217
- using action_receipt = std::variant<action_receipt_v0>;
218
-
219
- struct account_delta {
220
- eosio::name account = {};
221
- int64_t delta = {};
222
- };
223
-
224
- EOSIO_REFLECT(account_delta, account, delta)
225
- EOSIO_COMPARE(account_delta);
226
-
227
- struct action_trace_v0 {
228
- eosio::varuint32 action_ordinal = {};
229
- eosio::varuint32 creator_action_ordinal = {};
230
- std::optional<action_receipt> receipt = {};
231
- eosio::name receiver = {};
232
- action act = {};
233
- bool context_free = {};
234
- int64_t elapsed = {};
235
- std::string console = {};
236
- std::vector<account_delta> account_ram_deltas = {};
237
- std::optional<std::string> except = {};
238
- std::optional<uint64_t> error_code = {};
239
- };
240
-
241
- EOSIO_REFLECT(action_trace_v0, action_ordinal, creator_action_ordinal, receipt, receiver, act, context_free, elapsed,
242
- console, account_ram_deltas, except, error_code)
243
-
244
- struct action_trace_v1 {
245
- eosio::varuint32 action_ordinal = {};
246
- eosio::varuint32 creator_action_ordinal = {};
247
- std::optional<action_receipt> receipt = {};
248
- eosio::name receiver = {};
249
- action act = {};
250
- bool context_free = {};
251
- int64_t elapsed = {};
252
- std::string console = {};
253
- std::vector<account_delta> account_ram_deltas = {};
254
- std::vector<account_delta> account_disk_deltas = {};
255
- std::optional<std::string> except = {};
256
- std::optional<uint64_t> error_code = {};
257
- eosio::input_stream return_value = {};
258
- };
259
-
260
- EOSIO_REFLECT(action_trace_v1, action_ordinal, creator_action_ordinal, receipt, receiver, act, context_free, elapsed,
261
- console, account_ram_deltas, account_disk_deltas, except, error_code, return_value)
262
-
263
- using action_trace = std::variant<action_trace_v0, action_trace_v1>;
264
-
265
- struct prunable_data_type {
266
- struct none {
267
- eosio::checksum256 prunable_digest;
268
- };
269
-
270
- using segment_type = std::variant<eosio::checksum256, eosio::input_stream>;
271
-
272
- struct partial {
273
- std::vector<eosio::signature> signatures;
274
- std::vector<segment_type> context_free_segments;
275
- };
276
-
277
- struct full {
278
- std::vector<eosio::signature> signatures;
279
- std::vector<eosio::input_stream> context_free_segments;
280
- };
281
-
282
- struct full_legacy {
283
- std::vector<eosio::signature> signatures;
284
- eosio::input_stream packed_context_free_data;
285
- };
286
-
287
- using prunable_data_t = std::variant<full_legacy, none, partial, full>;
288
-
289
- prunable_data_t prunable_data;
290
- };
291
-
292
- EOSIO_REFLECT(prunable_data_type, prunable_data)
293
- EOSIO_REFLECT(prunable_data_type::none, prunable_digest)
294
- EOSIO_REFLECT(prunable_data_type::partial, signatures, context_free_segments)
295
- EOSIO_REFLECT(prunable_data_type::full, signatures, context_free_segments)
296
- EOSIO_REFLECT(prunable_data_type::full_legacy, signatures, packed_context_free_data)
297
-
298
- struct partial_transaction_v0 {
299
- eosio::time_point_sec expiration = {};
300
- uint16_t ref_block_num = {};
301
- uint32_t ref_block_prefix = {};
302
- eosio::varuint32 max_net_usage_words = {};
303
- uint8_t max_cpu_usage_ms = {};
304
- eosio::varuint32 delay_sec = {};
305
- std::vector<extension> transaction_extensions = {};
306
- std::vector<eosio::signature> signatures = {};
307
- std::vector<eosio::input_stream> context_free_data = {};
308
- };
309
-
310
- EOSIO_REFLECT(partial_transaction_v0, expiration, ref_block_num, ref_block_prefix, max_net_usage_words,
311
- max_cpu_usage_ms, delay_sec, transaction_extensions, signatures, context_free_data)
312
-
313
- struct partial_transaction_v1 {
314
- eosio::time_point_sec expiration = {};
315
- uint16_t ref_block_num = {};
316
- uint32_t ref_block_prefix = {};
317
- eosio::varuint32 max_net_usage_words = {};
318
- uint8_t max_cpu_usage_ms = {};
319
- eosio::varuint32 delay_sec = {};
320
- std::vector<extension> transaction_extensions = {};
321
- std::optional<prunable_data_type> prunable_data = {};
322
- };
323
-
324
- EOSIO_REFLECT(partial_transaction_v1, expiration, ref_block_num, ref_block_prefix, max_net_usage_words,
325
- max_cpu_usage_ms, delay_sec, transaction_extensions, prunable_data)
326
-
327
- using partial_transaction = std::variant<partial_transaction_v0, partial_transaction_v1>;
328
-
329
- struct recurse_transaction_trace;
330
-
331
- struct transaction_trace_v0 {
332
- eosio::checksum256 id = {};
333
- transaction_status status = {};
334
- uint32_t cpu_usage_us = {};
335
- eosio::varuint32 net_usage_words = {};
336
- int64_t elapsed = {};
337
- uint64_t net_usage = {};
338
- bool scheduled = {};
339
- std::vector<action_trace> action_traces = {};
340
- std::optional<account_delta> account_ram_delta = {};
341
- std::optional<std::string> except = {};
342
- std::optional<uint64_t> error_code = {};
343
- // semantically, this should be std::optional<transaction_trace>;
344
- // optional serializes as bool[,transaction_trace]
345
- // vector serializes as size[,transaction_trace..] but vector will only ever have 0 or 1 transaction trace
346
- // This assumes that bool and size for false/true serializes to same as size 0/1
347
- std::vector<recurse_transaction_trace> failed_dtrx_trace = {};
348
- std::optional<partial_transaction> partial = {};
349
- };
350
-
351
- EOSIO_REFLECT(transaction_trace_v0, id, status, cpu_usage_us, net_usage_words, elapsed, net_usage, scheduled,
352
- action_traces, account_ram_delta, except, error_code, failed_dtrx_trace, partial)
353
-
354
- using transaction_trace = std::variant<transaction_trace_v0>;
355
-
356
- struct recurse_transaction_trace {
357
- transaction_trace recurse = {};
358
- };
359
-
360
- struct producer_key {
361
- eosio::name producer_name = {};
362
- eosio::public_key block_signing_key = {};
363
- };
364
-
365
- EOSIO_REFLECT(producer_key, producer_name, block_signing_key)
366
-
367
- struct producer_schedule {
368
- uint32_t version = {};
369
- std::vector<producer_key> producers = {};
370
- };
371
-
372
- EOSIO_REFLECT(producer_schedule, version, producers)
373
-
374
- struct transaction_receipt_header {
375
- transaction_status status = {};
376
- uint32_t cpu_usage_us = {};
377
- eosio::varuint32 net_usage_words = {};
378
- };
379
-
380
- EOSIO_REFLECT(transaction_receipt_header, status, cpu_usage_us, net_usage_words)
381
-
382
- struct packed_transaction_v0 {
383
- std::vector<eosio::signature> signatures = {};
384
- uint8_t compression = {};
385
- eosio::input_stream packed_context_free_data = {};
386
- eosio::input_stream packed_trx = {};
387
- };
388
-
389
- EOSIO_REFLECT(packed_transaction_v0, signatures, compression, packed_context_free_data, packed_trx)
390
-
391
- struct packed_transaction {
392
- uint8_t compression = {};
393
- prunable_data_type prunable_data = {};
394
- eosio::input_stream packed_trx = {};
395
- };
396
-
397
- EOSIO_REFLECT(packed_transaction, compression, prunable_data, packed_trx)
398
-
399
- using transaction_variant_v0 = std::variant<eosio::checksum256, packed_transaction_v0>;
400
-
401
- struct transaction_receipt_v0 : transaction_receipt_header {
402
- transaction_variant_v0 trx = {};
403
- };
404
-
405
- EOSIO_REFLECT(transaction_receipt_v0, base transaction_receipt_header, trx)
406
-
407
- using transaction_variant = std::variant<eosio::checksum256, packed_transaction>;
408
-
409
- struct transaction_receipt : transaction_receipt_header {
410
- transaction_variant trx = {};
411
- };
412
-
413
- EOSIO_REFLECT(transaction_receipt, base transaction_receipt_header, trx)
414
-
415
- struct block_header {
416
- eosio::block_timestamp timestamp{};
417
- eosio::name producer = {};
418
- uint16_t confirmed = {};
419
- eosio::checksum256 previous = {};
420
- eosio::checksum256 transaction_mroot = {};
421
- eosio::checksum256 action_mroot = {};
422
- uint32_t schedule_version = {};
423
- std::optional<producer_schedule> new_producers = {};
424
- std::vector<extension> header_extensions = {};
425
- };
426
-
427
- EOSIO_REFLECT(block_header, timestamp, producer, confirmed, previous, transaction_mroot, action_mroot,
428
- schedule_version, new_producers, header_extensions)
429
-
430
- struct signed_block_header : block_header {
431
- eosio::signature producer_signature = {};
432
- };
433
-
434
- EOSIO_REFLECT(signed_block_header, base block_header, producer_signature)
435
-
436
- struct signed_block_v0 : signed_block_header {
437
- std::vector<transaction_receipt_v0> transactions = {};
438
- std::vector<extension> block_extensions = {};
439
- };
440
-
441
- EOSIO_REFLECT(signed_block_v0, base signed_block_header, transactions, block_extensions)
442
-
443
- struct signed_block_v1 : signed_block_header {
444
- uint8_t prune_state = {};
445
- std::vector<transaction_receipt> transactions = {};
446
- std::vector<extension> block_extensions = {};
447
- };
448
-
449
- EOSIO_REFLECT(signed_block_v1, base signed_block_header, prune_state, transactions, block_extensions)
450
-
451
- using signed_block_variant = std::variant<signed_block_v0, signed_block_v1>;
452
-
453
- struct get_blocks_result_v1 : get_blocks_result_base {
454
- std::optional<signed_block_variant> block = {};
455
- eosio::opaque<std::vector<transaction_trace>> traces = {};
456
- eosio::opaque<std::vector<table_delta>> deltas = {};
457
- };
458
-
459
- EOSIO_REFLECT(get_blocks_result_v1, base get_blocks_result_base, block, traces, deltas)
460
-
461
- struct get_blocks_result_v2 : get_blocks_result_base {
462
- eosio::opaque<signed_block_variant> block = {};
463
- eosio::opaque<signed_block_header> block_header = {};
464
- eosio::opaque<std::vector<transaction_trace>> traces = {};
465
- eosio::opaque<std::vector<table_delta>> deltas = {};
466
- };
467
-
468
- EOSIO_REFLECT(get_blocks_result_v2, base get_blocks_result_base, block, block_header, traces, deltas)
469
-
470
- using result = std::variant<get_status_result_v0, get_blocks_result_v0, get_blocks_result_v1, get_blocks_result_v2>;
471
-
472
- struct transaction_header {
473
- eosio::time_point_sec expiration = {};
474
- uint16_t ref_block_num = {};
475
- uint32_t ref_block_prefix = {};
476
- eosio::varuint32 max_net_usage_words = {};
477
- uint8_t max_cpu_usage_ms = {};
478
- eosio::varuint32 delay_sec = {};
479
- };
480
-
481
- EOSIO_REFLECT(transaction_header, expiration, ref_block_num, ref_block_prefix, max_net_usage_words, max_cpu_usage_ms,
482
- delay_sec)
483
-
484
- struct transaction : transaction_header {
485
- std::vector<action> context_free_actions = {};
486
- std::vector<action> actions = {};
487
- std::vector<extension> transaction_extensions = {};
488
- };
489
-
490
- EOSIO_REFLECT(transaction, base transaction_header, context_free_actions, actions, transaction_extensions)
491
-
492
- struct code_id {
493
- uint8_t vm_type = {};
494
- uint8_t vm_version = {};
495
- eosio::checksum256 code_hash = {};
496
- };
497
-
498
- EOSIO_REFLECT(code_id, vm_type, vm_version, code_hash)
499
-
500
- struct account_v0 {
501
- eosio::name name = {};
502
- eosio::block_timestamp creation_date = {};
503
- eosio::input_stream abi = {};
504
- };
505
-
506
- EOSIO_REFLECT(account_v0, name, creation_date, abi)
507
-
508
- using account = std::variant<account_v0>;
509
-
510
- struct account_metadata_v0 {
511
- eosio::name name = {};
512
- bool privileged = {};
513
- eosio::time_point last_code_update = {};
514
- std::optional<code_id> code = {};
515
- };
516
-
517
- EOSIO_REFLECT(account_metadata_v0, name, privileged, last_code_update, code)
518
-
519
- using account_metadata = std::variant<account_metadata_v0>;
520
-
521
- struct code_v0 {
522
- uint8_t vm_type = {};
523
- uint8_t vm_version = {};
524
- eosio::checksum256 code_hash = {};
525
- eosio::input_stream code = {};
526
- };
527
-
528
- EOSIO_REFLECT(code_v0, vm_type, vm_version, code_hash, code)
529
-
530
- using code = std::variant<code_v0>;
531
-
532
- struct contract_table_v0 {
533
- eosio::name code = {};
534
- eosio::name scope = {};
535
- eosio::name table = {};
536
- eosio::name payer = {};
537
- };
538
-
539
- EOSIO_REFLECT(contract_table_v0, code, scope, table, payer)
540
-
541
- using contract_table = std::variant<contract_table_v0>;
542
-
543
- struct contract_row_v0 {
544
- eosio::name code = {};
545
- eosio::name scope = {};
546
- eosio::name table = {};
547
- uint64_t primary_key = {};
548
- eosio::name payer = {};
549
- eosio::input_stream value = {};
550
- };
551
-
552
- EOSIO_REFLECT(contract_row_v0, code, scope, table, primary_key, payer, value)
553
-
554
- using contract_row = std::variant<contract_row_v0>;
555
-
556
- struct contract_index64_v0 {
557
- eosio::name code = {};
558
- eosio::name scope = {};
559
- eosio::name table = {};
560
- uint64_t primary_key = {};
561
- eosio::name payer = {};
562
- uint64_t secondary_key = {};
563
- };
564
-
565
- EOSIO_REFLECT(contract_index64_v0, code, scope, table, primary_key, payer, secondary_key)
566
-
567
- using contract_index64 = std::variant<contract_index64_v0>;
568
-
569
- struct contract_index128_v0 {
570
- eosio::name code = {};
571
- eosio::name scope = {};
572
- eosio::name table = {};
573
- uint64_t primary_key = {};
574
- eosio::name payer = {};
575
- uint128_t secondary_key = {};
576
- };
577
-
578
- EOSIO_REFLECT(contract_index128_v0, code, scope, table, primary_key, payer, secondary_key)
579
-
580
- using contract_index128 = std::variant<contract_index128_v0>;
581
-
582
- struct contract_index256_v0 {
583
- eosio::name code = {};
584
- eosio::name scope = {};
585
- eosio::name table = {};
586
- uint64_t primary_key = {};
587
- eosio::name payer = {};
588
- eosio::checksum256 secondary_key = {};
589
- };
590
-
591
- EOSIO_REFLECT(contract_index256_v0, code, scope, table, primary_key, payer, secondary_key)
592
-
593
- using contract_index256 = std::variant<contract_index256_v0>;
594
-
595
- struct contract_index_double_v0 {
596
- eosio::name code = {};
597
- eosio::name scope = {};
598
- eosio::name table = {};
599
- uint64_t primary_key = {};
600
- eosio::name payer = {};
601
- double secondary_key = {};
602
- };
603
-
604
- EOSIO_REFLECT(contract_index_double_v0, code, scope, table, primary_key, payer, secondary_key)
605
-
606
- using contract_index_double = std::variant<contract_index_double_v0>;
607
-
608
- struct contract_index_long_double_v0 {
609
- eosio::name code = {};
610
- eosio::name scope = {};
611
- eosio::name table = {};
612
- uint64_t primary_key = {};
613
- eosio::name payer = {};
614
- eosio::float128 secondary_key = {};
615
- };
616
-
617
- EOSIO_REFLECT(contract_index_long_double_v0, code, scope, table, primary_key, payer, secondary_key)
618
-
619
- using contract_index_long_double = std::variant<contract_index_long_double_v0>;
620
-
621
- struct key_value_v0 {
622
- eosio::name contract = {};
623
- eosio::input_stream key = {};
624
- eosio::input_stream value = {};
625
- eosio::name payer = {};
626
- };
627
-
628
- EOSIO_REFLECT(key_value_v0, contract, key, value, payer)
629
-
630
- using key_value = std::variant<key_value_v0>;
631
-
632
- struct key_weight {
633
- eosio::public_key key = {};
634
- uint16_t weight = {};
635
- };
636
-
637
- EOSIO_REFLECT(key_weight, key, weight)
638
-
639
- struct block_signing_authority_v0 {
640
- uint32_t threshold = {};
641
- std::vector<key_weight> keys = {};
642
- };
643
-
644
- EOSIO_REFLECT(block_signing_authority_v0, threshold, keys)
645
-
646
- using block_signing_authority = std::variant<block_signing_authority_v0>;
647
-
648
- struct producer_authority {
649
- eosio::name producer_name = {};
650
- block_signing_authority authority = {};
651
- };
652
-
653
- EOSIO_REFLECT(producer_authority, producer_name, authority)
654
-
655
- struct producer_authority_schedule {
656
- uint32_t version = {};
657
- std::vector<producer_authority> producers = {};
658
- };
659
-
660
- EOSIO_REFLECT(producer_authority_schedule, version, producers)
661
-
662
- struct chain_config_v0 {
663
- uint64_t max_block_net_usage = {};
664
- uint32_t target_block_net_usage_pct = {};
665
- uint32_t max_transaction_net_usage = {};
666
- uint32_t base_per_transaction_net_usage = {};
667
- uint32_t net_usage_leeway = {};
668
- uint32_t context_free_discount_net_usage_num = {};
669
- uint32_t context_free_discount_net_usage_den = {};
670
- uint32_t max_block_cpu_usage = {};
671
- uint32_t target_block_cpu_usage_pct = {};
672
- uint32_t max_transaction_cpu_usage = {};
673
- uint32_t min_transaction_cpu_usage = {};
674
- uint32_t max_transaction_lifetime = {};
675
- uint32_t deferred_trx_expiration_window = {};
676
- uint32_t max_transaction_delay = {};
677
- uint32_t max_inline_action_size = {};
678
- uint16_t max_inline_action_depth = {};
679
- uint16_t max_authority_depth = {};
680
- };
681
-
682
- EOSIO_REFLECT(chain_config_v0, max_block_net_usage, target_block_net_usage_pct, max_transaction_net_usage,
683
- base_per_transaction_net_usage, net_usage_leeway, context_free_discount_net_usage_num,
684
- context_free_discount_net_usage_den, max_block_cpu_usage, target_block_cpu_usage_pct,
685
- max_transaction_cpu_usage, min_transaction_cpu_usage, max_transaction_lifetime,
686
- deferred_trx_expiration_window, max_transaction_delay, max_inline_action_size, max_inline_action_depth,
687
- max_authority_depth)
688
-
689
- struct chain_config_v1 {
690
- uint64_t max_block_net_usage = {};
691
- uint32_t target_block_net_usage_pct = {};
692
- uint32_t max_transaction_net_usage = {};
693
- uint32_t base_per_transaction_net_usage = {};
694
- uint32_t net_usage_leeway = {};
695
- uint32_t context_free_discount_net_usage_num = {};
696
- uint32_t context_free_discount_net_usage_den = {};
697
- uint32_t max_block_cpu_usage = {};
698
- uint32_t target_block_cpu_usage_pct = {};
699
- uint32_t max_transaction_cpu_usage = {};
700
- uint32_t min_transaction_cpu_usage = {};
701
- uint32_t max_transaction_lifetime = {};
702
- uint32_t deferred_trx_expiration_window = {};
703
- uint32_t max_transaction_delay = {};
704
- uint32_t max_inline_action_size = {};
705
- uint16_t max_inline_action_depth = {};
706
- uint16_t max_authority_depth = {};
707
- uint32_t max_action_return_value_size = {};
708
- };
709
-
710
- EOSIO_REFLECT(chain_config_v1, max_block_net_usage, target_block_net_usage_pct, max_transaction_net_usage,
711
- base_per_transaction_net_usage, net_usage_leeway, context_free_discount_net_usage_num,
712
- context_free_discount_net_usage_den, max_block_cpu_usage, target_block_cpu_usage_pct,
713
- max_transaction_cpu_usage, min_transaction_cpu_usage, max_transaction_lifetime,
714
- deferred_trx_expiration_window, max_transaction_delay, max_inline_action_size, max_inline_action_depth,
715
- max_authority_depth, max_action_return_value_size)
716
-
717
- using chain_config = std::variant<chain_config_v0, chain_config_v1>;
718
-
719
- struct global_property_v0 {
720
- std::optional<uint32_t> proposed_schedule_block_num = {};
721
- producer_schedule proposed_schedule = {};
722
- chain_config configuration = {};
723
- };
724
-
725
- EOSIO_REFLECT(global_property_v0, proposed_schedule_block_num, proposed_schedule, configuration)
726
-
727
- struct global_property_v1 {
728
- std::optional<uint32_t> proposed_schedule_block_num = {};
729
- producer_authority_schedule proposed_schedule = {};
730
- chain_config configuration = {};
731
- eosio::checksum256 chain_id = {};
732
- };
733
-
734
- EOSIO_REFLECT(global_property_v1, proposed_schedule_block_num, proposed_schedule, configuration, chain_id)
735
-
736
- struct kv_database_config {
737
- uint32_t max_key_size = 0; ///< the maximum size in bytes of a key
738
- uint32_t max_value_size = 0; ///< the maximum size in bytes of a value
739
- uint32_t max_iterators = 0; ///< the maximum number of iterators that a contract can have simultaneously.
740
- };
741
-
742
- EOSIO_REFLECT(kv_database_config, max_key_size, max_value_size, max_iterators)
743
-
744
- struct wasm_config {
745
- uint32_t max_mutable_global_bytes;
746
- uint32_t max_table_elements;
747
- uint32_t max_section_elements;
748
- uint32_t max_linear_memory_init;
749
- uint32_t max_func_local_bytes;
750
- uint32_t max_nested_structures;
751
- uint32_t max_symbol_bytes;
752
- uint32_t max_module_bytes;
753
- uint32_t max_code_bytes;
754
- uint32_t max_pages;
755
- uint32_t max_call_depth;
756
- };
757
-
758
- EOSIO_REFLECT(wasm_config, max_mutable_global_bytes, max_table_elements, max_section_elements,
759
- max_linear_memory_init, max_func_local_bytes, max_nested_structures, max_symbol_bytes,
760
- max_module_bytes, max_code_bytes, max_pages, max_call_depth)
761
-
762
- using global_property = std::variant<global_property_v0, global_property_v1>;
763
-
764
- struct generated_transaction_v0 {
765
- eosio::name sender = {};
766
- uint128_t sender_id = {};
767
- eosio::name payer = {};
768
- eosio::checksum256 trx_id = {};
769
- eosio::input_stream packed_trx = {};
770
- };
771
-
772
- EOSIO_REFLECT(generated_transaction_v0, sender, sender_id, payer, trx_id, packed_trx)
773
-
774
- using generated_transaction = std::variant<generated_transaction_v0>;
775
-
776
- struct activated_protocol_feature_v0 {
777
- eosio::checksum256 feature_digest = {};
778
- uint32_t activation_block_num = {};
779
- };
780
-
781
- EOSIO_REFLECT(activated_protocol_feature_v0, feature_digest, activation_block_num)
782
-
783
- using activated_protocol_feature = std::variant<activated_protocol_feature_v0>;
784
-
785
- struct protocol_state_v0 {
786
- std::vector<activated_protocol_feature> activated_protocol_features = {};
787
- };
788
-
789
- EOSIO_REFLECT(protocol_state_v0, activated_protocol_features)
790
-
791
- using protocol_state = std::variant<protocol_state_v0>;
792
-
793
- struct permission_level_weight {
794
- permission_level permission = {};
795
- uint16_t weight = {};
796
- };
797
-
798
- EOSIO_REFLECT(permission_level_weight, permission, weight)
799
-
800
- struct wait_weight {
801
- uint32_t wait_sec = {};
802
- uint16_t weight = {};
803
- };
804
-
805
- EOSIO_REFLECT(wait_weight, wait_sec, weight)
806
-
807
- struct authority {
808
- uint32_t threshold = {};
809
- std::vector<key_weight> keys = {};
810
- std::vector<permission_level_weight> accounts = {};
811
- std::vector<wait_weight> waits = {};
812
- };
813
-
814
- EOSIO_REFLECT(authority, threshold, keys, accounts, waits)
815
-
816
- struct permission_v0 {
817
- eosio::name owner = {};
818
- eosio::name name = {};
819
- eosio::name parent = {};
820
- eosio::time_point last_updated = {};
821
- authority auth = {};
822
- };
823
-
824
- EOSIO_REFLECT(permission_v0, owner, name, parent, last_updated, auth)
825
-
826
- using permission = std::variant<permission_v0>;
827
-
828
- struct permission_link_v0 {
829
- eosio::name account = {};
830
- eosio::name code = {};
831
- eosio::name message_type = {};
832
- eosio::name required_permission = {};
833
- };
834
-
835
- EOSIO_REFLECT(permission_link_v0, account, code, message_type, required_permission)
836
-
837
- using permission_link = std::variant<permission_link_v0>;
838
-
839
- struct resource_limits_v0 {
840
- eosio::name owner = {};
841
- int64_t net_weight = {};
842
- int64_t cpu_weight = {};
843
- int64_t ram_bytes = {};
844
- };
845
-
846
- EOSIO_REFLECT(resource_limits_v0, owner, net_weight, cpu_weight, ram_bytes)
847
-
848
- using resource_limits = std::variant<resource_limits_v0>;
849
-
850
- struct usage_accumulator_v0 {
851
- uint32_t last_ordinal = {};
852
- uint64_t value_ex = {};
853
- uint64_t consumed = {};
854
- };
855
-
856
- EOSIO_REFLECT(usage_accumulator_v0, last_ordinal, value_ex, consumed)
857
-
858
- using usage_accumulator = std::variant<usage_accumulator_v0>;
859
-
860
- struct resource_usage_v0 {
861
- eosio::name owner = {};
862
- usage_accumulator net_usage = {};
863
- usage_accumulator cpu_usage = {};
864
- uint64_t ram_usage = {};
865
- };
866
-
867
- EOSIO_REFLECT(resource_usage_v0, owner, net_usage, cpu_usage, ram_usage)
868
-
869
- using resource_usage = std::variant<resource_usage_v0>;
870
-
871
- struct resource_limits_state_v0 {
872
- usage_accumulator average_block_net_usage = {};
873
- usage_accumulator average_block_cpu_usage = {};
874
- uint64_t total_net_weight = {};
875
- uint64_t total_cpu_weight = {};
876
- uint64_t total_ram_bytes = {};
877
- uint64_t virtual_net_limit = {};
878
- uint64_t virtual_cpu_limit = {};
879
- };
880
-
881
- EOSIO_REFLECT(resource_limits_state_v0, average_block_net_usage, average_block_cpu_usage, total_net_weight,
882
- total_cpu_weight, total_ram_bytes, virtual_net_limit, virtual_cpu_limit)
883
-
884
- using resource_limits_state = std::variant<resource_limits_state_v0>;
885
-
886
- struct resource_limits_ratio_v0 {
887
- uint64_t numerator = {};
888
- uint64_t denominator = {};
889
- };
890
-
891
- EOSIO_REFLECT(resource_limits_ratio_v0, numerator, denominator)
892
-
893
- using resource_limits_ratio = std::variant<resource_limits_ratio_v0>;
894
-
895
- struct elastic_limit_parameters_v0 {
896
- uint64_t target = {};
897
- uint64_t max = {};
898
- uint32_t periods = {};
899
- uint32_t max_multiplier = {};
900
- resource_limits_ratio contract_rate = {};
901
- resource_limits_ratio expand_rate = {};
902
- };
903
-
904
- EOSIO_REFLECT(elastic_limit_parameters_v0, target, max, periods, max_multiplier, contract_rate, expand_rate)
905
-
906
- using elastic_limit_parameters = std::variant<elastic_limit_parameters_v0>;
907
-
908
- struct resource_limits_config_v0 {
909
- elastic_limit_parameters cpu_limit_parameters = {};
910
- elastic_limit_parameters net_limit_parameters = {};
911
- uint32_t account_cpu_usage_average_window = {};
912
- uint32_t account_net_usage_average_window = {};
913
- };
914
-
915
- EOSIO_REFLECT(resource_limits_config_v0, cpu_limit_parameters, net_limit_parameters,
916
- account_cpu_usage_average_window, account_net_usage_average_window)
917
-
918
- using resource_limits_config = std::variant<resource_limits_config_v0>;
919
-
920
- }} // namespace eosio::ship_protocol
921
-
922
- namespace eosio {
923
-
924
- template <typename S>
925
- void to_json(const ship_protocol::transaction_status& status, S& stream) {
926
- // todo: switch to new serializer string support.
927
- return eosio::to_json((uint8_t)status, stream);
928
- }
929
-
930
- template <typename S>
931
- void from_json(ship_protocol::transaction_status& status, S& stream) {
932
- uint8_t v;
933
- eosio::from_json(v, stream);
934
- status = (ship_protocol::transaction_status)v;
935
- }
936
-
937
- template <typename S>
938
- void to_bin(const ship_protocol::recurse_transaction_trace& obj, S& stream) {
939
- return to_bin(obj.recurse, stream);
940
- }
941
-
942
- template <typename S>
943
- void from_bin(ship_protocol::recurse_transaction_trace& obj, S& stream) {
944
- return from_bin(obj.recurse, stream);
945
- }
946
-
947
- template <typename S>
948
- void to_json(const ship_protocol::recurse_transaction_trace& obj, S& stream) {
949
- return to_json(obj.recurse, stream);
950
- }
951
-
952
- template <typename S>
953
- void to_json(const std::vector<ship_protocol::recurse_transaction_trace>& obj, S& stream) {
954
- if (!obj.empty()) {
955
- to_json(obj[0], stream);
956
- } else {
957
- stream.write("null", 4);
958
- }
959
- }
960
-
961
- template <typename S>
962
- void from_json(std::vector<ship_protocol::recurse_transaction_trace>& result, S& stream) {
963
- if(stream.get_null_pred()) {
964
- result.clear();
965
- } else {
966
- result.emplace_back();
967
- from_json(result[0], stream);
968
- }
969
- }
970
-
971
- }