koilib 2.6.1 → 3.0.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 (66) hide show
  1. package/README.md +66 -12
  2. package/dist/koinos.js +8533 -274
  3. package/dist/koinos.min.js +1 -1
  4. package/lib/Contract.d.ts +53 -16
  5. package/lib/Contract.js +99 -31
  6. package/lib/Contract.js.map +1 -1
  7. package/lib/Provider.d.ts +39 -19
  8. package/lib/Provider.js +119 -87
  9. package/lib/Provider.js.map +1 -1
  10. package/lib/Serializer.d.ts +8 -3
  11. package/lib/Serializer.js +60 -41
  12. package/lib/Serializer.js.map +1 -1
  13. package/lib/Signer.d.ts +53 -39
  14. package/lib/Signer.js +320 -91
  15. package/lib/Signer.js.map +1 -1
  16. package/lib/browser/Contract.d.ts +53 -16
  17. package/lib/browser/Contract.js +99 -31
  18. package/lib/browser/Contract.js.map +1 -1
  19. package/lib/browser/Provider.d.ts +39 -19
  20. package/lib/browser/Provider.js +119 -87
  21. package/lib/browser/Provider.js.map +1 -1
  22. package/lib/browser/Serializer.d.ts +8 -3
  23. package/lib/browser/Serializer.js +60 -41
  24. package/lib/browser/Serializer.js.map +1 -1
  25. package/lib/browser/Signer.d.ts +53 -39
  26. package/lib/browser/Signer.js +320 -91
  27. package/lib/browser/Signer.js.map +1 -1
  28. package/lib/browser/index.d.ts +1 -1
  29. package/lib/browser/index.js +1 -1
  30. package/lib/browser/index.js.map +1 -1
  31. package/lib/browser/indexUtils.d.ts +2 -0
  32. package/lib/browser/indexUtils.js +15 -0
  33. package/lib/browser/indexUtils.js.map +1 -0
  34. package/lib/browser/interface.d.ts +242 -65
  35. package/lib/browser/jsonDescriptors/chain-proto.json +676 -0
  36. package/lib/browser/jsonDescriptors/krc20-proto.json +47 -4
  37. package/lib/browser/protoModules/protocol-proto.d.ts +2 -0
  38. package/lib/browser/protoModules/protocol-proto.js +6336 -0
  39. package/lib/browser/protoModules/protocol-proto.js.map +1 -0
  40. package/lib/browser/utils.d.ts +18 -254
  41. package/lib/browser/utils.js +140 -12
  42. package/lib/browser/utils.js.map +1 -1
  43. package/lib/browser/utilsNode.d.ts +1021 -0
  44. package/lib/browser/utilsNode.js +346 -0
  45. package/lib/browser/utilsNode.js.map +1 -0
  46. package/lib/index.d.ts +1 -1
  47. package/lib/index.js +1 -1
  48. package/lib/index.js.map +1 -1
  49. package/lib/indexUtils.d.ts +2 -0
  50. package/lib/indexUtils.js +15 -0
  51. package/lib/indexUtils.js.map +1 -0
  52. package/lib/interface.d.ts +242 -65
  53. package/lib/jsonDescriptors/chain-proto.json +676 -0
  54. package/lib/jsonDescriptors/krc20-proto.json +47 -4
  55. package/lib/protoModules/protocol-proto.d.ts +2 -0
  56. package/lib/protoModules/protocol-proto.js +6336 -0
  57. package/lib/protoModules/protocol-proto.js.map +1 -0
  58. package/lib/utils.d.ts +18 -254
  59. package/lib/utils.js +140 -12
  60. package/lib/utils.js.map +1 -1
  61. package/lib/utilsNode.d.ts +1021 -0
  62. package/lib/utilsNode.js +346 -0
  63. package/lib/utilsNode.js.map +1 -0
  64. package/package.json +1 -1
  65. package/lib/browser/jsonDescriptors/protocol-proto.json +0 -246
  66. package/lib/jsonDescriptors/protocol-proto.json +0 -246
@@ -0,0 +1,676 @@
1
+ {
2
+ "nested": {
3
+ "koinos": {
4
+ "options": {
5
+ "go_package": "github.com/koinos/koinos-proto-golang/koinos"
6
+ },
7
+ "nested": {
8
+ "block_topology": {
9
+ "fields": {
10
+ "id": {
11
+ "type": "bytes",
12
+ "id": 1,
13
+ "options": {
14
+ "(btype)": "BLOCK_ID"
15
+ }
16
+ },
17
+ "height": {
18
+ "type": "uint64",
19
+ "id": 2,
20
+ "options": {
21
+ "jstype": "JS_STRING"
22
+ }
23
+ },
24
+ "previous": {
25
+ "type": "bytes",
26
+ "id": 3,
27
+ "options": {
28
+ "(btype)": "BLOCK_ID"
29
+ }
30
+ }
31
+ }
32
+ },
33
+ "protocol": {
34
+ "options": {
35
+ "go_package": "github.com/koinos/koinos-proto-golang/koinos/protocol"
36
+ },
37
+ "nested": {
38
+ "event_data": {
39
+ "fields": {
40
+ "sequence": {
41
+ "type": "uint32",
42
+ "id": 1
43
+ },
44
+ "source": {
45
+ "type": "bytes",
46
+ "id": 2,
47
+ "options": {
48
+ "(btype)": "CONTRACT_ID"
49
+ }
50
+ },
51
+ "name": {
52
+ "type": "string",
53
+ "id": 3
54
+ },
55
+ "data": {
56
+ "type": "bytes",
57
+ "id": 4
58
+ },
59
+ "impacted": {
60
+ "rule": "repeated",
61
+ "type": "bytes",
62
+ "id": 5,
63
+ "options": {
64
+ "(btype)": "ADDRESS"
65
+ }
66
+ }
67
+ }
68
+ },
69
+ "contract_call_bundle": {
70
+ "fields": {
71
+ "contract_id": {
72
+ "type": "bytes",
73
+ "id": 1,
74
+ "options": {
75
+ "(btype)": "CONTRACT_ID"
76
+ }
77
+ },
78
+ "entry_point": {
79
+ "type": "uint32",
80
+ "id": 2
81
+ }
82
+ }
83
+ },
84
+ "system_call_target": {
85
+ "oneofs": {
86
+ "target": {
87
+ "oneof": ["thunk_id", "system_call_bundle"]
88
+ }
89
+ },
90
+ "fields": {
91
+ "thunk_id": {
92
+ "type": "uint32",
93
+ "id": 1
94
+ },
95
+ "system_call_bundle": {
96
+ "type": "contract_call_bundle",
97
+ "id": 2
98
+ }
99
+ }
100
+ },
101
+ "upload_contract_operation": {
102
+ "fields": {
103
+ "contract_id": {
104
+ "type": "bytes",
105
+ "id": 1,
106
+ "options": {
107
+ "(btype)": "CONTRACT_ID"
108
+ }
109
+ },
110
+ "bytecode": {
111
+ "type": "bytes",
112
+ "id": 2
113
+ },
114
+ "abi": {
115
+ "type": "string",
116
+ "id": 3
117
+ },
118
+ "authorizes_call_contract": {
119
+ "type": "bool",
120
+ "id": 4
121
+ },
122
+ "authorizes_transaction_application": {
123
+ "type": "bool",
124
+ "id": 5
125
+ },
126
+ "authorizes_upload_contract": {
127
+ "type": "bool",
128
+ "id": 6
129
+ }
130
+ }
131
+ },
132
+ "call_contract_operation": {
133
+ "fields": {
134
+ "contract_id": {
135
+ "type": "bytes",
136
+ "id": 1,
137
+ "options": {
138
+ "(btype)": "CONTRACT_ID"
139
+ }
140
+ },
141
+ "entry_point": {
142
+ "type": "uint32",
143
+ "id": 2
144
+ },
145
+ "args": {
146
+ "type": "bytes",
147
+ "id": 3
148
+ }
149
+ }
150
+ },
151
+ "set_system_call_operation": {
152
+ "fields": {
153
+ "call_id": {
154
+ "type": "uint32",
155
+ "id": 1
156
+ },
157
+ "target": {
158
+ "type": "system_call_target",
159
+ "id": 2
160
+ }
161
+ }
162
+ },
163
+ "set_system_contract_operation": {
164
+ "fields": {
165
+ "contract_id": {
166
+ "type": "bytes",
167
+ "id": 1,
168
+ "options": {
169
+ "(btype)": "CONTRACT_ID"
170
+ }
171
+ },
172
+ "system_contract": {
173
+ "type": "bool",
174
+ "id": 2
175
+ }
176
+ }
177
+ },
178
+ "operation": {
179
+ "oneofs": {
180
+ "op": {
181
+ "oneof": [
182
+ "upload_contract",
183
+ "call_contract",
184
+ "set_system_call",
185
+ "set_system_contract"
186
+ ]
187
+ }
188
+ },
189
+ "fields": {
190
+ "upload_contract": {
191
+ "type": "upload_contract_operation",
192
+ "id": 1
193
+ },
194
+ "call_contract": {
195
+ "type": "call_contract_operation",
196
+ "id": 2
197
+ },
198
+ "set_system_call": {
199
+ "type": "set_system_call_operation",
200
+ "id": 3
201
+ },
202
+ "set_system_contract": {
203
+ "type": "set_system_contract_operation",
204
+ "id": 4
205
+ }
206
+ }
207
+ },
208
+ "transaction_header": {
209
+ "fields": {
210
+ "chain_id": {
211
+ "type": "bytes",
212
+ "id": 1
213
+ },
214
+ "rc_limit": {
215
+ "type": "uint64",
216
+ "id": 2,
217
+ "options": {
218
+ "jstype": "JS_STRING"
219
+ }
220
+ },
221
+ "nonce": {
222
+ "type": "bytes",
223
+ "id": 3
224
+ },
225
+ "operation_merkle_root": {
226
+ "type": "bytes",
227
+ "id": 4
228
+ },
229
+ "payer": {
230
+ "type": "bytes",
231
+ "id": 5,
232
+ "options": {
233
+ "(btype)": "ADDRESS"
234
+ }
235
+ },
236
+ "payee": {
237
+ "type": "bytes",
238
+ "id": 6,
239
+ "options": {
240
+ "(btype)": "ADDRESS"
241
+ }
242
+ }
243
+ }
244
+ },
245
+ "transaction": {
246
+ "fields": {
247
+ "id": {
248
+ "type": "bytes",
249
+ "id": 1,
250
+ "options": {
251
+ "(btype)": "TRANSACTION_ID"
252
+ }
253
+ },
254
+ "header": {
255
+ "type": "transaction_header",
256
+ "id": 2
257
+ },
258
+ "operations": {
259
+ "rule": "repeated",
260
+ "type": "operation",
261
+ "id": 3
262
+ },
263
+ "signatures": {
264
+ "rule": "repeated",
265
+ "type": "bytes",
266
+ "id": 4
267
+ }
268
+ }
269
+ },
270
+ "transaction_receipt": {
271
+ "fields": {
272
+ "id": {
273
+ "type": "bytes",
274
+ "id": 1,
275
+ "options": {
276
+ "(btype)": "TRANSACTION_ID"
277
+ }
278
+ },
279
+ "payer": {
280
+ "type": "bytes",
281
+ "id": 2,
282
+ "options": {
283
+ "(btype)": "ADDRESS"
284
+ }
285
+ },
286
+ "max_payer_rc": {
287
+ "type": "uint64",
288
+ "id": 3,
289
+ "options": {
290
+ "jstype": "JS_STRING"
291
+ }
292
+ },
293
+ "rc_limit": {
294
+ "type": "uint64",
295
+ "id": 4,
296
+ "options": {
297
+ "jstype": "JS_STRING"
298
+ }
299
+ },
300
+ "rc_used": {
301
+ "type": "uint64",
302
+ "id": 5,
303
+ "options": {
304
+ "jstype": "JS_STRING"
305
+ }
306
+ },
307
+ "disk_storage_used": {
308
+ "type": "uint64",
309
+ "id": 6,
310
+ "options": {
311
+ "jstype": "JS_STRING"
312
+ }
313
+ },
314
+ "network_bandwidth_used": {
315
+ "type": "uint64",
316
+ "id": 7,
317
+ "options": {
318
+ "jstype": "JS_STRING"
319
+ }
320
+ },
321
+ "compute_bandwidth_used": {
322
+ "type": "uint64",
323
+ "id": 8,
324
+ "options": {
325
+ "jstype": "JS_STRING"
326
+ }
327
+ },
328
+ "reverted": {
329
+ "type": "bool",
330
+ "id": 9
331
+ },
332
+ "events": {
333
+ "rule": "repeated",
334
+ "type": "event_data",
335
+ "id": 10
336
+ },
337
+ "logs": {
338
+ "rule": "repeated",
339
+ "type": "string",
340
+ "id": 11
341
+ }
342
+ }
343
+ },
344
+ "block_header": {
345
+ "fields": {
346
+ "previous": {
347
+ "type": "bytes",
348
+ "id": 1,
349
+ "options": {
350
+ "(btype)": "BLOCK_ID"
351
+ }
352
+ },
353
+ "height": {
354
+ "type": "uint64",
355
+ "id": 2,
356
+ "options": {
357
+ "jstype": "JS_STRING"
358
+ }
359
+ },
360
+ "timestamp": {
361
+ "type": "uint64",
362
+ "id": 3,
363
+ "options": {
364
+ "jstype": "JS_STRING"
365
+ }
366
+ },
367
+ "previous_state_merkle_root": {
368
+ "type": "bytes",
369
+ "id": 4
370
+ },
371
+ "transaction_merkle_root": {
372
+ "type": "bytes",
373
+ "id": 5
374
+ },
375
+ "signer": {
376
+ "type": "bytes",
377
+ "id": 6,
378
+ "options": {
379
+ "(btype)": "ADDRESS"
380
+ }
381
+ }
382
+ }
383
+ },
384
+ "block": {
385
+ "fields": {
386
+ "id": {
387
+ "type": "bytes",
388
+ "id": 1,
389
+ "options": {
390
+ "(btype)": "BLOCK_ID"
391
+ }
392
+ },
393
+ "header": {
394
+ "type": "block_header",
395
+ "id": 2
396
+ },
397
+ "transactions": {
398
+ "rule": "repeated",
399
+ "type": "transaction",
400
+ "id": 3
401
+ },
402
+ "signature": {
403
+ "type": "bytes",
404
+ "id": 4
405
+ }
406
+ }
407
+ },
408
+ "block_receipt": {
409
+ "fields": {
410
+ "id": {
411
+ "type": "bytes",
412
+ "id": 1,
413
+ "options": {
414
+ "(btype)": "BLOCK_ID"
415
+ }
416
+ },
417
+ "height": {
418
+ "type": "uint64",
419
+ "id": 2,
420
+ "options": {
421
+ "jstype": "JS_STRING"
422
+ }
423
+ },
424
+ "disk_storage_used": {
425
+ "type": "uint64",
426
+ "id": 3,
427
+ "options": {
428
+ "jstype": "JS_STRING"
429
+ }
430
+ },
431
+ "network_bandwidth_used": {
432
+ "type": "uint64",
433
+ "id": 4,
434
+ "options": {
435
+ "jstype": "JS_STRING"
436
+ }
437
+ },
438
+ "compute_bandwidth_used": {
439
+ "type": "uint64",
440
+ "id": 5,
441
+ "options": {
442
+ "jstype": "JS_STRING"
443
+ }
444
+ },
445
+ "state_merkle_root": {
446
+ "type": "bytes",
447
+ "id": 6
448
+ },
449
+ "events": {
450
+ "rule": "repeated",
451
+ "type": "event_data",
452
+ "id": 7
453
+ },
454
+ "transaction_receipts": {
455
+ "rule": "repeated",
456
+ "type": "transaction_receipt",
457
+ "id": 8
458
+ },
459
+ "logs": {
460
+ "rule": "repeated",
461
+ "type": "string",
462
+ "id": 9
463
+ }
464
+ }
465
+ }
466
+ }
467
+ },
468
+ "chain": {
469
+ "options": {
470
+ "go_package": "github.com/koinos/koinos-proto-golang/koinos/chain"
471
+ },
472
+ "nested": {
473
+ "object_space": {
474
+ "fields": {
475
+ "system": {
476
+ "type": "bool",
477
+ "id": 1
478
+ },
479
+ "zone": {
480
+ "type": "bytes",
481
+ "id": 2
482
+ },
483
+ "id": {
484
+ "type": "uint32",
485
+ "id": 3
486
+ }
487
+ }
488
+ },
489
+ "database_key": {
490
+ "fields": {
491
+ "space": {
492
+ "type": "object_space",
493
+ "id": 1
494
+ },
495
+ "key": {
496
+ "type": "bytes",
497
+ "id": 2
498
+ }
499
+ }
500
+ },
501
+ "max_account_resources": {
502
+ "fields": {
503
+ "value": {
504
+ "type": "uint64",
505
+ "id": 1,
506
+ "options": {
507
+ "jstype": "JS_STRING"
508
+ }
509
+ }
510
+ }
511
+ },
512
+ "privilege": {
513
+ "values": {
514
+ "kernel_mode": 0,
515
+ "user_mode": 1
516
+ }
517
+ },
518
+ "head_info": {
519
+ "fields": {
520
+ "head_topology": {
521
+ "type": "block_topology",
522
+ "id": 1
523
+ },
524
+ "head_block_time": {
525
+ "type": "uint64",
526
+ "id": 2,
527
+ "options": {
528
+ "jstype": "JS_STRING"
529
+ }
530
+ },
531
+ "last_irreversible_block": {
532
+ "type": "uint64",
533
+ "id": 3,
534
+ "options": {
535
+ "jstype": "JS_STRING"
536
+ }
537
+ }
538
+ }
539
+ },
540
+ "caller_data": {
541
+ "fields": {
542
+ "caller": {
543
+ "type": "bytes",
544
+ "id": 1,
545
+ "options": {
546
+ "(btype)": "ADDRESS"
547
+ }
548
+ },
549
+ "caller_privilege": {
550
+ "type": "privilege",
551
+ "id": 2
552
+ }
553
+ }
554
+ },
555
+ "resource_limit_data": {
556
+ "fields": {
557
+ "disk_storage_limit": {
558
+ "type": "uint64",
559
+ "id": 1,
560
+ "options": {
561
+ "jstype": "JS_STRING"
562
+ }
563
+ },
564
+ "disk_storage_cost": {
565
+ "type": "uint64",
566
+ "id": 2,
567
+ "options": {
568
+ "jstype": "JS_STRING"
569
+ }
570
+ },
571
+ "network_bandwidth_limit": {
572
+ "type": "uint64",
573
+ "id": 3,
574
+ "options": {
575
+ "jstype": "JS_STRING"
576
+ }
577
+ },
578
+ "network_bandwidth_cost": {
579
+ "type": "uint64",
580
+ "id": 4,
581
+ "options": {
582
+ "jstype": "JS_STRING"
583
+ }
584
+ },
585
+ "compute_bandwidth_limit": {
586
+ "type": "uint64",
587
+ "id": 5,
588
+ "options": {
589
+ "jstype": "JS_STRING"
590
+ }
591
+ },
592
+ "compute_bandwidth_cost": {
593
+ "type": "uint64",
594
+ "id": 6,
595
+ "options": {
596
+ "jstype": "JS_STRING"
597
+ }
598
+ }
599
+ }
600
+ },
601
+ "contract_metadata_object": {
602
+ "fields": {
603
+ "hash": {
604
+ "type": "bytes",
605
+ "id": 1
606
+ },
607
+ "system": {
608
+ "type": "bool",
609
+ "id": 2
610
+ },
611
+ "authorizes_call_contract": {
612
+ "type": "bool",
613
+ "id": 3
614
+ },
615
+ "authorizes_transaction_application": {
616
+ "type": "bool",
617
+ "id": 4
618
+ },
619
+ "authorizes_upload_contract": {
620
+ "type": "bool",
621
+ "id": 5
622
+ }
623
+ }
624
+ },
625
+ "compute_bandwidth_entry": {
626
+ "fields": {
627
+ "name": {
628
+ "type": "string",
629
+ "id": 1
630
+ },
631
+ "compute": {
632
+ "type": "uint64",
633
+ "id": 2
634
+ }
635
+ }
636
+ },
637
+ "compute_bandwidth_registry": {
638
+ "fields": {
639
+ "entries": {
640
+ "rule": "repeated",
641
+ "type": "compute_bandwidth_entry",
642
+ "id": 1
643
+ }
644
+ }
645
+ },
646
+ "genesis_entry": {
647
+ "fields": {
648
+ "space": {
649
+ "type": "object_space",
650
+ "id": 1
651
+ },
652
+ "key": {
653
+ "type": "bytes",
654
+ "id": 2
655
+ },
656
+ "value": {
657
+ "type": "bytes",
658
+ "id": 3
659
+ }
660
+ }
661
+ },
662
+ "genesis_data": {
663
+ "fields": {
664
+ "entries": {
665
+ "rule": "repeated",
666
+ "type": "genesis_entry",
667
+ "id": 1
668
+ }
669
+ }
670
+ }
671
+ }
672
+ }
673
+ }
674
+ }
675
+ }
676
+ }