@pump-fun/pump-sdk 1.6.0 → 1.6.1-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/index.js CHANGED
@@ -175,6 +175,195 @@ var pump_default = {
175
175
  }
176
176
  ]
177
177
  },
178
+ {
179
+ name: "admin_update_token_incentives",
180
+ discriminator: [
181
+ 209,
182
+ 11,
183
+ 115,
184
+ 87,
185
+ 213,
186
+ 23,
187
+ 124,
188
+ 204
189
+ ],
190
+ accounts: [
191
+ {
192
+ name: "authority",
193
+ writable: true,
194
+ signer: true,
195
+ relations: [
196
+ "global"
197
+ ]
198
+ },
199
+ {
200
+ name: "global"
201
+ },
202
+ {
203
+ name: "global_volume_accumulator",
204
+ writable: true,
205
+ pda: {
206
+ seeds: [
207
+ {
208
+ kind: "const",
209
+ value: [
210
+ 103,
211
+ 108,
212
+ 111,
213
+ 98,
214
+ 97,
215
+ 108,
216
+ 95,
217
+ 118,
218
+ 111,
219
+ 108,
220
+ 117,
221
+ 109,
222
+ 101,
223
+ 95,
224
+ 97,
225
+ 99,
226
+ 99,
227
+ 117,
228
+ 109,
229
+ 117,
230
+ 108,
231
+ 97,
232
+ 116,
233
+ 111,
234
+ 114
235
+ ]
236
+ }
237
+ ]
238
+ }
239
+ },
240
+ {
241
+ name: "mint"
242
+ },
243
+ {
244
+ name: "global_incentive_token_account",
245
+ writable: true,
246
+ pda: {
247
+ seeds: [
248
+ {
249
+ kind: "account",
250
+ path: "global_volume_accumulator"
251
+ },
252
+ {
253
+ kind: "account",
254
+ path: "token_program"
255
+ },
256
+ {
257
+ kind: "account",
258
+ path: "mint"
259
+ }
260
+ ],
261
+ program: {
262
+ kind: "const",
263
+ value: [
264
+ 140,
265
+ 151,
266
+ 37,
267
+ 143,
268
+ 78,
269
+ 36,
270
+ 137,
271
+ 241,
272
+ 187,
273
+ 61,
274
+ 16,
275
+ 41,
276
+ 20,
277
+ 142,
278
+ 13,
279
+ 131,
280
+ 11,
281
+ 90,
282
+ 19,
283
+ 153,
284
+ 218,
285
+ 255,
286
+ 16,
287
+ 132,
288
+ 4,
289
+ 142,
290
+ 123,
291
+ 216,
292
+ 219,
293
+ 233,
294
+ 248,
295
+ 89
296
+ ]
297
+ }
298
+ }
299
+ },
300
+ {
301
+ name: "associated_token_program",
302
+ address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
303
+ },
304
+ {
305
+ name: "system_program",
306
+ address: "11111111111111111111111111111111"
307
+ },
308
+ {
309
+ name: "token_program"
310
+ },
311
+ {
312
+ name: "event_authority",
313
+ pda: {
314
+ seeds: [
315
+ {
316
+ kind: "const",
317
+ value: [
318
+ 95,
319
+ 95,
320
+ 101,
321
+ 118,
322
+ 101,
323
+ 110,
324
+ 116,
325
+ 95,
326
+ 97,
327
+ 117,
328
+ 116,
329
+ 104,
330
+ 111,
331
+ 114,
332
+ 105,
333
+ 116,
334
+ 121
335
+ ]
336
+ }
337
+ ]
338
+ }
339
+ },
340
+ {
341
+ name: "program"
342
+ }
343
+ ],
344
+ args: [
345
+ {
346
+ name: "start_time",
347
+ type: "i64"
348
+ },
349
+ {
350
+ name: "end_time",
351
+ type: "i64"
352
+ },
353
+ {
354
+ name: "seconds_in_a_day",
355
+ type: "i64"
356
+ },
357
+ {
358
+ name: "day_number",
359
+ type: "u64"
360
+ },
361
+ {
362
+ name: "pump_token_supply_per_day",
363
+ type: "u64"
364
+ }
365
+ ]
366
+ },
178
367
  {
179
368
  name: "buy",
180
369
  docs: [
@@ -384,6 +573,38 @@ var pump_default = {
384
573
  ]
385
574
  }
386
575
  },
576
+ {
577
+ name: "event_authority",
578
+ pda: {
579
+ seeds: [
580
+ {
581
+ kind: "const",
582
+ value: [
583
+ 95,
584
+ 95,
585
+ 101,
586
+ 118,
587
+ 101,
588
+ 110,
589
+ 116,
590
+ 95,
591
+ 97,
592
+ 117,
593
+ 116,
594
+ 104,
595
+ 111,
596
+ 114,
597
+ 105,
598
+ 116,
599
+ 121
600
+ ]
601
+ }
602
+ ]
603
+ }
604
+ },
605
+ {
606
+ name: "program"
607
+ },
387
608
  {
388
609
  name: "global_volume_accumulator",
389
610
  writable: true,
@@ -461,38 +682,6 @@ var pump_default = {
461
682
  }
462
683
  ]
463
684
  }
464
- },
465
- {
466
- name: "event_authority",
467
- pda: {
468
- seeds: [
469
- {
470
- kind: "const",
471
- value: [
472
- 95,
473
- 95,
474
- 101,
475
- 118,
476
- 101,
477
- 110,
478
- 116,
479
- 95,
480
- 97,
481
- 117,
482
- 116,
483
- 104,
484
- 111,
485
- 114,
486
- 105,
487
- 116,
488
- 121
489
- ]
490
- }
491
- ]
492
- }
493
- },
494
- {
495
- name: "program"
496
685
  }
497
686
  ],
498
687
  args: [
@@ -507,23 +696,18 @@ var pump_default = {
507
696
  ]
508
697
  },
509
698
  {
510
- name: "claim_pump_incentives",
699
+ name: "claim_token_incentives",
511
700
  discriminator: [
512
- 207,
701
+ 16,
702
+ 4,
703
+ 71,
704
+ 28,
513
705
  204,
514
- 203,
515
- 6,
516
- 18,
517
- 141,
518
- 218,
519
- 200
706
+ 1,
707
+ 40,
708
+ 27
520
709
  ],
521
710
  accounts: [
522
- {
523
- name: "payer",
524
- writable: true,
525
- signer: true
526
- },
527
711
  {
528
712
  name: "user"
529
713
  },
@@ -720,7 +904,9 @@ var pump_default = {
720
904
  },
721
905
  {
722
906
  name: "mint",
723
- address: "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn"
907
+ relations: [
908
+ "global_volume_accumulator"
909
+ ]
724
910
  },
725
911
  {
726
912
  name: "token_program"
@@ -764,6 +950,11 @@ var pump_default = {
764
950
  },
765
951
  {
766
952
  name: "program"
953
+ },
954
+ {
955
+ name: "payer",
956
+ writable: true,
957
+ signer: true
767
958
  }
768
959
  ],
769
960
  args: []
@@ -2557,204 +2748,68 @@ var pump_default = {
2557
2748
  type: "pubkey"
2558
2749
  },
2559
2750
  {
2560
- name: "enable_migrate",
2561
- type: "bool"
2562
- },
2563
- {
2564
- name: "pool_migration_fee",
2565
- type: "u64"
2566
- },
2567
- {
2568
- name: "creator_fee_basis_points",
2569
- type: "u64"
2570
- },
2571
- {
2572
- name: "set_creator_authority",
2573
- type: "pubkey"
2574
- },
2575
- {
2576
- name: "admin_set_creator_authority",
2577
- type: "pubkey"
2578
- }
2579
- ]
2580
- },
2581
- {
2582
- name: "update_global_authority",
2583
- discriminator: [
2584
- 227,
2585
- 181,
2586
- 74,
2587
- 196,
2588
- 208,
2589
- 21,
2590
- 97,
2591
- 213
2592
- ],
2593
- accounts: [
2594
- {
2595
- name: "global",
2596
- writable: true,
2597
- pda: {
2598
- seeds: [
2599
- {
2600
- kind: "const",
2601
- value: [
2602
- 103,
2603
- 108,
2604
- 111,
2605
- 98,
2606
- 97,
2607
- 108
2608
- ]
2609
- }
2610
- ]
2611
- }
2612
- },
2613
- {
2614
- name: "authority",
2615
- signer: true,
2616
- relations: [
2617
- "global"
2618
- ]
2619
- },
2620
- {
2621
- name: "new_authority"
2622
- },
2623
- {
2624
- name: "event_authority",
2625
- pda: {
2626
- seeds: [
2627
- {
2628
- kind: "const",
2629
- value: [
2630
- 95,
2631
- 95,
2632
- 101,
2633
- 118,
2634
- 101,
2635
- 110,
2636
- 116,
2637
- 95,
2638
- 97,
2639
- 117,
2640
- 116,
2641
- 104,
2642
- 111,
2643
- 114,
2644
- 105,
2645
- 116,
2646
- 121
2647
- ]
2648
- }
2649
- ]
2650
- }
2651
- },
2652
- {
2653
- name: "program"
2654
- }
2655
- ],
2656
- args: []
2657
- },
2658
- {
2659
- name: "update_pump_incentives",
2660
- discriminator: [
2661
- 233,
2662
- 15,
2663
- 108,
2664
- 188,
2665
- 211,
2666
- 206,
2667
- 82,
2668
- 34
2669
- ],
2670
- accounts: [
2671
- {
2672
- name: "admin",
2673
- writable: true,
2674
- signer: true,
2675
- relations: [
2676
- "global_config"
2677
- ]
2751
+ name: "enable_migrate",
2752
+ type: "bool"
2678
2753
  },
2679
2754
  {
2680
- name: "global_config"
2755
+ name: "pool_migration_fee",
2756
+ type: "u64"
2681
2757
  },
2682
2758
  {
2683
- name: "global_volume_accumulator",
2684
- writable: true
2759
+ name: "creator_fee_basis_points",
2760
+ type: "u64"
2685
2761
  },
2686
2762
  {
2687
- name: "mint",
2688
- writable: true,
2689
- address: "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn"
2763
+ name: "set_creator_authority",
2764
+ type: "pubkey"
2690
2765
  },
2691
2766
  {
2692
- name: "global_incentive_token_account",
2767
+ name: "admin_set_creator_authority",
2768
+ type: "pubkey"
2769
+ }
2770
+ ]
2771
+ },
2772
+ {
2773
+ name: "update_global_authority",
2774
+ discriminator: [
2775
+ 227,
2776
+ 181,
2777
+ 74,
2778
+ 196,
2779
+ 208,
2780
+ 21,
2781
+ 97,
2782
+ 213
2783
+ ],
2784
+ accounts: [
2785
+ {
2786
+ name: "global",
2693
2787
  writable: true,
2694
2788
  pda: {
2695
2789
  seeds: [
2696
2790
  {
2697
- kind: "account",
2698
- path: "global_volume_accumulator"
2699
- },
2700
- {
2701
- kind: "account",
2702
- path: "token_program"
2703
- },
2704
- {
2705
- kind: "account",
2706
- path: "mint"
2791
+ kind: "const",
2792
+ value: [
2793
+ 103,
2794
+ 108,
2795
+ 111,
2796
+ 98,
2797
+ 97,
2798
+ 108
2799
+ ]
2707
2800
  }
2708
- ],
2709
- program: {
2710
- kind: "const",
2711
- value: [
2712
- 140,
2713
- 151,
2714
- 37,
2715
- 143,
2716
- 78,
2717
- 36,
2718
- 137,
2719
- 241,
2720
- 187,
2721
- 61,
2722
- 16,
2723
- 41,
2724
- 20,
2725
- 142,
2726
- 13,
2727
- 131,
2728
- 11,
2729
- 90,
2730
- 19,
2731
- 153,
2732
- 218,
2733
- 255,
2734
- 16,
2735
- 132,
2736
- 4,
2737
- 142,
2738
- 123,
2739
- 216,
2740
- 219,
2741
- 233,
2742
- 248,
2743
- 89
2744
- ]
2745
- }
2801
+ ]
2746
2802
  }
2747
2803
  },
2748
2804
  {
2749
- name: "associated_token_program",
2750
- address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
2751
- },
2752
- {
2753
- name: "system_program",
2754
- address: "11111111111111111111111111111111"
2805
+ name: "authority",
2806
+ signer: true,
2807
+ relations: [
2808
+ "global"
2809
+ ]
2755
2810
  },
2756
2811
  {
2757
- name: "token_program"
2812
+ name: "new_authority"
2758
2813
  },
2759
2814
  {
2760
2815
  name: "event_authority",
@@ -2789,24 +2844,7 @@ var pump_default = {
2789
2844
  name: "program"
2790
2845
  }
2791
2846
  ],
2792
- args: [
2793
- {
2794
- name: "start_time",
2795
- type: "i64"
2796
- },
2797
- {
2798
- name: "end_time",
2799
- type: "i64"
2800
- },
2801
- {
2802
- name: "day_number",
2803
- type: "u16"
2804
- },
2805
- {
2806
- name: "pump_token_supply_per_day",
2807
- type: "u64"
2808
- }
2809
- ]
2847
+ args: []
2810
2848
  }
2811
2849
  ],
2812
2850
  accounts: [
@@ -2836,19 +2874,6 @@ var pump_default = {
2836
2874
  127
2837
2875
  ]
2838
2876
  },
2839
- {
2840
- name: "GlobalConfig",
2841
- discriminator: [
2842
- 149,
2843
- 8,
2844
- 156,
2845
- 202,
2846
- 160,
2847
- 252,
2848
- 176,
2849
- 217
2850
- ]
2851
- },
2852
2877
  {
2853
2878
  name: "GlobalVolumeAccumulator",
2854
2879
  discriminator: [
@@ -2891,29 +2916,29 @@ var pump_default = {
2891
2916
  ]
2892
2917
  },
2893
2918
  {
2894
- name: "AdminUpdatePumpIncentivesEvent",
2919
+ name: "AdminUpdateTokenIncentivesEvent",
2895
2920
  discriminator: [
2896
- 156,
2897
- 65,
2898
- 48,
2899
- 237,
2900
- 27,
2901
- 54,
2902
- 158,
2903
- 27
2921
+ 147,
2922
+ 250,
2923
+ 108,
2924
+ 120,
2925
+ 247,
2926
+ 29,
2927
+ 67,
2928
+ 222
2904
2929
  ]
2905
2930
  },
2906
2931
  {
2907
- name: "ClaimPumpIncentivesEvent",
2932
+ name: "ClaimTokenIncentivesEvent",
2908
2933
  discriminator: [
2909
- 13,
2910
- 204,
2911
- 53,
2912
- 161,
2913
- 254,
2914
- 254,
2915
- 81,
2916
- 233
2934
+ 79,
2935
+ 172,
2936
+ 246,
2937
+ 49,
2938
+ 205,
2939
+ 91,
2940
+ 206,
2941
+ 232
2917
2942
  ]
2918
2943
  },
2919
2944
  {
@@ -3205,13 +3230,39 @@ var pump_default = {
3205
3230
  },
3206
3231
  {
3207
3232
  code: 6031,
3208
- name: "InvalidDayIndex",
3209
- msg: "Invalid day index"
3233
+ name: "StartTimeInThePast"
3210
3234
  },
3211
3235
  {
3212
3236
  code: 6032,
3213
- name: "InvalidTimeRange",
3214
- msg: "Invalid time range"
3237
+ name: "EndTimeInThePast"
3238
+ },
3239
+ {
3240
+ code: 6033,
3241
+ name: "EndTimeBeforeStartTime"
3242
+ },
3243
+ {
3244
+ code: 6034,
3245
+ name: "TimeRangeTooLarge"
3246
+ },
3247
+ {
3248
+ code: 6035,
3249
+ name: "EndTimeBeforeCurrentDay"
3250
+ },
3251
+ {
3252
+ code: 6036,
3253
+ name: "SupplyUpdateForFinishedRange"
3254
+ },
3255
+ {
3256
+ code: 6037,
3257
+ name: "DayIndexAfterEndIndex"
3258
+ },
3259
+ {
3260
+ code: 6038,
3261
+ name: "DayInActiveRange"
3262
+ },
3263
+ {
3264
+ code: 6039,
3265
+ name: "InvalidIncentiveMint"
3215
3266
  }
3216
3267
  ],
3217
3268
  types: [
@@ -3248,10 +3299,27 @@ var pump_default = {
3248
3299
  }
3249
3300
  },
3250
3301
  {
3251
- name: "AdminUpdatePumpIncentivesEvent",
3302
+ name: "AdminUpdateTokenIncentivesEvent",
3252
3303
  type: {
3253
3304
  kind: "struct",
3254
- fields: []
3305
+ fields: [
3306
+ {
3307
+ name: "start_time",
3308
+ type: "i64"
3309
+ },
3310
+ {
3311
+ name: "end_time",
3312
+ type: "i64"
3313
+ },
3314
+ {
3315
+ name: "day_number",
3316
+ type: "u64"
3317
+ },
3318
+ {
3319
+ name: "token_supply_per_day",
3320
+ type: "u64"
3321
+ }
3322
+ ]
3255
3323
  }
3256
3324
  },
3257
3325
  {
@@ -3291,10 +3359,23 @@ var pump_default = {
3291
3359
  }
3292
3360
  },
3293
3361
  {
3294
- name: "ClaimPumpIncentivesEvent",
3362
+ name: "ClaimTokenIncentivesEvent",
3295
3363
  type: {
3296
3364
  kind: "struct",
3297
- fields: []
3365
+ fields: [
3366
+ {
3367
+ name: "user",
3368
+ type: "pubkey"
3369
+ },
3370
+ {
3371
+ name: "mint",
3372
+ type: "pubkey"
3373
+ },
3374
+ {
3375
+ name: "amount",
3376
+ type: "u64"
3377
+ }
3378
+ ]
3298
3379
  }
3299
3380
  },
3300
3381
  {
@@ -3544,43 +3625,6 @@ var pump_default = {
3544
3625
  ]
3545
3626
  }
3546
3627
  },
3547
- {
3548
- name: "GlobalConfig",
3549
- type: {
3550
- kind: "struct",
3551
- fields: [
3552
- {
3553
- name: "admin",
3554
- type: "pubkey"
3555
- },
3556
- {
3557
- name: "lp_fee_basis_points",
3558
- type: "u64"
3559
- },
3560
- {
3561
- name: "protocol_fee_basis_points",
3562
- type: "u64"
3563
- },
3564
- {
3565
- name: "disable_flags",
3566
- type: "u8"
3567
- },
3568
- {
3569
- name: "protocol_fee_recipients",
3570
- type: {
3571
- array: [
3572
- "pubkey",
3573
- 8
3574
- ]
3575
- }
3576
- },
3577
- {
3578
- name: "coin_creator_fee_basis_points",
3579
- type: "u64"
3580
- }
3581
- ]
3582
- }
3583
- },
3584
3628
  {
3585
3629
  name: "GlobalVolumeAccumulator",
3586
3630
  type: {
@@ -3595,7 +3639,15 @@ var pump_default = {
3595
3639
  type: "i64"
3596
3640
  },
3597
3641
  {
3598
- name: "total_pump_token_supply",
3642
+ name: "seconds_in_a_day",
3643
+ type: "i64"
3644
+ },
3645
+ {
3646
+ name: "mint",
3647
+ type: "pubkey"
3648
+ },
3649
+ {
3650
+ name: "total_token_supply",
3599
3651
  type: {
3600
3652
  array: [
3601
3653
  "u64",
@@ -3838,20 +3890,28 @@ var pump_default = {
3838
3890
  kind: "struct",
3839
3891
  fields: [
3840
3892
  {
3841
- name: "last_update_timestamp",
3842
- type: "i64"
3893
+ name: "user",
3894
+ type: "pubkey"
3843
3895
  },
3844
3896
  {
3845
- name: "current_sol_volume",
3897
+ name: "needs_claim",
3898
+ type: "bool"
3899
+ },
3900
+ {
3901
+ name: "total_unclaimed_tokens",
3846
3902
  type: "u64"
3847
3903
  },
3848
3904
  {
3849
- name: "total_unclaimed_pump_tokens",
3905
+ name: "total_claimed_tokens",
3850
3906
  type: "u64"
3851
3907
  },
3852
3908
  {
3853
- name: "total_claimed_pump_tokens",
3909
+ name: "current_sol_volume",
3854
3910
  type: "u64"
3911
+ },
3912
+ {
3913
+ name: "last_update_timestamp",
3914
+ type: "i64"
3855
3915
  }
3856
3916
  ]
3857
3917
  }
@@ -4306,21 +4366,22 @@ var PumpSdk = class {
4306
4366
  }
4307
4367
  return new import_bn2.default(accountInfo.lamports - rentExemptionLamports);
4308
4368
  }
4309
- async adminUpdatePumpIncentives(admin, startTime, endTime, dayNumber, pumpTokenSupplyPerDay, mint = PUMP_TOKEN_MINT, tokenProgram = import_spl_token.TOKEN_2022_PROGRAM_ID) {
4310
- return await this.offlinePumpProgram.methods.updatePumpIncentives(
4369
+ async adminUpdateTokenIncentives(startTime, endTime, dayNumber, tokenSupplyPerDay, secondsInADay = new import_bn2.default(86400), mint = PUMP_TOKEN_MINT, tokenProgram = import_spl_token.TOKEN_2022_PROGRAM_ID) {
4370
+ const global = await this.fetchGlobal();
4371
+ return await this.offlinePumpProgram.methods.adminUpdateTokenIncentives(
4311
4372
  startTime,
4312
4373
  endTime,
4313
- dayNumber.toNumber(),
4314
- pumpTokenSupplyPerDay
4374
+ secondsInADay,
4375
+ dayNumber,
4376
+ tokenSupplyPerDay
4315
4377
  ).accountsPartial({
4316
- admin,
4317
- globalVolumeAccumulator: this.globalVolumeAccumulatorPda()[0],
4318
- globalConfig: this.globalPda(),
4378
+ global: this.globalPda(),
4379
+ authority: global.authority,
4319
4380
  mint,
4320
4381
  tokenProgram
4321
4382
  }).instruction();
4322
4383
  }
4323
- async claimPumpIncentives(user, payer, mint = PUMP_TOKEN_MINT, tokenProgram = import_spl_token.TOKEN_2022_PROGRAM_ID) {
4384
+ async claimTokenIncentives(user, payer, mint = PUMP_TOKEN_MINT, tokenProgram = import_spl_token.TOKEN_2022_PROGRAM_ID) {
4324
4385
  const userPumpAta = (0, import_spl_token.getAssociatedTokenAddressSync)(
4325
4386
  mint,
4326
4387
  user,
@@ -4335,10 +4396,9 @@ var PumpSdk = class {
4335
4396
  mint,
4336
4397
  tokenProgram
4337
4398
  ),
4338
- await this.offlinePumpProgram.methods.claimPumpIncentives().accountsPartial({
4399
+ await this.offlinePumpProgram.methods.claimTokenIncentives().accountsPartial({
4339
4400
  user,
4340
4401
  payer,
4341
- globalVolumeAccumulator: this.globalVolumeAccumulatorPda()[0],
4342
4402
  mint,
4343
4403
  tokenProgram
4344
4404
  }).instruction()