@scalecrx/sdk 0.4.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.
@@ -0,0 +1,1471 @@
1
+ {
2
+ "address": "Fh6e5po2THVypEwp658kFwqGDiixUc88AC5k37MVGgXF",
3
+ "metadata": {
4
+ "name": "scale_amm",
5
+ "version": "0.1.0",
6
+ "spec": "0.1.0"
7
+ },
8
+ "instructions": [
9
+ {
10
+ "name": "buy",
11
+ "discriminator": [
12
+ 102,
13
+ 6,
14
+ 61,
15
+ 18,
16
+ 1,
17
+ 218,
18
+ 235,
19
+ 234
20
+ ],
21
+ "accounts": [
22
+ {
23
+ "name": "pool",
24
+ "writable": true,
25
+ "pda": {
26
+ "seeds": [
27
+ {
28
+ "kind": "const",
29
+ "value": [
30
+ 112,
31
+ 111,
32
+ 111,
33
+ 108
34
+ ]
35
+ },
36
+ {
37
+ "kind": "account",
38
+ "path": "owner"
39
+ },
40
+ {
41
+ "kind": "account",
42
+ "path": "mint_a"
43
+ },
44
+ {
45
+ "kind": "account",
46
+ "path": "mint_b"
47
+ }
48
+ ]
49
+ }
50
+ },
51
+ {
52
+ "name": "user",
53
+ "writable": true,
54
+ "signer": true
55
+ },
56
+ {
57
+ "name": "owner"
58
+ },
59
+ {
60
+ "name": "mint_a"
61
+ },
62
+ {
63
+ "name": "mint_b"
64
+ },
65
+ {
66
+ "name": "user_ta_a",
67
+ "writable": true
68
+ },
69
+ {
70
+ "name": "user_ta_b",
71
+ "writable": true
72
+ },
73
+ {
74
+ "name": "vault_a",
75
+ "writable": true,
76
+ "pda": {
77
+ "seeds": [
78
+ {
79
+ "kind": "account",
80
+ "path": "pool"
81
+ },
82
+ {
83
+ "kind": "account",
84
+ "path": "mint_a"
85
+ }
86
+ ]
87
+ }
88
+ },
89
+ {
90
+ "name": "vault_b",
91
+ "writable": true,
92
+ "pda": {
93
+ "seeds": [
94
+ {
95
+ "kind": "account",
96
+ "path": "pool"
97
+ },
98
+ {
99
+ "kind": "account",
100
+ "path": "mint_b"
101
+ }
102
+ ]
103
+ }
104
+ },
105
+ {
106
+ "name": "platform_fee_ta_a",
107
+ "writable": true
108
+ },
109
+ {
110
+ "name": "token_program_a"
111
+ },
112
+ {
113
+ "name": "token_program_b"
114
+ },
115
+ {
116
+ "name": "system_program",
117
+ "address": "11111111111111111111111111111111"
118
+ },
119
+ {
120
+ "name": "config",
121
+ "pda": {
122
+ "seeds": [
123
+ {
124
+ "kind": "const",
125
+ "value": [
126
+ 99,
127
+ 111,
128
+ 110,
129
+ 102,
130
+ 105,
131
+ 103
132
+ ]
133
+ }
134
+ ]
135
+ }
136
+ }
137
+ ],
138
+ "args": [
139
+ {
140
+ "name": "params",
141
+ "type": {
142
+ "defined": {
143
+ "name": "SwapParams"
144
+ }
145
+ }
146
+ }
147
+ ]
148
+ },
149
+ {
150
+ "name": "create",
151
+ "discriminator": [
152
+ 24,
153
+ 30,
154
+ 200,
155
+ 40,
156
+ 5,
157
+ 28,
158
+ 7,
159
+ 119
160
+ ],
161
+ "accounts": [
162
+ {
163
+ "name": "payer",
164
+ "writable": true,
165
+ "signer": true
166
+ },
167
+ {
168
+ "name": "owner",
169
+ "docs": [
170
+ "Pool owner."
171
+ ],
172
+ "signer": true
173
+ },
174
+ {
175
+ "name": "token_wallet_authority",
176
+ "docs": [
177
+ "Token account authority for funding token B."
178
+ ],
179
+ "signer": true
180
+ },
181
+ {
182
+ "name": "mint_a"
183
+ },
184
+ {
185
+ "name": "mint_b"
186
+ },
187
+ {
188
+ "name": "token_wallet_b",
189
+ "writable": true
190
+ },
191
+ {
192
+ "name": "pool",
193
+ "writable": true,
194
+ "pda": {
195
+ "seeds": [
196
+ {
197
+ "kind": "const",
198
+ "value": [
199
+ 112,
200
+ 111,
201
+ 111,
202
+ 108
203
+ ]
204
+ },
205
+ {
206
+ "kind": "account",
207
+ "path": "owner"
208
+ },
209
+ {
210
+ "kind": "account",
211
+ "path": "mint_a"
212
+ },
213
+ {
214
+ "kind": "account",
215
+ "path": "mint_b"
216
+ }
217
+ ]
218
+ }
219
+ },
220
+ {
221
+ "name": "vault_a",
222
+ "writable": true,
223
+ "pda": {
224
+ "seeds": [
225
+ {
226
+ "kind": "account",
227
+ "path": "pool"
228
+ },
229
+ {
230
+ "kind": "account",
231
+ "path": "mint_a"
232
+ }
233
+ ]
234
+ }
235
+ },
236
+ {
237
+ "name": "vault_b",
238
+ "writable": true,
239
+ "pda": {
240
+ "seeds": [
241
+ {
242
+ "kind": "account",
243
+ "path": "pool"
244
+ },
245
+ {
246
+ "kind": "account",
247
+ "path": "mint_b"
248
+ }
249
+ ]
250
+ }
251
+ },
252
+ {
253
+ "name": "token_program_a"
254
+ },
255
+ {
256
+ "name": "token_program_b"
257
+ },
258
+ {
259
+ "name": "system_program",
260
+ "address": "11111111111111111111111111111111"
261
+ },
262
+ {
263
+ "name": "config",
264
+ "pda": {
265
+ "seeds": [
266
+ {
267
+ "kind": "const",
268
+ "value": [
269
+ 99,
270
+ 111,
271
+ 110,
272
+ 102,
273
+ 105,
274
+ 103
275
+ ]
276
+ }
277
+ ]
278
+ }
279
+ }
280
+ ],
281
+ "args": [
282
+ {
283
+ "name": "params",
284
+ "type": {
285
+ "defined": {
286
+ "name": "CreateParams"
287
+ }
288
+ }
289
+ }
290
+ ]
291
+ },
292
+ {
293
+ "name": "create_from_vmm",
294
+ "discriminator": [
295
+ 1,
296
+ 80,
297
+ 10,
298
+ 67,
299
+ 24,
300
+ 120,
301
+ 235,
302
+ 169
303
+ ],
304
+ "accounts": [
305
+ {
306
+ "name": "payer",
307
+ "writable": true,
308
+ "signer": true
309
+ },
310
+ {
311
+ "name": "owner",
312
+ "docs": [
313
+ "Pool owner."
314
+ ],
315
+ "signer": true
316
+ },
317
+ {
318
+ "name": "token_wallet_authority",
319
+ "docs": [
320
+ "Token account authority for funding token A/B."
321
+ ],
322
+ "signer": true
323
+ },
324
+ {
325
+ "name": "mint_a"
326
+ },
327
+ {
328
+ "name": "mint_b"
329
+ },
330
+ {
331
+ "name": "token_wallet_a",
332
+ "writable": true
333
+ },
334
+ {
335
+ "name": "token_wallet_b",
336
+ "writable": true
337
+ },
338
+ {
339
+ "name": "pool",
340
+ "writable": true,
341
+ "pda": {
342
+ "seeds": [
343
+ {
344
+ "kind": "const",
345
+ "value": [
346
+ 112,
347
+ 111,
348
+ 111,
349
+ 108
350
+ ]
351
+ },
352
+ {
353
+ "kind": "account",
354
+ "path": "owner"
355
+ },
356
+ {
357
+ "kind": "account",
358
+ "path": "mint_a"
359
+ },
360
+ {
361
+ "kind": "account",
362
+ "path": "mint_b"
363
+ }
364
+ ]
365
+ }
366
+ },
367
+ {
368
+ "name": "vault_a",
369
+ "writable": true,
370
+ "pda": {
371
+ "seeds": [
372
+ {
373
+ "kind": "account",
374
+ "path": "pool"
375
+ },
376
+ {
377
+ "kind": "account",
378
+ "path": "mint_a"
379
+ }
380
+ ]
381
+ }
382
+ },
383
+ {
384
+ "name": "vault_b",
385
+ "writable": true,
386
+ "pda": {
387
+ "seeds": [
388
+ {
389
+ "kind": "account",
390
+ "path": "pool"
391
+ },
392
+ {
393
+ "kind": "account",
394
+ "path": "mint_b"
395
+ }
396
+ ]
397
+ }
398
+ },
399
+ {
400
+ "name": "token_program_a"
401
+ },
402
+ {
403
+ "name": "token_program_b"
404
+ },
405
+ {
406
+ "name": "system_program",
407
+ "address": "11111111111111111111111111111111"
408
+ },
409
+ {
410
+ "name": "config",
411
+ "pda": {
412
+ "seeds": [
413
+ {
414
+ "kind": "const",
415
+ "value": [
416
+ 99,
417
+ 111,
418
+ 110,
419
+ 102,
420
+ 105,
421
+ 103
422
+ ]
423
+ }
424
+ ]
425
+ }
426
+ }
427
+ ],
428
+ "args": [
429
+ {
430
+ "name": "params",
431
+ "type": {
432
+ "defined": {
433
+ "name": "CreateFromVmmParams"
434
+ }
435
+ }
436
+ }
437
+ ]
438
+ },
439
+ {
440
+ "name": "quote_buy",
441
+ "discriminator": [
442
+ 83,
443
+ 9,
444
+ 231,
445
+ 110,
446
+ 146,
447
+ 31,
448
+ 40,
449
+ 12
450
+ ],
451
+ "accounts": [
452
+ {
453
+ "name": "pool",
454
+ "pda": {
455
+ "seeds": [
456
+ {
457
+ "kind": "const",
458
+ "value": [
459
+ 112,
460
+ 111,
461
+ 111,
462
+ 108
463
+ ]
464
+ },
465
+ {
466
+ "kind": "account",
467
+ "path": "owner"
468
+ },
469
+ {
470
+ "kind": "account",
471
+ "path": "mint_a"
472
+ },
473
+ {
474
+ "kind": "account",
475
+ "path": "mint_b"
476
+ }
477
+ ]
478
+ }
479
+ },
480
+ {
481
+ "name": "owner"
482
+ },
483
+ {
484
+ "name": "mint_a"
485
+ },
486
+ {
487
+ "name": "mint_b"
488
+ },
489
+ {
490
+ "name": "config",
491
+ "pda": {
492
+ "seeds": [
493
+ {
494
+ "kind": "const",
495
+ "value": [
496
+ 99,
497
+ 111,
498
+ 110,
499
+ 102,
500
+ 105,
501
+ 103
502
+ ]
503
+ }
504
+ ]
505
+ }
506
+ }
507
+ ],
508
+ "args": [
509
+ {
510
+ "name": "params",
511
+ "type": {
512
+ "defined": {
513
+ "name": "SwapParams"
514
+ }
515
+ }
516
+ }
517
+ ],
518
+ "returns": {
519
+ "defined": {
520
+ "name": "SwapResult"
521
+ }
522
+ }
523
+ },
524
+ {
525
+ "name": "quote_sell",
526
+ "discriminator": [
527
+ 5,
528
+ 178,
529
+ 49,
530
+ 206,
531
+ 140,
532
+ 231,
533
+ 131,
534
+ 145
535
+ ],
536
+ "accounts": [
537
+ {
538
+ "name": "pool",
539
+ "pda": {
540
+ "seeds": [
541
+ {
542
+ "kind": "const",
543
+ "value": [
544
+ 112,
545
+ 111,
546
+ 111,
547
+ 108
548
+ ]
549
+ },
550
+ {
551
+ "kind": "account",
552
+ "path": "owner"
553
+ },
554
+ {
555
+ "kind": "account",
556
+ "path": "mint_a"
557
+ },
558
+ {
559
+ "kind": "account",
560
+ "path": "mint_b"
561
+ }
562
+ ]
563
+ }
564
+ },
565
+ {
566
+ "name": "owner"
567
+ },
568
+ {
569
+ "name": "mint_a"
570
+ },
571
+ {
572
+ "name": "mint_b"
573
+ },
574
+ {
575
+ "name": "config",
576
+ "pda": {
577
+ "seeds": [
578
+ {
579
+ "kind": "const",
580
+ "value": [
581
+ 99,
582
+ 111,
583
+ 110,
584
+ 102,
585
+ 105,
586
+ 103
587
+ ]
588
+ }
589
+ ]
590
+ }
591
+ }
592
+ ],
593
+ "args": [
594
+ {
595
+ "name": "params",
596
+ "type": {
597
+ "defined": {
598
+ "name": "SwapParams"
599
+ }
600
+ }
601
+ }
602
+ ],
603
+ "returns": {
604
+ "defined": {
605
+ "name": "SwapResult"
606
+ }
607
+ }
608
+ },
609
+ {
610
+ "name": "sell",
611
+ "discriminator": [
612
+ 51,
613
+ 230,
614
+ 133,
615
+ 164,
616
+ 1,
617
+ 127,
618
+ 131,
619
+ 173
620
+ ],
621
+ "accounts": [
622
+ {
623
+ "name": "pool",
624
+ "writable": true,
625
+ "pda": {
626
+ "seeds": [
627
+ {
628
+ "kind": "const",
629
+ "value": [
630
+ 112,
631
+ 111,
632
+ 111,
633
+ 108
634
+ ]
635
+ },
636
+ {
637
+ "kind": "account",
638
+ "path": "owner"
639
+ },
640
+ {
641
+ "kind": "account",
642
+ "path": "mint_a"
643
+ },
644
+ {
645
+ "kind": "account",
646
+ "path": "mint_b"
647
+ }
648
+ ]
649
+ }
650
+ },
651
+ {
652
+ "name": "user",
653
+ "writable": true,
654
+ "signer": true
655
+ },
656
+ {
657
+ "name": "owner"
658
+ },
659
+ {
660
+ "name": "mint_a"
661
+ },
662
+ {
663
+ "name": "mint_b"
664
+ },
665
+ {
666
+ "name": "user_ta_a",
667
+ "writable": true
668
+ },
669
+ {
670
+ "name": "user_ta_b",
671
+ "writable": true
672
+ },
673
+ {
674
+ "name": "vault_a",
675
+ "writable": true,
676
+ "pda": {
677
+ "seeds": [
678
+ {
679
+ "kind": "account",
680
+ "path": "pool"
681
+ },
682
+ {
683
+ "kind": "account",
684
+ "path": "mint_a"
685
+ }
686
+ ]
687
+ }
688
+ },
689
+ {
690
+ "name": "vault_b",
691
+ "writable": true,
692
+ "pda": {
693
+ "seeds": [
694
+ {
695
+ "kind": "account",
696
+ "path": "pool"
697
+ },
698
+ {
699
+ "kind": "account",
700
+ "path": "mint_b"
701
+ }
702
+ ]
703
+ }
704
+ },
705
+ {
706
+ "name": "platform_fee_ta_a",
707
+ "writable": true
708
+ },
709
+ {
710
+ "name": "token_program_a"
711
+ },
712
+ {
713
+ "name": "token_program_b"
714
+ },
715
+ {
716
+ "name": "system_program",
717
+ "address": "11111111111111111111111111111111"
718
+ },
719
+ {
720
+ "name": "config",
721
+ "pda": {
722
+ "seeds": [
723
+ {
724
+ "kind": "const",
725
+ "value": [
726
+ 99,
727
+ 111,
728
+ 110,
729
+ 102,
730
+ 105,
731
+ 103
732
+ ]
733
+ }
734
+ ]
735
+ }
736
+ }
737
+ ],
738
+ "args": [
739
+ {
740
+ "name": "params",
741
+ "type": {
742
+ "defined": {
743
+ "name": "SwapParams"
744
+ }
745
+ }
746
+ }
747
+ ]
748
+ },
749
+ {
750
+ "name": "set_fee_beneficiary",
751
+ "discriminator": [
752
+ 74,
753
+ 105,
754
+ 83,
755
+ 74,
756
+ 154,
757
+ 205,
758
+ 249,
759
+ 217
760
+ ],
761
+ "accounts": [
762
+ {
763
+ "name": "authority",
764
+ "writable": true,
765
+ "signer": true
766
+ },
767
+ {
768
+ "name": "config",
769
+ "writable": true,
770
+ "pda": {
771
+ "seeds": [
772
+ {
773
+ "kind": "const",
774
+ "value": [
775
+ 99,
776
+ 111,
777
+ 110,
778
+ 102,
779
+ 105,
780
+ 103
781
+ ]
782
+ }
783
+ ]
784
+ }
785
+ }
786
+ ],
787
+ "args": [
788
+ {
789
+ "name": "beneficiary",
790
+ "type": "pubkey"
791
+ }
792
+ ]
793
+ },
794
+ {
795
+ "name": "set_platform_base_token",
796
+ "discriminator": [
797
+ 157,
798
+ 110,
799
+ 249,
800
+ 237,
801
+ 128,
802
+ 5,
803
+ 212,
804
+ 233
805
+ ],
806
+ "accounts": [
807
+ {
808
+ "name": "authority",
809
+ "writable": true,
810
+ "signer": true
811
+ },
812
+ {
813
+ "name": "config",
814
+ "writable": true,
815
+ "pda": {
816
+ "seeds": [
817
+ {
818
+ "kind": "const",
819
+ "value": [
820
+ 99,
821
+ 111,
822
+ 110,
823
+ 102,
824
+ 105,
825
+ 103
826
+ ]
827
+ }
828
+ ]
829
+ }
830
+ },
831
+ {
832
+ "name": "system_program",
833
+ "address": "11111111111111111111111111111111"
834
+ },
835
+ {
836
+ "name": "program_data"
837
+ }
838
+ ],
839
+ "args": [
840
+ {
841
+ "name": "base_token",
842
+ "type": "pubkey"
843
+ }
844
+ ]
845
+ },
846
+ {
847
+ "name": "set_platform_fee",
848
+ "discriminator": [
849
+ 19,
850
+ 70,
851
+ 111,
852
+ 182,
853
+ 156,
854
+ 58,
855
+ 208,
856
+ 203
857
+ ],
858
+ "accounts": [
859
+ {
860
+ "name": "authority",
861
+ "writable": true,
862
+ "signer": true
863
+ },
864
+ {
865
+ "name": "config",
866
+ "writable": true,
867
+ "pda": {
868
+ "seeds": [
869
+ {
870
+ "kind": "const",
871
+ "value": [
872
+ 99,
873
+ 111,
874
+ 110,
875
+ 102,
876
+ 105,
877
+ 103
878
+ ]
879
+ }
880
+ ]
881
+ }
882
+ }
883
+ ],
884
+ "args": [
885
+ {
886
+ "name": "fee_bps",
887
+ "type": "u16"
888
+ }
889
+ ]
890
+ },
891
+ {
892
+ "name": "transfer_authority",
893
+ "discriminator": [
894
+ 48,
895
+ 169,
896
+ 76,
897
+ 72,
898
+ 229,
899
+ 180,
900
+ 55,
901
+ 161
902
+ ],
903
+ "accounts": [
904
+ {
905
+ "name": "authority",
906
+ "writable": true,
907
+ "signer": true
908
+ },
909
+ {
910
+ "name": "config",
911
+ "writable": true,
912
+ "pda": {
913
+ "seeds": [
914
+ {
915
+ "kind": "const",
916
+ "value": [
917
+ 99,
918
+ 111,
919
+ 110,
920
+ 102,
921
+ 105,
922
+ 103
923
+ ]
924
+ }
925
+ ]
926
+ }
927
+ }
928
+ ],
929
+ "args": [
930
+ {
931
+ "name": "new_authority",
932
+ "type": "pubkey"
933
+ }
934
+ ]
935
+ }
936
+ ],
937
+ "accounts": [
938
+ {
939
+ "name": "PlatformConfig",
940
+ "discriminator": [
941
+ 160,
942
+ 78,
943
+ 128,
944
+ 0,
945
+ 248,
946
+ 83,
947
+ 230,
948
+ 160
949
+ ]
950
+ },
951
+ {
952
+ "name": "Pool",
953
+ "discriminator": [
954
+ 241,
955
+ 154,
956
+ 109,
957
+ 4,
958
+ 17,
959
+ 177,
960
+ 109,
961
+ 188
962
+ ]
963
+ }
964
+ ],
965
+ "events": [
966
+ {
967
+ "name": "BuyEvent",
968
+ "discriminator": [
969
+ 103,
970
+ 244,
971
+ 82,
972
+ 31,
973
+ 44,
974
+ 245,
975
+ 119,
976
+ 119
977
+ ]
978
+ },
979
+ {
980
+ "name": "PoolCreated",
981
+ "discriminator": [
982
+ 202,
983
+ 44,
984
+ 41,
985
+ 88,
986
+ 104,
987
+ 220,
988
+ 157,
989
+ 82
990
+ ]
991
+ },
992
+ {
993
+ "name": "SellEvent",
994
+ "discriminator": [
995
+ 62,
996
+ 47,
997
+ 55,
998
+ 10,
999
+ 165,
1000
+ 3,
1001
+ 220,
1002
+ 42
1003
+ ]
1004
+ }
1005
+ ],
1006
+ "errors": [
1007
+ {
1008
+ "code": 6000,
1009
+ "name": "PoolDisabled",
1010
+ "msg": "Pool Disabled"
1011
+ },
1012
+ {
1013
+ "code": 6001,
1014
+ "name": "OwnerMustBeSystemAccount",
1015
+ "msg": "Owner must be a system account (wallet), not a PDA"
1016
+ },
1017
+ {
1018
+ "code": 6002,
1019
+ "name": "InvalidFeeDecay",
1020
+ "msg": "Invalid Fee Decay"
1021
+ },
1022
+ {
1023
+ "code": 6003,
1024
+ "name": "InvalidInitialTokenReserves",
1025
+ "msg": "Initial token reserves must be greater than 0"
1026
+ },
1027
+ {
1028
+ "code": 6004,
1029
+ "name": "InvalidMint",
1030
+ "msg": "Invalid Mint"
1031
+ },
1032
+ {
1033
+ "code": 6005,
1034
+ "name": "InvalidTokenAccount",
1035
+ "msg": "Invalid Token Account"
1036
+ },
1037
+ {
1038
+ "code": 6006,
1039
+ "name": "InsufficientFunds",
1040
+ "msg": "Insufficient Funds"
1041
+ },
1042
+ {
1043
+ "code": 6007,
1044
+ "name": "InvalidShift",
1045
+ "msg": "Shift must be greater than 0"
1046
+ },
1047
+ {
1048
+ "code": 6008,
1049
+ "name": "InvalidFees",
1050
+ "msg": "Fees must be between 0 and 10000 basis points"
1051
+ },
1052
+ {
1053
+ "code": 6009,
1054
+ "name": "MathOverflow",
1055
+ "msg": "MathOverflow"
1056
+ },
1057
+ {
1058
+ "code": 6010,
1059
+ "name": "InsufficientOutput",
1060
+ "msg": "Insufficient output"
1061
+ },
1062
+ {
1063
+ "code": 6011,
1064
+ "name": "InsufficientInput",
1065
+ "msg": "Insufficient input"
1066
+ },
1067
+ {
1068
+ "code": 6012,
1069
+ "name": "IllegalClaimant",
1070
+ "msg": "Illegal Claimant"
1071
+ },
1072
+ {
1073
+ "code": 6013,
1074
+ "name": "PoolEmpty",
1075
+ "msg": "Pool Empty"
1076
+ },
1077
+ {
1078
+ "code": 6014,
1079
+ "name": "InvalidPlatformBaseToken",
1080
+ "msg": "Pool base token is restricted by platform config"
1081
+ },
1082
+ {
1083
+ "code": 6015,
1084
+ "name": "InvalidPlatformFee",
1085
+ "msg": "Invalid platform fee"
1086
+ },
1087
+ {
1088
+ "code": 6016,
1089
+ "name": "InvalidBeneficiary",
1090
+ "msg": "Invalid fee beneficiary"
1091
+ },
1092
+ {
1093
+ "code": 6017,
1094
+ "name": "MissingBeneficiaryAccount",
1095
+ "msg": "Missing beneficiary accounts"
1096
+ },
1097
+ {
1098
+ "code": 6018,
1099
+ "name": "UnauthorizedAuthority",
1100
+ "msg": "Unauthorized program authority"
1101
+ },
1102
+ {
1103
+ "code": 6019,
1104
+ "name": "SnipingProtection",
1105
+ "msg": "Swapper not allowed during protected window"
1106
+ }
1107
+ ],
1108
+ "types": [
1109
+ {
1110
+ "name": "BuyEvent",
1111
+ "type": {
1112
+ "kind": "struct",
1113
+ "fields": [
1114
+ {
1115
+ "name": "pool",
1116
+ "type": "pubkey"
1117
+ },
1118
+ {
1119
+ "name": "user",
1120
+ "type": "pubkey"
1121
+ },
1122
+ {
1123
+ "name": "amount_a",
1124
+ "type": "u64"
1125
+ },
1126
+ {
1127
+ "name": "amount_b",
1128
+ "type": "u64"
1129
+ },
1130
+ {
1131
+ "name": "new_reserves_a",
1132
+ "type": "u128"
1133
+ },
1134
+ {
1135
+ "name": "new_reserves_b",
1136
+ "type": "u128"
1137
+ },
1138
+ {
1139
+ "name": "fee_a",
1140
+ "type": "u64"
1141
+ }
1142
+ ]
1143
+ }
1144
+ },
1145
+ {
1146
+ "name": "CreateFromVmmParams",
1147
+ "type": {
1148
+ "kind": "struct",
1149
+ "fields": [
1150
+ {
1151
+ "name": "shift",
1152
+ "type": "u128"
1153
+ },
1154
+ {
1155
+ "name": "initial_token_a_reserves",
1156
+ "type": "u64"
1157
+ },
1158
+ {
1159
+ "name": "initial_token_b_reserves",
1160
+ "type": "u64"
1161
+ },
1162
+ {
1163
+ "name": "curve",
1164
+ "type": {
1165
+ "defined": {
1166
+ "name": "CurveType"
1167
+ }
1168
+ }
1169
+ },
1170
+ {
1171
+ "name": "fee_beneficiaries",
1172
+ "type": {
1173
+ "vec": {
1174
+ "defined": {
1175
+ "name": "FeeBeneficiary"
1176
+ }
1177
+ }
1178
+ }
1179
+ }
1180
+ ]
1181
+ }
1182
+ },
1183
+ {
1184
+ "name": "CreateParams",
1185
+ "type": {
1186
+ "kind": "struct",
1187
+ "fields": [
1188
+ {
1189
+ "name": "shift",
1190
+ "type": "u128"
1191
+ },
1192
+ {
1193
+ "name": "initial_token_b_reserves",
1194
+ "type": "u64"
1195
+ },
1196
+ {
1197
+ "name": "curve",
1198
+ "type": {
1199
+ "defined": {
1200
+ "name": "CurveType"
1201
+ }
1202
+ }
1203
+ },
1204
+ {
1205
+ "name": "fee_beneficiaries",
1206
+ "type": {
1207
+ "vec": {
1208
+ "defined": {
1209
+ "name": "FeeBeneficiary"
1210
+ }
1211
+ }
1212
+ }
1213
+ }
1214
+ ]
1215
+ }
1216
+ },
1217
+ {
1218
+ "name": "CurveType",
1219
+ "type": {
1220
+ "kind": "enum",
1221
+ "variants": [
1222
+ {
1223
+ "name": "ConstantProduct"
1224
+ },
1225
+ {
1226
+ "name": "Exponential"
1227
+ }
1228
+ ]
1229
+ }
1230
+ },
1231
+ {
1232
+ "name": "FeeBeneficiary",
1233
+ "type": {
1234
+ "kind": "struct",
1235
+ "fields": [
1236
+ {
1237
+ "name": "wallet",
1238
+ "type": "pubkey"
1239
+ },
1240
+ {
1241
+ "name": "share_bps",
1242
+ "type": "u16"
1243
+ }
1244
+ ]
1245
+ }
1246
+ },
1247
+ {
1248
+ "name": "PlatformConfig",
1249
+ "type": {
1250
+ "kind": "struct",
1251
+ "fields": [
1252
+ {
1253
+ "name": "authority",
1254
+ "type": "pubkey"
1255
+ },
1256
+ {
1257
+ "name": "fee_beneficiary",
1258
+ "type": "pubkey"
1259
+ },
1260
+ {
1261
+ "name": "base_token",
1262
+ "type": "pubkey"
1263
+ },
1264
+ {
1265
+ "name": "platform_fee_bps",
1266
+ "type": "u16"
1267
+ },
1268
+ {
1269
+ "name": "bump",
1270
+ "type": "u8"
1271
+ }
1272
+ ]
1273
+ }
1274
+ },
1275
+ {
1276
+ "name": "Pool",
1277
+ "type": {
1278
+ "kind": "struct",
1279
+ "fields": [
1280
+ {
1281
+ "name": "enabled",
1282
+ "type": "bool"
1283
+ },
1284
+ {
1285
+ "name": "owner",
1286
+ "type": "pubkey"
1287
+ },
1288
+ {
1289
+ "name": "mint_a",
1290
+ "type": "pubkey"
1291
+ },
1292
+ {
1293
+ "name": "mint_b",
1294
+ "type": "pubkey"
1295
+ },
1296
+ {
1297
+ "name": "token_a_reserves",
1298
+ "type": "u128"
1299
+ },
1300
+ {
1301
+ "name": "token_b_reserves",
1302
+ "type": "u128"
1303
+ },
1304
+ {
1305
+ "name": "shift",
1306
+ "type": "u128"
1307
+ },
1308
+ {
1309
+ "name": "curve",
1310
+ "type": {
1311
+ "defined": {
1312
+ "name": "CurveType"
1313
+ }
1314
+ }
1315
+ },
1316
+ {
1317
+ "name": "fee_beneficiary_count",
1318
+ "type": "u8"
1319
+ },
1320
+ {
1321
+ "name": "fee_beneficiaries",
1322
+ "type": {
1323
+ "array": [
1324
+ {
1325
+ "defined": {
1326
+ "name": "FeeBeneficiary"
1327
+ }
1328
+ },
1329
+ 5
1330
+ ]
1331
+ }
1332
+ },
1333
+ {
1334
+ "name": "bump",
1335
+ "type": "u8"
1336
+ }
1337
+ ]
1338
+ }
1339
+ },
1340
+ {
1341
+ "name": "PoolCreated",
1342
+ "type": {
1343
+ "kind": "struct",
1344
+ "fields": [
1345
+ {
1346
+ "name": "pool",
1347
+ "type": "pubkey"
1348
+ },
1349
+ {
1350
+ "name": "mint_a",
1351
+ "type": "pubkey"
1352
+ },
1353
+ {
1354
+ "name": "mint_b",
1355
+ "type": "pubkey"
1356
+ },
1357
+ {
1358
+ "name": "owner",
1359
+ "type": "pubkey"
1360
+ },
1361
+ {
1362
+ "name": "initial_token_reserves",
1363
+ "type": "u64"
1364
+ },
1365
+ {
1366
+ "name": "shift",
1367
+ "type": "u128"
1368
+ },
1369
+ {
1370
+ "name": "curve",
1371
+ "type": {
1372
+ "defined": {
1373
+ "name": "CurveType"
1374
+ }
1375
+ }
1376
+ },
1377
+ {
1378
+ "name": "fee_beneficiaries",
1379
+ "type": {
1380
+ "vec": {
1381
+ "defined": {
1382
+ "name": "FeeBeneficiary"
1383
+ }
1384
+ }
1385
+ }
1386
+ }
1387
+ ]
1388
+ }
1389
+ },
1390
+ {
1391
+ "name": "SellEvent",
1392
+ "type": {
1393
+ "kind": "struct",
1394
+ "fields": [
1395
+ {
1396
+ "name": "pool",
1397
+ "type": "pubkey"
1398
+ },
1399
+ {
1400
+ "name": "user",
1401
+ "type": "pubkey"
1402
+ },
1403
+ {
1404
+ "name": "amount_a",
1405
+ "type": "u64"
1406
+ },
1407
+ {
1408
+ "name": "amount_b",
1409
+ "type": "u64"
1410
+ },
1411
+ {
1412
+ "name": "new_reserves_a",
1413
+ "type": "u128"
1414
+ },
1415
+ {
1416
+ "name": "new_reserves_b",
1417
+ "type": "u128"
1418
+ },
1419
+ {
1420
+ "name": "fee_a",
1421
+ "type": "u64"
1422
+ }
1423
+ ]
1424
+ }
1425
+ },
1426
+ {
1427
+ "name": "SwapParams",
1428
+ "type": {
1429
+ "kind": "struct",
1430
+ "fields": [
1431
+ {
1432
+ "name": "amount",
1433
+ "type": "u64"
1434
+ },
1435
+ {
1436
+ "name": "limit",
1437
+ "type": "u64"
1438
+ }
1439
+ ]
1440
+ }
1441
+ },
1442
+ {
1443
+ "name": "SwapResult",
1444
+ "type": {
1445
+ "kind": "struct",
1446
+ "fields": [
1447
+ {
1448
+ "name": "new_reserves_a",
1449
+ "type": "u128"
1450
+ },
1451
+ {
1452
+ "name": "new_reserves_b",
1453
+ "type": "u128"
1454
+ },
1455
+ {
1456
+ "name": "amount_a",
1457
+ "type": "u64"
1458
+ },
1459
+ {
1460
+ "name": "amount_b",
1461
+ "type": "u64"
1462
+ },
1463
+ {
1464
+ "name": "fee_a",
1465
+ "type": "u64"
1466
+ }
1467
+ ]
1468
+ }
1469
+ }
1470
+ ]
1471
+ }