@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,1470 @@
1
+ {
2
+ "source": {
3
+ "hash": "0x6e0eaec1512315978981967d4f9d6072c6a3f50381289c69205961fa9509fff9",
4
+ "language": "ink! 4.3.0",
5
+ "compiler": "rustc 1.72.1",
6
+ "build_info": {
7
+ "build_mode": "Release",
8
+ "cargo_contract_version": "3.2.0",
9
+ "rust_toolchain": "stable-x86_64-apple-darwin",
10
+ "wasm_opt_settings": {
11
+ "keep_debug_symbols": false,
12
+ "optimization_passes": "Z"
13
+ }
14
+ }
15
+ },
16
+ "contract": {
17
+ "name": "market-maker",
18
+ "version": "0.1.0",
19
+ "authors": [
20
+ "D9Dev"
21
+ ]
22
+ },
23
+ "spec": {
24
+ "constructors": [
25
+ {
26
+ "args": [
27
+ {
28
+ "label": "usdt_contract",
29
+ "type": {
30
+ "displayName": [
31
+ "AccountId"
32
+ ],
33
+ "type": 0
34
+ }
35
+ },
36
+ {
37
+ "label": "fee_percent",
38
+ "type": {
39
+ "displayName": [
40
+ "u32"
41
+ ],
42
+ "type": 3
43
+ }
44
+ },
45
+ {
46
+ "label": "liquidity_tolerance_percent",
47
+ "type": {
48
+ "displayName": [
49
+ "u32"
50
+ ],
51
+ "type": 3
52
+ }
53
+ }
54
+ ],
55
+ "default": false,
56
+ "docs": [],
57
+ "label": "new",
58
+ "payable": false,
59
+ "returnType": {
60
+ "displayName": [
61
+ "ink_primitives",
62
+ "ConstructorResult"
63
+ ],
64
+ "type": 5
65
+ },
66
+ "selector": "0x9bae9d5e"
67
+ }
68
+ ],
69
+ "docs": [],
70
+ "environment": {
71
+ "accountId": {
72
+ "displayName": [
73
+ "AccountId"
74
+ ],
75
+ "type": 0
76
+ },
77
+ "balance": {
78
+ "displayName": [
79
+ "Balance"
80
+ ],
81
+ "type": 4
82
+ },
83
+ "blockNumber": {
84
+ "displayName": [
85
+ "BlockNumber"
86
+ ],
87
+ "type": 3
88
+ },
89
+ "chainExtension": {
90
+ "displayName": [
91
+ "ChainExtension"
92
+ ],
93
+ "type": 24
94
+ },
95
+ "hash": {
96
+ "displayName": [
97
+ "Hash"
98
+ ],
99
+ "type": 22
100
+ },
101
+ "maxEventTopics": 4,
102
+ "timestamp": {
103
+ "displayName": [
104
+ "Timestamp"
105
+ ],
106
+ "type": 23
107
+ }
108
+ },
109
+ "events": [
110
+ {
111
+ "args": [
112
+ {
113
+ "docs": [],
114
+ "indexed": true,
115
+ "label": "account_id",
116
+ "type": {
117
+ "displayName": [
118
+ "AccountId"
119
+ ],
120
+ "type": 0
121
+ }
122
+ },
123
+ {
124
+ "docs": [],
125
+ "indexed": true,
126
+ "label": "usdt",
127
+ "type": {
128
+ "displayName": [
129
+ "Balance"
130
+ ],
131
+ "type": 4
132
+ }
133
+ },
134
+ {
135
+ "docs": [],
136
+ "indexed": true,
137
+ "label": "d9",
138
+ "type": {
139
+ "displayName": [
140
+ "Balance"
141
+ ],
142
+ "type": 4
143
+ }
144
+ }
145
+ ],
146
+ "docs": [],
147
+ "label": "LiquidityAdded"
148
+ },
149
+ {
150
+ "args": [
151
+ {
152
+ "docs": [],
153
+ "indexed": true,
154
+ "label": "account_id",
155
+ "type": {
156
+ "displayName": [
157
+ "AccountId"
158
+ ],
159
+ "type": 0
160
+ }
161
+ },
162
+ {
163
+ "docs": [],
164
+ "indexed": true,
165
+ "label": "usdt",
166
+ "type": {
167
+ "displayName": [
168
+ "Balance"
169
+ ],
170
+ "type": 4
171
+ }
172
+ },
173
+ {
174
+ "docs": [],
175
+ "indexed": true,
176
+ "label": "d9",
177
+ "type": {
178
+ "displayName": [
179
+ "Balance"
180
+ ],
181
+ "type": 4
182
+ }
183
+ }
184
+ ],
185
+ "docs": [],
186
+ "label": "LiquidityRemoved"
187
+ },
188
+ {
189
+ "args": [
190
+ {
191
+ "docs": [],
192
+ "indexed": true,
193
+ "label": "account_id",
194
+ "type": {
195
+ "displayName": [
196
+ "AccountId"
197
+ ],
198
+ "type": 0
199
+ }
200
+ },
201
+ {
202
+ "docs": [],
203
+ "indexed": true,
204
+ "label": "usdt",
205
+ "type": {
206
+ "displayName": [
207
+ "Balance"
208
+ ],
209
+ "type": 4
210
+ }
211
+ },
212
+ {
213
+ "docs": [],
214
+ "indexed": true,
215
+ "label": "d9",
216
+ "type": {
217
+ "displayName": [
218
+ "Balance"
219
+ ],
220
+ "type": 4
221
+ }
222
+ }
223
+ ],
224
+ "docs": [],
225
+ "label": "D9ToUSDTConversion"
226
+ },
227
+ {
228
+ "args": [
229
+ {
230
+ "docs": [],
231
+ "indexed": true,
232
+ "label": "account_id",
233
+ "type": {
234
+ "displayName": [
235
+ "AccountId"
236
+ ],
237
+ "type": 0
238
+ }
239
+ },
240
+ {
241
+ "docs": [],
242
+ "indexed": true,
243
+ "label": "usdt",
244
+ "type": {
245
+ "displayName": [
246
+ "Balance"
247
+ ],
248
+ "type": 4
249
+ }
250
+ },
251
+ {
252
+ "docs": [],
253
+ "indexed": true,
254
+ "label": "d9",
255
+ "type": {
256
+ "displayName": [
257
+ "Balance"
258
+ ],
259
+ "type": 4
260
+ }
261
+ }
262
+ ],
263
+ "docs": [],
264
+ "label": "USDTToD9Conversion"
265
+ }
266
+ ],
267
+ "lang_error": {
268
+ "displayName": [
269
+ "ink",
270
+ "LangError"
271
+ ],
272
+ "type": 7
273
+ },
274
+ "messages": [
275
+ {
276
+ "args": [
277
+ {
278
+ "label": "new_admin",
279
+ "type": {
280
+ "displayName": [
281
+ "AccountId"
282
+ ],
283
+ "type": 0
284
+ }
285
+ }
286
+ ],
287
+ "default": false,
288
+ "docs": [],
289
+ "label": "change_admin",
290
+ "mutates": true,
291
+ "payable": false,
292
+ "returnType": {
293
+ "displayName": [
294
+ "ink",
295
+ "MessageResult"
296
+ ],
297
+ "type": 5
298
+ },
299
+ "selector": "0x61ae97d7"
300
+ },
301
+ {
302
+ "args": [],
303
+ "default": false,
304
+ "docs": [
305
+ " get pool balances (d9, usdt)"
306
+ ],
307
+ "label": "get_currency_reserves",
308
+ "mutates": false,
309
+ "payable": false,
310
+ "returnType": {
311
+ "displayName": [
312
+ "ink",
313
+ "MessageResult"
314
+ ],
315
+ "type": 8
316
+ },
317
+ "selector": "0x43b2d0e6"
318
+ },
319
+ {
320
+ "args": [
321
+ {
322
+ "label": "account_id",
323
+ "type": {
324
+ "displayName": [
325
+ "AccountId"
326
+ ],
327
+ "type": 0
328
+ }
329
+ }
330
+ ],
331
+ "default": false,
332
+ "docs": [],
333
+ "label": "get_liquidity_provider",
334
+ "mutates": false,
335
+ "payable": false,
336
+ "returnType": {
337
+ "displayName": [
338
+ "ink",
339
+ "MessageResult"
340
+ ],
341
+ "type": 10
342
+ },
343
+ "selector": "0x32e702ad"
344
+ },
345
+ {
346
+ "args": [
347
+ {
348
+ "label": "usdt_liquidity",
349
+ "type": {
350
+ "displayName": [
351
+ "Balance"
352
+ ],
353
+ "type": 4
354
+ }
355
+ }
356
+ ],
357
+ "default": false,
358
+ "docs": [
359
+ " add liquidity by adding tokens to the reserves"
360
+ ],
361
+ "label": "add_liquidity",
362
+ "mutates": true,
363
+ "payable": true,
364
+ "returnType": {
365
+ "displayName": [
366
+ "ink",
367
+ "MessageResult"
368
+ ],
369
+ "type": 12
370
+ },
371
+ "selector": "0x264cd04b"
372
+ },
373
+ {
374
+ "args": [],
375
+ "default": false,
376
+ "docs": [],
377
+ "label": "remove_liquidity",
378
+ "mutates": true,
379
+ "payable": false,
380
+ "returnType": {
381
+ "displayName": [
382
+ "ink",
383
+ "MessageResult"
384
+ ],
385
+ "type": 12
386
+ },
387
+ "selector": "0xbdd16bfa"
388
+ },
389
+ {
390
+ "args": [
391
+ {
392
+ "label": "code_hash",
393
+ "type": {
394
+ "displayName": [],
395
+ "type": 1
396
+ }
397
+ }
398
+ ],
399
+ "default": false,
400
+ "docs": [
401
+ " Modifies the code which is used to execute calls to this contract address (`AccountId`).",
402
+ "",
403
+ " We use this to upgrade the contract logic. We don't do any authorization here, any caller",
404
+ " can execute this method. In a production contract you would do some authorization here."
405
+ ],
406
+ "label": "set_code",
407
+ "mutates": true,
408
+ "payable": false,
409
+ "returnType": {
410
+ "displayName": [
411
+ "ink",
412
+ "MessageResult"
413
+ ],
414
+ "type": 5
415
+ },
416
+ "selector": "0x694fb50f"
417
+ },
418
+ {
419
+ "args": [
420
+ {
421
+ "label": "usdt_liquidity",
422
+ "type": {
423
+ "displayName": [
424
+ "Balance"
425
+ ],
426
+ "type": 4
427
+ }
428
+ },
429
+ {
430
+ "label": "d9_liquidity",
431
+ "type": {
432
+ "displayName": [
433
+ "Balance"
434
+ ],
435
+ "type": 4
436
+ }
437
+ }
438
+ ],
439
+ "default": false,
440
+ "docs": [],
441
+ "label": "check_new_liquidity",
442
+ "mutates": false,
443
+ "payable": false,
444
+ "returnType": {
445
+ "displayName": [
446
+ "ink",
447
+ "MessageResult"
448
+ ],
449
+ "type": 12
450
+ },
451
+ "selector": "0x5a150c03"
452
+ },
453
+ {
454
+ "args": [
455
+ {
456
+ "label": "usdt",
457
+ "type": {
458
+ "displayName": [
459
+ "Balance"
460
+ ],
461
+ "type": 4
462
+ }
463
+ }
464
+ ],
465
+ "default": false,
466
+ "docs": [
467
+ " sell usdt"
468
+ ],
469
+ "label": "get_d9",
470
+ "mutates": true,
471
+ "payable": false,
472
+ "returnType": {
473
+ "displayName": [
474
+ "ink",
475
+ "MessageResult"
476
+ ],
477
+ "type": 16
478
+ },
479
+ "selector": "0x0edab8e1"
480
+ },
481
+ {
482
+ "args": [],
483
+ "default": false,
484
+ "docs": [
485
+ " sell d9"
486
+ ],
487
+ "label": "get_usdt",
488
+ "mutates": true,
489
+ "payable": true,
490
+ "returnType": {
491
+ "displayName": [
492
+ "ink",
493
+ "MessageResult"
494
+ ],
495
+ "type": 16
496
+ },
497
+ "selector": "0x5b41ab8a"
498
+ },
499
+ {
500
+ "args": [
501
+ {
502
+ "label": "d9_liquidity",
503
+ "type": {
504
+ "displayName": [
505
+ "Balance"
506
+ ],
507
+ "type": 4
508
+ }
509
+ },
510
+ {
511
+ "label": "usdt_liquidity",
512
+ "type": {
513
+ "displayName": [
514
+ "Balance"
515
+ ],
516
+ "type": 4
517
+ }
518
+ }
519
+ ],
520
+ "default": false,
521
+ "docs": [
522
+ " calculate lp tokens based on usdt liquidity"
523
+ ],
524
+ "label": "calc_new_lp_tokens",
525
+ "mutates": true,
526
+ "payable": false,
527
+ "returnType": {
528
+ "displayName": [
529
+ "ink",
530
+ "MessageResult"
531
+ ],
532
+ "type": 18
533
+ },
534
+ "selector": "0xbdcee4ed"
535
+ },
536
+ {
537
+ "args": [
538
+ {
539
+ "label": "direction",
540
+ "type": {
541
+ "displayName": [
542
+ "Direction"
543
+ ],
544
+ "type": 19
545
+ }
546
+ },
547
+ {
548
+ "label": "amount_0",
549
+ "type": {
550
+ "displayName": [
551
+ "Balance"
552
+ ],
553
+ "type": 4
554
+ }
555
+ }
556
+ ],
557
+ "default": false,
558
+ "docs": [
559
+ " amount of currency B from A, if A => B"
560
+ ],
561
+ "label": "calculate_exchange",
562
+ "mutates": false,
563
+ "payable": false,
564
+ "returnType": {
565
+ "displayName": [
566
+ "ink",
567
+ "MessageResult"
568
+ ],
569
+ "type": 16
570
+ },
571
+ "selector": "0x2413eb9a"
572
+ },
573
+ {
574
+ "args": [
575
+ {
576
+ "label": "direction",
577
+ "type": {
578
+ "displayName": [
579
+ "Direction"
580
+ ],
581
+ "type": 19
582
+ }
583
+ },
584
+ {
585
+ "label": "amount_0",
586
+ "type": {
587
+ "displayName": [
588
+ "Balance"
589
+ ],
590
+ "type": 4
591
+ }
592
+ }
593
+ ],
594
+ "default": false,
595
+ "docs": [],
596
+ "label": "estimate_exchange",
597
+ "mutates": false,
598
+ "payable": false,
599
+ "returnType": {
600
+ "displayName": [
601
+ "ink",
602
+ "MessageResult"
603
+ ],
604
+ "type": 20
605
+ },
606
+ "selector": "0x06f49352"
607
+ },
608
+ {
609
+ "args": [
610
+ {
611
+ "label": "account_id",
612
+ "type": {
613
+ "displayName": [
614
+ "AccountId"
615
+ ],
616
+ "type": 0
617
+ }
618
+ },
619
+ {
620
+ "label": "amount",
621
+ "type": {
622
+ "displayName": [
623
+ "Balance"
624
+ ],
625
+ "type": 4
626
+ }
627
+ }
628
+ ],
629
+ "default": false,
630
+ "docs": [
631
+ " check if usdt balance is sufficient for swap"
632
+ ],
633
+ "label": "check_usdt_balance",
634
+ "mutates": false,
635
+ "payable": false,
636
+ "returnType": {
637
+ "displayName": [
638
+ "ink",
639
+ "MessageResult"
640
+ ],
641
+ "type": 12
642
+ },
643
+ "selector": "0x4a74f8d9"
644
+ }
645
+ ]
646
+ },
647
+ "storage": {
648
+ "root": {
649
+ "layout": {
650
+ "struct": {
651
+ "fields": [
652
+ {
653
+ "layout": {
654
+ "leaf": {
655
+ "key": "0x00000000",
656
+ "ty": 0
657
+ }
658
+ },
659
+ "name": "usdt_contract"
660
+ },
661
+ {
662
+ "layout": {
663
+ "leaf": {
664
+ "key": "0x00000000",
665
+ "ty": 3
666
+ }
667
+ },
668
+ "name": "fee_percent"
669
+ },
670
+ {
671
+ "layout": {
672
+ "leaf": {
673
+ "key": "0x00000000",
674
+ "ty": 4
675
+ }
676
+ },
677
+ "name": "fee_total"
678
+ },
679
+ {
680
+ "layout": {
681
+ "leaf": {
682
+ "key": "0x00000000",
683
+ "ty": 3
684
+ }
685
+ },
686
+ "name": "liquidity_tolerance_percent"
687
+ },
688
+ {
689
+ "layout": {
690
+ "root": {
691
+ "layout": {
692
+ "leaf": {
693
+ "key": "0x838a4d0c",
694
+ "ty": 4
695
+ }
696
+ },
697
+ "root_key": "0x838a4d0c"
698
+ }
699
+ },
700
+ "name": "liquidity_providers"
701
+ },
702
+ {
703
+ "layout": {
704
+ "leaf": {
705
+ "key": "0x00000000",
706
+ "ty": 4
707
+ }
708
+ },
709
+ "name": "total_lp_tokens"
710
+ },
711
+ {
712
+ "layout": {
713
+ "leaf": {
714
+ "key": "0x00000000",
715
+ "ty": 0
716
+ }
717
+ },
718
+ "name": "admin"
719
+ }
720
+ ],
721
+ "name": "MarketMaker"
722
+ }
723
+ },
724
+ "root_key": "0x00000000"
725
+ }
726
+ },
727
+ "types": [
728
+ {
729
+ "id": 0,
730
+ "type": {
731
+ "def": {
732
+ "composite": {
733
+ "fields": [
734
+ {
735
+ "type": 1,
736
+ "typeName": "[u8; 32]"
737
+ }
738
+ ]
739
+ }
740
+ },
741
+ "path": [
742
+ "ink_primitives",
743
+ "types",
744
+ "AccountId"
745
+ ]
746
+ }
747
+ },
748
+ {
749
+ "id": 1,
750
+ "type": {
751
+ "def": {
752
+ "array": {
753
+ "len": 32,
754
+ "type": 2
755
+ }
756
+ }
757
+ }
758
+ },
759
+ {
760
+ "id": 2,
761
+ "type": {
762
+ "def": {
763
+ "primitive": "u8"
764
+ }
765
+ }
766
+ },
767
+ {
768
+ "id": 3,
769
+ "type": {
770
+ "def": {
771
+ "primitive": "u32"
772
+ }
773
+ }
774
+ },
775
+ {
776
+ "id": 4,
777
+ "type": {
778
+ "def": {
779
+ "primitive": "u128"
780
+ }
781
+ }
782
+ },
783
+ {
784
+ "id": 5,
785
+ "type": {
786
+ "def": {
787
+ "variant": {
788
+ "variants": [
789
+ {
790
+ "fields": [
791
+ {
792
+ "type": 6
793
+ }
794
+ ],
795
+ "index": 0,
796
+ "name": "Ok"
797
+ },
798
+ {
799
+ "fields": [
800
+ {
801
+ "type": 7
802
+ }
803
+ ],
804
+ "index": 1,
805
+ "name": "Err"
806
+ }
807
+ ]
808
+ }
809
+ },
810
+ "params": [
811
+ {
812
+ "name": "T",
813
+ "type": 6
814
+ },
815
+ {
816
+ "name": "E",
817
+ "type": 7
818
+ }
819
+ ],
820
+ "path": [
821
+ "Result"
822
+ ]
823
+ }
824
+ },
825
+ {
826
+ "id": 6,
827
+ "type": {
828
+ "def": {
829
+ "tuple": []
830
+ }
831
+ }
832
+ },
833
+ {
834
+ "id": 7,
835
+ "type": {
836
+ "def": {
837
+ "variant": {
838
+ "variants": [
839
+ {
840
+ "index": 1,
841
+ "name": "CouldNotReadInput"
842
+ }
843
+ ]
844
+ }
845
+ },
846
+ "path": [
847
+ "ink_primitives",
848
+ "LangError"
849
+ ]
850
+ }
851
+ },
852
+ {
853
+ "id": 8,
854
+ "type": {
855
+ "def": {
856
+ "variant": {
857
+ "variants": [
858
+ {
859
+ "fields": [
860
+ {
861
+ "type": 9
862
+ }
863
+ ],
864
+ "index": 0,
865
+ "name": "Ok"
866
+ },
867
+ {
868
+ "fields": [
869
+ {
870
+ "type": 7
871
+ }
872
+ ],
873
+ "index": 1,
874
+ "name": "Err"
875
+ }
876
+ ]
877
+ }
878
+ },
879
+ "params": [
880
+ {
881
+ "name": "T",
882
+ "type": 9
883
+ },
884
+ {
885
+ "name": "E",
886
+ "type": 7
887
+ }
888
+ ],
889
+ "path": [
890
+ "Result"
891
+ ]
892
+ }
893
+ },
894
+ {
895
+ "id": 9,
896
+ "type": {
897
+ "def": {
898
+ "tuple": [
899
+ 4,
900
+ 4
901
+ ]
902
+ }
903
+ }
904
+ },
905
+ {
906
+ "id": 10,
907
+ "type": {
908
+ "def": {
909
+ "variant": {
910
+ "variants": [
911
+ {
912
+ "fields": [
913
+ {
914
+ "type": 11
915
+ }
916
+ ],
917
+ "index": 0,
918
+ "name": "Ok"
919
+ },
920
+ {
921
+ "fields": [
922
+ {
923
+ "type": 7
924
+ }
925
+ ],
926
+ "index": 1,
927
+ "name": "Err"
928
+ }
929
+ ]
930
+ }
931
+ },
932
+ "params": [
933
+ {
934
+ "name": "T",
935
+ "type": 11
936
+ },
937
+ {
938
+ "name": "E",
939
+ "type": 7
940
+ }
941
+ ],
942
+ "path": [
943
+ "Result"
944
+ ]
945
+ }
946
+ },
947
+ {
948
+ "id": 11,
949
+ "type": {
950
+ "def": {
951
+ "variant": {
952
+ "variants": [
953
+ {
954
+ "index": 0,
955
+ "name": "None"
956
+ },
957
+ {
958
+ "fields": [
959
+ {
960
+ "type": 4
961
+ }
962
+ ],
963
+ "index": 1,
964
+ "name": "Some"
965
+ }
966
+ ]
967
+ }
968
+ },
969
+ "params": [
970
+ {
971
+ "name": "T",
972
+ "type": 4
973
+ }
974
+ ],
975
+ "path": [
976
+ "Option"
977
+ ]
978
+ }
979
+ },
980
+ {
981
+ "id": 12,
982
+ "type": {
983
+ "def": {
984
+ "variant": {
985
+ "variants": [
986
+ {
987
+ "fields": [
988
+ {
989
+ "type": 13
990
+ }
991
+ ],
992
+ "index": 0,
993
+ "name": "Ok"
994
+ },
995
+ {
996
+ "fields": [
997
+ {
998
+ "type": 7
999
+ }
1000
+ ],
1001
+ "index": 1,
1002
+ "name": "Err"
1003
+ }
1004
+ ]
1005
+ }
1006
+ },
1007
+ "params": [
1008
+ {
1009
+ "name": "T",
1010
+ "type": 13
1011
+ },
1012
+ {
1013
+ "name": "E",
1014
+ "type": 7
1015
+ }
1016
+ ],
1017
+ "path": [
1018
+ "Result"
1019
+ ]
1020
+ }
1021
+ },
1022
+ {
1023
+ "id": 13,
1024
+ "type": {
1025
+ "def": {
1026
+ "variant": {
1027
+ "variants": [
1028
+ {
1029
+ "fields": [
1030
+ {
1031
+ "type": 6
1032
+ }
1033
+ ],
1034
+ "index": 0,
1035
+ "name": "Ok"
1036
+ },
1037
+ {
1038
+ "fields": [
1039
+ {
1040
+ "type": 14
1041
+ }
1042
+ ],
1043
+ "index": 1,
1044
+ "name": "Err"
1045
+ }
1046
+ ]
1047
+ }
1048
+ },
1049
+ "params": [
1050
+ {
1051
+ "name": "T",
1052
+ "type": 6
1053
+ },
1054
+ {
1055
+ "name": "E",
1056
+ "type": 14
1057
+ }
1058
+ ],
1059
+ "path": [
1060
+ "Result"
1061
+ ]
1062
+ }
1063
+ },
1064
+ {
1065
+ "id": 14,
1066
+ "type": {
1067
+ "def": {
1068
+ "variant": {
1069
+ "variants": [
1070
+ {
1071
+ "index": 0,
1072
+ "name": "D9orUSDTProvidedLiquidityAtZero"
1073
+ },
1074
+ {
1075
+ "index": 1,
1076
+ "name": "ConversionAmountTooLow"
1077
+ },
1078
+ {
1079
+ "index": 2,
1080
+ "name": "CouldntTransferUSDTFromUser"
1081
+ },
1082
+ {
1083
+ "fields": [
1084
+ {
1085
+ "type": 15,
1086
+ "typeName": "Currency"
1087
+ }
1088
+ ],
1089
+ "index": 3,
1090
+ "name": "InsufficientLiquidity"
1091
+ },
1092
+ {
1093
+ "index": 4,
1094
+ "name": "InsufficientAllowance"
1095
+ },
1096
+ {
1097
+ "fields": [
1098
+ {
1099
+ "type": 15,
1100
+ "typeName": "Currency"
1101
+ }
1102
+ ],
1103
+ "index": 5,
1104
+ "name": "MarketMakerHasInsufficientFunds"
1105
+ },
1106
+ {
1107
+ "index": 6,
1108
+ "name": "InsufficientLiquidityProvided"
1109
+ },
1110
+ {
1111
+ "index": 7,
1112
+ "name": "USDTBalanceInsufficient"
1113
+ },
1114
+ {
1115
+ "index": 8,
1116
+ "name": "LiquidityProviderNotFound"
1117
+ },
1118
+ {
1119
+ "fields": [
1120
+ {
1121
+ "type": 4,
1122
+ "typeName": "Balance"
1123
+ },
1124
+ {
1125
+ "type": 4,
1126
+ "typeName": "Balance"
1127
+ }
1128
+ ],
1129
+ "index": 9,
1130
+ "name": "LiquidityAddedBeyondTolerance"
1131
+ },
1132
+ {
1133
+ "index": 10,
1134
+ "name": "InsufficientLPTokens"
1135
+ },
1136
+ {
1137
+ "index": 11,
1138
+ "name": "InsufficientContractLPTokens"
1139
+ },
1140
+ {
1141
+ "index": 12,
1142
+ "name": "DivisionByZero"
1143
+ },
1144
+ {
1145
+ "index": 13,
1146
+ "name": "MultiplicationError"
1147
+ },
1148
+ {
1149
+ "index": 14,
1150
+ "name": "USDTTooSmall"
1151
+ },
1152
+ {
1153
+ "index": 15,
1154
+ "name": "USDTTooMuch"
1155
+ },
1156
+ {
1157
+ "index": 16,
1158
+ "name": "LiquidityTooLow"
1159
+ }
1160
+ ]
1161
+ }
1162
+ },
1163
+ "path": [
1164
+ "market_maker",
1165
+ "market_maker",
1166
+ "Error"
1167
+ ]
1168
+ }
1169
+ },
1170
+ {
1171
+ "id": 15,
1172
+ "type": {
1173
+ "def": {
1174
+ "variant": {
1175
+ "variants": [
1176
+ {
1177
+ "index": 0,
1178
+ "name": "D9"
1179
+ },
1180
+ {
1181
+ "index": 1,
1182
+ "name": "USDT"
1183
+ }
1184
+ ]
1185
+ }
1186
+ },
1187
+ "path": [
1188
+ "market_maker",
1189
+ "market_maker",
1190
+ "Currency"
1191
+ ]
1192
+ }
1193
+ },
1194
+ {
1195
+ "id": 16,
1196
+ "type": {
1197
+ "def": {
1198
+ "variant": {
1199
+ "variants": [
1200
+ {
1201
+ "fields": [
1202
+ {
1203
+ "type": 17
1204
+ }
1205
+ ],
1206
+ "index": 0,
1207
+ "name": "Ok"
1208
+ },
1209
+ {
1210
+ "fields": [
1211
+ {
1212
+ "type": 7
1213
+ }
1214
+ ],
1215
+ "index": 1,
1216
+ "name": "Err"
1217
+ }
1218
+ ]
1219
+ }
1220
+ },
1221
+ "params": [
1222
+ {
1223
+ "name": "T",
1224
+ "type": 17
1225
+ },
1226
+ {
1227
+ "name": "E",
1228
+ "type": 7
1229
+ }
1230
+ ],
1231
+ "path": [
1232
+ "Result"
1233
+ ]
1234
+ }
1235
+ },
1236
+ {
1237
+ "id": 17,
1238
+ "type": {
1239
+ "def": {
1240
+ "variant": {
1241
+ "variants": [
1242
+ {
1243
+ "fields": [
1244
+ {
1245
+ "type": 4
1246
+ }
1247
+ ],
1248
+ "index": 0,
1249
+ "name": "Ok"
1250
+ },
1251
+ {
1252
+ "fields": [
1253
+ {
1254
+ "type": 14
1255
+ }
1256
+ ],
1257
+ "index": 1,
1258
+ "name": "Err"
1259
+ }
1260
+ ]
1261
+ }
1262
+ },
1263
+ "params": [
1264
+ {
1265
+ "name": "T",
1266
+ "type": 4
1267
+ },
1268
+ {
1269
+ "name": "E",
1270
+ "type": 14
1271
+ }
1272
+ ],
1273
+ "path": [
1274
+ "Result"
1275
+ ]
1276
+ }
1277
+ },
1278
+ {
1279
+ "id": 18,
1280
+ "type": {
1281
+ "def": {
1282
+ "variant": {
1283
+ "variants": [
1284
+ {
1285
+ "fields": [
1286
+ {
1287
+ "type": 4
1288
+ }
1289
+ ],
1290
+ "index": 0,
1291
+ "name": "Ok"
1292
+ },
1293
+ {
1294
+ "fields": [
1295
+ {
1296
+ "type": 7
1297
+ }
1298
+ ],
1299
+ "index": 1,
1300
+ "name": "Err"
1301
+ }
1302
+ ]
1303
+ }
1304
+ },
1305
+ "params": [
1306
+ {
1307
+ "name": "T",
1308
+ "type": 4
1309
+ },
1310
+ {
1311
+ "name": "E",
1312
+ "type": 7
1313
+ }
1314
+ ],
1315
+ "path": [
1316
+ "Result"
1317
+ ]
1318
+ }
1319
+ },
1320
+ {
1321
+ "id": 19,
1322
+ "type": {
1323
+ "def": {
1324
+ "composite": {
1325
+ "fields": [
1326
+ {
1327
+ "type": 15,
1328
+ "typeName": "Currency"
1329
+ },
1330
+ {
1331
+ "type": 15,
1332
+ "typeName": "Currency"
1333
+ }
1334
+ ]
1335
+ }
1336
+ },
1337
+ "path": [
1338
+ "market_maker",
1339
+ "market_maker",
1340
+ "Direction"
1341
+ ]
1342
+ }
1343
+ },
1344
+ {
1345
+ "id": 20,
1346
+ "type": {
1347
+ "def": {
1348
+ "variant": {
1349
+ "variants": [
1350
+ {
1351
+ "fields": [
1352
+ {
1353
+ "type": 21
1354
+ }
1355
+ ],
1356
+ "index": 0,
1357
+ "name": "Ok"
1358
+ },
1359
+ {
1360
+ "fields": [
1361
+ {
1362
+ "type": 7
1363
+ }
1364
+ ],
1365
+ "index": 1,
1366
+ "name": "Err"
1367
+ }
1368
+ ]
1369
+ }
1370
+ },
1371
+ "params": [
1372
+ {
1373
+ "name": "T",
1374
+ "type": 21
1375
+ },
1376
+ {
1377
+ "name": "E",
1378
+ "type": 7
1379
+ }
1380
+ ],
1381
+ "path": [
1382
+ "Result"
1383
+ ]
1384
+ }
1385
+ },
1386
+ {
1387
+ "id": 21,
1388
+ "type": {
1389
+ "def": {
1390
+ "variant": {
1391
+ "variants": [
1392
+ {
1393
+ "fields": [
1394
+ {
1395
+ "type": 9
1396
+ }
1397
+ ],
1398
+ "index": 0,
1399
+ "name": "Ok"
1400
+ },
1401
+ {
1402
+ "fields": [
1403
+ {
1404
+ "type": 14
1405
+ }
1406
+ ],
1407
+ "index": 1,
1408
+ "name": "Err"
1409
+ }
1410
+ ]
1411
+ }
1412
+ },
1413
+ "params": [
1414
+ {
1415
+ "name": "T",
1416
+ "type": 9
1417
+ },
1418
+ {
1419
+ "name": "E",
1420
+ "type": 14
1421
+ }
1422
+ ],
1423
+ "path": [
1424
+ "Result"
1425
+ ]
1426
+ }
1427
+ },
1428
+ {
1429
+ "id": 22,
1430
+ "type": {
1431
+ "def": {
1432
+ "composite": {
1433
+ "fields": [
1434
+ {
1435
+ "type": 1,
1436
+ "typeName": "[u8; 32]"
1437
+ }
1438
+ ]
1439
+ }
1440
+ },
1441
+ "path": [
1442
+ "ink_primitives",
1443
+ "types",
1444
+ "Hash"
1445
+ ]
1446
+ }
1447
+ },
1448
+ {
1449
+ "id": 23,
1450
+ "type": {
1451
+ "def": {
1452
+ "primitive": "u64"
1453
+ }
1454
+ }
1455
+ },
1456
+ {
1457
+ "id": 24,
1458
+ "type": {
1459
+ "def": {
1460
+ "variant": {}
1461
+ },
1462
+ "path": [
1463
+ "d9_chain_extension",
1464
+ "D9ChainExtension"
1465
+ ]
1466
+ }
1467
+ }
1468
+ ],
1469
+ "version": "4"
1470
+ }