@pump-fun/pump-sdk 1.5.0 → 1.6.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 +817 -55
- package/dist/index.d.mts +2631 -1254
- package/dist/index.d.ts +2631 -1254
- package/dist/index.js +824 -63
- package/package.json +2 -2
- package/src/idl/pump.json +723 -47
- package/src/idl/pump.ts +723 -47
- package/src/index.ts +2 -0
- package/src/pda.ts +20 -0
- package/src/sdk.ts +101 -1
- package/src/state.ts +14 -0
package/dist/esm/index.js
CHANGED
|
@@ -331,6 +331,84 @@ var pump_default = {
|
|
|
331
331
|
]
|
|
332
332
|
}
|
|
333
333
|
},
|
|
334
|
+
{
|
|
335
|
+
name: "global_volume_accumulator",
|
|
336
|
+
writable: true,
|
|
337
|
+
pda: {
|
|
338
|
+
seeds: [
|
|
339
|
+
{
|
|
340
|
+
kind: "const",
|
|
341
|
+
value: [
|
|
342
|
+
103,
|
|
343
|
+
108,
|
|
344
|
+
111,
|
|
345
|
+
98,
|
|
346
|
+
97,
|
|
347
|
+
108,
|
|
348
|
+
95,
|
|
349
|
+
118,
|
|
350
|
+
111,
|
|
351
|
+
108,
|
|
352
|
+
117,
|
|
353
|
+
109,
|
|
354
|
+
101,
|
|
355
|
+
95,
|
|
356
|
+
97,
|
|
357
|
+
99,
|
|
358
|
+
99,
|
|
359
|
+
117,
|
|
360
|
+
109,
|
|
361
|
+
117,
|
|
362
|
+
108,
|
|
363
|
+
97,
|
|
364
|
+
116,
|
|
365
|
+
111,
|
|
366
|
+
114
|
|
367
|
+
]
|
|
368
|
+
}
|
|
369
|
+
]
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
name: "user_volume_accumulator",
|
|
374
|
+
writable: true,
|
|
375
|
+
pda: {
|
|
376
|
+
seeds: [
|
|
377
|
+
{
|
|
378
|
+
kind: "const",
|
|
379
|
+
value: [
|
|
380
|
+
117,
|
|
381
|
+
115,
|
|
382
|
+
101,
|
|
383
|
+
114,
|
|
384
|
+
95,
|
|
385
|
+
118,
|
|
386
|
+
111,
|
|
387
|
+
108,
|
|
388
|
+
117,
|
|
389
|
+
109,
|
|
390
|
+
101,
|
|
391
|
+
95,
|
|
392
|
+
97,
|
|
393
|
+
99,
|
|
394
|
+
99,
|
|
395
|
+
117,
|
|
396
|
+
109,
|
|
397
|
+
117,
|
|
398
|
+
108,
|
|
399
|
+
97,
|
|
400
|
+
116,
|
|
401
|
+
111,
|
|
402
|
+
114
|
|
403
|
+
]
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
kind: "account",
|
|
407
|
+
path: "user"
|
|
408
|
+
}
|
|
409
|
+
]
|
|
410
|
+
}
|
|
411
|
+
},
|
|
334
412
|
{
|
|
335
413
|
name: "event_authority",
|
|
336
414
|
pda: {
|
|
@@ -375,6 +453,268 @@ var pump_default = {
|
|
|
375
453
|
}
|
|
376
454
|
]
|
|
377
455
|
},
|
|
456
|
+
{
|
|
457
|
+
name: "claim_pump_incentives",
|
|
458
|
+
discriminator: [
|
|
459
|
+
207,
|
|
460
|
+
204,
|
|
461
|
+
203,
|
|
462
|
+
6,
|
|
463
|
+
18,
|
|
464
|
+
141,
|
|
465
|
+
218,
|
|
466
|
+
200
|
|
467
|
+
],
|
|
468
|
+
accounts: [
|
|
469
|
+
{
|
|
470
|
+
name: "payer",
|
|
471
|
+
writable: true,
|
|
472
|
+
signer: true
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
name: "user"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
name: "user_ata",
|
|
479
|
+
writable: true,
|
|
480
|
+
pda: {
|
|
481
|
+
seeds: [
|
|
482
|
+
{
|
|
483
|
+
kind: "account",
|
|
484
|
+
path: "user"
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
kind: "account",
|
|
488
|
+
path: "token_program"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
kind: "account",
|
|
492
|
+
path: "mint"
|
|
493
|
+
}
|
|
494
|
+
],
|
|
495
|
+
program: {
|
|
496
|
+
kind: "const",
|
|
497
|
+
value: [
|
|
498
|
+
140,
|
|
499
|
+
151,
|
|
500
|
+
37,
|
|
501
|
+
143,
|
|
502
|
+
78,
|
|
503
|
+
36,
|
|
504
|
+
137,
|
|
505
|
+
241,
|
|
506
|
+
187,
|
|
507
|
+
61,
|
|
508
|
+
16,
|
|
509
|
+
41,
|
|
510
|
+
20,
|
|
511
|
+
142,
|
|
512
|
+
13,
|
|
513
|
+
131,
|
|
514
|
+
11,
|
|
515
|
+
90,
|
|
516
|
+
19,
|
|
517
|
+
153,
|
|
518
|
+
218,
|
|
519
|
+
255,
|
|
520
|
+
16,
|
|
521
|
+
132,
|
|
522
|
+
4,
|
|
523
|
+
142,
|
|
524
|
+
123,
|
|
525
|
+
216,
|
|
526
|
+
219,
|
|
527
|
+
233,
|
|
528
|
+
248,
|
|
529
|
+
89
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
name: "global_volume_accumulator",
|
|
536
|
+
pda: {
|
|
537
|
+
seeds: [
|
|
538
|
+
{
|
|
539
|
+
kind: "const",
|
|
540
|
+
value: [
|
|
541
|
+
103,
|
|
542
|
+
108,
|
|
543
|
+
111,
|
|
544
|
+
98,
|
|
545
|
+
97,
|
|
546
|
+
108,
|
|
547
|
+
95,
|
|
548
|
+
118,
|
|
549
|
+
111,
|
|
550
|
+
108,
|
|
551
|
+
117,
|
|
552
|
+
109,
|
|
553
|
+
101,
|
|
554
|
+
95,
|
|
555
|
+
97,
|
|
556
|
+
99,
|
|
557
|
+
99,
|
|
558
|
+
117,
|
|
559
|
+
109,
|
|
560
|
+
117,
|
|
561
|
+
108,
|
|
562
|
+
97,
|
|
563
|
+
116,
|
|
564
|
+
111,
|
|
565
|
+
114
|
|
566
|
+
]
|
|
567
|
+
}
|
|
568
|
+
]
|
|
569
|
+
}
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
name: "global_incentive_token_account",
|
|
573
|
+
writable: true,
|
|
574
|
+
pda: {
|
|
575
|
+
seeds: [
|
|
576
|
+
{
|
|
577
|
+
kind: "account",
|
|
578
|
+
path: "global_volume_accumulator"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
kind: "account",
|
|
582
|
+
path: "token_program"
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
kind: "account",
|
|
586
|
+
path: "mint"
|
|
587
|
+
}
|
|
588
|
+
],
|
|
589
|
+
program: {
|
|
590
|
+
kind: "const",
|
|
591
|
+
value: [
|
|
592
|
+
140,
|
|
593
|
+
151,
|
|
594
|
+
37,
|
|
595
|
+
143,
|
|
596
|
+
78,
|
|
597
|
+
36,
|
|
598
|
+
137,
|
|
599
|
+
241,
|
|
600
|
+
187,
|
|
601
|
+
61,
|
|
602
|
+
16,
|
|
603
|
+
41,
|
|
604
|
+
20,
|
|
605
|
+
142,
|
|
606
|
+
13,
|
|
607
|
+
131,
|
|
608
|
+
11,
|
|
609
|
+
90,
|
|
610
|
+
19,
|
|
611
|
+
153,
|
|
612
|
+
218,
|
|
613
|
+
255,
|
|
614
|
+
16,
|
|
615
|
+
132,
|
|
616
|
+
4,
|
|
617
|
+
142,
|
|
618
|
+
123,
|
|
619
|
+
216,
|
|
620
|
+
219,
|
|
621
|
+
233,
|
|
622
|
+
248,
|
|
623
|
+
89
|
|
624
|
+
]
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
name: "user_volume_accumulator",
|
|
630
|
+
writable: true,
|
|
631
|
+
pda: {
|
|
632
|
+
seeds: [
|
|
633
|
+
{
|
|
634
|
+
kind: "const",
|
|
635
|
+
value: [
|
|
636
|
+
117,
|
|
637
|
+
115,
|
|
638
|
+
101,
|
|
639
|
+
114,
|
|
640
|
+
95,
|
|
641
|
+
118,
|
|
642
|
+
111,
|
|
643
|
+
108,
|
|
644
|
+
117,
|
|
645
|
+
109,
|
|
646
|
+
101,
|
|
647
|
+
95,
|
|
648
|
+
97,
|
|
649
|
+
99,
|
|
650
|
+
99,
|
|
651
|
+
117,
|
|
652
|
+
109,
|
|
653
|
+
117,
|
|
654
|
+
108,
|
|
655
|
+
97,
|
|
656
|
+
116,
|
|
657
|
+
111,
|
|
658
|
+
114
|
|
659
|
+
]
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
kind: "account",
|
|
663
|
+
path: "user"
|
|
664
|
+
}
|
|
665
|
+
]
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
name: "mint",
|
|
670
|
+
address: "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn"
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
name: "token_program"
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
name: "system_program",
|
|
677
|
+
address: "11111111111111111111111111111111"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
name: "associated_token_program",
|
|
681
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
name: "event_authority",
|
|
685
|
+
pda: {
|
|
686
|
+
seeds: [
|
|
687
|
+
{
|
|
688
|
+
kind: "const",
|
|
689
|
+
value: [
|
|
690
|
+
95,
|
|
691
|
+
95,
|
|
692
|
+
101,
|
|
693
|
+
118,
|
|
694
|
+
101,
|
|
695
|
+
110,
|
|
696
|
+
116,
|
|
697
|
+
95,
|
|
698
|
+
97,
|
|
699
|
+
117,
|
|
700
|
+
116,
|
|
701
|
+
104,
|
|
702
|
+
111,
|
|
703
|
+
114,
|
|
704
|
+
105,
|
|
705
|
+
116,
|
|
706
|
+
121
|
|
707
|
+
]
|
|
708
|
+
}
|
|
709
|
+
]
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
name: "program"
|
|
714
|
+
}
|
|
715
|
+
],
|
|
716
|
+
args: []
|
|
717
|
+
},
|
|
378
718
|
{
|
|
379
719
|
name: "collect_creator_fee",
|
|
380
720
|
docs: [
|
|
@@ -393,8 +733,7 @@ var pump_default = {
|
|
|
393
733
|
accounts: [
|
|
394
734
|
{
|
|
395
735
|
name: "creator",
|
|
396
|
-
writable: true
|
|
397
|
-
signer: true
|
|
736
|
+
writable: true
|
|
398
737
|
},
|
|
399
738
|
{
|
|
400
739
|
name: "creator_vault",
|
|
@@ -2219,14 +2558,150 @@ var pump_default = {
|
|
|
2219
2558
|
}
|
|
2220
2559
|
},
|
|
2221
2560
|
{
|
|
2222
|
-
name: "authority",
|
|
2223
|
-
signer: true,
|
|
2224
|
-
relations: [
|
|
2225
|
-
"global"
|
|
2226
|
-
]
|
|
2561
|
+
name: "authority",
|
|
2562
|
+
signer: true,
|
|
2563
|
+
relations: [
|
|
2564
|
+
"global"
|
|
2565
|
+
]
|
|
2566
|
+
},
|
|
2567
|
+
{
|
|
2568
|
+
name: "new_authority"
|
|
2569
|
+
},
|
|
2570
|
+
{
|
|
2571
|
+
name: "event_authority",
|
|
2572
|
+
pda: {
|
|
2573
|
+
seeds: [
|
|
2574
|
+
{
|
|
2575
|
+
kind: "const",
|
|
2576
|
+
value: [
|
|
2577
|
+
95,
|
|
2578
|
+
95,
|
|
2579
|
+
101,
|
|
2580
|
+
118,
|
|
2581
|
+
101,
|
|
2582
|
+
110,
|
|
2583
|
+
116,
|
|
2584
|
+
95,
|
|
2585
|
+
97,
|
|
2586
|
+
117,
|
|
2587
|
+
116,
|
|
2588
|
+
104,
|
|
2589
|
+
111,
|
|
2590
|
+
114,
|
|
2591
|
+
105,
|
|
2592
|
+
116,
|
|
2593
|
+
121
|
|
2594
|
+
]
|
|
2595
|
+
}
|
|
2596
|
+
]
|
|
2597
|
+
}
|
|
2598
|
+
},
|
|
2599
|
+
{
|
|
2600
|
+
name: "program"
|
|
2601
|
+
}
|
|
2602
|
+
],
|
|
2603
|
+
args: []
|
|
2604
|
+
},
|
|
2605
|
+
{
|
|
2606
|
+
name: "update_pump_incentives",
|
|
2607
|
+
discriminator: [
|
|
2608
|
+
233,
|
|
2609
|
+
15,
|
|
2610
|
+
108,
|
|
2611
|
+
188,
|
|
2612
|
+
211,
|
|
2613
|
+
206,
|
|
2614
|
+
82,
|
|
2615
|
+
34
|
|
2616
|
+
],
|
|
2617
|
+
accounts: [
|
|
2618
|
+
{
|
|
2619
|
+
name: "admin",
|
|
2620
|
+
writable: true,
|
|
2621
|
+
signer: true,
|
|
2622
|
+
relations: [
|
|
2623
|
+
"global_config"
|
|
2624
|
+
]
|
|
2625
|
+
},
|
|
2626
|
+
{
|
|
2627
|
+
name: "global_config"
|
|
2628
|
+
},
|
|
2629
|
+
{
|
|
2630
|
+
name: "global_volume_accumulator",
|
|
2631
|
+
writable: true
|
|
2632
|
+
},
|
|
2633
|
+
{
|
|
2634
|
+
name: "mint",
|
|
2635
|
+
writable: true,
|
|
2636
|
+
address: "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn"
|
|
2637
|
+
},
|
|
2638
|
+
{
|
|
2639
|
+
name: "global_incentive_token_account",
|
|
2640
|
+
writable: true,
|
|
2641
|
+
pda: {
|
|
2642
|
+
seeds: [
|
|
2643
|
+
{
|
|
2644
|
+
kind: "account",
|
|
2645
|
+
path: "global_volume_accumulator"
|
|
2646
|
+
},
|
|
2647
|
+
{
|
|
2648
|
+
kind: "account",
|
|
2649
|
+
path: "token_program"
|
|
2650
|
+
},
|
|
2651
|
+
{
|
|
2652
|
+
kind: "account",
|
|
2653
|
+
path: "mint"
|
|
2654
|
+
}
|
|
2655
|
+
],
|
|
2656
|
+
program: {
|
|
2657
|
+
kind: "const",
|
|
2658
|
+
value: [
|
|
2659
|
+
140,
|
|
2660
|
+
151,
|
|
2661
|
+
37,
|
|
2662
|
+
143,
|
|
2663
|
+
78,
|
|
2664
|
+
36,
|
|
2665
|
+
137,
|
|
2666
|
+
241,
|
|
2667
|
+
187,
|
|
2668
|
+
61,
|
|
2669
|
+
16,
|
|
2670
|
+
41,
|
|
2671
|
+
20,
|
|
2672
|
+
142,
|
|
2673
|
+
13,
|
|
2674
|
+
131,
|
|
2675
|
+
11,
|
|
2676
|
+
90,
|
|
2677
|
+
19,
|
|
2678
|
+
153,
|
|
2679
|
+
218,
|
|
2680
|
+
255,
|
|
2681
|
+
16,
|
|
2682
|
+
132,
|
|
2683
|
+
4,
|
|
2684
|
+
142,
|
|
2685
|
+
123,
|
|
2686
|
+
216,
|
|
2687
|
+
219,
|
|
2688
|
+
233,
|
|
2689
|
+
248,
|
|
2690
|
+
89
|
|
2691
|
+
]
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
},
|
|
2695
|
+
{
|
|
2696
|
+
name: "associated_token_program",
|
|
2697
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
2227
2698
|
},
|
|
2228
2699
|
{
|
|
2229
|
-
name: "
|
|
2700
|
+
name: "system_program",
|
|
2701
|
+
address: "11111111111111111111111111111111"
|
|
2702
|
+
},
|
|
2703
|
+
{
|
|
2704
|
+
name: "token_program"
|
|
2230
2705
|
},
|
|
2231
2706
|
{
|
|
2232
2707
|
name: "event_authority",
|
|
@@ -2261,7 +2736,24 @@ var pump_default = {
|
|
|
2261
2736
|
name: "program"
|
|
2262
2737
|
}
|
|
2263
2738
|
],
|
|
2264
|
-
args: [
|
|
2739
|
+
args: [
|
|
2740
|
+
{
|
|
2741
|
+
name: "start_time",
|
|
2742
|
+
type: "i64"
|
|
2743
|
+
},
|
|
2744
|
+
{
|
|
2745
|
+
name: "end_time",
|
|
2746
|
+
type: "i64"
|
|
2747
|
+
},
|
|
2748
|
+
{
|
|
2749
|
+
name: "day_number",
|
|
2750
|
+
type: "u16"
|
|
2751
|
+
},
|
|
2752
|
+
{
|
|
2753
|
+
name: "pump_token_supply_per_day",
|
|
2754
|
+
type: "u64"
|
|
2755
|
+
}
|
|
2756
|
+
]
|
|
2265
2757
|
}
|
|
2266
2758
|
],
|
|
2267
2759
|
accounts: [
|
|
@@ -2290,6 +2782,45 @@ var pump_default = {
|
|
|
2290
2782
|
114,
|
|
2291
2783
|
127
|
|
2292
2784
|
]
|
|
2785
|
+
},
|
|
2786
|
+
{
|
|
2787
|
+
name: "GlobalConfig",
|
|
2788
|
+
discriminator: [
|
|
2789
|
+
149,
|
|
2790
|
+
8,
|
|
2791
|
+
156,
|
|
2792
|
+
202,
|
|
2793
|
+
160,
|
|
2794
|
+
252,
|
|
2795
|
+
176,
|
|
2796
|
+
217
|
|
2797
|
+
]
|
|
2798
|
+
},
|
|
2799
|
+
{
|
|
2800
|
+
name: "GlobalVolumeAccumulator",
|
|
2801
|
+
discriminator: [
|
|
2802
|
+
202,
|
|
2803
|
+
42,
|
|
2804
|
+
246,
|
|
2805
|
+
43,
|
|
2806
|
+
142,
|
|
2807
|
+
190,
|
|
2808
|
+
30,
|
|
2809
|
+
255
|
|
2810
|
+
]
|
|
2811
|
+
},
|
|
2812
|
+
{
|
|
2813
|
+
name: "UserVolumeAccumulator",
|
|
2814
|
+
discriminator: [
|
|
2815
|
+
86,
|
|
2816
|
+
255,
|
|
2817
|
+
112,
|
|
2818
|
+
14,
|
|
2819
|
+
102,
|
|
2820
|
+
53,
|
|
2821
|
+
154,
|
|
2822
|
+
250
|
|
2823
|
+
]
|
|
2293
2824
|
}
|
|
2294
2825
|
],
|
|
2295
2826
|
events: [
|
|
@@ -2306,6 +2837,32 @@ var pump_default = {
|
|
|
2306
2837
|
107
|
|
2307
2838
|
]
|
|
2308
2839
|
},
|
|
2840
|
+
{
|
|
2841
|
+
name: "AdminUpdatePumpIncentivesEvent",
|
|
2842
|
+
discriminator: [
|
|
2843
|
+
156,
|
|
2844
|
+
65,
|
|
2845
|
+
48,
|
|
2846
|
+
237,
|
|
2847
|
+
27,
|
|
2848
|
+
54,
|
|
2849
|
+
158,
|
|
2850
|
+
27
|
|
2851
|
+
]
|
|
2852
|
+
},
|
|
2853
|
+
{
|
|
2854
|
+
name: "ClaimPumpIncentivesEvent",
|
|
2855
|
+
discriminator: [
|
|
2856
|
+
13,
|
|
2857
|
+
204,
|
|
2858
|
+
53,
|
|
2859
|
+
161,
|
|
2860
|
+
254,
|
|
2861
|
+
254,
|
|
2862
|
+
81,
|
|
2863
|
+
233
|
|
2864
|
+
]
|
|
2865
|
+
},
|
|
2309
2866
|
{
|
|
2310
2867
|
name: "CollectCreatorFeeEvent",
|
|
2311
2868
|
discriminator: [
|
|
@@ -2592,6 +3149,16 @@ var pump_default = {
|
|
|
2592
3149
|
code: 6030,
|
|
2593
3150
|
name: "CreatorShouldNotBeZero",
|
|
2594
3151
|
msg: "Creator should not be zero"
|
|
3152
|
+
},
|
|
3153
|
+
{
|
|
3154
|
+
code: 6031,
|
|
3155
|
+
name: "InvalidDayIndex",
|
|
3156
|
+
msg: "Invalid day index"
|
|
3157
|
+
},
|
|
3158
|
+
{
|
|
3159
|
+
code: 6032,
|
|
3160
|
+
name: "InvalidTimeRange",
|
|
3161
|
+
msg: "Invalid time range"
|
|
2595
3162
|
}
|
|
2596
3163
|
],
|
|
2597
3164
|
types: [
|
|
@@ -2627,6 +3194,13 @@ var pump_default = {
|
|
|
2627
3194
|
]
|
|
2628
3195
|
}
|
|
2629
3196
|
},
|
|
3197
|
+
{
|
|
3198
|
+
name: "AdminUpdatePumpIncentivesEvent",
|
|
3199
|
+
type: {
|
|
3200
|
+
kind: "struct",
|
|
3201
|
+
fields: []
|
|
3202
|
+
}
|
|
3203
|
+
},
|
|
2630
3204
|
{
|
|
2631
3205
|
name: "BondingCurve",
|
|
2632
3206
|
type: {
|
|
@@ -2663,6 +3237,13 @@ var pump_default = {
|
|
|
2663
3237
|
]
|
|
2664
3238
|
}
|
|
2665
3239
|
},
|
|
3240
|
+
{
|
|
3241
|
+
name: "ClaimPumpIncentivesEvent",
|
|
3242
|
+
type: {
|
|
3243
|
+
kind: "struct",
|
|
3244
|
+
fields: []
|
|
3245
|
+
}
|
|
3246
|
+
},
|
|
2666
3247
|
{
|
|
2667
3248
|
name: "CollectCreatorFeeEvent",
|
|
2668
3249
|
type: {
|
|
@@ -2910,6 +3491,77 @@ var pump_default = {
|
|
|
2910
3491
|
]
|
|
2911
3492
|
}
|
|
2912
3493
|
},
|
|
3494
|
+
{
|
|
3495
|
+
name: "GlobalConfig",
|
|
3496
|
+
type: {
|
|
3497
|
+
kind: "struct",
|
|
3498
|
+
fields: [
|
|
3499
|
+
{
|
|
3500
|
+
name: "admin",
|
|
3501
|
+
type: "pubkey"
|
|
3502
|
+
},
|
|
3503
|
+
{
|
|
3504
|
+
name: "lp_fee_basis_points",
|
|
3505
|
+
type: "u64"
|
|
3506
|
+
},
|
|
3507
|
+
{
|
|
3508
|
+
name: "protocol_fee_basis_points",
|
|
3509
|
+
type: "u64"
|
|
3510
|
+
},
|
|
3511
|
+
{
|
|
3512
|
+
name: "disable_flags",
|
|
3513
|
+
type: "u8"
|
|
3514
|
+
},
|
|
3515
|
+
{
|
|
3516
|
+
name: "protocol_fee_recipients",
|
|
3517
|
+
type: {
|
|
3518
|
+
array: [
|
|
3519
|
+
"pubkey",
|
|
3520
|
+
8
|
|
3521
|
+
]
|
|
3522
|
+
}
|
|
3523
|
+
},
|
|
3524
|
+
{
|
|
3525
|
+
name: "coin_creator_fee_basis_points",
|
|
3526
|
+
type: "u64"
|
|
3527
|
+
}
|
|
3528
|
+
]
|
|
3529
|
+
}
|
|
3530
|
+
},
|
|
3531
|
+
{
|
|
3532
|
+
name: "GlobalVolumeAccumulator",
|
|
3533
|
+
type: {
|
|
3534
|
+
kind: "struct",
|
|
3535
|
+
fields: [
|
|
3536
|
+
{
|
|
3537
|
+
name: "start_time",
|
|
3538
|
+
type: "i64"
|
|
3539
|
+
},
|
|
3540
|
+
{
|
|
3541
|
+
name: "end_time",
|
|
3542
|
+
type: "i64"
|
|
3543
|
+
},
|
|
3544
|
+
{
|
|
3545
|
+
name: "total_pump_token_supply",
|
|
3546
|
+
type: {
|
|
3547
|
+
array: [
|
|
3548
|
+
"u64",
|
|
3549
|
+
30
|
|
3550
|
+
]
|
|
3551
|
+
}
|
|
3552
|
+
},
|
|
3553
|
+
{
|
|
3554
|
+
name: "sol_volumes",
|
|
3555
|
+
type: {
|
|
3556
|
+
array: [
|
|
3557
|
+
"u64",
|
|
3558
|
+
30
|
|
3559
|
+
]
|
|
3560
|
+
}
|
|
3561
|
+
}
|
|
3562
|
+
]
|
|
3563
|
+
}
|
|
3564
|
+
},
|
|
2913
3565
|
{
|
|
2914
3566
|
name: "SetCreatorEvent",
|
|
2915
3567
|
type: {
|
|
@@ -3126,6 +3778,30 @@ var pump_default = {
|
|
|
3126
3778
|
}
|
|
3127
3779
|
]
|
|
3128
3780
|
}
|
|
3781
|
+
},
|
|
3782
|
+
{
|
|
3783
|
+
name: "UserVolumeAccumulator",
|
|
3784
|
+
type: {
|
|
3785
|
+
kind: "struct",
|
|
3786
|
+
fields: [
|
|
3787
|
+
{
|
|
3788
|
+
name: "last_update_timestamp",
|
|
3789
|
+
type: "i64"
|
|
3790
|
+
},
|
|
3791
|
+
{
|
|
3792
|
+
name: "current_sol_volume",
|
|
3793
|
+
type: "u64"
|
|
3794
|
+
},
|
|
3795
|
+
{
|
|
3796
|
+
name: "total_unclaimed_pump_tokens",
|
|
3797
|
+
type: "u64"
|
|
3798
|
+
},
|
|
3799
|
+
{
|
|
3800
|
+
name: "total_claimed_pump_tokens",
|
|
3801
|
+
type: "u64"
|
|
3802
|
+
}
|
|
3803
|
+
]
|
|
3804
|
+
}
|
|
3129
3805
|
}
|
|
3130
3806
|
]
|
|
3131
3807
|
};
|
|
@@ -3202,47 +3878,9 @@ function getSellSolAmountFromTokenAmount(global, bondingCurve, amount) {
|
|
|
3202
3878
|
}
|
|
3203
3879
|
|
|
3204
3880
|
// src/pda.ts
|
|
3205
|
-
import { PublicKey as
|
|
3206
|
-
import { NATIVE_MINT } from "@solana/spl-token";
|
|
3881
|
+
import { PublicKey as PublicKey3 } from "@solana/web3.js";
|
|
3882
|
+
import { NATIVE_MINT as NATIVE_MINT2 } from "@solana/spl-token";
|
|
3207
3883
|
import { poolPda } from "@pump-fun/pump-swap-sdk";
|
|
3208
|
-
function globalPda(programId) {
|
|
3209
|
-
const [globalPda2] = PublicKey2.findProgramAddressSync(
|
|
3210
|
-
[Buffer.from("global")],
|
|
3211
|
-
programId
|
|
3212
|
-
);
|
|
3213
|
-
return globalPda2;
|
|
3214
|
-
}
|
|
3215
|
-
function bondingCurvePda(programId, mint) {
|
|
3216
|
-
const [bondingCurvePda2] = PublicKey2.findProgramAddressSync(
|
|
3217
|
-
[Buffer.from("bonding-curve"), new PublicKey2(mint).toBuffer()],
|
|
3218
|
-
programId
|
|
3219
|
-
);
|
|
3220
|
-
return bondingCurvePda2;
|
|
3221
|
-
}
|
|
3222
|
-
function creatorVaultPda(programId, creator) {
|
|
3223
|
-
const [creatorVault] = PublicKey2.findProgramAddressSync(
|
|
3224
|
-
[Buffer.from("creator-vault"), creator.toBuffer()],
|
|
3225
|
-
programId
|
|
3226
|
-
);
|
|
3227
|
-
return creatorVault;
|
|
3228
|
-
}
|
|
3229
|
-
function pumpPoolAuthorityPda(mint, pumpProgramId) {
|
|
3230
|
-
return PublicKey2.findProgramAddressSync(
|
|
3231
|
-
[Buffer.from("pool-authority"), mint.toBuffer()],
|
|
3232
|
-
pumpProgramId
|
|
3233
|
-
);
|
|
3234
|
-
}
|
|
3235
|
-
var CANONICAL_POOL_INDEX = 0;
|
|
3236
|
-
function canonicalPumpPoolPda(pumpProgramId, pumpAmmProgramId, mint) {
|
|
3237
|
-
const [pumpPoolAuthority] = pumpPoolAuthorityPda(mint, pumpProgramId);
|
|
3238
|
-
return poolPda(
|
|
3239
|
-
CANONICAL_POOL_INDEX,
|
|
3240
|
-
pumpPoolAuthority,
|
|
3241
|
-
mint,
|
|
3242
|
-
NATIVE_MINT,
|
|
3243
|
-
pumpAmmProgramId
|
|
3244
|
-
);
|
|
3245
|
-
}
|
|
3246
3884
|
|
|
3247
3885
|
// src/sdk.ts
|
|
3248
3886
|
import { AnchorProvider, Program } from "@coral-xyz/anchor";
|
|
@@ -3250,11 +3888,12 @@ import { PumpAmmAdminSdk, PumpAmmSdk } from "@pump-fun/pump-swap-sdk";
|
|
|
3250
3888
|
import {
|
|
3251
3889
|
createAssociatedTokenAccountIdempotentInstruction,
|
|
3252
3890
|
getAssociatedTokenAddressSync,
|
|
3253
|
-
NATIVE_MINT
|
|
3891
|
+
NATIVE_MINT,
|
|
3892
|
+
TOKEN_2022_PROGRAM_ID,
|
|
3254
3893
|
TOKEN_PROGRAM_ID
|
|
3255
3894
|
} from "@solana/spl-token";
|
|
3256
3895
|
import {
|
|
3257
|
-
PublicKey as
|
|
3896
|
+
PublicKey as PublicKey2
|
|
3258
3897
|
} from "@solana/web3.js";
|
|
3259
3898
|
import BN2 from "bn.js";
|
|
3260
3899
|
function getPumpProgram(connection, programId) {
|
|
@@ -3265,13 +3904,16 @@ function getPumpProgram(connection, programId) {
|
|
|
3265
3904
|
new AnchorProvider(connection, null, {})
|
|
3266
3905
|
);
|
|
3267
3906
|
}
|
|
3268
|
-
var PUMP_PROGRAM_ID = new
|
|
3907
|
+
var PUMP_PROGRAM_ID = new PublicKey2(
|
|
3269
3908
|
"6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
|
|
3270
3909
|
);
|
|
3271
|
-
var PUMP_AMM_PROGRAM_ID = new
|
|
3910
|
+
var PUMP_AMM_PROGRAM_ID = new PublicKey2(
|
|
3272
3911
|
"pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"
|
|
3273
3912
|
);
|
|
3274
3913
|
var BONDING_CURVE_NEW_SIZE = 150;
|
|
3914
|
+
var PUMP_TOKEN_MINT = new PublicKey2(
|
|
3915
|
+
"pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn"
|
|
3916
|
+
);
|
|
3275
3917
|
var PumpSdk = class {
|
|
3276
3918
|
constructor(connection, pumpProgramId = PUMP_PROGRAM_ID, pumpAmmProgramId = PUMP_AMM_PROGRAM_ID) {
|
|
3277
3919
|
this.connection = connection;
|
|
@@ -3308,6 +3950,12 @@ var PumpSdk = class {
|
|
|
3308
3950
|
mint
|
|
3309
3951
|
);
|
|
3310
3952
|
}
|
|
3953
|
+
globalVolumeAccumulatorPda() {
|
|
3954
|
+
return globalVolumeAccumulatorPda(this.offlinePumpProgram.programId);
|
|
3955
|
+
}
|
|
3956
|
+
userVolumeAccumulatorPda(user) {
|
|
3957
|
+
return userVolumeAccumulatorPda(user, this.offlinePumpProgram.programId);
|
|
3958
|
+
}
|
|
3311
3959
|
decodeGlobal(accountInfo) {
|
|
3312
3960
|
return this.offlinePumpProgram.coder.accounts.decode(
|
|
3313
3961
|
"global",
|
|
@@ -3320,6 +3968,18 @@ var PumpSdk = class {
|
|
|
3320
3968
|
accountInfo.data
|
|
3321
3969
|
);
|
|
3322
3970
|
}
|
|
3971
|
+
decodeGlobalVolumeAccumulator(accountInfo) {
|
|
3972
|
+
return this.offlinePumpProgram.coder.accounts.decode(
|
|
3973
|
+
"globalVolumeAccumulator",
|
|
3974
|
+
accountInfo.data
|
|
3975
|
+
);
|
|
3976
|
+
}
|
|
3977
|
+
decodeUserVolumeAccumulator(accountInfo) {
|
|
3978
|
+
return this.offlinePumpProgram.coder.accounts.decode(
|
|
3979
|
+
"userVolumeAccumulator",
|
|
3980
|
+
accountInfo.data
|
|
3981
|
+
);
|
|
3982
|
+
}
|
|
3323
3983
|
async fetchGlobal() {
|
|
3324
3984
|
return await this.pumpProgram.account.global.fetch(this.globalPda());
|
|
3325
3985
|
}
|
|
@@ -3359,6 +4019,16 @@ var PumpSdk = class {
|
|
|
3359
4019
|
const bondingCurve = this.decodeBondingCurve(bondingCurveAccountInfo);
|
|
3360
4020
|
return { bondingCurveAccountInfo, bondingCurve };
|
|
3361
4021
|
}
|
|
4022
|
+
async fetchGlobalVolumeAccumulator() {
|
|
4023
|
+
return await this.pumpProgram.account.globalVolumeAccumulator.fetch(
|
|
4024
|
+
this.globalVolumeAccumulatorPda()[0]
|
|
4025
|
+
);
|
|
4026
|
+
}
|
|
4027
|
+
async fetchUserVolumeAccumulator(user) {
|
|
4028
|
+
return await this.pumpProgram.account.userVolumeAccumulator.fetch(
|
|
4029
|
+
this.userVolumeAccumulatorPda(user)[0]
|
|
4030
|
+
);
|
|
4031
|
+
}
|
|
3362
4032
|
async createInstruction({
|
|
3363
4033
|
mint,
|
|
3364
4034
|
name,
|
|
@@ -3533,7 +4203,7 @@ var PumpSdk = class {
|
|
|
3533
4203
|
}).instruction();
|
|
3534
4204
|
}
|
|
3535
4205
|
async collectCoinCreatorFeeInstructions(coinCreator) {
|
|
3536
|
-
let quoteMint =
|
|
4206
|
+
let quoteMint = NATIVE_MINT;
|
|
3537
4207
|
let quoteTokenProgram = TOKEN_PROGRAM_ID;
|
|
3538
4208
|
let coinCreatorVaultAuthority = this.pumpAmmSdk.coinCreatorVaultAuthorityPda(coinCreator);
|
|
3539
4209
|
let coinCreatorVaultAta = this.pumpAmmSdk.coinCreatorVaultAta(
|
|
@@ -3591,11 +4261,101 @@ var PumpSdk = class {
|
|
|
3591
4261
|
}
|
|
3592
4262
|
return new BN2(accountInfo.lamports - rentExemptionLamports);
|
|
3593
4263
|
}
|
|
4264
|
+
async adminUpdatePumpIncentives(admin, startTime, endTime, dayNumber, pumpTokenSupplyPerDay, mint = PUMP_TOKEN_MINT, tokenProgram = TOKEN_2022_PROGRAM_ID) {
|
|
4265
|
+
return await this.offlinePumpProgram.methods.updatePumpIncentives(
|
|
4266
|
+
startTime,
|
|
4267
|
+
endTime,
|
|
4268
|
+
dayNumber.toNumber(),
|
|
4269
|
+
pumpTokenSupplyPerDay
|
|
4270
|
+
).accountsPartial({
|
|
4271
|
+
admin,
|
|
4272
|
+
globalVolumeAccumulator: this.globalVolumeAccumulatorPda()[0],
|
|
4273
|
+
globalConfig: this.globalPda(),
|
|
4274
|
+
mint,
|
|
4275
|
+
tokenProgram
|
|
4276
|
+
}).instruction();
|
|
4277
|
+
}
|
|
4278
|
+
async claimPumpIncentives(user, payer, mint = PUMP_TOKEN_MINT, tokenProgram = TOKEN_2022_PROGRAM_ID) {
|
|
4279
|
+
const userPumpAta = getAssociatedTokenAddressSync(
|
|
4280
|
+
mint,
|
|
4281
|
+
user,
|
|
4282
|
+
true,
|
|
4283
|
+
tokenProgram
|
|
4284
|
+
);
|
|
4285
|
+
return [
|
|
4286
|
+
createAssociatedTokenAccountIdempotentInstruction(
|
|
4287
|
+
payer,
|
|
4288
|
+
userPumpAta,
|
|
4289
|
+
user,
|
|
4290
|
+
mint,
|
|
4291
|
+
tokenProgram
|
|
4292
|
+
),
|
|
4293
|
+
await this.offlinePumpProgram.methods.claimPumpIncentives().accountsPartial({
|
|
4294
|
+
user,
|
|
4295
|
+
payer,
|
|
4296
|
+
globalVolumeAccumulator: this.globalVolumeAccumulatorPda()[0],
|
|
4297
|
+
mint,
|
|
4298
|
+
tokenProgram
|
|
4299
|
+
}).instruction()
|
|
4300
|
+
];
|
|
4301
|
+
}
|
|
3594
4302
|
};
|
|
3595
4303
|
function getFeeRecipient(global) {
|
|
3596
4304
|
const feeRecipients = [global.feeRecipient, ...global.feeRecipients];
|
|
3597
4305
|
return feeRecipients[Math.floor(Math.random() * feeRecipients.length)];
|
|
3598
4306
|
}
|
|
4307
|
+
|
|
4308
|
+
// src/pda.ts
|
|
4309
|
+
function globalPda(programId) {
|
|
4310
|
+
const [globalPda2] = PublicKey3.findProgramAddressSync(
|
|
4311
|
+
[Buffer.from("global")],
|
|
4312
|
+
programId
|
|
4313
|
+
);
|
|
4314
|
+
return globalPda2;
|
|
4315
|
+
}
|
|
4316
|
+
function bondingCurvePda(programId, mint) {
|
|
4317
|
+
const [bondingCurvePda2] = PublicKey3.findProgramAddressSync(
|
|
4318
|
+
[Buffer.from("bonding-curve"), new PublicKey3(mint).toBuffer()],
|
|
4319
|
+
programId
|
|
4320
|
+
);
|
|
4321
|
+
return bondingCurvePda2;
|
|
4322
|
+
}
|
|
4323
|
+
function creatorVaultPda(programId, creator) {
|
|
4324
|
+
const [creatorVault] = PublicKey3.findProgramAddressSync(
|
|
4325
|
+
[Buffer.from("creator-vault"), creator.toBuffer()],
|
|
4326
|
+
programId
|
|
4327
|
+
);
|
|
4328
|
+
return creatorVault;
|
|
4329
|
+
}
|
|
4330
|
+
function pumpPoolAuthorityPda(mint, pumpProgramId) {
|
|
4331
|
+
return PublicKey3.findProgramAddressSync(
|
|
4332
|
+
[Buffer.from("pool-authority"), mint.toBuffer()],
|
|
4333
|
+
pumpProgramId
|
|
4334
|
+
);
|
|
4335
|
+
}
|
|
4336
|
+
var CANONICAL_POOL_INDEX = 0;
|
|
4337
|
+
function canonicalPumpPoolPda(pumpProgramId, pumpAmmProgramId, mint) {
|
|
4338
|
+
const [pumpPoolAuthority] = pumpPoolAuthorityPda(mint, pumpProgramId);
|
|
4339
|
+
return poolPda(
|
|
4340
|
+
CANONICAL_POOL_INDEX,
|
|
4341
|
+
pumpPoolAuthority,
|
|
4342
|
+
mint,
|
|
4343
|
+
NATIVE_MINT2,
|
|
4344
|
+
pumpAmmProgramId
|
|
4345
|
+
);
|
|
4346
|
+
}
|
|
4347
|
+
function globalVolumeAccumulatorPda(programId = PUMP_PROGRAM_ID) {
|
|
4348
|
+
return PublicKey3.findProgramAddressSync(
|
|
4349
|
+
[Buffer.from("global_volume_accumulator")],
|
|
4350
|
+
programId
|
|
4351
|
+
);
|
|
4352
|
+
}
|
|
4353
|
+
function userVolumeAccumulatorPda(user, programId = PUMP_PROGRAM_ID) {
|
|
4354
|
+
return PublicKey3.findProgramAddressSync(
|
|
4355
|
+
[Buffer.from("user_volume_accumulator"), user.toBuffer()],
|
|
4356
|
+
programId
|
|
4357
|
+
);
|
|
4358
|
+
}
|
|
3599
4359
|
export {
|
|
3600
4360
|
BONDING_CURVE_NEW_SIZE,
|
|
3601
4361
|
CANONICAL_POOL_INDEX,
|
|
@@ -3610,7 +4370,9 @@ export {
|
|
|
3610
4370
|
getPumpProgram,
|
|
3611
4371
|
getSellSolAmountFromTokenAmount,
|
|
3612
4372
|
globalPda,
|
|
4373
|
+
globalVolumeAccumulatorPda,
|
|
3613
4374
|
newBondingCurve,
|
|
3614
4375
|
pump_default as pumpIdl,
|
|
3615
|
-
pumpPoolAuthorityPda
|
|
4376
|
+
pumpPoolAuthorityPda,
|
|
4377
|
+
userVolumeAccumulatorPda
|
|
3616
4378
|
};
|