@pump-fun/pump-sdk 1.19.0-devnet.1 → 1.20.0-devnet.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.
- package/dist/esm/index.js +460 -185
- package/dist/index.d.mts +1025 -615
- package/dist/index.d.ts +1025 -615
- package/dist/index.js +457 -184
- package/package.json +1 -1
- package/src/idl/pump.json +338 -148
- package/src/idl/pump.ts +338 -148
- package/src/onlineSdk.ts +4 -4
- package/src/sdk.ts +121 -4
package/dist/esm/index.js
CHANGED
|
@@ -2302,41 +2302,8 @@ var pump_default = {
|
|
|
2302
2302
|
path: "bonding_curve"
|
|
2303
2303
|
},
|
|
2304
2304
|
{
|
|
2305
|
-
kind: "
|
|
2306
|
-
|
|
2307
|
-
6,
|
|
2308
|
-
221,
|
|
2309
|
-
246,
|
|
2310
|
-
225,
|
|
2311
|
-
215,
|
|
2312
|
-
101,
|
|
2313
|
-
161,
|
|
2314
|
-
147,
|
|
2315
|
-
217,
|
|
2316
|
-
203,
|
|
2317
|
-
225,
|
|
2318
|
-
70,
|
|
2319
|
-
206,
|
|
2320
|
-
235,
|
|
2321
|
-
121,
|
|
2322
|
-
172,
|
|
2323
|
-
28,
|
|
2324
|
-
180,
|
|
2325
|
-
133,
|
|
2326
|
-
237,
|
|
2327
|
-
95,
|
|
2328
|
-
91,
|
|
2329
|
-
55,
|
|
2330
|
-
145,
|
|
2331
|
-
58,
|
|
2332
|
-
140,
|
|
2333
|
-
245,
|
|
2334
|
-
133,
|
|
2335
|
-
126,
|
|
2336
|
-
255,
|
|
2337
|
-
0,
|
|
2338
|
-
169
|
|
2339
|
-
]
|
|
2305
|
+
kind: "account",
|
|
2306
|
+
path: "token_program"
|
|
2340
2307
|
},
|
|
2341
2308
|
{
|
|
2342
2309
|
kind: "account",
|
|
@@ -2396,8 +2363,7 @@ var pump_default = {
|
|
|
2396
2363
|
address: "11111111111111111111111111111111"
|
|
2397
2364
|
},
|
|
2398
2365
|
{
|
|
2399
|
-
name: "token_program"
|
|
2400
|
-
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
2366
|
+
name: "token_program"
|
|
2401
2367
|
},
|
|
2402
2368
|
{
|
|
2403
2369
|
name: "creator_vault",
|
|
@@ -2718,41 +2684,8 @@ var pump_default = {
|
|
|
2718
2684
|
path: "bonding_curve"
|
|
2719
2685
|
},
|
|
2720
2686
|
{
|
|
2721
|
-
kind: "
|
|
2722
|
-
|
|
2723
|
-
6,
|
|
2724
|
-
221,
|
|
2725
|
-
246,
|
|
2726
|
-
225,
|
|
2727
|
-
215,
|
|
2728
|
-
101,
|
|
2729
|
-
161,
|
|
2730
|
-
147,
|
|
2731
|
-
217,
|
|
2732
|
-
203,
|
|
2733
|
-
225,
|
|
2734
|
-
70,
|
|
2735
|
-
206,
|
|
2736
|
-
235,
|
|
2737
|
-
121,
|
|
2738
|
-
172,
|
|
2739
|
-
28,
|
|
2740
|
-
180,
|
|
2741
|
-
133,
|
|
2742
|
-
237,
|
|
2743
|
-
95,
|
|
2744
|
-
91,
|
|
2745
|
-
55,
|
|
2746
|
-
145,
|
|
2747
|
-
58,
|
|
2748
|
-
140,
|
|
2749
|
-
245,
|
|
2750
|
-
133,
|
|
2751
|
-
126,
|
|
2752
|
-
255,
|
|
2753
|
-
0,
|
|
2754
|
-
169
|
|
2755
|
-
]
|
|
2687
|
+
kind: "account",
|
|
2688
|
+
path: "token_program"
|
|
2756
2689
|
},
|
|
2757
2690
|
{
|
|
2758
2691
|
kind: "account",
|
|
@@ -2812,8 +2745,7 @@ var pump_default = {
|
|
|
2812
2745
|
address: "11111111111111111111111111111111"
|
|
2813
2746
|
},
|
|
2814
2747
|
{
|
|
2815
|
-
name: "token_program"
|
|
2816
|
-
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
2748
|
+
name: "token_program"
|
|
2817
2749
|
},
|
|
2818
2750
|
{
|
|
2819
2751
|
name: "creator_vault",
|
|
@@ -3736,14 +3668,239 @@ var pump_default = {
|
|
|
3736
3668
|
]
|
|
3737
3669
|
},
|
|
3738
3670
|
{
|
|
3739
|
-
kind: "account",
|
|
3740
|
-
path: "mint"
|
|
3671
|
+
kind: "account",
|
|
3672
|
+
path: "mint"
|
|
3673
|
+
}
|
|
3674
|
+
],
|
|
3675
|
+
program: {
|
|
3676
|
+
kind: "account",
|
|
3677
|
+
path: "mpl_token_metadata"
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
},
|
|
3681
|
+
{
|
|
3682
|
+
name: "user",
|
|
3683
|
+
writable: true,
|
|
3684
|
+
signer: true
|
|
3685
|
+
},
|
|
3686
|
+
{
|
|
3687
|
+
name: "system_program",
|
|
3688
|
+
address: "11111111111111111111111111111111"
|
|
3689
|
+
},
|
|
3690
|
+
{
|
|
3691
|
+
name: "token_program",
|
|
3692
|
+
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
3693
|
+
},
|
|
3694
|
+
{
|
|
3695
|
+
name: "associated_token_program",
|
|
3696
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
3697
|
+
},
|
|
3698
|
+
{
|
|
3699
|
+
name: "rent",
|
|
3700
|
+
address: "SysvarRent111111111111111111111111111111111"
|
|
3701
|
+
},
|
|
3702
|
+
{
|
|
3703
|
+
name: "event_authority",
|
|
3704
|
+
pda: {
|
|
3705
|
+
seeds: [
|
|
3706
|
+
{
|
|
3707
|
+
kind: "const",
|
|
3708
|
+
value: [
|
|
3709
|
+
95,
|
|
3710
|
+
95,
|
|
3711
|
+
101,
|
|
3712
|
+
118,
|
|
3713
|
+
101,
|
|
3714
|
+
110,
|
|
3715
|
+
116,
|
|
3716
|
+
95,
|
|
3717
|
+
97,
|
|
3718
|
+
117,
|
|
3719
|
+
116,
|
|
3720
|
+
104,
|
|
3721
|
+
111,
|
|
3722
|
+
114,
|
|
3723
|
+
105,
|
|
3724
|
+
116,
|
|
3725
|
+
121
|
|
3726
|
+
]
|
|
3727
|
+
}
|
|
3728
|
+
]
|
|
3729
|
+
}
|
|
3730
|
+
},
|
|
3731
|
+
{
|
|
3732
|
+
name: "program"
|
|
3733
|
+
}
|
|
3734
|
+
],
|
|
3735
|
+
args: [
|
|
3736
|
+
{
|
|
3737
|
+
name: "name",
|
|
3738
|
+
type: "string"
|
|
3739
|
+
},
|
|
3740
|
+
{
|
|
3741
|
+
name: "symbol",
|
|
3742
|
+
type: "string"
|
|
3743
|
+
},
|
|
3744
|
+
{
|
|
3745
|
+
name: "uri",
|
|
3746
|
+
type: "string"
|
|
3747
|
+
},
|
|
3748
|
+
{
|
|
3749
|
+
name: "creator",
|
|
3750
|
+
type: "pubkey"
|
|
3751
|
+
}
|
|
3752
|
+
]
|
|
3753
|
+
},
|
|
3754
|
+
{
|
|
3755
|
+
name: "create_v2",
|
|
3756
|
+
docs: [
|
|
3757
|
+
"Creates a new spl-22 coin and bonding curve."
|
|
3758
|
+
],
|
|
3759
|
+
discriminator: [
|
|
3760
|
+
214,
|
|
3761
|
+
144,
|
|
3762
|
+
76,
|
|
3763
|
+
236,
|
|
3764
|
+
95,
|
|
3765
|
+
139,
|
|
3766
|
+
49,
|
|
3767
|
+
180
|
|
3768
|
+
],
|
|
3769
|
+
accounts: [
|
|
3770
|
+
{
|
|
3771
|
+
name: "mint",
|
|
3772
|
+
writable: true,
|
|
3773
|
+
signer: true
|
|
3774
|
+
},
|
|
3775
|
+
{
|
|
3776
|
+
name: "mint_authority",
|
|
3777
|
+
pda: {
|
|
3778
|
+
seeds: [
|
|
3779
|
+
{
|
|
3780
|
+
kind: "const",
|
|
3781
|
+
value: [
|
|
3782
|
+
109,
|
|
3783
|
+
105,
|
|
3784
|
+
110,
|
|
3785
|
+
116,
|
|
3786
|
+
45,
|
|
3787
|
+
97,
|
|
3788
|
+
117,
|
|
3789
|
+
116,
|
|
3790
|
+
104,
|
|
3791
|
+
111,
|
|
3792
|
+
114,
|
|
3793
|
+
105,
|
|
3794
|
+
116,
|
|
3795
|
+
121
|
|
3796
|
+
]
|
|
3797
|
+
}
|
|
3798
|
+
]
|
|
3799
|
+
}
|
|
3800
|
+
},
|
|
3801
|
+
{
|
|
3802
|
+
name: "bonding_curve",
|
|
3803
|
+
writable: true,
|
|
3804
|
+
pda: {
|
|
3805
|
+
seeds: [
|
|
3806
|
+
{
|
|
3807
|
+
kind: "const",
|
|
3808
|
+
value: [
|
|
3809
|
+
98,
|
|
3810
|
+
111,
|
|
3811
|
+
110,
|
|
3812
|
+
100,
|
|
3813
|
+
105,
|
|
3814
|
+
110,
|
|
3815
|
+
103,
|
|
3816
|
+
45,
|
|
3817
|
+
99,
|
|
3818
|
+
117,
|
|
3819
|
+
114,
|
|
3820
|
+
118,
|
|
3821
|
+
101
|
|
3822
|
+
]
|
|
3823
|
+
},
|
|
3824
|
+
{
|
|
3825
|
+
kind: "account",
|
|
3826
|
+
path: "mint"
|
|
3827
|
+
}
|
|
3828
|
+
]
|
|
3829
|
+
}
|
|
3830
|
+
},
|
|
3831
|
+
{
|
|
3832
|
+
name: "associated_bonding_curve",
|
|
3833
|
+
writable: true,
|
|
3834
|
+
pda: {
|
|
3835
|
+
seeds: [
|
|
3836
|
+
{
|
|
3837
|
+
kind: "account",
|
|
3838
|
+
path: "bonding_curve"
|
|
3839
|
+
},
|
|
3840
|
+
{
|
|
3841
|
+
kind: "account",
|
|
3842
|
+
path: "token_program"
|
|
3843
|
+
},
|
|
3844
|
+
{
|
|
3845
|
+
kind: "account",
|
|
3846
|
+
path: "mint"
|
|
3847
|
+
}
|
|
3848
|
+
],
|
|
3849
|
+
program: {
|
|
3850
|
+
kind: "const",
|
|
3851
|
+
value: [
|
|
3852
|
+
140,
|
|
3853
|
+
151,
|
|
3854
|
+
37,
|
|
3855
|
+
143,
|
|
3856
|
+
78,
|
|
3857
|
+
36,
|
|
3858
|
+
137,
|
|
3859
|
+
241,
|
|
3860
|
+
187,
|
|
3861
|
+
61,
|
|
3862
|
+
16,
|
|
3863
|
+
41,
|
|
3864
|
+
20,
|
|
3865
|
+
142,
|
|
3866
|
+
13,
|
|
3867
|
+
131,
|
|
3868
|
+
11,
|
|
3869
|
+
90,
|
|
3870
|
+
19,
|
|
3871
|
+
153,
|
|
3872
|
+
218,
|
|
3873
|
+
255,
|
|
3874
|
+
16,
|
|
3875
|
+
132,
|
|
3876
|
+
4,
|
|
3877
|
+
142,
|
|
3878
|
+
123,
|
|
3879
|
+
216,
|
|
3880
|
+
219,
|
|
3881
|
+
233,
|
|
3882
|
+
248,
|
|
3883
|
+
89
|
|
3884
|
+
]
|
|
3885
|
+
}
|
|
3886
|
+
}
|
|
3887
|
+
},
|
|
3888
|
+
{
|
|
3889
|
+
name: "global",
|
|
3890
|
+
pda: {
|
|
3891
|
+
seeds: [
|
|
3892
|
+
{
|
|
3893
|
+
kind: "const",
|
|
3894
|
+
value: [
|
|
3895
|
+
103,
|
|
3896
|
+
108,
|
|
3897
|
+
111,
|
|
3898
|
+
98,
|
|
3899
|
+
97,
|
|
3900
|
+
108
|
|
3901
|
+
]
|
|
3741
3902
|
}
|
|
3742
|
-
]
|
|
3743
|
-
program: {
|
|
3744
|
-
kind: "account",
|
|
3745
|
-
path: "mpl_token_metadata"
|
|
3746
|
-
}
|
|
3903
|
+
]
|
|
3747
3904
|
}
|
|
3748
3905
|
},
|
|
3749
3906
|
{
|
|
@@ -3757,16 +3914,12 @@ var pump_default = {
|
|
|
3757
3914
|
},
|
|
3758
3915
|
{
|
|
3759
3916
|
name: "token_program",
|
|
3760
|
-
address: "
|
|
3917
|
+
address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
|
|
3761
3918
|
},
|
|
3762
3919
|
{
|
|
3763
3920
|
name: "associated_token_program",
|
|
3764
3921
|
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
3765
3922
|
},
|
|
3766
|
-
{
|
|
3767
|
-
name: "rent",
|
|
3768
|
-
address: "SysvarRent111111111111111111111111111111111"
|
|
3769
|
-
},
|
|
3770
3923
|
{
|
|
3771
3924
|
name: "event_authority",
|
|
3772
3925
|
pda: {
|
|
@@ -4113,41 +4266,8 @@ var pump_default = {
|
|
|
4113
4266
|
path: "bonding_curve"
|
|
4114
4267
|
},
|
|
4115
4268
|
{
|
|
4116
|
-
kind: "
|
|
4117
|
-
|
|
4118
|
-
6,
|
|
4119
|
-
221,
|
|
4120
|
-
246,
|
|
4121
|
-
225,
|
|
4122
|
-
215,
|
|
4123
|
-
101,
|
|
4124
|
-
161,
|
|
4125
|
-
147,
|
|
4126
|
-
217,
|
|
4127
|
-
203,
|
|
4128
|
-
225,
|
|
4129
|
-
70,
|
|
4130
|
-
206,
|
|
4131
|
-
235,
|
|
4132
|
-
121,
|
|
4133
|
-
172,
|
|
4134
|
-
28,
|
|
4135
|
-
180,
|
|
4136
|
-
133,
|
|
4137
|
-
237,
|
|
4138
|
-
95,
|
|
4139
|
-
91,
|
|
4140
|
-
55,
|
|
4141
|
-
145,
|
|
4142
|
-
58,
|
|
4143
|
-
140,
|
|
4144
|
-
245,
|
|
4145
|
-
133,
|
|
4146
|
-
126,
|
|
4147
|
-
255,
|
|
4148
|
-
0,
|
|
4149
|
-
169
|
|
4150
|
-
]
|
|
4269
|
+
kind: "account",
|
|
4270
|
+
path: "mint"
|
|
4151
4271
|
},
|
|
4152
4272
|
{
|
|
4153
4273
|
kind: "account",
|
|
@@ -4291,7 +4411,7 @@ var pump_default = {
|
|
|
4291
4411
|
},
|
|
4292
4412
|
{
|
|
4293
4413
|
kind: "account",
|
|
4294
|
-
path: "
|
|
4414
|
+
path: "mint"
|
|
4295
4415
|
},
|
|
4296
4416
|
{
|
|
4297
4417
|
kind: "account",
|
|
@@ -4429,7 +4549,7 @@ var pump_default = {
|
|
|
4429
4549
|
},
|
|
4430
4550
|
{
|
|
4431
4551
|
kind: "account",
|
|
4432
|
-
path: "
|
|
4552
|
+
path: "mint"
|
|
4433
4553
|
},
|
|
4434
4554
|
{
|
|
4435
4555
|
kind: "account",
|
|
@@ -4623,41 +4743,8 @@ var pump_default = {
|
|
|
4623
4743
|
path: "bonding_curve"
|
|
4624
4744
|
},
|
|
4625
4745
|
{
|
|
4626
|
-
kind: "
|
|
4627
|
-
|
|
4628
|
-
6,
|
|
4629
|
-
221,
|
|
4630
|
-
246,
|
|
4631
|
-
225,
|
|
4632
|
-
215,
|
|
4633
|
-
101,
|
|
4634
|
-
161,
|
|
4635
|
-
147,
|
|
4636
|
-
217,
|
|
4637
|
-
203,
|
|
4638
|
-
225,
|
|
4639
|
-
70,
|
|
4640
|
-
206,
|
|
4641
|
-
235,
|
|
4642
|
-
121,
|
|
4643
|
-
172,
|
|
4644
|
-
28,
|
|
4645
|
-
180,
|
|
4646
|
-
133,
|
|
4647
|
-
237,
|
|
4648
|
-
95,
|
|
4649
|
-
91,
|
|
4650
|
-
55,
|
|
4651
|
-
145,
|
|
4652
|
-
58,
|
|
4653
|
-
140,
|
|
4654
|
-
245,
|
|
4655
|
-
133,
|
|
4656
|
-
126,
|
|
4657
|
-
255,
|
|
4658
|
-
0,
|
|
4659
|
-
169
|
|
4660
|
-
]
|
|
4746
|
+
kind: "account",
|
|
4747
|
+
path: "token_program"
|
|
4661
4748
|
},
|
|
4662
4749
|
{
|
|
4663
4750
|
kind: "account",
|
|
@@ -4748,8 +4835,7 @@ var pump_default = {
|
|
|
4748
4835
|
}
|
|
4749
4836
|
},
|
|
4750
4837
|
{
|
|
4751
|
-
name: "token_program"
|
|
4752
|
-
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
4838
|
+
name: "token_program"
|
|
4753
4839
|
},
|
|
4754
4840
|
{
|
|
4755
4841
|
name: "event_authority",
|
|
@@ -5508,6 +5594,86 @@ var pump_default = {
|
|
|
5508
5594
|
],
|
|
5509
5595
|
args: []
|
|
5510
5596
|
},
|
|
5597
|
+
{
|
|
5598
|
+
name: "toggle_create_v2",
|
|
5599
|
+
discriminator: [
|
|
5600
|
+
28,
|
|
5601
|
+
255,
|
|
5602
|
+
230,
|
|
5603
|
+
240,
|
|
5604
|
+
172,
|
|
5605
|
+
107,
|
|
5606
|
+
203,
|
|
5607
|
+
171
|
|
5608
|
+
],
|
|
5609
|
+
accounts: [
|
|
5610
|
+
{
|
|
5611
|
+
name: "global",
|
|
5612
|
+
writable: true,
|
|
5613
|
+
pda: {
|
|
5614
|
+
seeds: [
|
|
5615
|
+
{
|
|
5616
|
+
kind: "const",
|
|
5617
|
+
value: [
|
|
5618
|
+
103,
|
|
5619
|
+
108,
|
|
5620
|
+
111,
|
|
5621
|
+
98,
|
|
5622
|
+
97,
|
|
5623
|
+
108
|
|
5624
|
+
]
|
|
5625
|
+
}
|
|
5626
|
+
]
|
|
5627
|
+
}
|
|
5628
|
+
},
|
|
5629
|
+
{
|
|
5630
|
+
name: "authority",
|
|
5631
|
+
writable: true,
|
|
5632
|
+
signer: true,
|
|
5633
|
+
relations: [
|
|
5634
|
+
"global"
|
|
5635
|
+
]
|
|
5636
|
+
},
|
|
5637
|
+
{
|
|
5638
|
+
name: "event_authority",
|
|
5639
|
+
pda: {
|
|
5640
|
+
seeds: [
|
|
5641
|
+
{
|
|
5642
|
+
kind: "const",
|
|
5643
|
+
value: [
|
|
5644
|
+
95,
|
|
5645
|
+
95,
|
|
5646
|
+
101,
|
|
5647
|
+
118,
|
|
5648
|
+
101,
|
|
5649
|
+
110,
|
|
5650
|
+
116,
|
|
5651
|
+
95,
|
|
5652
|
+
97,
|
|
5653
|
+
117,
|
|
5654
|
+
116,
|
|
5655
|
+
104,
|
|
5656
|
+
111,
|
|
5657
|
+
114,
|
|
5658
|
+
105,
|
|
5659
|
+
116,
|
|
5660
|
+
121
|
|
5661
|
+
]
|
|
5662
|
+
}
|
|
5663
|
+
]
|
|
5664
|
+
}
|
|
5665
|
+
},
|
|
5666
|
+
{
|
|
5667
|
+
name: "program"
|
|
5668
|
+
}
|
|
5669
|
+
],
|
|
5670
|
+
args: [
|
|
5671
|
+
{
|
|
5672
|
+
name: "enabled",
|
|
5673
|
+
type: "bool"
|
|
5674
|
+
}
|
|
5675
|
+
]
|
|
5676
|
+
},
|
|
5511
5677
|
{
|
|
5512
5678
|
name: "update_global_authority",
|
|
5513
5679
|
discriminator: [
|
|
@@ -6082,6 +6248,22 @@ var pump_default = {
|
|
|
6082
6248
|
code: 6042,
|
|
6083
6249
|
name: "BuySlippageBelowMinTokensOut",
|
|
6084
6250
|
msg: "Slippage: Would buy less tokens than expected min_tokens_out"
|
|
6251
|
+
},
|
|
6252
|
+
{
|
|
6253
|
+
code: 6043,
|
|
6254
|
+
name: "NameTooLong"
|
|
6255
|
+
},
|
|
6256
|
+
{
|
|
6257
|
+
code: 6044,
|
|
6258
|
+
name: "SymbolTooLong"
|
|
6259
|
+
},
|
|
6260
|
+
{
|
|
6261
|
+
code: 6045,
|
|
6262
|
+
name: "UriTooLong"
|
|
6263
|
+
},
|
|
6264
|
+
{
|
|
6265
|
+
code: 6046,
|
|
6266
|
+
name: "CreateV2Disabled"
|
|
6085
6267
|
}
|
|
6086
6268
|
],
|
|
6087
6269
|
types: [
|
|
@@ -6401,6 +6583,10 @@ var pump_default = {
|
|
|
6401
6583
|
{
|
|
6402
6584
|
name: "token_total_supply",
|
|
6403
6585
|
type: "u64"
|
|
6586
|
+
},
|
|
6587
|
+
{
|
|
6588
|
+
name: "token_program",
|
|
6589
|
+
type: "pubkey"
|
|
6404
6590
|
}
|
|
6405
6591
|
]
|
|
6406
6592
|
}
|
|
@@ -6582,6 +6768,10 @@ var pump_default = {
|
|
|
6582
6768
|
{
|
|
6583
6769
|
name: "admin_set_creator_authority",
|
|
6584
6770
|
type: "pubkey"
|
|
6771
|
+
},
|
|
6772
|
+
{
|
|
6773
|
+
name: "create_v2_enabled",
|
|
6774
|
+
type: "bool"
|
|
6585
6775
|
}
|
|
6586
6776
|
]
|
|
6587
6777
|
}
|
|
@@ -7207,7 +7397,9 @@ import { AnchorProvider, Program } from "@coral-xyz/anchor";
|
|
|
7207
7397
|
import { PUMP_AMM_SDK as PUMP_AMM_SDK2 } from "@pump-fun/pump-swap-sdk";
|
|
7208
7398
|
import {
|
|
7209
7399
|
createAssociatedTokenAccountIdempotentInstruction,
|
|
7210
|
-
getAssociatedTokenAddressSync as getAssociatedTokenAddressSync2
|
|
7400
|
+
getAssociatedTokenAddressSync as getAssociatedTokenAddressSync2,
|
|
7401
|
+
TOKEN_2022_PROGRAM_ID as TOKEN_2022_PROGRAM_ID2,
|
|
7402
|
+
TOKEN_PROGRAM_ID as TOKEN_PROGRAM_ID2
|
|
7211
7403
|
} from "@solana/spl-token";
|
|
7212
7404
|
import {
|
|
7213
7405
|
PublicKey as PublicKey4
|
|
@@ -7317,10 +7509,10 @@ var OnlinePumpSdk = class {
|
|
|
7317
7509
|
bondingCurvePda(mint)
|
|
7318
7510
|
);
|
|
7319
7511
|
}
|
|
7320
|
-
async fetchBuyState(mint, user) {
|
|
7512
|
+
async fetchBuyState(mint, user, tokenProgram = TOKEN_PROGRAM_ID) {
|
|
7321
7513
|
const [bondingCurveAccountInfo, associatedUserAccountInfo] = await this.connection.getMultipleAccountsInfo([
|
|
7322
7514
|
bondingCurvePda(mint),
|
|
7323
|
-
getAssociatedTokenAddressSync(mint, user, true)
|
|
7515
|
+
getAssociatedTokenAddressSync(mint, user, true, tokenProgram)
|
|
7324
7516
|
]);
|
|
7325
7517
|
if (!bondingCurveAccountInfo) {
|
|
7326
7518
|
throw new Error(
|
|
@@ -7330,10 +7522,10 @@ var OnlinePumpSdk = class {
|
|
|
7330
7522
|
const bondingCurve = PUMP_SDK.decodeBondingCurve(bondingCurveAccountInfo);
|
|
7331
7523
|
return { bondingCurveAccountInfo, bondingCurve, associatedUserAccountInfo };
|
|
7332
7524
|
}
|
|
7333
|
-
async fetchSellState(mint, user) {
|
|
7525
|
+
async fetchSellState(mint, user, tokenProgram = TOKEN_PROGRAM_ID) {
|
|
7334
7526
|
const [bondingCurveAccountInfo, associatedUserAccountInfo] = await this.connection.getMultipleAccountsInfo([
|
|
7335
7527
|
bondingCurvePda(mint),
|
|
7336
|
-
getAssociatedTokenAddressSync(mint, user, true)
|
|
7528
|
+
getAssociatedTokenAddressSync(mint, user, true, tokenProgram)
|
|
7337
7529
|
]);
|
|
7338
7530
|
if (!bondingCurveAccountInfo) {
|
|
7339
7531
|
throw new Error(
|
|
@@ -7639,6 +7831,9 @@ var PumpSdk = class {
|
|
|
7639
7831
|
return null;
|
|
7640
7832
|
}
|
|
7641
7833
|
}
|
|
7834
|
+
/**
|
|
7835
|
+
* @deprecated Use `createInstructionV2` instead.
|
|
7836
|
+
*/
|
|
7642
7837
|
async createInstruction({
|
|
7643
7838
|
mint,
|
|
7644
7839
|
name,
|
|
@@ -7649,7 +7844,22 @@ var PumpSdk = class {
|
|
|
7649
7844
|
}) {
|
|
7650
7845
|
return await this.offlinePumpProgram.methods.create(name, symbol, uri, creator).accountsPartial({
|
|
7651
7846
|
mint,
|
|
7652
|
-
user
|
|
7847
|
+
user,
|
|
7848
|
+
tokenProgram: TOKEN_PROGRAM_ID2
|
|
7849
|
+
}).instruction();
|
|
7850
|
+
}
|
|
7851
|
+
async createV2Instruction({
|
|
7852
|
+
mint,
|
|
7853
|
+
name,
|
|
7854
|
+
symbol,
|
|
7855
|
+
uri,
|
|
7856
|
+
creator,
|
|
7857
|
+
user
|
|
7858
|
+
}) {
|
|
7859
|
+
return await this.offlinePumpProgram.methods.createV2(name, symbol, uri, creator).accountsPartial({
|
|
7860
|
+
mint,
|
|
7861
|
+
user,
|
|
7862
|
+
tokenProgram: TOKEN_2022_PROGRAM_ID2
|
|
7653
7863
|
}).instruction();
|
|
7654
7864
|
}
|
|
7655
7865
|
async buyInstructions({
|
|
@@ -7661,7 +7871,8 @@ var PumpSdk = class {
|
|
|
7661
7871
|
user,
|
|
7662
7872
|
amount,
|
|
7663
7873
|
solAmount,
|
|
7664
|
-
slippage
|
|
7874
|
+
slippage,
|
|
7875
|
+
tokenProgram = TOKEN_PROGRAM_ID2
|
|
7665
7876
|
}) {
|
|
7666
7877
|
const instructions = [];
|
|
7667
7878
|
if (bondingCurveAccountInfo.data.length < BONDING_CURVE_NEW_SIZE) {
|
|
@@ -7672,14 +7883,15 @@ var PumpSdk = class {
|
|
|
7672
7883
|
})
|
|
7673
7884
|
);
|
|
7674
7885
|
}
|
|
7675
|
-
const associatedUser = getAssociatedTokenAddressSync2(mint, user, true);
|
|
7886
|
+
const associatedUser = getAssociatedTokenAddressSync2(mint, user, true, tokenProgram);
|
|
7676
7887
|
if (!associatedUserAccountInfo) {
|
|
7677
7888
|
instructions.push(
|
|
7678
7889
|
createAssociatedTokenAccountIdempotentInstruction(
|
|
7679
7890
|
user,
|
|
7680
7891
|
associatedUser,
|
|
7681
7892
|
user,
|
|
7682
|
-
mint
|
|
7893
|
+
mint,
|
|
7894
|
+
tokenProgram
|
|
7683
7895
|
)
|
|
7684
7896
|
);
|
|
7685
7897
|
}
|
|
@@ -7692,11 +7904,53 @@ var PumpSdk = class {
|
|
|
7692
7904
|
associatedUser,
|
|
7693
7905
|
amount,
|
|
7694
7906
|
solAmount,
|
|
7695
|
-
slippage
|
|
7907
|
+
slippage,
|
|
7908
|
+
tokenProgram
|
|
7696
7909
|
})
|
|
7697
7910
|
);
|
|
7698
7911
|
return instructions;
|
|
7699
7912
|
}
|
|
7913
|
+
async createV2AndBuyInstructions({
|
|
7914
|
+
global,
|
|
7915
|
+
mint,
|
|
7916
|
+
name,
|
|
7917
|
+
symbol,
|
|
7918
|
+
uri,
|
|
7919
|
+
creator,
|
|
7920
|
+
user,
|
|
7921
|
+
amount,
|
|
7922
|
+
solAmount
|
|
7923
|
+
}) {
|
|
7924
|
+
const associatedUser = getAssociatedTokenAddressSync2(mint, user, true, TOKEN_2022_PROGRAM_ID2);
|
|
7925
|
+
return [
|
|
7926
|
+
await this.createV2Instruction({ mint, name, symbol, uri, creator, user }),
|
|
7927
|
+
await this.extendAccountInstruction({
|
|
7928
|
+
account: bondingCurvePda(mint),
|
|
7929
|
+
user
|
|
7930
|
+
}),
|
|
7931
|
+
createAssociatedTokenAccountIdempotentInstruction(
|
|
7932
|
+
user,
|
|
7933
|
+
associatedUser,
|
|
7934
|
+
user,
|
|
7935
|
+
mint,
|
|
7936
|
+
TOKEN_2022_PROGRAM_ID2
|
|
7937
|
+
),
|
|
7938
|
+
await this.buyInstruction({
|
|
7939
|
+
global,
|
|
7940
|
+
mint,
|
|
7941
|
+
creator,
|
|
7942
|
+
user,
|
|
7943
|
+
associatedUser,
|
|
7944
|
+
amount,
|
|
7945
|
+
solAmount,
|
|
7946
|
+
slippage: 1,
|
|
7947
|
+
tokenProgram: TOKEN_2022_PROGRAM_ID2
|
|
7948
|
+
})
|
|
7949
|
+
];
|
|
7950
|
+
}
|
|
7951
|
+
/**
|
|
7952
|
+
* @deprecated Use `createV2AndBuyInstructions` instead.
|
|
7953
|
+
*/
|
|
7700
7954
|
async createAndBuyInstructions({
|
|
7701
7955
|
global,
|
|
7702
7956
|
mint,
|
|
@@ -7741,7 +7995,8 @@ var PumpSdk = class {
|
|
|
7741
7995
|
associatedUser,
|
|
7742
7996
|
amount,
|
|
7743
7997
|
solAmount,
|
|
7744
|
-
slippage
|
|
7998
|
+
slippage,
|
|
7999
|
+
tokenProgram
|
|
7745
8000
|
}) {
|
|
7746
8001
|
return await this.getBuyInstructionInternal({
|
|
7747
8002
|
user,
|
|
@@ -7752,7 +8007,8 @@ var PumpSdk = class {
|
|
|
7752
8007
|
amount,
|
|
7753
8008
|
solAmount: solAmount.add(
|
|
7754
8009
|
solAmount.mul(new BN5(Math.floor(slippage * 10))).div(new BN5(1e3))
|
|
7755
|
-
)
|
|
8010
|
+
),
|
|
8011
|
+
tokenProgram
|
|
7756
8012
|
});
|
|
7757
8013
|
}
|
|
7758
8014
|
async sellInstructions({
|
|
@@ -7763,7 +8019,8 @@ var PumpSdk = class {
|
|
|
7763
8019
|
user,
|
|
7764
8020
|
amount,
|
|
7765
8021
|
solAmount,
|
|
7766
|
-
slippage
|
|
8022
|
+
slippage,
|
|
8023
|
+
tokenProgram = TOKEN_PROGRAM_ID2
|
|
7767
8024
|
}) {
|
|
7768
8025
|
const instructions = [];
|
|
7769
8026
|
if (bondingCurveAccountInfo.data.length < BONDING_CURVE_NEW_SIZE) {
|
|
@@ -7783,7 +8040,8 @@ var PumpSdk = class {
|
|
|
7783
8040
|
amount,
|
|
7784
8041
|
solAmount: solAmount.sub(
|
|
7785
8042
|
solAmount.mul(new BN5(Math.floor(slippage * 10))).div(new BN5(1e3))
|
|
7786
|
-
)
|
|
8043
|
+
),
|
|
8044
|
+
tokenProgram
|
|
7787
8045
|
})
|
|
7788
8046
|
);
|
|
7789
8047
|
return instructions;
|
|
@@ -7800,12 +8058,22 @@ var PumpSdk = class {
|
|
|
7800
8058
|
async migrateInstruction({
|
|
7801
8059
|
withdrawAuthority,
|
|
7802
8060
|
mint,
|
|
7803
|
-
user
|
|
8061
|
+
user,
|
|
8062
|
+
tokenProgram = TOKEN_PROGRAM_ID2
|
|
7804
8063
|
}) {
|
|
8064
|
+
const bondingCurve = bondingCurvePda(mint);
|
|
8065
|
+
const associatedBondingCurve = getAssociatedTokenAddressSync2(mint, bondingCurve, true, tokenProgram);
|
|
8066
|
+
const poolAuthority = pumpPoolAuthorityPda(mint);
|
|
8067
|
+
const poolAuthorityMintAccount = getAssociatedTokenAddressSync2(mint, poolAuthority, true, tokenProgram);
|
|
8068
|
+
const pool = canonicalPumpPoolPda(mint);
|
|
8069
|
+
const poolBaseTokenAccount = getAssociatedTokenAddressSync2(mint, pool, true, tokenProgram);
|
|
7805
8070
|
return this.offlinePumpProgram.methods.migrate().accountsPartial({
|
|
7806
8071
|
mint,
|
|
7807
8072
|
user,
|
|
7808
|
-
withdrawAuthority
|
|
8073
|
+
withdrawAuthority,
|
|
8074
|
+
associatedBondingCurve,
|
|
8075
|
+
poolAuthorityMintAccount,
|
|
8076
|
+
poolBaseTokenAccount
|
|
7809
8077
|
}).instruction();
|
|
7810
8078
|
}
|
|
7811
8079
|
async syncUserVolumeAccumulator(user) {
|
|
@@ -7842,11 +8110,12 @@ var PumpSdk = class {
|
|
|
7842
8110
|
creator,
|
|
7843
8111
|
amount,
|
|
7844
8112
|
solAmount,
|
|
7845
|
-
feeRecipient = getStaticRandomFeeRecipient()
|
|
8113
|
+
feeRecipient = getStaticRandomFeeRecipient(),
|
|
8114
|
+
tokenProgram = TOKEN_PROGRAM_ID2
|
|
7846
8115
|
}) {
|
|
7847
8116
|
return await this.getBuyInstructionInternal({
|
|
7848
8117
|
user,
|
|
7849
|
-
associatedUser: getAssociatedTokenAddressSync2(mint, user, true),
|
|
8118
|
+
associatedUser: getAssociatedTokenAddressSync2(mint, user, true, tokenProgram),
|
|
7850
8119
|
mint,
|
|
7851
8120
|
creator,
|
|
7852
8121
|
feeRecipient,
|
|
@@ -7861,14 +8130,16 @@ var PumpSdk = class {
|
|
|
7861
8130
|
creator,
|
|
7862
8131
|
feeRecipient,
|
|
7863
8132
|
amount,
|
|
7864
|
-
solAmount
|
|
8133
|
+
solAmount,
|
|
8134
|
+
tokenProgram = TOKEN_PROGRAM_ID2
|
|
7865
8135
|
}) {
|
|
7866
8136
|
return await this.offlinePumpProgram.methods.buy(amount, solAmount, { 0: true }).accountsPartial({
|
|
7867
8137
|
feeRecipient,
|
|
7868
8138
|
mint,
|
|
7869
8139
|
associatedUser,
|
|
7870
8140
|
user,
|
|
7871
|
-
creatorVault: creatorVaultPda(creator)
|
|
8141
|
+
creatorVault: creatorVaultPda(creator),
|
|
8142
|
+
tokenProgram
|
|
7872
8143
|
}).instruction();
|
|
7873
8144
|
}
|
|
7874
8145
|
async getSellInstructionRaw({
|
|
@@ -7877,7 +8148,8 @@ var PumpSdk = class {
|
|
|
7877
8148
|
creator,
|
|
7878
8149
|
amount,
|
|
7879
8150
|
solAmount,
|
|
7880
|
-
feeRecipient = getStaticRandomFeeRecipient()
|
|
8151
|
+
feeRecipient = getStaticRandomFeeRecipient(),
|
|
8152
|
+
tokenProgram = TOKEN_PROGRAM_ID2
|
|
7881
8153
|
}) {
|
|
7882
8154
|
return await this.getSellInstructionInternal({
|
|
7883
8155
|
user,
|
|
@@ -7885,7 +8157,8 @@ var PumpSdk = class {
|
|
|
7885
8157
|
creator,
|
|
7886
8158
|
feeRecipient,
|
|
7887
8159
|
amount,
|
|
7888
|
-
solAmount
|
|
8160
|
+
solAmount,
|
|
8161
|
+
tokenProgram
|
|
7889
8162
|
});
|
|
7890
8163
|
}
|
|
7891
8164
|
async getSellInstructionInternal({
|
|
@@ -7894,14 +8167,16 @@ var PumpSdk = class {
|
|
|
7894
8167
|
creator,
|
|
7895
8168
|
feeRecipient,
|
|
7896
8169
|
amount,
|
|
7897
|
-
solAmount
|
|
8170
|
+
solAmount,
|
|
8171
|
+
tokenProgram
|
|
7898
8172
|
}) {
|
|
7899
8173
|
return await this.offlinePumpProgram.methods.sell(amount, solAmount).accountsPartial({
|
|
7900
8174
|
feeRecipient,
|
|
7901
8175
|
mint,
|
|
7902
|
-
associatedUser: getAssociatedTokenAddressSync2(mint, user, true),
|
|
8176
|
+
associatedUser: getAssociatedTokenAddressSync2(mint, user, true, tokenProgram),
|
|
7903
8177
|
user,
|
|
7904
|
-
creatorVault: creatorVaultPda(creator)
|
|
8178
|
+
creatorVault: creatorVaultPda(creator),
|
|
8179
|
+
tokenProgram
|
|
7905
8180
|
}).instruction();
|
|
7906
8181
|
}
|
|
7907
8182
|
};
|