@d9-network/spec 0.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 (36) hide show
  1. package/.papi/contracts/burnManager.json +1300 -0
  2. package/.papi/contracts/burnMining.json +1385 -0
  3. package/.papi/contracts/crossChainTransfer.json +1693 -0
  4. package/.papi/contracts/marketMaker.json +1470 -0
  5. package/.papi/contracts/merchantMining.json +1750 -0
  6. package/.papi/contracts/miningPool.json +1019 -0
  7. package/.papi/contracts/nodeReward.json +1214 -0
  8. package/.papi/contracts/usdt.json +1036 -0
  9. package/.papi/descriptors/.gitignore +3 -0
  10. package/.papi/descriptors/package.json +24 -0
  11. package/.papi/metadata/d9.scale +0 -0
  12. package/.papi/polkadot-api.json +22 -0
  13. package/assets/ABIs/burn-manager.json +1300 -0
  14. package/assets/ABIs/burn-mining.json +1385 -0
  15. package/assets/ABIs/cross-chain-transfer.json +1693 -0
  16. package/assets/ABIs/market-maker.json +1470 -0
  17. package/assets/ABIs/merchant-mining.json +1750 -0
  18. package/assets/ABIs/mining-pool.json +1019 -0
  19. package/assets/ABIs/node-reward.json +1214 -0
  20. package/assets/ABIs/usdt.json +1036 -0
  21. package/package.json +51 -0
  22. package/scripts/papi-add-ink.ts +104 -0
  23. package/src/client.ts +68 -0
  24. package/src/index.ts +17 -0
  25. package/src/wallet/account.ts +57 -0
  26. package/src/wallet/hex.ts +30 -0
  27. package/src/wallet/index.ts +6 -0
  28. package/src/wallet/mnemonic.ts +19 -0
  29. package/src/wallet/signer.ts +9 -0
  30. package/src/wallet/sr25519.ts +42 -0
  31. package/src/wallet/ss58.ts +14 -0
  32. package/test/client.test.ts +15 -0
  33. package/test/descriptors.test.ts +32 -0
  34. package/test/wallet.test.ts +65 -0
  35. package/tsconfig.json +13 -0
  36. package/tsdown.config.ts +13 -0
@@ -0,0 +1,1750 @@
1
+ {
2
+ "source": {
3
+ "hash": "0x1605acf16a5d67473a30bde3624e103393a3ffaf9310f3abfcdb6ef1d1370ee4",
4
+ "language": "ink! 4.3.0",
5
+ "compiler": "rustc 1.76.0",
6
+ "build_info": {
7
+ "build_mode": "Release",
8
+ "cargo_contract_version": "3.2.0",
9
+ "rust_toolchain": "stable-aarch64-apple-darwin",
10
+ "wasm_opt_settings": {
11
+ "keep_debug_symbols": false,
12
+ "optimization_passes": "Z"
13
+ }
14
+ }
15
+ },
16
+ "contract": {
17
+ "name": "d9-merchant-mining",
18
+ "version": "0.1.0",
19
+ "authors": [
20
+ "D9Dev"
21
+ ]
22
+ },
23
+ "spec": {
24
+ "constructors": [
25
+ {
26
+ "args": [
27
+ {
28
+ "label": "amm_contract",
29
+ "type": {
30
+ "displayName": [
31
+ "AccountId"
32
+ ],
33
+ "type": 2
34
+ }
35
+ },
36
+ {
37
+ "label": "mining_pool",
38
+ "type": {
39
+ "displayName": [
40
+ "AccountId"
41
+ ],
42
+ "type": 2
43
+ }
44
+ },
45
+ {
46
+ "label": "usdt_contract",
47
+ "type": {
48
+ "displayName": [
49
+ "AccountId"
50
+ ],
51
+ "type": 2
52
+ }
53
+ }
54
+ ],
55
+ "default": false,
56
+ "docs": [
57
+ "Constructor that initializes the `bool` value to the given `init_value`."
58
+ ],
59
+ "label": "new",
60
+ "payable": false,
61
+ "returnType": {
62
+ "displayName": [
63
+ "ink_primitives",
64
+ "ConstructorResult"
65
+ ],
66
+ "type": 5
67
+ },
68
+ "selector": "0x9bae9d5e"
69
+ }
70
+ ],
71
+ "docs": [],
72
+ "environment": {
73
+ "accountId": {
74
+ "displayName": [
75
+ "AccountId"
76
+ ],
77
+ "type": 2
78
+ },
79
+ "balance": {
80
+ "displayName": [
81
+ "Balance"
82
+ ],
83
+ "type": 1
84
+ },
85
+ "blockNumber": {
86
+ "displayName": [
87
+ "BlockNumber"
88
+ ],
89
+ "type": 25
90
+ },
91
+ "chainExtension": {
92
+ "displayName": [
93
+ "ChainExtension"
94
+ ],
95
+ "type": 26
96
+ },
97
+ "hash": {
98
+ "displayName": [
99
+ "Hash"
100
+ ],
101
+ "type": 24
102
+ },
103
+ "maxEventTopics": 4,
104
+ "timestamp": {
105
+ "displayName": [
106
+ "Timestamp"
107
+ ],
108
+ "type": 0
109
+ }
110
+ },
111
+ "events": [
112
+ {
113
+ "args": [
114
+ {
115
+ "docs": [],
116
+ "indexed": true,
117
+ "label": "account_id",
118
+ "type": {
119
+ "displayName": [
120
+ "AccountId"
121
+ ],
122
+ "type": 2
123
+ }
124
+ },
125
+ {
126
+ "docs": [],
127
+ "indexed": true,
128
+ "label": "usdt",
129
+ "type": {
130
+ "displayName": [
131
+ "Balance"
132
+ ],
133
+ "type": 1
134
+ }
135
+ },
136
+ {
137
+ "docs": [],
138
+ "indexed": true,
139
+ "label": "expiry",
140
+ "type": {
141
+ "displayName": [
142
+ "Timestamp"
143
+ ],
144
+ "type": 0
145
+ }
146
+ }
147
+ ],
148
+ "docs": [],
149
+ "label": "SubscriptionExtended"
150
+ },
151
+ {
152
+ "args": [
153
+ {
154
+ "docs": [],
155
+ "indexed": true,
156
+ "label": "account_id",
157
+ "type": {
158
+ "displayName": [
159
+ "AccountId"
160
+ ],
161
+ "type": 2
162
+ }
163
+ },
164
+ {
165
+ "docs": [],
166
+ "indexed": true,
167
+ "label": "redeemed_d9",
168
+ "type": {
169
+ "displayName": [
170
+ "Balance"
171
+ ],
172
+ "type": 1
173
+ }
174
+ }
175
+ ],
176
+ "docs": [],
177
+ "label": "D9Redeemed"
178
+ },
179
+ {
180
+ "args": [
181
+ {
182
+ "docs": [],
183
+ "indexed": true,
184
+ "label": "merchant",
185
+ "type": {
186
+ "displayName": [
187
+ "GreenPointsCreated"
188
+ ],
189
+ "type": 23
190
+ }
191
+ },
192
+ {
193
+ "docs": [],
194
+ "indexed": true,
195
+ "label": "consumer",
196
+ "type": {
197
+ "displayName": [
198
+ "GreenPointsCreated"
199
+ ],
200
+ "type": 23
201
+ }
202
+ }
203
+ ],
204
+ "docs": [],
205
+ "label": "GreenPointsTransaction"
206
+ },
207
+ {
208
+ "args": [
209
+ {
210
+ "docs": [],
211
+ "indexed": true,
212
+ "label": "merchant",
213
+ "type": {
214
+ "displayName": [
215
+ "AccountId"
216
+ ],
217
+ "type": 2
218
+ }
219
+ },
220
+ {
221
+ "docs": [],
222
+ "indexed": true,
223
+ "label": "consumer",
224
+ "type": {
225
+ "displayName": [
226
+ "AccountId"
227
+ ],
228
+ "type": 2
229
+ }
230
+ },
231
+ {
232
+ "docs": [],
233
+ "indexed": true,
234
+ "label": "amount",
235
+ "type": {
236
+ "displayName": [
237
+ "Balance"
238
+ ],
239
+ "type": 1
240
+ }
241
+ }
242
+ ],
243
+ "docs": [],
244
+ "label": "D9MerchantPaymentSent"
245
+ },
246
+ {
247
+ "args": [
248
+ {
249
+ "docs": [],
250
+ "indexed": true,
251
+ "label": "merchant",
252
+ "type": {
253
+ "displayName": [
254
+ "AccountId"
255
+ ],
256
+ "type": 2
257
+ }
258
+ },
259
+ {
260
+ "docs": [],
261
+ "indexed": true,
262
+ "label": "consumer",
263
+ "type": {
264
+ "displayName": [
265
+ "AccountId"
266
+ ],
267
+ "type": 2
268
+ }
269
+ },
270
+ {
271
+ "docs": [],
272
+ "indexed": true,
273
+ "label": "amount",
274
+ "type": {
275
+ "displayName": [
276
+ "Balance"
277
+ ],
278
+ "type": 1
279
+ }
280
+ }
281
+ ],
282
+ "docs": [],
283
+ "label": "USDTMerchantPaymentSent"
284
+ },
285
+ {
286
+ "args": [
287
+ {
288
+ "docs": [],
289
+ "indexed": true,
290
+ "label": "consumer",
291
+ "type": {
292
+ "displayName": [
293
+ "AccountId"
294
+ ],
295
+ "type": 2
296
+ }
297
+ },
298
+ {
299
+ "docs": [],
300
+ "indexed": true,
301
+ "label": "merchant",
302
+ "type": {
303
+ "displayName": [
304
+ "AccountId"
305
+ ],
306
+ "type": 2
307
+ }
308
+ },
309
+ {
310
+ "docs": [],
311
+ "indexed": true,
312
+ "label": "amount",
313
+ "type": {
314
+ "displayName": [
315
+ "Balance"
316
+ ],
317
+ "type": 1
318
+ }
319
+ }
320
+ ],
321
+ "docs": [],
322
+ "label": "GivePointsUSDT"
323
+ }
324
+ ],
325
+ "lang_error": {
326
+ "displayName": [
327
+ "ink",
328
+ "LangError"
329
+ ],
330
+ "type": 7
331
+ },
332
+ "messages": [
333
+ {
334
+ "args": [
335
+ {
336
+ "label": "usdt_amount",
337
+ "type": {
338
+ "displayName": [
339
+ "Balance"
340
+ ],
341
+ "type": 1
342
+ }
343
+ }
344
+ ],
345
+ "default": false,
346
+ "docs": [
347
+ " create merchant account subscription"
348
+ ],
349
+ "label": "subscribe",
350
+ "mutates": true,
351
+ "payable": false,
352
+ "returnType": {
353
+ "displayName": [
354
+ "ink",
355
+ "MessageResult"
356
+ ],
357
+ "type": 8
358
+ },
359
+ "selector": "0xfb968a8f"
360
+ },
361
+ {
362
+ "args": [],
363
+ "default": false,
364
+ "docs": [
365
+ "withdraw a certain amount of d9 that has been converted into red points"
366
+ ],
367
+ "label": "redeem_d9",
368
+ "mutates": true,
369
+ "payable": false,
370
+ "returnType": {
371
+ "displayName": [
372
+ "ink",
373
+ "MessageResult"
374
+ ],
375
+ "type": 11
376
+ },
377
+ "selector": "0x47082626"
378
+ },
379
+ {
380
+ "args": [
381
+ {
382
+ "label": "consumer_id",
383
+ "type": {
384
+ "displayName": [
385
+ "AccountId"
386
+ ],
387
+ "type": 2
388
+ }
389
+ }
390
+ ],
391
+ "default": false,
392
+ "docs": [],
393
+ "label": "give_green_points_d9",
394
+ "mutates": true,
395
+ "payable": true,
396
+ "returnType": {
397
+ "displayName": [
398
+ "ink",
399
+ "MessageResult"
400
+ ],
401
+ "type": 13
402
+ },
403
+ "selector": "0x88b8f067"
404
+ },
405
+ {
406
+ "args": [
407
+ {
408
+ "label": "consumer_id",
409
+ "type": {
410
+ "displayName": [
411
+ "AccountId"
412
+ ],
413
+ "type": 2
414
+ }
415
+ },
416
+ {
417
+ "label": "usdt_payment",
418
+ "type": {
419
+ "displayName": [
420
+ "Balance"
421
+ ],
422
+ "type": 1
423
+ }
424
+ }
425
+ ],
426
+ "default": false,
427
+ "docs": [],
428
+ "label": "give_green_points_usdt",
429
+ "mutates": true,
430
+ "payable": false,
431
+ "returnType": {
432
+ "displayName": [
433
+ "ink",
434
+ "MessageResult"
435
+ ],
436
+ "type": 13
437
+ },
438
+ "selector": "0xf52b0ab9"
439
+ },
440
+ {
441
+ "args": [
442
+ {
443
+ "label": "merchant_id",
444
+ "type": {
445
+ "displayName": [
446
+ "AccountId"
447
+ ],
448
+ "type": 2
449
+ }
450
+ },
451
+ {
452
+ "label": "usdt_amount",
453
+ "type": {
454
+ "displayName": [
455
+ "Balance"
456
+ ],
457
+ "type": 1
458
+ }
459
+ }
460
+ ],
461
+ "default": false,
462
+ "docs": [],
463
+ "label": "send_usdt_payment_to_merchant",
464
+ "mutates": true,
465
+ "payable": true,
466
+ "returnType": {
467
+ "displayName": [
468
+ "ink",
469
+ "MessageResult"
470
+ ],
471
+ "type": 13
472
+ },
473
+ "selector": "0xa69d4305"
474
+ },
475
+ {
476
+ "args": [
477
+ {
478
+ "label": "merchant_id",
479
+ "type": {
480
+ "displayName": [
481
+ "AccountId"
482
+ ],
483
+ "type": 2
484
+ }
485
+ }
486
+ ],
487
+ "default": false,
488
+ "docs": [
489
+ " a customer pays a merchant using d9"
490
+ ],
491
+ "label": "send_d9_payment_to_merchant",
492
+ "mutates": true,
493
+ "payable": true,
494
+ "returnType": {
495
+ "displayName": [
496
+ "ink",
497
+ "MessageResult"
498
+ ],
499
+ "type": 13
500
+ },
501
+ "selector": "0xb0e55803"
502
+ },
503
+ {
504
+ "args": [
505
+ {
506
+ "label": "account_id",
507
+ "type": {
508
+ "displayName": [
509
+ "AccountId"
510
+ ],
511
+ "type": 2
512
+ }
513
+ }
514
+ ],
515
+ "default": false,
516
+ "docs": [],
517
+ "label": "get_expiry",
518
+ "mutates": false,
519
+ "payable": false,
520
+ "returnType": {
521
+ "displayName": [
522
+ "ink",
523
+ "MessageResult"
524
+ ],
525
+ "type": 8
526
+ },
527
+ "selector": "0xfe38aab5"
528
+ },
529
+ {
530
+ "args": [
531
+ {
532
+ "label": "account_id",
533
+ "type": {
534
+ "displayName": [
535
+ "AccountId"
536
+ ],
537
+ "type": 2
538
+ }
539
+ }
540
+ ],
541
+ "default": false,
542
+ "docs": [
543
+ " get account details"
544
+ ],
545
+ "label": "get_account",
546
+ "mutates": false,
547
+ "payable": false,
548
+ "returnType": {
549
+ "displayName": [
550
+ "ink",
551
+ "MessageResult"
552
+ ],
553
+ "type": 16
554
+ },
555
+ "selector": "0xd0f48683"
556
+ },
557
+ {
558
+ "args": [
559
+ {
560
+ "label": "new_amm_contract",
561
+ "type": {
562
+ "displayName": [
563
+ "AccountId"
564
+ ],
565
+ "type": 2
566
+ }
567
+ }
568
+ ],
569
+ "default": false,
570
+ "docs": [],
571
+ "label": "change_amm_contract",
572
+ "mutates": true,
573
+ "payable": false,
574
+ "returnType": {
575
+ "displayName": [
576
+ "ink",
577
+ "MessageResult"
578
+ ],
579
+ "type": 21
580
+ },
581
+ "selector": "0x0db11b82"
582
+ },
583
+ {
584
+ "args": [
585
+ {
586
+ "label": "new_mining_pool",
587
+ "type": {
588
+ "displayName": [
589
+ "AccountId"
590
+ ],
591
+ "type": 2
592
+ }
593
+ }
594
+ ],
595
+ "default": false,
596
+ "docs": [],
597
+ "label": "change_mining_pool",
598
+ "mutates": true,
599
+ "payable": false,
600
+ "returnType": {
601
+ "displayName": [
602
+ "ink",
603
+ "MessageResult"
604
+ ],
605
+ "type": 21
606
+ },
607
+ "selector": "0xafda72a6"
608
+ },
609
+ {
610
+ "args": [
611
+ {
612
+ "label": "code_hash",
613
+ "type": {
614
+ "displayName": [],
615
+ "type": 3
616
+ }
617
+ }
618
+ ],
619
+ "default": false,
620
+ "docs": [
621
+ " Modifies the code which is used to execute calls to this contract address (`AccountId`).",
622
+ "",
623
+ " We use this to upgrade the contract logic. We don't do any authorization here, any caller",
624
+ " can execute this method. In a production contract you would do some authorization here."
625
+ ],
626
+ "label": "set_code",
627
+ "mutates": true,
628
+ "payable": false,
629
+ "returnType": {
630
+ "displayName": [
631
+ "ink",
632
+ "MessageResult"
633
+ ],
634
+ "type": 5
635
+ },
636
+ "selector": "0x694fb50f"
637
+ },
638
+ {
639
+ "args": [
640
+ {
641
+ "label": "new_admin",
642
+ "type": {
643
+ "displayName": [
644
+ "AccountId"
645
+ ],
646
+ "type": 2
647
+ }
648
+ }
649
+ ],
650
+ "default": false,
651
+ "docs": [],
652
+ "label": "change_admin",
653
+ "mutates": true,
654
+ "payable": false,
655
+ "returnType": {
656
+ "displayName": [
657
+ "ink",
658
+ "MessageResult"
659
+ ],
660
+ "type": 21
661
+ },
662
+ "selector": "0x61ae97d7"
663
+ }
664
+ ]
665
+ },
666
+ "storage": {
667
+ "root": {
668
+ "layout": {
669
+ "struct": {
670
+ "fields": [
671
+ {
672
+ "layout": {
673
+ "root": {
674
+ "layout": {
675
+ "leaf": {
676
+ "key": "0x368a973a",
677
+ "ty": 0
678
+ }
679
+ },
680
+ "root_key": "0x368a973a"
681
+ }
682
+ },
683
+ "name": "merchant_expiry"
684
+ },
685
+ {
686
+ "layout": {
687
+ "root": {
688
+ "layout": {
689
+ "struct": {
690
+ "fields": [
691
+ {
692
+ "layout": {
693
+ "leaf": {
694
+ "key": "0xfe031739",
695
+ "ty": 1
696
+ }
697
+ },
698
+ "name": "green_points"
699
+ },
700
+ {
701
+ "layout": {
702
+ "struct": {
703
+ "fields": [
704
+ {
705
+ "layout": {
706
+ "leaf": {
707
+ "key": "0xfe031739",
708
+ "ty": 1
709
+ }
710
+ },
711
+ "name": "0"
712
+ },
713
+ {
714
+ "layout": {
715
+ "leaf": {
716
+ "key": "0xfe031739",
717
+ "ty": 1
718
+ }
719
+ },
720
+ "name": "1"
721
+ }
722
+ ],
723
+ "name": "(A, B)"
724
+ }
725
+ },
726
+ "name": "relationship_factors"
727
+ },
728
+ {
729
+ "layout": {
730
+ "enum": {
731
+ "dispatchKey": "0xfe031739",
732
+ "name": "Option",
733
+ "variants": {
734
+ "0": {
735
+ "fields": [],
736
+ "name": "None"
737
+ },
738
+ "1": {
739
+ "fields": [
740
+ {
741
+ "layout": {
742
+ "leaf": {
743
+ "key": "0xfe031739",
744
+ "ty": 0
745
+ }
746
+ },
747
+ "name": "0"
748
+ }
749
+ ],
750
+ "name": "Some"
751
+ }
752
+ }
753
+ }
754
+ },
755
+ "name": "last_conversion"
756
+ },
757
+ {
758
+ "layout": {
759
+ "leaf": {
760
+ "key": "0xfe031739",
761
+ "ty": 1
762
+ }
763
+ },
764
+ "name": "redeemed_usdt"
765
+ },
766
+ {
767
+ "layout": {
768
+ "leaf": {
769
+ "key": "0xfe031739",
770
+ "ty": 1
771
+ }
772
+ },
773
+ "name": "redeemed_d9"
774
+ },
775
+ {
776
+ "layout": {
777
+ "leaf": {
778
+ "key": "0xfe031739",
779
+ "ty": 0
780
+ }
781
+ },
782
+ "name": "created_at"
783
+ }
784
+ ],
785
+ "name": "Account"
786
+ }
787
+ },
788
+ "root_key": "0xfe031739"
789
+ }
790
+ },
791
+ "name": "accounts"
792
+ },
793
+ {
794
+ "layout": {
795
+ "leaf": {
796
+ "key": "0x00000000",
797
+ "ty": 1
798
+ }
799
+ },
800
+ "name": "subscription_fee"
801
+ },
802
+ {
803
+ "layout": {
804
+ "leaf": {
805
+ "key": "0x00000000",
806
+ "ty": 2
807
+ }
808
+ },
809
+ "name": "usdt_contract"
810
+ },
811
+ {
812
+ "layout": {
813
+ "leaf": {
814
+ "key": "0x00000000",
815
+ "ty": 2
816
+ }
817
+ },
818
+ "name": "amm_contract"
819
+ },
820
+ {
821
+ "layout": {
822
+ "leaf": {
823
+ "key": "0x00000000",
824
+ "ty": 2
825
+ }
826
+ },
827
+ "name": "mining_pool"
828
+ },
829
+ {
830
+ "layout": {
831
+ "leaf": {
832
+ "key": "0x00000000",
833
+ "ty": 0
834
+ }
835
+ },
836
+ "name": "milliseconds_day"
837
+ },
838
+ {
839
+ "layout": {
840
+ "leaf": {
841
+ "key": "0x00000000",
842
+ "ty": 2
843
+ }
844
+ },
845
+ "name": "admin"
846
+ }
847
+ ],
848
+ "name": "D9MerchantMining"
849
+ }
850
+ },
851
+ "root_key": "0x00000000"
852
+ }
853
+ },
854
+ "types": [
855
+ {
856
+ "id": 0,
857
+ "type": {
858
+ "def": {
859
+ "primitive": "u64"
860
+ }
861
+ }
862
+ },
863
+ {
864
+ "id": 1,
865
+ "type": {
866
+ "def": {
867
+ "primitive": "u128"
868
+ }
869
+ }
870
+ },
871
+ {
872
+ "id": 2,
873
+ "type": {
874
+ "def": {
875
+ "composite": {
876
+ "fields": [
877
+ {
878
+ "type": 3,
879
+ "typeName": "[u8; 32]"
880
+ }
881
+ ]
882
+ }
883
+ },
884
+ "path": [
885
+ "ink_primitives",
886
+ "types",
887
+ "AccountId"
888
+ ]
889
+ }
890
+ },
891
+ {
892
+ "id": 3,
893
+ "type": {
894
+ "def": {
895
+ "array": {
896
+ "len": 32,
897
+ "type": 4
898
+ }
899
+ }
900
+ }
901
+ },
902
+ {
903
+ "id": 4,
904
+ "type": {
905
+ "def": {
906
+ "primitive": "u8"
907
+ }
908
+ }
909
+ },
910
+ {
911
+ "id": 5,
912
+ "type": {
913
+ "def": {
914
+ "variant": {
915
+ "variants": [
916
+ {
917
+ "fields": [
918
+ {
919
+ "type": 6
920
+ }
921
+ ],
922
+ "index": 0,
923
+ "name": "Ok"
924
+ },
925
+ {
926
+ "fields": [
927
+ {
928
+ "type": 7
929
+ }
930
+ ],
931
+ "index": 1,
932
+ "name": "Err"
933
+ }
934
+ ]
935
+ }
936
+ },
937
+ "params": [
938
+ {
939
+ "name": "T",
940
+ "type": 6
941
+ },
942
+ {
943
+ "name": "E",
944
+ "type": 7
945
+ }
946
+ ],
947
+ "path": [
948
+ "Result"
949
+ ]
950
+ }
951
+ },
952
+ {
953
+ "id": 6,
954
+ "type": {
955
+ "def": {
956
+ "tuple": []
957
+ }
958
+ }
959
+ },
960
+ {
961
+ "id": 7,
962
+ "type": {
963
+ "def": {
964
+ "variant": {
965
+ "variants": [
966
+ {
967
+ "index": 1,
968
+ "name": "CouldNotReadInput"
969
+ }
970
+ ]
971
+ }
972
+ },
973
+ "path": [
974
+ "ink_primitives",
975
+ "LangError"
976
+ ]
977
+ }
978
+ },
979
+ {
980
+ "id": 8,
981
+ "type": {
982
+ "def": {
983
+ "variant": {
984
+ "variants": [
985
+ {
986
+ "fields": [
987
+ {
988
+ "type": 9
989
+ }
990
+ ],
991
+ "index": 0,
992
+ "name": "Ok"
993
+ },
994
+ {
995
+ "fields": [
996
+ {
997
+ "type": 7
998
+ }
999
+ ],
1000
+ "index": 1,
1001
+ "name": "Err"
1002
+ }
1003
+ ]
1004
+ }
1005
+ },
1006
+ "params": [
1007
+ {
1008
+ "name": "T",
1009
+ "type": 9
1010
+ },
1011
+ {
1012
+ "name": "E",
1013
+ "type": 7
1014
+ }
1015
+ ],
1016
+ "path": [
1017
+ "Result"
1018
+ ]
1019
+ }
1020
+ },
1021
+ {
1022
+ "id": 9,
1023
+ "type": {
1024
+ "def": {
1025
+ "variant": {
1026
+ "variants": [
1027
+ {
1028
+ "fields": [
1029
+ {
1030
+ "type": 0
1031
+ }
1032
+ ],
1033
+ "index": 0,
1034
+ "name": "Ok"
1035
+ },
1036
+ {
1037
+ "fields": [
1038
+ {
1039
+ "type": 10
1040
+ }
1041
+ ],
1042
+ "index": 1,
1043
+ "name": "Err"
1044
+ }
1045
+ ]
1046
+ }
1047
+ },
1048
+ "params": [
1049
+ {
1050
+ "name": "T",
1051
+ "type": 0
1052
+ },
1053
+ {
1054
+ "name": "E",
1055
+ "type": 10
1056
+ }
1057
+ ],
1058
+ "path": [
1059
+ "Result"
1060
+ ]
1061
+ }
1062
+ },
1063
+ {
1064
+ "id": 10,
1065
+ "type": {
1066
+ "def": {
1067
+ "variant": {
1068
+ "variants": [
1069
+ {
1070
+ "index": 0,
1071
+ "name": "InsufficientPayment"
1072
+ },
1073
+ {
1074
+ "index": 1,
1075
+ "name": "InsufficientAllowance"
1076
+ },
1077
+ {
1078
+ "index": 2,
1079
+ "name": "NoMerchantAccountFound"
1080
+ },
1081
+ {
1082
+ "index": 3,
1083
+ "name": "MerchantAccountExpired"
1084
+ },
1085
+ {
1086
+ "index": 4,
1087
+ "name": "NoAccountFound"
1088
+ },
1089
+ {
1090
+ "index": 5,
1091
+ "name": "NothingToRedeem"
1092
+ },
1093
+ {
1094
+ "index": 6,
1095
+ "name": "TransferringToMainContract"
1096
+ },
1097
+ {
1098
+ "index": 7,
1099
+ "name": "TransferringToUSDTToMerchant"
1100
+ },
1101
+ {
1102
+ "index": 8,
1103
+ "name": "UserUSDTBalanceInsufficient"
1104
+ },
1105
+ {
1106
+ "index": 9,
1107
+ "name": "D9TransferFailed"
1108
+ },
1109
+ {
1110
+ "index": 10,
1111
+ "name": "USDTTransferFailed"
1112
+ },
1113
+ {
1114
+ "index": 11,
1115
+ "name": "OnlyAdmin"
1116
+ },
1117
+ {
1118
+ "index": 12,
1119
+ "name": "GrantingAllowanceFailed"
1120
+ },
1121
+ {
1122
+ "index": 13,
1123
+ "name": "AMMConversionFailed"
1124
+ },
1125
+ {
1126
+ "index": 14,
1127
+ "name": "ReceivingUSDTFromUser"
1128
+ },
1129
+ {
1130
+ "index": 15,
1131
+ "name": "ConvertingToD9"
1132
+ },
1133
+ {
1134
+ "index": 16,
1135
+ "name": "SendUSDTToMerchant"
1136
+ },
1137
+ {
1138
+ "index": 17,
1139
+ "name": "SendingD9ToMiningPool"
1140
+ },
1141
+ {
1142
+ "index": 18,
1143
+ "name": "SendingUSDTToAMM"
1144
+ },
1145
+ {
1146
+ "index": 19,
1147
+ "name": "GettingUSDTFromAMM"
1148
+ },
1149
+ {
1150
+ "index": 20,
1151
+ "name": "RedeemD9TransferFailed"
1152
+ },
1153
+ {
1154
+ "index": 21,
1155
+ "name": "SomeEnvironmentError"
1156
+ },
1157
+ {
1158
+ "index": 22,
1159
+ "name": "CalledContractTrapped"
1160
+ },
1161
+ {
1162
+ "index": 23,
1163
+ "name": "CalledContractReverted"
1164
+ },
1165
+ {
1166
+ "index": 24,
1167
+ "name": "NotCallable"
1168
+ },
1169
+ {
1170
+ "index": 25,
1171
+ "name": "SomeDecodeError"
1172
+ },
1173
+ {
1174
+ "index": 26,
1175
+ "name": "SomeOffChainError"
1176
+ },
1177
+ {
1178
+ "index": 27,
1179
+ "name": "CalleeTrapped"
1180
+ },
1181
+ {
1182
+ "index": 28,
1183
+ "name": "CalleeReverted"
1184
+ },
1185
+ {
1186
+ "index": 29,
1187
+ "name": "KeyNotFound"
1188
+ },
1189
+ {
1190
+ "index": 30,
1191
+ "name": "_BelowSubsistenceThreshold"
1192
+ },
1193
+ {
1194
+ "index": 31,
1195
+ "name": "TransferFailed"
1196
+ },
1197
+ {
1198
+ "index": 32,
1199
+ "name": "_EndowmentTooLow"
1200
+ },
1201
+ {
1202
+ "index": 33,
1203
+ "name": "CodeNotFound"
1204
+ },
1205
+ {
1206
+ "index": 34,
1207
+ "name": "Unknown"
1208
+ },
1209
+ {
1210
+ "index": 35,
1211
+ "name": "LoggingDisabled"
1212
+ },
1213
+ {
1214
+ "index": 36,
1215
+ "name": "CallRuntimeFailed"
1216
+ },
1217
+ {
1218
+ "index": 37,
1219
+ "name": "EcdsaRecoveryFailed"
1220
+ },
1221
+ {
1222
+ "index": 38,
1223
+ "name": "ErrorGettingEstimate"
1224
+ },
1225
+ {
1226
+ "index": 39,
1227
+ "name": "CrossContractCallErrorGettingEstimate"
1228
+ }
1229
+ ]
1230
+ }
1231
+ },
1232
+ "path": [
1233
+ "d9_merchant_mining",
1234
+ "d9_merchant_mining",
1235
+ "Error"
1236
+ ]
1237
+ }
1238
+ },
1239
+ {
1240
+ "id": 11,
1241
+ "type": {
1242
+ "def": {
1243
+ "variant": {
1244
+ "variants": [
1245
+ {
1246
+ "fields": [
1247
+ {
1248
+ "type": 12
1249
+ }
1250
+ ],
1251
+ "index": 0,
1252
+ "name": "Ok"
1253
+ },
1254
+ {
1255
+ "fields": [
1256
+ {
1257
+ "type": 7
1258
+ }
1259
+ ],
1260
+ "index": 1,
1261
+ "name": "Err"
1262
+ }
1263
+ ]
1264
+ }
1265
+ },
1266
+ "params": [
1267
+ {
1268
+ "name": "T",
1269
+ "type": 12
1270
+ },
1271
+ {
1272
+ "name": "E",
1273
+ "type": 7
1274
+ }
1275
+ ],
1276
+ "path": [
1277
+ "Result"
1278
+ ]
1279
+ }
1280
+ },
1281
+ {
1282
+ "id": 12,
1283
+ "type": {
1284
+ "def": {
1285
+ "variant": {
1286
+ "variants": [
1287
+ {
1288
+ "fields": [
1289
+ {
1290
+ "type": 1
1291
+ }
1292
+ ],
1293
+ "index": 0,
1294
+ "name": "Ok"
1295
+ },
1296
+ {
1297
+ "fields": [
1298
+ {
1299
+ "type": 10
1300
+ }
1301
+ ],
1302
+ "index": 1,
1303
+ "name": "Err"
1304
+ }
1305
+ ]
1306
+ }
1307
+ },
1308
+ "params": [
1309
+ {
1310
+ "name": "T",
1311
+ "type": 1
1312
+ },
1313
+ {
1314
+ "name": "E",
1315
+ "type": 10
1316
+ }
1317
+ ],
1318
+ "path": [
1319
+ "Result"
1320
+ ]
1321
+ }
1322
+ },
1323
+ {
1324
+ "id": 13,
1325
+ "type": {
1326
+ "def": {
1327
+ "variant": {
1328
+ "variants": [
1329
+ {
1330
+ "fields": [
1331
+ {
1332
+ "type": 14
1333
+ }
1334
+ ],
1335
+ "index": 0,
1336
+ "name": "Ok"
1337
+ },
1338
+ {
1339
+ "fields": [
1340
+ {
1341
+ "type": 7
1342
+ }
1343
+ ],
1344
+ "index": 1,
1345
+ "name": "Err"
1346
+ }
1347
+ ]
1348
+ }
1349
+ },
1350
+ "params": [
1351
+ {
1352
+ "name": "T",
1353
+ "type": 14
1354
+ },
1355
+ {
1356
+ "name": "E",
1357
+ "type": 7
1358
+ }
1359
+ ],
1360
+ "path": [
1361
+ "Result"
1362
+ ]
1363
+ }
1364
+ },
1365
+ {
1366
+ "id": 14,
1367
+ "type": {
1368
+ "def": {
1369
+ "variant": {
1370
+ "variants": [
1371
+ {
1372
+ "fields": [
1373
+ {
1374
+ "type": 15
1375
+ }
1376
+ ],
1377
+ "index": 0,
1378
+ "name": "Ok"
1379
+ },
1380
+ {
1381
+ "fields": [
1382
+ {
1383
+ "type": 10
1384
+ }
1385
+ ],
1386
+ "index": 1,
1387
+ "name": "Err"
1388
+ }
1389
+ ]
1390
+ }
1391
+ },
1392
+ "params": [
1393
+ {
1394
+ "name": "T",
1395
+ "type": 15
1396
+ },
1397
+ {
1398
+ "name": "E",
1399
+ "type": 10
1400
+ }
1401
+ ],
1402
+ "path": [
1403
+ "Result"
1404
+ ]
1405
+ }
1406
+ },
1407
+ {
1408
+ "id": 15,
1409
+ "type": {
1410
+ "def": {
1411
+ "composite": {
1412
+ "fields": [
1413
+ {
1414
+ "name": "merchant",
1415
+ "type": 1,
1416
+ "typeName": "Balance"
1417
+ },
1418
+ {
1419
+ "name": "consumer",
1420
+ "type": 1,
1421
+ "typeName": "Balance"
1422
+ }
1423
+ ]
1424
+ }
1425
+ },
1426
+ "path": [
1427
+ "d9_merchant_mining",
1428
+ "d9_merchant_mining",
1429
+ "GreenPointsResult"
1430
+ ]
1431
+ }
1432
+ },
1433
+ {
1434
+ "id": 16,
1435
+ "type": {
1436
+ "def": {
1437
+ "variant": {
1438
+ "variants": [
1439
+ {
1440
+ "fields": [
1441
+ {
1442
+ "type": 17
1443
+ }
1444
+ ],
1445
+ "index": 0,
1446
+ "name": "Ok"
1447
+ },
1448
+ {
1449
+ "fields": [
1450
+ {
1451
+ "type": 7
1452
+ }
1453
+ ],
1454
+ "index": 1,
1455
+ "name": "Err"
1456
+ }
1457
+ ]
1458
+ }
1459
+ },
1460
+ "params": [
1461
+ {
1462
+ "name": "T",
1463
+ "type": 17
1464
+ },
1465
+ {
1466
+ "name": "E",
1467
+ "type": 7
1468
+ }
1469
+ ],
1470
+ "path": [
1471
+ "Result"
1472
+ ]
1473
+ }
1474
+ },
1475
+ {
1476
+ "id": 17,
1477
+ "type": {
1478
+ "def": {
1479
+ "variant": {
1480
+ "variants": [
1481
+ {
1482
+ "index": 0,
1483
+ "name": "None"
1484
+ },
1485
+ {
1486
+ "fields": [
1487
+ {
1488
+ "type": 18
1489
+ }
1490
+ ],
1491
+ "index": 1,
1492
+ "name": "Some"
1493
+ }
1494
+ ]
1495
+ }
1496
+ },
1497
+ "params": [
1498
+ {
1499
+ "name": "T",
1500
+ "type": 18
1501
+ }
1502
+ ],
1503
+ "path": [
1504
+ "Option"
1505
+ ]
1506
+ }
1507
+ },
1508
+ {
1509
+ "id": 18,
1510
+ "type": {
1511
+ "def": {
1512
+ "composite": {
1513
+ "fields": [
1514
+ {
1515
+ "name": "green_points",
1516
+ "type": 1,
1517
+ "typeName": "Balance"
1518
+ },
1519
+ {
1520
+ "name": "relationship_factors",
1521
+ "type": 19,
1522
+ "typeName": "(Balance, Balance)"
1523
+ },
1524
+ {
1525
+ "name": "last_conversion",
1526
+ "type": 20,
1527
+ "typeName": "Option<Timestamp>"
1528
+ },
1529
+ {
1530
+ "name": "redeemed_usdt",
1531
+ "type": 1,
1532
+ "typeName": "Balance"
1533
+ },
1534
+ {
1535
+ "name": "redeemed_d9",
1536
+ "type": 1,
1537
+ "typeName": "Balance"
1538
+ },
1539
+ {
1540
+ "name": "created_at",
1541
+ "type": 0,
1542
+ "typeName": "Timestamp"
1543
+ }
1544
+ ]
1545
+ }
1546
+ },
1547
+ "path": [
1548
+ "d9_merchant_mining",
1549
+ "d9_merchant_mining",
1550
+ "Account"
1551
+ ]
1552
+ }
1553
+ },
1554
+ {
1555
+ "id": 19,
1556
+ "type": {
1557
+ "def": {
1558
+ "tuple": [
1559
+ 1,
1560
+ 1
1561
+ ]
1562
+ }
1563
+ }
1564
+ },
1565
+ {
1566
+ "id": 20,
1567
+ "type": {
1568
+ "def": {
1569
+ "variant": {
1570
+ "variants": [
1571
+ {
1572
+ "index": 0,
1573
+ "name": "None"
1574
+ },
1575
+ {
1576
+ "fields": [
1577
+ {
1578
+ "type": 0
1579
+ }
1580
+ ],
1581
+ "index": 1,
1582
+ "name": "Some"
1583
+ }
1584
+ ]
1585
+ }
1586
+ },
1587
+ "params": [
1588
+ {
1589
+ "name": "T",
1590
+ "type": 0
1591
+ }
1592
+ ],
1593
+ "path": [
1594
+ "Option"
1595
+ ]
1596
+ }
1597
+ },
1598
+ {
1599
+ "id": 21,
1600
+ "type": {
1601
+ "def": {
1602
+ "variant": {
1603
+ "variants": [
1604
+ {
1605
+ "fields": [
1606
+ {
1607
+ "type": 22
1608
+ }
1609
+ ],
1610
+ "index": 0,
1611
+ "name": "Ok"
1612
+ },
1613
+ {
1614
+ "fields": [
1615
+ {
1616
+ "type": 7
1617
+ }
1618
+ ],
1619
+ "index": 1,
1620
+ "name": "Err"
1621
+ }
1622
+ ]
1623
+ }
1624
+ },
1625
+ "params": [
1626
+ {
1627
+ "name": "T",
1628
+ "type": 22
1629
+ },
1630
+ {
1631
+ "name": "E",
1632
+ "type": 7
1633
+ }
1634
+ ],
1635
+ "path": [
1636
+ "Result"
1637
+ ]
1638
+ }
1639
+ },
1640
+ {
1641
+ "id": 22,
1642
+ "type": {
1643
+ "def": {
1644
+ "variant": {
1645
+ "variants": [
1646
+ {
1647
+ "fields": [
1648
+ {
1649
+ "type": 6
1650
+ }
1651
+ ],
1652
+ "index": 0,
1653
+ "name": "Ok"
1654
+ },
1655
+ {
1656
+ "fields": [
1657
+ {
1658
+ "type": 10
1659
+ }
1660
+ ],
1661
+ "index": 1,
1662
+ "name": "Err"
1663
+ }
1664
+ ]
1665
+ }
1666
+ },
1667
+ "params": [
1668
+ {
1669
+ "name": "T",
1670
+ "type": 6
1671
+ },
1672
+ {
1673
+ "name": "E",
1674
+ "type": 10
1675
+ }
1676
+ ],
1677
+ "path": [
1678
+ "Result"
1679
+ ]
1680
+ }
1681
+ },
1682
+ {
1683
+ "id": 23,
1684
+ "type": {
1685
+ "def": {
1686
+ "composite": {
1687
+ "fields": [
1688
+ {
1689
+ "name": "account_id",
1690
+ "type": 2,
1691
+ "typeName": "AccountId"
1692
+ },
1693
+ {
1694
+ "name": "green_points",
1695
+ "type": 1,
1696
+ "typeName": "Balance"
1697
+ }
1698
+ ]
1699
+ }
1700
+ },
1701
+ "path": [
1702
+ "d9_merchant_mining",
1703
+ "d9_merchant_mining",
1704
+ "GreenPointsCreated"
1705
+ ]
1706
+ }
1707
+ },
1708
+ {
1709
+ "id": 24,
1710
+ "type": {
1711
+ "def": {
1712
+ "composite": {
1713
+ "fields": [
1714
+ {
1715
+ "type": 3,
1716
+ "typeName": "[u8; 32]"
1717
+ }
1718
+ ]
1719
+ }
1720
+ },
1721
+ "path": [
1722
+ "ink_primitives",
1723
+ "types",
1724
+ "Hash"
1725
+ ]
1726
+ }
1727
+ },
1728
+ {
1729
+ "id": 25,
1730
+ "type": {
1731
+ "def": {
1732
+ "primitive": "u32"
1733
+ }
1734
+ }
1735
+ },
1736
+ {
1737
+ "id": 26,
1738
+ "type": {
1739
+ "def": {
1740
+ "variant": {}
1741
+ },
1742
+ "path": [
1743
+ "d9_chain_extension",
1744
+ "D9ChainExtension"
1745
+ ]
1746
+ }
1747
+ }
1748
+ ],
1749
+ "version": "4"
1750
+ }