openchain-nodejs-ts-yxl 1.0.1

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 (76) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +66 -0
  3. package/_config.yml +1 -0
  4. package/doc/SDK_CN.md +2003 -0
  5. package/example/atp10TokenDemo.js +319 -0
  6. package/example/exchange.js +184 -0
  7. package/example/offlineSignatureDemo.js +83 -0
  8. package/example/submitTransactionDemo.js +92 -0
  9. package/index.d.ts +186 -0
  10. package/index.js +9 -0
  11. package/lib/account/index.js +234 -0
  12. package/lib/blockchain/block.js +380 -0
  13. package/lib/blockchain/transaction.js +264 -0
  14. package/lib/common/ctp.js +5 -0
  15. package/lib/common/operation/accountSetMetadata.js +55 -0
  16. package/lib/common/operation/accountSetPrivilege.js +90 -0
  17. package/lib/common/operation/activateAccount.js +58 -0
  18. package/lib/common/operation/contractCreate.js +72 -0
  19. package/lib/common/operation/contractInvokeByAsset.js +75 -0
  20. package/lib/common/operation/contractInvokeByBU.js +53 -0
  21. package/lib/common/operation/createLog.js +44 -0
  22. package/lib/common/operation/ctp10TokenApprove.js +59 -0
  23. package/lib/common/operation/ctp10TokenAssign.js +59 -0
  24. package/lib/common/operation/ctp10TokenChangeOwner.js +58 -0
  25. package/lib/common/operation/ctp10TokenIssue.js +78 -0
  26. package/lib/common/operation/ctp10TokenTransfer.js +59 -0
  27. package/lib/common/operation/ctp10TokenTransferFrom.js +60 -0
  28. package/lib/common/operation/issueAsset.js +35 -0
  29. package/lib/common/operation/payAsset.js +62 -0
  30. package/lib/common/operation/payCoin.js +44 -0
  31. package/lib/common/util.js +880 -0
  32. package/lib/contract/index.js +212 -0
  33. package/lib/crypto/protobuf/bundle.json +1643 -0
  34. package/lib/exception/customErrors.js +56 -0
  35. package/lib/exception/errors.js +240 -0
  36. package/lib/exception/index.js +8 -0
  37. package/lib/operation/account.js +193 -0
  38. package/lib/operation/asset.js +106 -0
  39. package/lib/operation/bu.js +52 -0
  40. package/lib/operation/contract.js +184 -0
  41. package/lib/operation/ctp10Token.js +394 -0
  42. package/lib/operation/index.js +30 -0
  43. package/lib/operation/log.js +47 -0
  44. package/lib/sdk.js +70 -0
  45. package/lib/token/asset.js +79 -0
  46. package/lib/token/ctp10Token.js +301 -0
  47. package/lib/token/index.js +17 -0
  48. package/lib/util/index.js +86 -0
  49. package/openchain-sdk-nodejs.iml +9 -0
  50. package/package.json +39 -0
  51. package/test/Ctp10Token.test.js +96 -0
  52. package/test/account.test.js +132 -0
  53. package/test/accountActivateOperation.test.js +99 -0
  54. package/test/accountSetMetadata.test.js +102 -0
  55. package/test/accountSetPrivilege.test.js +66 -0
  56. package/test/asset.test.js +63 -0
  57. package/test/assetIssueOperation.test.js +77 -0
  58. package/test/assetSendOperation.test.js +103 -0
  59. package/test/blob.test.js +128 -0
  60. package/test/block.test.js +165 -0
  61. package/test/buSendOperation.test.js +64 -0
  62. package/test/contract.test.js +64 -0
  63. package/test/contractCreateOperation.test.js +41 -0
  64. package/test/contractCreateTransaction.test.js +116 -0
  65. package/test/contractInvokeByAssetOperation.test.js +109 -0
  66. package/test/contractInvokeByBUOperation.test.js +107 -0
  67. package/test/ctp10TokenApproveOperation.test.js +98 -0
  68. package/test/ctp10TokenAssignOperation.test.js +99 -0
  69. package/test/ctp10TokenChangeOwnerOperation.test.js +98 -0
  70. package/test/ctp10TokenIssueOperation.test.js +40 -0
  71. package/test/ctp10TokenIssueOperationTransaction.test.js +106 -0
  72. package/test/ctp10TokenTransferFromOperation.test.js +101 -0
  73. package/test/ctp10TokenTransferOperation.test.js +98 -0
  74. package/test/log.transaction.test.js +103 -0
  75. package/test/transaction.test.js +166 -0
  76. package/test/util.test.js +93 -0
@@ -0,0 +1,1643 @@
1
+ {
2
+ "nested": {
3
+ "protocol": {
4
+ "options": {
5
+ "java_package": "cn.openchain.blockchain.adapter3"
6
+ },
7
+ "nested": {
8
+ "Account": {
9
+ "fields": {
10
+ "address": {
11
+ "type": "string",
12
+ "id": 1
13
+ },
14
+ "nonce": {
15
+ "type": "int64",
16
+ "id": 2
17
+ },
18
+ "priv": {
19
+ "type": "AccountPrivilege",
20
+ "id": 3
21
+ },
22
+ "metadatasHash": {
23
+ "type": "bytes",
24
+ "id": 4
25
+ },
26
+ "assetsHash": {
27
+ "type": "bytes",
28
+ "id": 5
29
+ },
30
+ "contract": {
31
+ "type": "Contract",
32
+ "id": 6
33
+ },
34
+ "balance": {
35
+ "type": "int64",
36
+ "id": 7
37
+ }
38
+ }
39
+ },
40
+ "AssetKey": {
41
+ "fields": {
42
+ "issuer": {
43
+ "type": "string",
44
+ "id": 1
45
+ },
46
+ "code": {
47
+ "type": "string",
48
+ "id": 2
49
+ },
50
+ "type": {
51
+ "type": "int32",
52
+ "id": 3
53
+ }
54
+ }
55
+ },
56
+ "Asset": {
57
+ "fields": {
58
+ "key": {
59
+ "type": "AssetKey",
60
+ "id": 1
61
+ },
62
+ "amount": {
63
+ "type": "int64",
64
+ "id": 2
65
+ }
66
+ }
67
+ },
68
+ "AssetStore": {
69
+ "fields": {
70
+ "key": {
71
+ "type": "AssetKey",
72
+ "id": 1
73
+ },
74
+ "amount": {
75
+ "type": "int64",
76
+ "id": 2
77
+ }
78
+ }
79
+ },
80
+ "LedgerHeader": {
81
+ "fields": {
82
+ "seq": {
83
+ "type": "int64",
84
+ "id": 1
85
+ },
86
+ "hash": {
87
+ "type": "bytes",
88
+ "id": 2
89
+ },
90
+ "previousHash": {
91
+ "type": "bytes",
92
+ "id": 3
93
+ },
94
+ "accountTreeHash": {
95
+ "type": "bytes",
96
+ "id": 4
97
+ },
98
+ "closeTime": {
99
+ "type": "int64",
100
+ "id": 5
101
+ },
102
+ "consensusValueHash": {
103
+ "type": "bytes",
104
+ "id": 6
105
+ },
106
+ "version": {
107
+ "type": "int64",
108
+ "id": 7
109
+ },
110
+ "txCount": {
111
+ "type": "int64",
112
+ "id": 8
113
+ },
114
+ "validatorsHash": {
115
+ "type": "bytes",
116
+ "id": 9
117
+ },
118
+ "reserve": {
119
+ "type": "string",
120
+ "id": 10
121
+ },
122
+ "feesHash": {
123
+ "type": "bytes",
124
+ "id": 11
125
+ },
126
+ "chainId": {
127
+ "type": "int64",
128
+ "id": 12
129
+ }
130
+ }
131
+ },
132
+ "Ledger": {
133
+ "fields": {
134
+ "header": {
135
+ "type": "LedgerHeader",
136
+ "id": 1
137
+ },
138
+ "transactionEnvs": {
139
+ "rule": "repeated",
140
+ "type": "TransactionEnv",
141
+ "id": 2
142
+ }
143
+ }
144
+ },
145
+ "OperationPayAsset": {
146
+ "fields": {
147
+ "destAddress": {
148
+ "type": "string",
149
+ "id": 1
150
+ },
151
+ "asset": {
152
+ "type": "Asset",
153
+ "id": 2
154
+ },
155
+ "input": {
156
+ "type": "string",
157
+ "id": 3
158
+ }
159
+ }
160
+ },
161
+ "OperationTypeThreshold": {
162
+ "fields": {
163
+ "type": {
164
+ "type": "Operation.Type",
165
+ "id": 1
166
+ },
167
+ "threshold": {
168
+ "type": "int64",
169
+ "id": 2
170
+ }
171
+ }
172
+ },
173
+ "AccountPrivilege": {
174
+ "fields": {
175
+ "masterWeight": {
176
+ "type": "int64",
177
+ "id": 1
178
+ },
179
+ "signers": {
180
+ "rule": "repeated",
181
+ "type": "Signer",
182
+ "id": 2
183
+ },
184
+ "thresholds": {
185
+ "type": "AccountThreshold",
186
+ "id": 3
187
+ }
188
+ }
189
+ },
190
+ "AccountThreshold": {
191
+ "fields": {
192
+ "txThreshold": {
193
+ "type": "int64",
194
+ "id": 1
195
+ },
196
+ "typeThresholds": {
197
+ "rule": "repeated",
198
+ "type": "OperationTypeThreshold",
199
+ "id": 2
200
+ }
201
+ }
202
+ },
203
+ "OperationIssueAsset": {
204
+ "fields": {
205
+ "code": {
206
+ "type": "string",
207
+ "id": 1
208
+ },
209
+ "amount": {
210
+ "type": "int64",
211
+ "id": 2
212
+ }
213
+ }
214
+ },
215
+ "OperationPayCoin": {
216
+ "fields": {
217
+ "destAddress": {
218
+ "type": "string",
219
+ "id": 1
220
+ },
221
+ "amount": {
222
+ "type": "int64",
223
+ "id": 2
224
+ },
225
+ "input": {
226
+ "type": "string",
227
+ "id": 3
228
+ }
229
+ }
230
+ },
231
+ "OperationSetSignerWeight": {
232
+ "fields": {
233
+ "masterWeight": {
234
+ "type": "int64",
235
+ "id": 1
236
+ },
237
+ "signers": {
238
+ "rule": "repeated",
239
+ "type": "Signer",
240
+ "id": 2
241
+ }
242
+ }
243
+ },
244
+ "OperationLog": {
245
+ "fields": {
246
+ "topic": {
247
+ "type": "string",
248
+ "id": 1
249
+ },
250
+ "datas": {
251
+ "rule": "repeated",
252
+ "type": "string",
253
+ "id": 2
254
+ }
255
+ }
256
+ },
257
+ "OperationSetPrivilege": {
258
+ "fields": {
259
+ "masterWeight": {
260
+ "type": "string",
261
+ "id": 1
262
+ },
263
+ "signers": {
264
+ "rule": "repeated",
265
+ "type": "Signer",
266
+ "id": 2
267
+ },
268
+ "txThreshold": {
269
+ "type": "string",
270
+ "id": 3
271
+ },
272
+ "typeThresholds": {
273
+ "rule": "repeated",
274
+ "type": "OperationTypeThreshold",
275
+ "id": 4
276
+ }
277
+ }
278
+ },
279
+ "Operation": {
280
+ "fields": {
281
+ "type": {
282
+ "type": "Type",
283
+ "id": 1
284
+ },
285
+ "sourceAddress": {
286
+ "type": "string",
287
+ "id": 2
288
+ },
289
+ "metadata": {
290
+ "type": "bytes",
291
+ "id": 3
292
+ },
293
+ "exprCondition": {
294
+ "type": "string",
295
+ "id": 4
296
+ },
297
+ "createAccount": {
298
+ "type": "OperationCreateAccount",
299
+ "id": 5
300
+ },
301
+ "issueAsset": {
302
+ "type": "OperationIssueAsset",
303
+ "id": 6
304
+ },
305
+ "payAsset": {
306
+ "type": "OperationPayAsset",
307
+ "id": 7
308
+ },
309
+ "setMetadata": {
310
+ "type": "OperationSetMetadata",
311
+ "id": 9
312
+ },
313
+ "setSignerWeight": {
314
+ "type": "OperationSetSignerWeight",
315
+ "id": 10
316
+ },
317
+ "setThreshold": {
318
+ "type": "OperationSetThreshold",
319
+ "id": 11
320
+ },
321
+ "payCoin": {
322
+ "type": "OperationPayCoin",
323
+ "id": 12
324
+ },
325
+ "log": {
326
+ "type": "OperationLog",
327
+ "id": 13
328
+ },
329
+ "setPrivilege": {
330
+ "type": "OperationSetPrivilege",
331
+ "id": 14
332
+ }
333
+ },
334
+ "nested": {
335
+ "Type": {
336
+ "values": {
337
+ "UNKNOWN": 0,
338
+ "CREATE_ACCOUNT": 1,
339
+ "ISSUE_ASSET": 2,
340
+ "PAY_ASSET": 3,
341
+ "SET_METADATA": 4,
342
+ "SET_SIGNER_WEIGHT": 5,
343
+ "SET_THRESHOLD": 6,
344
+ "PAY_COIN": 7,
345
+ "LOG": 8,
346
+ "SET_PRIVILEGE": 9
347
+ }
348
+ }
349
+ }
350
+ },
351
+ "OperationSetThreshold": {
352
+ "fields": {
353
+ "txThreshold": {
354
+ "type": "int64",
355
+ "id": 1
356
+ },
357
+ "typeThresholds": {
358
+ "rule": "repeated",
359
+ "type": "OperationTypeThreshold",
360
+ "id": 4
361
+ }
362
+ }
363
+ },
364
+ "Transaction": {
365
+ "fields": {
366
+ "sourceAddress": {
367
+ "type": "string",
368
+ "id": 1
369
+ },
370
+ "nonce": {
371
+ "type": "int64",
372
+ "id": 2
373
+ },
374
+ "exprCondition": {
375
+ "type": "string",
376
+ "id": 3
377
+ },
378
+ "operations": {
379
+ "rule": "repeated",
380
+ "type": "Operation",
381
+ "id": 4
382
+ },
383
+ "metadata": {
384
+ "type": "bytes",
385
+ "id": 5
386
+ },
387
+ "feeLimit": {
388
+ "type": "int64",
389
+ "id": 6
390
+ },
391
+ "gasPrice": {
392
+ "type": "int64",
393
+ "id": 7
394
+ },
395
+ "ceilLedgerSeq": {
396
+ "type": "int64",
397
+ "id": 8
398
+ },
399
+ "chainId": {
400
+ "type": "int64",
401
+ "id": 9
402
+ }
403
+ },
404
+ "nested": {
405
+ "Limit": {
406
+ "values": {
407
+ "UNKNOWN": 0,
408
+ "OPERATIONS": 1000
409
+ }
410
+ }
411
+ }
412
+ },
413
+ "Signer": {
414
+ "fields": {
415
+ "address": {
416
+ "type": "string",
417
+ "id": 1
418
+ },
419
+ "weight": {
420
+ "type": "int64",
421
+ "id": 2
422
+ }
423
+ },
424
+ "nested": {
425
+ "Limit": {
426
+ "values": {
427
+ "SIGNER_NONE": 0,
428
+ "SIGNER": 100
429
+ }
430
+ }
431
+ }
432
+ },
433
+ "Trigger": {
434
+ "fields": {
435
+ "transactionType": {
436
+ "type": "TransactionType",
437
+ "id": 1
438
+ },
439
+ "ledgerSeq": {
440
+ "type": "int64",
441
+ "id": 2
442
+ },
443
+ "transaction": {
444
+ "type": "OperationTrigger",
445
+ "id": 3
446
+ }
447
+ },
448
+ "nested": {
449
+ "TransactionType": {
450
+ "values": {
451
+ "NORMAL_TRANSACTION": 0,
452
+ "CONTRACT_TRANSACTION": 1
453
+ }
454
+ },
455
+ "OperationTrigger": {
456
+ "fields": {
457
+ "hash": {
458
+ "type": "bytes",
459
+ "id": 1
460
+ },
461
+ "index": {
462
+ "type": "int64",
463
+ "id": 2
464
+ }
465
+ }
466
+ }
467
+ }
468
+ },
469
+ "Limit": {
470
+ "values": {
471
+ "UNKNOWN": 0,
472
+ "SIGNATURE": 100
473
+ }
474
+ },
475
+ "TransactionEnv": {
476
+ "fields": {
477
+ "transaction": {
478
+ "type": "Transaction",
479
+ "id": 1
480
+ },
481
+ "signatures": {
482
+ "rule": "repeated",
483
+ "type": "Signature",
484
+ "id": 2
485
+ },
486
+ "trigger": {
487
+ "type": "Trigger",
488
+ "id": 3
489
+ }
490
+ }
491
+ },
492
+ "TransactionEnvStore": {
493
+ "fields": {
494
+ "transactionEnv": {
495
+ "type": "TransactionEnv",
496
+ "id": 1
497
+ },
498
+ "errorCode": {
499
+ "type": "int32",
500
+ "id": 2
501
+ },
502
+ "errorDesc": {
503
+ "type": "string",
504
+ "id": 3
505
+ },
506
+ "ledgerSeq": {
507
+ "type": "int64",
508
+ "id": 4
509
+ },
510
+ "closeTime": {
511
+ "type": "int64",
512
+ "id": 5
513
+ },
514
+ "hash": {
515
+ "type": "bytes",
516
+ "id": 6
517
+ },
518
+ "actualFee": {
519
+ "type": "int64",
520
+ "id": 7
521
+ },
522
+ "contractTxHashes": {
523
+ "rule": "repeated",
524
+ "type": "bytes",
525
+ "id": 8
526
+ }
527
+ }
528
+ },
529
+ "TransactionEnvSet": {
530
+ "fields": {
531
+ "txs": {
532
+ "rule": "repeated",
533
+ "type": "TransactionEnv",
534
+ "id": 2
535
+ }
536
+ }
537
+ },
538
+ "ConsensusValueValidation": {
539
+ "fields": {
540
+ "expireTxIds": {
541
+ "rule": "repeated",
542
+ "type": "int32",
543
+ "id": 1
544
+ },
545
+ "errorTxIds": {
546
+ "rule": "repeated",
547
+ "type": "int32",
548
+ "id": 2
549
+ }
550
+ }
551
+ },
552
+ "ConsensusValue": {
553
+ "fields": {
554
+ "txset": {
555
+ "type": "TransactionEnvSet",
556
+ "id": 1
557
+ },
558
+ "closeTime": {
559
+ "type": "int64",
560
+ "id": 2
561
+ },
562
+ "previousProof": {
563
+ "type": "bytes",
564
+ "id": 3
565
+ },
566
+ "ledgerSeq": {
567
+ "type": "int64",
568
+ "id": 4
569
+ },
570
+ "previousLedgerHash": {
571
+ "type": "bytes",
572
+ "id": 5
573
+ },
574
+ "ledgerUpgrade": {
575
+ "type": "LedgerUpgrade",
576
+ "id": 6
577
+ },
578
+ "validation": {
579
+ "type": "ConsensusValueValidation",
580
+ "id": 7
581
+ }
582
+ }
583
+ },
584
+ "Contract": {
585
+ "fields": {
586
+ "type": {
587
+ "type": "ContractType",
588
+ "id": 1
589
+ },
590
+ "payload": {
591
+ "type": "string",
592
+ "id": 2
593
+ }
594
+ },
595
+ "nested": {
596
+ "ContractType": {
597
+ "values": {
598
+ "JAVASCRIPT": 0
599
+ }
600
+ }
601
+ }
602
+ },
603
+ "OperationCreateAccount": {
604
+ "fields": {
605
+ "destAddress": {
606
+ "type": "string",
607
+ "id": 1
608
+ },
609
+ "contract": {
610
+ "type": "Contract",
611
+ "id": 2
612
+ },
613
+ "priv": {
614
+ "type": "AccountPrivilege",
615
+ "id": 3
616
+ },
617
+ "metadatas": {
618
+ "rule": "repeated",
619
+ "type": "KeyPair",
620
+ "id": 4
621
+ },
622
+ "initBalance": {
623
+ "type": "int64",
624
+ "id": 5
625
+ },
626
+ "initInput": {
627
+ "type": "string",
628
+ "id": 6
629
+ }
630
+ }
631
+ },
632
+ "OperationSetMetadata": {
633
+ "fields": {
634
+ "key": {
635
+ "type": "string",
636
+ "id": 1
637
+ },
638
+ "value": {
639
+ "type": "string",
640
+ "id": 2
641
+ },
642
+ "version": {
643
+ "type": "int64",
644
+ "id": 3
645
+ },
646
+ "deleteFlag": {
647
+ "type": "bool",
648
+ "id": 4
649
+ }
650
+ }
651
+ },
652
+ "KeyPair": {
653
+ "fields": {
654
+ "key": {
655
+ "type": "string",
656
+ "id": 1
657
+ },
658
+ "value": {
659
+ "type": "string",
660
+ "id": 2
661
+ },
662
+ "version": {
663
+ "type": "int64",
664
+ "id": 3
665
+ }
666
+ }
667
+ },
668
+ "Signature": {
669
+ "fields": {
670
+ "publicKey": {
671
+ "type": "string",
672
+ "id": 1
673
+ },
674
+ "signData": {
675
+ "type": "bytes",
676
+ "id": 2
677
+ }
678
+ }
679
+ },
680
+ "LedgerUpgrade": {
681
+ "fields": {
682
+ "newLedgerVersion": {
683
+ "type": "int64",
684
+ "id": 1
685
+ },
686
+ "newValidatorList": {
687
+ "rule": "repeated",
688
+ "type": "string",
689
+ "id": 2
690
+ },
691
+ "delValidators": {
692
+ "rule": "repeated",
693
+ "type": "string",
694
+ "id": 3
695
+ },
696
+ "chainId": {
697
+ "type": "int64",
698
+ "id": 4
699
+ }
700
+ }
701
+ },
702
+ "WsMessage": {
703
+ "fields": {
704
+ "type": {
705
+ "type": "int64",
706
+ "id": 1
707
+ },
708
+ "request": {
709
+ "type": "bool",
710
+ "id": 2
711
+ },
712
+ "sequence": {
713
+ "type": "int64",
714
+ "id": 3
715
+ },
716
+ "data": {
717
+ "type": "bytes",
718
+ "id": 4
719
+ }
720
+ }
721
+ },
722
+ "Ping": {
723
+ "fields": {
724
+ "nonce": {
725
+ "type": "int64",
726
+ "id": 1
727
+ }
728
+ }
729
+ },
730
+ "Pong": {
731
+ "fields": {
732
+ "nonce": {
733
+ "type": "int64",
734
+ "id": 1
735
+ }
736
+ }
737
+ },
738
+ "ERRORCODE": {
739
+ "values": {
740
+ "ERRCODE_SUCCESS": 0,
741
+ "ERRCODE_INTERNAL_ERROR": 1,
742
+ "ERRCODE_INVALID_PARAMETER": 2,
743
+ "ERRCODE_ALREADY_EXIST": 3,
744
+ "ERRCODE_NOT_EXIST": 4,
745
+ "ERRCODE_TX_TIMEOUT": 5,
746
+ "ERRCODE_ACCESS_DENIED": 6,
747
+ "ERRCODE_MATH_OVERFLOW": 7,
748
+ "ERRCODE_EXPR_CONDITION_RESULT_FALSE": 20,
749
+ "ERRCODE_EXPR_CONDITION_SYNTAX_ERROR": 21,
750
+ "ERRCODE_INVALID_PUBKEY": 90,
751
+ "ERRCODE_INVALID_PRIKEY": 91,
752
+ "ERRCODE_ASSET_INVALID": 92,
753
+ "ERRCODE_INVALID_SIGNATURE": 93,
754
+ "ERRCODE_INVALID_ADDRESS": 94,
755
+ "ERRCODE_MISSING_OPERATIONS": 97,
756
+ "ERRCODE_TOO_MANY_OPERATIONS": 98,
757
+ "ERRCODE_BAD_SEQUENCE": 99,
758
+ "ERRCODE_ACCOUNT_LOW_RESERVE": 100,
759
+ "ERRCODE_ACCOUNT_SOURCEDEST_EQUAL": 101,
760
+ "ERRCODE_ACCOUNT_DEST_EXIST": 102,
761
+ "ERRCODE_ACCOUNT_NOT_EXIST": 103,
762
+ "ERRCODE_ACCOUNT_ASSET_LOW_RESERVE": 104,
763
+ "ERRCODE_ACCOUNT_ASSET_AMOUNT_TOO_LARGE": 105,
764
+ "ERRCODE_ACCOUNT_INIT_LOW_RESERVE": 106,
765
+ "ERRCODE_FEE_NOT_ENOUGH": 111,
766
+ "ERRCODE_FEE_INVALID": 112,
767
+ "ERRCODE_OUT_OF_TXCACHE": 114,
768
+ "ERRCODE_WEIGHT_NOT_VALID": 120,
769
+ "ERRCODE_THRESHOLD_NOT_VALID": 121,
770
+ "ERRCODE_INVALID_DATAVERSION": 144,
771
+ "ERRCODE_TX_SIZE_TOO_BIG": 146,
772
+ "ERRCODE_CONTRACT_EXECUTE_FAIL": 151,
773
+ "ERRCODE_CONTRACT_SYNTAX_ERROR": 152,
774
+ "ERRCODE_CONTRACT_TOO_MANY_RECURSION": 153,
775
+ "ERRCODE_CONTRACT_TOO_MANY_TRANSACTIONS": 154,
776
+ "ERRCODE_CONTRACT_EXECUTE_EXPIRED": 155,
777
+ "ERRCODE_TX_INSERT_QUEUE_FAIL": 160
778
+ }
779
+ },
780
+ "OVERLAY_MESSAGE_TYPE": {
781
+ "values": {
782
+ "OVERLAY_MSGTYPE_NONE": 0,
783
+ "OVERLAY_MSGTYPE_PING": 1,
784
+ "OVERLAY_MSGTYPE_HELLO": 2,
785
+ "OVERLAY_MSGTYPE_PEERS": 3,
786
+ "OVERLAY_MSGTYPE_TRANSACTION": 4,
787
+ "OVERLAY_MSGTYPE_LEDGERS": 5,
788
+ "OVERLAY_MSGTYPE_PBFT": 6,
789
+ "OVERLAY_MSGTYPE_LEDGER_UPGRADE_NOTIFY": 7
790
+ }
791
+ },
792
+ "Hello": {
793
+ "fields": {
794
+ "networkId": {
795
+ "type": "int64",
796
+ "id": 1
797
+ },
798
+ "ledgerVersion": {
799
+ "type": "int64",
800
+ "id": 2
801
+ },
802
+ "overlayVersion": {
803
+ "type": "int64",
804
+ "id": 3
805
+ },
806
+ "buchainVersion": {
807
+ "type": "string",
808
+ "id": 4
809
+ },
810
+ "listeningPort": {
811
+ "type": "int64",
812
+ "id": 5
813
+ },
814
+ "nodeAddress": {
815
+ "type": "string",
816
+ "id": 6
817
+ },
818
+ "nodeRand": {
819
+ "type": "string",
820
+ "id": 7
821
+ },
822
+ "license": {
823
+ "type": "string",
824
+ "id": 8
825
+ }
826
+ }
827
+ },
828
+ "HelloResponse": {
829
+ "fields": {
830
+ "errorCode": {
831
+ "type": "ERRORCODE",
832
+ "id": 1
833
+ },
834
+ "errorDesc": {
835
+ "type": "string",
836
+ "id": 2
837
+ }
838
+ }
839
+ },
840
+ "Peer": {
841
+ "fields": {
842
+ "ip": {
843
+ "type": "string",
844
+ "id": 1
845
+ },
846
+ "port": {
847
+ "type": "int64",
848
+ "id": 2
849
+ },
850
+ "numFailures": {
851
+ "type": "int64",
852
+ "id": 3
853
+ },
854
+ "nextAttemptTime": {
855
+ "type": "int64",
856
+ "id": 4
857
+ },
858
+ "activeTime": {
859
+ "type": "int64",
860
+ "id": 5
861
+ },
862
+ "connectionId": {
863
+ "type": "int64",
864
+ "id": 6
865
+ }
866
+ }
867
+ },
868
+ "Peers": {
869
+ "fields": {
870
+ "peers": {
871
+ "rule": "repeated",
872
+ "type": "Peer",
873
+ "id": 1
874
+ }
875
+ }
876
+ },
877
+ "GetLedgers": {
878
+ "fields": {
879
+ "begin": {
880
+ "type": "int64",
881
+ "id": 1
882
+ },
883
+ "end": {
884
+ "type": "int64",
885
+ "id": 2
886
+ },
887
+ "timestamp": {
888
+ "type": "int64",
889
+ "id": 3
890
+ },
891
+ "chainId": {
892
+ "type": "int64",
893
+ "id": 4
894
+ }
895
+ }
896
+ },
897
+ "Ledgers": {
898
+ "fields": {
899
+ "values": {
900
+ "rule": "repeated",
901
+ "type": "ConsensusValue",
902
+ "id": 1
903
+ },
904
+ "syncCode": {
905
+ "type": "SyncCode",
906
+ "id": 2
907
+ },
908
+ "maxSeq": {
909
+ "type": "int64",
910
+ "id": 3
911
+ },
912
+ "proof": {
913
+ "type": "bytes",
914
+ "id": 4
915
+ },
916
+ "chainId": {
917
+ "type": "int64",
918
+ "id": 5
919
+ }
920
+ },
921
+ "nested": {
922
+ "SyncCode": {
923
+ "values": {
924
+ "OK": 0,
925
+ "OUT_OF_SYNC": 1,
926
+ "OUT_OF_LEDGERS": 2,
927
+ "BUSY": 3,
928
+ "REFUSE": 4,
929
+ "INTERNAL": 5
930
+ }
931
+ }
932
+ }
933
+ },
934
+ "DontHave": {
935
+ "fields": {
936
+ "type": {
937
+ "type": "int64",
938
+ "id": 1
939
+ },
940
+ "hash": {
941
+ "type": "bytes",
942
+ "id": 2
943
+ }
944
+ }
945
+ },
946
+ "LedgerUpgradeNotify": {
947
+ "fields": {
948
+ "nonce": {
949
+ "type": "int64",
950
+ "id": 1
951
+ },
952
+ "upgrade": {
953
+ "type": "LedgerUpgrade",
954
+ "id": 2
955
+ },
956
+ "signature": {
957
+ "type": "Signature",
958
+ "id": 3
959
+ }
960
+ }
961
+ },
962
+ "EntryList": {
963
+ "fields": {
964
+ "entry": {
965
+ "rule": "repeated",
966
+ "type": "bytes",
967
+ "id": 1
968
+ }
969
+ }
970
+ },
971
+ "ChainMessageType": {
972
+ "values": {
973
+ "CHAIN_TYPE_NONE": 0,
974
+ "CHAIN_HELLO": 10,
975
+ "CHAIN_TX_STATUS": 11,
976
+ "CHAIN_PEER_ONLINE": 12,
977
+ "CHAIN_PEER_OFFLINE": 13,
978
+ "CHAIN_PEER_MESSAGE": 14,
979
+ "CHAIN_SUBMITTRANSACTION": 15,
980
+ "CHAIN_LEDGER_HEADER": 16,
981
+ "CHAIN_CONTRACT_LOG": 17,
982
+ "CHAIN_LEDGER_TXS": 18,
983
+ "CHAIN_SUBSCRIBE_TX": 19,
984
+ "CHAIN_TX_ENV_STORE": 20
985
+ }
986
+ },
987
+ "ChainHello": {
988
+ "fields": {
989
+ "apiList": {
990
+ "rule": "repeated",
991
+ "type": "ChainMessageType",
992
+ "id": 1
993
+ },
994
+ "timestamp": {
995
+ "type": "int64",
996
+ "id": 2
997
+ }
998
+ }
999
+ },
1000
+ "ChainStatus": {
1001
+ "fields": {
1002
+ "selfAddr": {
1003
+ "type": "string",
1004
+ "id": 1
1005
+ },
1006
+ "ledgerVersion": {
1007
+ "type": "int64",
1008
+ "id": 2
1009
+ },
1010
+ "monitorVersion": {
1011
+ "type": "int64",
1012
+ "id": 3
1013
+ },
1014
+ "buchainVersion": {
1015
+ "type": "string",
1016
+ "id": 4
1017
+ },
1018
+ "timestamp": {
1019
+ "type": "int64",
1020
+ "id": 5
1021
+ },
1022
+ "networkId": {
1023
+ "type": "int64",
1024
+ "id": 6
1025
+ }
1026
+ }
1027
+ },
1028
+ "ChainPeerMessage": {
1029
+ "fields": {
1030
+ "srcPeerAddr": {
1031
+ "type": "string",
1032
+ "id": 1
1033
+ },
1034
+ "desPeerAddrs": {
1035
+ "rule": "repeated",
1036
+ "type": "string",
1037
+ "id": 2
1038
+ },
1039
+ "data": {
1040
+ "type": "bytes",
1041
+ "id": 3
1042
+ }
1043
+ }
1044
+ },
1045
+ "ChainSubscribeTx": {
1046
+ "fields": {
1047
+ "address": {
1048
+ "rule": "repeated",
1049
+ "type": "string",
1050
+ "id": 1
1051
+ }
1052
+ }
1053
+ },
1054
+ "ChainResponse": {
1055
+ "fields": {
1056
+ "errorCode": {
1057
+ "type": "int32",
1058
+ "id": 1
1059
+ },
1060
+ "errorDesc": {
1061
+ "type": "string",
1062
+ "id": 2
1063
+ }
1064
+ }
1065
+ },
1066
+ "ChainTxStatus": {
1067
+ "fields": {
1068
+ "status": {
1069
+ "type": "TxStatus",
1070
+ "id": 1
1071
+ },
1072
+ "txHash": {
1073
+ "type": "string",
1074
+ "id": 2
1075
+ },
1076
+ "sourceAddress": {
1077
+ "type": "string",
1078
+ "id": 3
1079
+ },
1080
+ "sourceAccountSeq": {
1081
+ "type": "int64",
1082
+ "id": 4
1083
+ },
1084
+ "ledgerSeq": {
1085
+ "type": "int64",
1086
+ "id": 5
1087
+ },
1088
+ "newAccountSeq": {
1089
+ "type": "int64",
1090
+ "id": 6
1091
+ },
1092
+ "errorCode": {
1093
+ "type": "ERRORCODE",
1094
+ "id": 7
1095
+ },
1096
+ "errorDesc": {
1097
+ "type": "string",
1098
+ "id": 8
1099
+ },
1100
+ "timestamp": {
1101
+ "type": "int64",
1102
+ "id": 9
1103
+ }
1104
+ },
1105
+ "nested": {
1106
+ "TxStatus": {
1107
+ "values": {
1108
+ "UNDEFINED": 0,
1109
+ "CONFIRMED": 1,
1110
+ "PENDING": 2,
1111
+ "COMPLETE": 3,
1112
+ "FAILURE": 4,
1113
+ "APPLY_FAILURE": 5
1114
+ }
1115
+ }
1116
+ }
1117
+ },
1118
+ "TransactionEnvResult": {
1119
+ "fields": {
1120
+ "tranEnv": {
1121
+ "type": "protocol.TransactionEnv",
1122
+ "id": 1
1123
+ },
1124
+ "txHash": {
1125
+ "type": "string",
1126
+ "id": 2
1127
+ },
1128
+ "errorCode": {
1129
+ "type": "ERRORCODE",
1130
+ "id": 3
1131
+ },
1132
+ "errorDesc": {
1133
+ "type": "string",
1134
+ "id": 4
1135
+ }
1136
+ }
1137
+ },
1138
+ "LedgerTxs": {
1139
+ "fields": {
1140
+ "header": {
1141
+ "type": "protocol.LedgerHeader",
1142
+ "id": 1
1143
+ },
1144
+ "txs": {
1145
+ "rule": "repeated",
1146
+ "type": "TransactionEnvResult",
1147
+ "id": 2
1148
+ },
1149
+ "ledgerLength": {
1150
+ "type": "int64",
1151
+ "id": 3
1152
+ }
1153
+ }
1154
+ },
1155
+ "ChainContractLog": {
1156
+ "fields": {
1157
+ "sender": {
1158
+ "type": "string",
1159
+ "id": 1
1160
+ },
1161
+ "data": {
1162
+ "type": "string",
1163
+ "id": 2
1164
+ },
1165
+ "timestamp": {
1166
+ "type": "int64",
1167
+ "id": 3
1168
+ }
1169
+ }
1170
+ }
1171
+ }
1172
+ },
1173
+ "monitor": {
1174
+ "options": {
1175
+ "java_package": "cn.openchain.blockchain.adapter3"
1176
+ },
1177
+ "nested": {
1178
+ "MONITOR_MESSAGE_TYPE": {
1179
+ "values": {
1180
+ "MONITOR_MSGTYPE_NONE": 0,
1181
+ "MONITOR_MSGTYPE_HELLO": 30,
1182
+ "MONITOR_MSGTYPE_REGISTER": 31,
1183
+ "MONITOR_MSGTYPE_SYSTEM": 34,
1184
+ "MONITOR_MSGTYPE_CHAIN": 40,
1185
+ "MONITOR_MSGTYPE_AUTHORIZATION": 41,
1186
+ "MONITOR_MSGTYPE_NODE_INFO": 42,
1187
+ "MONITOR_MSGTYPE_BROADCAST": 43
1188
+ }
1189
+ },
1190
+ "Hello": {
1191
+ "fields": {
1192
+ "serviceVersion": {
1193
+ "type": "int64",
1194
+ "id": 1
1195
+ },
1196
+ "connectionTimeout": {
1197
+ "type": "int64",
1198
+ "id": 2
1199
+ },
1200
+ "timestamp": {
1201
+ "type": "int64",
1202
+ "id": 3
1203
+ }
1204
+ }
1205
+ },
1206
+ "SystemInfo": {
1207
+ "fields": {
1208
+ "hostName": {
1209
+ "type": "string",
1210
+ "id": 1
1211
+ },
1212
+ "osVersion": {
1213
+ "type": "string",
1214
+ "id": 2
1215
+ },
1216
+ "osBit": {
1217
+ "type": "string",
1218
+ "id": 3
1219
+ },
1220
+ "systemUptime": {
1221
+ "type": "int64",
1222
+ "id": 4
1223
+ },
1224
+ "cpuId": {
1225
+ "type": "string",
1226
+ "id": 5
1227
+ },
1228
+ "macAddresses": {
1229
+ "rule": "repeated",
1230
+ "type": "string",
1231
+ "id": 6
1232
+ }
1233
+ }
1234
+ },
1235
+ "Register": {
1236
+ "fields": {
1237
+ "id": {
1238
+ "type": "string",
1239
+ "id": 1
1240
+ },
1241
+ "blockchainVersion": {
1242
+ "type": "string",
1243
+ "id": 2
1244
+ },
1245
+ "agentVersion": {
1246
+ "type": "int64",
1247
+ "id": 3
1248
+ },
1249
+ "networkId": {
1250
+ "type": "int64",
1251
+ "id": 4
1252
+ },
1253
+ "nodeAddress": {
1254
+ "type": "string",
1255
+ "id": 5
1256
+ },
1257
+ "validatorAddress": {
1258
+ "type": "string",
1259
+ "id": 6
1260
+ },
1261
+ "processUptime": {
1262
+ "type": "int64",
1263
+ "id": 7
1264
+ },
1265
+ "ledgerHeader": {
1266
+ "type": "protocol.LedgerHeader",
1267
+ "id": 8
1268
+ },
1269
+ "system": {
1270
+ "type": "SystemInfo",
1271
+ "id": 9
1272
+ },
1273
+ "timestamp": {
1274
+ "type": "int64",
1275
+ "id": 10
1276
+ },
1277
+ "binPath": {
1278
+ "type": "string",
1279
+ "id": 11
1280
+ }
1281
+ }
1282
+ },
1283
+ "Peer": {
1284
+ "fields": {
1285
+ "nodeAddress": {
1286
+ "type": "string",
1287
+ "id": 1
1288
+ },
1289
+ "delay": {
1290
+ "type": "int64",
1291
+ "id": 2
1292
+ },
1293
+ "active": {
1294
+ "type": "bool",
1295
+ "id": 3
1296
+ },
1297
+ "ipAddress": {
1298
+ "type": "string",
1299
+ "id": 4
1300
+ },
1301
+ "activeTime": {
1302
+ "type": "int64",
1303
+ "id": 5
1304
+ },
1305
+ "inBound": {
1306
+ "type": "bool",
1307
+ "id": 6
1308
+ }
1309
+ }
1310
+ },
1311
+ "P2PConnection": {
1312
+ "fields": {
1313
+ "listenPort": {
1314
+ "type": "int64",
1315
+ "id": 1
1316
+ },
1317
+ "peers": {
1318
+ "rule": "repeated",
1319
+ "type": "Peer",
1320
+ "id": 2
1321
+ }
1322
+ }
1323
+ },
1324
+ "ListenAddresses": {
1325
+ "fields": {
1326
+ "p2pConnection": {
1327
+ "type": "P2PConnection",
1328
+ "id": 1
1329
+ },
1330
+ "webserver": {
1331
+ "type": "string",
1332
+ "id": 2
1333
+ },
1334
+ "wsserver": {
1335
+ "type": "string",
1336
+ "id": 3
1337
+ }
1338
+ }
1339
+ },
1340
+ "ChainStatus": {
1341
+ "fields": {
1342
+ "ledgerHeader": {
1343
+ "type": "protocol.LedgerHeader",
1344
+ "id": 1
1345
+ },
1346
+ "validators": {
1347
+ "rule": "repeated",
1348
+ "type": "string",
1349
+ "id": 2
1350
+ },
1351
+ "transactionsCacheSize": {
1352
+ "type": "int64",
1353
+ "id": 3
1354
+ },
1355
+ "accountCount": {
1356
+ "type": "int64",
1357
+ "id": 4
1358
+ },
1359
+ "listenAddresses": {
1360
+ "type": "ListenAddresses",
1361
+ "id": 5
1362
+ },
1363
+ "timestamp": {
1364
+ "type": "int64",
1365
+ "id": 6
1366
+ }
1367
+ }
1368
+ },
1369
+ "SystemResource": {
1370
+ "fields": {
1371
+ "available": {
1372
+ "type": "int64",
1373
+ "id": 1
1374
+ },
1375
+ "total": {
1376
+ "type": "int64",
1377
+ "id": 2
1378
+ },
1379
+ "usedPercent": {
1380
+ "type": "double",
1381
+ "id": 3
1382
+ }
1383
+ }
1384
+ },
1385
+ "SystemStatus": {
1386
+ "fields": {
1387
+ "cpu": {
1388
+ "type": "double",
1389
+ "id": 1
1390
+ },
1391
+ "memory": {
1392
+ "type": "SystemResource",
1393
+ "id": 2
1394
+ },
1395
+ "discs": {
1396
+ "rule": "repeated",
1397
+ "type": "Disc",
1398
+ "id": 3
1399
+ }
1400
+ }
1401
+ },
1402
+ "Disc": {
1403
+ "fields": {
1404
+ "path": {
1405
+ "type": "string",
1406
+ "id": 1
1407
+ },
1408
+ "resource": {
1409
+ "type": "SystemResource",
1410
+ "id": 2
1411
+ }
1412
+ }
1413
+ },
1414
+ "SignAlgorithm": {
1415
+ "fields": {
1416
+ "algorithm": {
1417
+ "type": "string",
1418
+ "id": 1
1419
+ },
1420
+ "parameter": {
1421
+ "type": "string",
1422
+ "id": 2
1423
+ }
1424
+ }
1425
+ },
1426
+ "CertSign": {
1427
+ "fields": {
1428
+ "signAlgorithm": {
1429
+ "type": "SignAlgorithm",
1430
+ "id": 1
1431
+ },
1432
+ "sign": {
1433
+ "type": "bytes",
1434
+ "id": 2
1435
+ }
1436
+ }
1437
+ },
1438
+ "Validity": {
1439
+ "fields": {
1440
+ "notBefore": {
1441
+ "type": "int64",
1442
+ "id": 1
1443
+ },
1444
+ "notAfter": {
1445
+ "type": "int64",
1446
+ "id": 2
1447
+ }
1448
+ }
1449
+ },
1450
+ "CertPublic": {
1451
+ "fields": {
1452
+ "algorithm": {
1453
+ "type": "SignAlgorithm",
1454
+ "id": 1
1455
+ },
1456
+ "modules": {
1457
+ "type": "bytes",
1458
+ "id": 2
1459
+ },
1460
+ "keySize": {
1461
+ "type": "string",
1462
+ "id": 3
1463
+ },
1464
+ "exponent": {
1465
+ "type": "string",
1466
+ "id": 4
1467
+ }
1468
+ }
1469
+ },
1470
+ "CertExtension": {
1471
+ "fields": {
1472
+ "name": {
1473
+ "type": "string",
1474
+ "id": 1
1475
+ },
1476
+ "value": {
1477
+ "type": "string",
1478
+ "id": 2
1479
+ }
1480
+ }
1481
+ },
1482
+ "CertExtensions": {
1483
+ "fields": {
1484
+ "isCa": {
1485
+ "type": "bool",
1486
+ "id": 1
1487
+ },
1488
+ "certExtensions": {
1489
+ "rule": "repeated",
1490
+ "type": "CertExtension",
1491
+ "id": 2
1492
+ }
1493
+ }
1494
+ },
1495
+ "Cert": {
1496
+ "fields": {
1497
+ "version": {
1498
+ "type": "string",
1499
+ "id": 1
1500
+ },
1501
+ "id": {
1502
+ "type": "string",
1503
+ "id": 2
1504
+ },
1505
+ "sign": {
1506
+ "type": "CertSign",
1507
+ "id": 3
1508
+ },
1509
+ "issuer": {
1510
+ "type": "string",
1511
+ "id": 4
1512
+ },
1513
+ "validity": {
1514
+ "type": "Validity",
1515
+ "id": 5
1516
+ },
1517
+ "subject": {
1518
+ "type": "string",
1519
+ "id": 6
1520
+ },
1521
+ "certPublic": {
1522
+ "type": "CertPublic",
1523
+ "id": 7
1524
+ },
1525
+ "certExtensions": {
1526
+ "type": "CertExtensions",
1527
+ "id": 8
1528
+ }
1529
+ }
1530
+ },
1531
+ "LicenseMessage": {
1532
+ "fields": {
1533
+ "id": {
1534
+ "type": "string",
1535
+ "id": 1
1536
+ },
1537
+ "networkId": {
1538
+ "type": "int64",
1539
+ "id": 2
1540
+ },
1541
+ "authority": {
1542
+ "type": "string",
1543
+ "id": 3
1544
+ },
1545
+ "subject": {
1546
+ "type": "string",
1547
+ "id": 4
1548
+ },
1549
+ "certificateId": {
1550
+ "type": "string",
1551
+ "id": 5
1552
+ },
1553
+ "hardware": {
1554
+ "type": "string",
1555
+ "id": 6
1556
+ },
1557
+ "time": {
1558
+ "type": "string",
1559
+ "id": 7
1560
+ },
1561
+ "extraData": {
1562
+ "type": "string",
1563
+ "id": 8
1564
+ },
1565
+ "version": {
1566
+ "type": "string",
1567
+ "id": 9
1568
+ }
1569
+ }
1570
+ },
1571
+ "License": {
1572
+ "fields": {
1573
+ "message": {
1574
+ "type": "LicenseMessage",
1575
+ "id": 1
1576
+ },
1577
+ "verification": {
1578
+ "type": "protocol.Signature",
1579
+ "id": 2
1580
+ }
1581
+ }
1582
+ },
1583
+ "Authorization": {
1584
+ "fields": {
1585
+ "verify": {
1586
+ "type": "Cert",
1587
+ "id": 1
1588
+ },
1589
+ "entity": {
1590
+ "type": "Cert",
1591
+ "id": 2
1592
+ },
1593
+ "license": {
1594
+ "type": "License",
1595
+ "id": 3
1596
+ }
1597
+ }
1598
+ },
1599
+ "NodeInfo": {
1600
+ "fields": {
1601
+ "chainStatus": {
1602
+ "type": "ChainStatus",
1603
+ "id": 1
1604
+ },
1605
+ "systemStatus": {
1606
+ "type": "SystemStatus",
1607
+ "id": 2
1608
+ },
1609
+ "authorization": {
1610
+ "type": "Authorization",
1611
+ "id": 3
1612
+ }
1613
+ }
1614
+ },
1615
+ "BroadcastTx": {
1616
+ "fields": {
1617
+ "networkId": {
1618
+ "type": "int64",
1619
+ "id": 1
1620
+ },
1621
+ "sourceNodeAddress": {
1622
+ "type": "string",
1623
+ "id": 2
1624
+ },
1625
+ "targetNodeAddresses": {
1626
+ "rule": "repeated",
1627
+ "type": "string",
1628
+ "id": 3
1629
+ },
1630
+ "txHash": {
1631
+ "type": "string",
1632
+ "id": 4
1633
+ },
1634
+ "timestamp": {
1635
+ "type": "int64",
1636
+ "id": 5
1637
+ }
1638
+ }
1639
+ }
1640
+ }
1641
+ }
1642
+ }
1643
+ }