@pump-fun/pump-sdk 1.8.0 → 1.9.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 CHANGED
@@ -2716,6 +2716,134 @@ var pump_default = {
2716
2716
  }
2717
2717
  ]
2718
2718
  },
2719
+ {
2720
+ name: "sync_user_volume_accumulator",
2721
+ discriminator: [
2722
+ 86,
2723
+ 31,
2724
+ 192,
2725
+ 87,
2726
+ 163,
2727
+ 87,
2728
+ 79,
2729
+ 238
2730
+ ],
2731
+ accounts: [
2732
+ {
2733
+ name: "user"
2734
+ },
2735
+ {
2736
+ name: "global_volume_accumulator",
2737
+ pda: {
2738
+ seeds: [
2739
+ {
2740
+ kind: "const",
2741
+ value: [
2742
+ 103,
2743
+ 108,
2744
+ 111,
2745
+ 98,
2746
+ 97,
2747
+ 108,
2748
+ 95,
2749
+ 118,
2750
+ 111,
2751
+ 108,
2752
+ 117,
2753
+ 109,
2754
+ 101,
2755
+ 95,
2756
+ 97,
2757
+ 99,
2758
+ 99,
2759
+ 117,
2760
+ 109,
2761
+ 117,
2762
+ 108,
2763
+ 97,
2764
+ 116,
2765
+ 111,
2766
+ 114
2767
+ ]
2768
+ }
2769
+ ]
2770
+ }
2771
+ },
2772
+ {
2773
+ name: "user_volume_accumulator",
2774
+ writable: true,
2775
+ pda: {
2776
+ seeds: [
2777
+ {
2778
+ kind: "const",
2779
+ value: [
2780
+ 117,
2781
+ 115,
2782
+ 101,
2783
+ 114,
2784
+ 95,
2785
+ 118,
2786
+ 111,
2787
+ 108,
2788
+ 117,
2789
+ 109,
2790
+ 101,
2791
+ 95,
2792
+ 97,
2793
+ 99,
2794
+ 99,
2795
+ 117,
2796
+ 109,
2797
+ 117,
2798
+ 108,
2799
+ 97,
2800
+ 116,
2801
+ 111,
2802
+ 114
2803
+ ]
2804
+ },
2805
+ {
2806
+ kind: "account",
2807
+ path: "user"
2808
+ }
2809
+ ]
2810
+ }
2811
+ },
2812
+ {
2813
+ name: "event_authority",
2814
+ pda: {
2815
+ seeds: [
2816
+ {
2817
+ kind: "const",
2818
+ value: [
2819
+ 95,
2820
+ 95,
2821
+ 101,
2822
+ 118,
2823
+ 101,
2824
+ 110,
2825
+ 116,
2826
+ 95,
2827
+ 97,
2828
+ 117,
2829
+ 116,
2830
+ 104,
2831
+ 111,
2832
+ 114,
2833
+ 105,
2834
+ 116,
2835
+ 121
2836
+ ]
2837
+ }
2838
+ ]
2839
+ }
2840
+ },
2841
+ {
2842
+ name: "program"
2843
+ }
2844
+ ],
2845
+ args: []
2846
+ },
2719
2847
  {
2720
2848
  name: "update_global_authority",
2721
2849
  discriminator: [
@@ -2992,6 +3120,19 @@ var pump_default = {
2992
3120
  131
2993
3121
  ]
2994
3122
  },
3123
+ {
3124
+ name: "SyncUserVolumeAccumulatorEvent",
3125
+ discriminator: [
3126
+ 197,
3127
+ 122,
3128
+ 167,
3129
+ 124,
3130
+ 116,
3131
+ 81,
3132
+ 91,
3133
+ 255
3134
+ ]
3135
+ },
2995
3136
  {
2996
3137
  name: "TradeEvent",
2997
3138
  discriminator: [
@@ -3735,6 +3876,26 @@ var pump_default = {
3735
3876
  ]
3736
3877
  }
3737
3878
  },
3879
+ {
3880
+ name: "SyncUserVolumeAccumulatorEvent",
3881
+ type: {
3882
+ kind: "struct",
3883
+ fields: [
3884
+ {
3885
+ name: "user",
3886
+ type: "pubkey"
3887
+ },
3888
+ {
3889
+ name: "total_claimed_tokens_before",
3890
+ type: "u64"
3891
+ },
3892
+ {
3893
+ name: "total_claimed_tokens_after",
3894
+ type: "u64"
3895
+ }
3896
+ ]
3897
+ }
3898
+ },
3738
3899
  {
3739
3900
  name: "TradeEvent",
3740
3901
  type: {
@@ -3859,6 +4020,10 @@ var pump_default = {
3859
4020
  {
3860
4021
  name: "last_update_timestamp",
3861
4022
  type: "i64"
4023
+ },
4024
+ {
4025
+ name: "has_total_claimed_tokens",
4026
+ type: "bool"
3862
4027
  }
3863
4028
  ]
3864
4029
  }
@@ -4388,19 +4553,30 @@ var PumpSdk = class {
4388
4553
  }
4389
4554
  async adminUpdateTokenIncentives(startTime, endTime, dayNumber, tokenSupplyPerDay, secondsInADay = new BN3(86400), mint = PUMP_TOKEN_MINT, tokenProgram = TOKEN_2022_PROGRAM_ID) {
4390
4555
  const { authority } = await this.fetchGlobal();
4556
+ return await this.offlinePumpProgram.methods.adminUpdateTokenIncentives(
4557
+ startTime,
4558
+ endTime,
4559
+ secondsInADay,
4560
+ dayNumber,
4561
+ tokenSupplyPerDay
4562
+ ).accountsPartial({
4563
+ global: this.globalPda(),
4564
+ authority,
4565
+ mint,
4566
+ tokenProgram
4567
+ }).instruction();
4568
+ }
4569
+ async adminUpdateTokenIncentivesBothPrograms(startTime, endTime, dayNumber, tokenSupplyPerDay, secondsInADay = new BN3(86400), mint = PUMP_TOKEN_MINT, tokenProgram = TOKEN_2022_PROGRAM_ID) {
4391
4570
  return [
4392
- await this.offlinePumpProgram.methods.adminUpdateTokenIncentives(
4571
+ await this.adminUpdateTokenIncentives(
4393
4572
  startTime,
4394
4573
  endTime,
4395
- secondsInADay,
4396
4574
  dayNumber,
4397
- tokenSupplyPerDay
4398
- ).accountsPartial({
4399
- global: this.globalPda(),
4400
- authority,
4575
+ tokenSupplyPerDay,
4576
+ secondsInADay,
4401
4577
  mint,
4402
4578
  tokenProgram
4403
- }).instruction(),
4579
+ ),
4404
4580
  await this.pumpAmmAdminSdk.adminUpdateTokenIncentives(
4405
4581
  startTime,
4406
4582
  endTime,
@@ -4413,14 +4589,17 @@ var PumpSdk = class {
4413
4589
  ];
4414
4590
  }
4415
4591
  async claimTokenIncentives(user, payer, mint = PUMP_TOKEN_MINT, tokenProgram = TOKEN_2022_PROGRAM_ID) {
4592
+ return await this.offlinePumpProgram.methods.claimTokenIncentives().accountsPartial({
4593
+ user,
4594
+ payer,
4595
+ mint,
4596
+ tokenProgram
4597
+ }).instruction();
4598
+ }
4599
+ async claimTokenIncentivesBothPrograms(user, payer, mint = PUMP_TOKEN_MINT, tokenProgram = TOKEN_2022_PROGRAM_ID) {
4416
4600
  return [
4417
- await this.offlinePumpProgram.methods.claimTokenIncentives().accountsPartial({
4418
- user,
4419
- payer,
4420
- mint,
4421
- tokenProgram
4422
- }).instruction(),
4423
- ...await this.pumpAmmSdk.claimTokenIncentives(
4601
+ await this.claimTokenIncentives(user, payer, mint, tokenProgram),
4602
+ await this.pumpAmmSdk.claimTokenIncentives(
4424
4603
  user,
4425
4604
  payer,
4426
4605
  mint,
@@ -4445,10 +4624,12 @@ var PumpSdk = class {
4445
4624
  const userVolumeAccumulator = this.decodeUserVolumeAccumulator(
4446
4625
  userVolumeAccumulatorAccountInfo
4447
4626
  );
4448
- return totalUnclaimedTokens(
4449
- globalVolumeAccumulator,
4450
- userVolumeAccumulator
4451
- ).add(await this.pumpAmmSdk.getCurrentDayTokens(user));
4627
+ return totalUnclaimedTokens(globalVolumeAccumulator, userVolumeAccumulator);
4628
+ }
4629
+ async getTotalUnclaimedTokensBothPrograms(user) {
4630
+ return (await this.getTotalUnclaimedTokens(user)).add(
4631
+ await this.pumpAmmSdk.getTotalUnclaimedTokens(user)
4632
+ );
4452
4633
  }
4453
4634
  async getCurrentDayTokens(user) {
4454
4635
  const [
@@ -4467,10 +4648,22 @@ var PumpSdk = class {
4467
4648
  const userVolumeAccumulator = this.decodeUserVolumeAccumulator(
4468
4649
  userVolumeAccumulatorAccountInfo
4469
4650
  );
4470
- return currentDayTokens(globalVolumeAccumulator, userVolumeAccumulator).add(
4651
+ return currentDayTokens(globalVolumeAccumulator, userVolumeAccumulator);
4652
+ }
4653
+ async getCurrentDayTokensBothPrograms(user) {
4654
+ return (await this.getCurrentDayTokens(user)).add(
4471
4655
  await this.pumpAmmSdk.getCurrentDayTokens(user)
4472
4656
  );
4473
4657
  }
4658
+ async syncUserVolumeAccumulator(user) {
4659
+ return await this.offlinePumpProgram.methods.syncUserVolumeAccumulator().accountsPartial({ user }).instruction();
4660
+ }
4661
+ async syncUserVolumeAccumulatorBothPrograms(user) {
4662
+ return [
4663
+ await this.syncUserVolumeAccumulator(user),
4664
+ await this.pumpAmmSdk.syncUserVolumeAccumulator(user)
4665
+ ];
4666
+ }
4474
4667
  };
4475
4668
  function getFeeRecipient(global) {
4476
4669
  const feeRecipients = [global.feeRecipient, ...global.feeRecipients];
package/dist/index.d.mts CHANGED
@@ -2725,6 +2725,134 @@ type Pump = {
2725
2725
  }
2726
2726
  ];
2727
2727
  },
2728
+ {
2729
+ "name": "syncUserVolumeAccumulator";
2730
+ "discriminator": [
2731
+ 86,
2732
+ 31,
2733
+ 192,
2734
+ 87,
2735
+ 163,
2736
+ 87,
2737
+ 79,
2738
+ 238
2739
+ ];
2740
+ "accounts": [
2741
+ {
2742
+ "name": "user";
2743
+ },
2744
+ {
2745
+ "name": "globalVolumeAccumulator";
2746
+ "pda": {
2747
+ "seeds": [
2748
+ {
2749
+ "kind": "const";
2750
+ "value": [
2751
+ 103,
2752
+ 108,
2753
+ 111,
2754
+ 98,
2755
+ 97,
2756
+ 108,
2757
+ 95,
2758
+ 118,
2759
+ 111,
2760
+ 108,
2761
+ 117,
2762
+ 109,
2763
+ 101,
2764
+ 95,
2765
+ 97,
2766
+ 99,
2767
+ 99,
2768
+ 117,
2769
+ 109,
2770
+ 117,
2771
+ 108,
2772
+ 97,
2773
+ 116,
2774
+ 111,
2775
+ 114
2776
+ ];
2777
+ }
2778
+ ];
2779
+ };
2780
+ },
2781
+ {
2782
+ "name": "userVolumeAccumulator";
2783
+ "writable": true;
2784
+ "pda": {
2785
+ "seeds": [
2786
+ {
2787
+ "kind": "const";
2788
+ "value": [
2789
+ 117,
2790
+ 115,
2791
+ 101,
2792
+ 114,
2793
+ 95,
2794
+ 118,
2795
+ 111,
2796
+ 108,
2797
+ 117,
2798
+ 109,
2799
+ 101,
2800
+ 95,
2801
+ 97,
2802
+ 99,
2803
+ 99,
2804
+ 117,
2805
+ 109,
2806
+ 117,
2807
+ 108,
2808
+ 97,
2809
+ 116,
2810
+ 111,
2811
+ 114
2812
+ ];
2813
+ },
2814
+ {
2815
+ "kind": "account";
2816
+ "path": "user";
2817
+ }
2818
+ ];
2819
+ };
2820
+ },
2821
+ {
2822
+ "name": "eventAuthority";
2823
+ "pda": {
2824
+ "seeds": [
2825
+ {
2826
+ "kind": "const";
2827
+ "value": [
2828
+ 95,
2829
+ 95,
2830
+ 101,
2831
+ 118,
2832
+ 101,
2833
+ 110,
2834
+ 116,
2835
+ 95,
2836
+ 97,
2837
+ 117,
2838
+ 116,
2839
+ 104,
2840
+ 111,
2841
+ 114,
2842
+ 105,
2843
+ 116,
2844
+ 121
2845
+ ];
2846
+ }
2847
+ ];
2848
+ };
2849
+ },
2850
+ {
2851
+ "name": "program";
2852
+ }
2853
+ ];
2854
+ "args": [];
2855
+ },
2728
2856
  {
2729
2857
  "name": "updateGlobalAuthority";
2730
2858
  "discriminator": [
@@ -3001,6 +3129,19 @@ type Pump = {
3001
3129
  131
3002
3130
  ];
3003
3131
  },
3132
+ {
3133
+ "name": "syncUserVolumeAccumulatorEvent";
3134
+ "discriminator": [
3135
+ 197,
3136
+ 122,
3137
+ 167,
3138
+ 124,
3139
+ 116,
3140
+ 81,
3141
+ 91,
3142
+ 255
3143
+ ];
3144
+ },
3004
3145
  {
3005
3146
  "name": "tradeEvent";
3006
3147
  "discriminator": [
@@ -3744,6 +3885,26 @@ type Pump = {
3744
3885
  ];
3745
3886
  };
3746
3887
  },
3888
+ {
3889
+ "name": "syncUserVolumeAccumulatorEvent";
3890
+ "type": {
3891
+ "kind": "struct";
3892
+ "fields": [
3893
+ {
3894
+ "name": "user";
3895
+ "type": "pubkey";
3896
+ },
3897
+ {
3898
+ "name": "totalClaimedTokensBefore";
3899
+ "type": "u64";
3900
+ },
3901
+ {
3902
+ "name": "totalClaimedTokensAfter";
3903
+ "type": "u64";
3904
+ }
3905
+ ];
3906
+ };
3907
+ },
3747
3908
  {
3748
3909
  "name": "tradeEvent";
3749
3910
  "type": {
@@ -3868,6 +4029,10 @@ type Pump = {
3868
4029
  {
3869
4030
  "name": "lastUpdateTimestamp";
3870
4031
  "type": "i64";
4032
+ },
4033
+ {
4034
+ "name": "hasTotalClaimedTokens";
4035
+ "type": "bool";
3871
4036
  }
3872
4037
  ];
3873
4038
  };
@@ -6597,6 +6762,135 @@ var instructions = [
6597
6762
  }
6598
6763
  ]
6599
6764
  },
6765
+ {
6766
+ name: "sync_user_volume_accumulator",
6767
+ discriminator: [
6768
+ 86,
6769
+ 31,
6770
+ 192,
6771
+ 87,
6772
+ 163,
6773
+ 87,
6774
+ 79,
6775
+ 238
6776
+ ],
6777
+ accounts: [
6778
+ {
6779
+ name: "user"
6780
+ },
6781
+ {
6782
+ name: "global_volume_accumulator",
6783
+ pda: {
6784
+ seeds: [
6785
+ {
6786
+ kind: "const",
6787
+ value: [
6788
+ 103,
6789
+ 108,
6790
+ 111,
6791
+ 98,
6792
+ 97,
6793
+ 108,
6794
+ 95,
6795
+ 118,
6796
+ 111,
6797
+ 108,
6798
+ 117,
6799
+ 109,
6800
+ 101,
6801
+ 95,
6802
+ 97,
6803
+ 99,
6804
+ 99,
6805
+ 117,
6806
+ 109,
6807
+ 117,
6808
+ 108,
6809
+ 97,
6810
+ 116,
6811
+ 111,
6812
+ 114
6813
+ ]
6814
+ }
6815
+ ]
6816
+ }
6817
+ },
6818
+ {
6819
+ name: "user_volume_accumulator",
6820
+ writable: true,
6821
+ pda: {
6822
+ seeds: [
6823
+ {
6824
+ kind: "const",
6825
+ value: [
6826
+ 117,
6827
+ 115,
6828
+ 101,
6829
+ 114,
6830
+ 95,
6831
+ 118,
6832
+ 111,
6833
+ 108,
6834
+ 117,
6835
+ 109,
6836
+ 101,
6837
+ 95,
6838
+ 97,
6839
+ 99,
6840
+ 99,
6841
+ 117,
6842
+ 109,
6843
+ 117,
6844
+ 108,
6845
+ 97,
6846
+ 116,
6847
+ 111,
6848
+ 114
6849
+ ]
6850
+ },
6851
+ {
6852
+ kind: "account",
6853
+ path: "user"
6854
+ }
6855
+ ]
6856
+ }
6857
+ },
6858
+ {
6859
+ name: "event_authority",
6860
+ pda: {
6861
+ seeds: [
6862
+ {
6863
+ kind: "const",
6864
+ value: [
6865
+ 95,
6866
+ 95,
6867
+ 101,
6868
+ 118,
6869
+ 101,
6870
+ 110,
6871
+ 116,
6872
+ 95,
6873
+ 97,
6874
+ 117,
6875
+ 116,
6876
+ 104,
6877
+ 111,
6878
+ 114,
6879
+ 105,
6880
+ 116,
6881
+ 121
6882
+ ]
6883
+ }
6884
+ ]
6885
+ }
6886
+ },
6887
+ {
6888
+ name: "program"
6889
+ }
6890
+ ],
6891
+ args: [
6892
+ ]
6893
+ },
6600
6894
  {
6601
6895
  name: "update_global_authority",
6602
6896
  discriminator: [
@@ -6874,6 +7168,19 @@ var events = [
6874
7168
  131
6875
7169
  ]
6876
7170
  },
7171
+ {
7172
+ name: "SyncUserVolumeAccumulatorEvent",
7173
+ discriminator: [
7174
+ 197,
7175
+ 122,
7176
+ 167,
7177
+ 124,
7178
+ 116,
7179
+ 81,
7180
+ 91,
7181
+ 255
7182
+ ]
7183
+ },
6877
7184
  {
6878
7185
  name: "TradeEvent",
6879
7186
  discriminator: [
@@ -7617,6 +7924,26 @@ var types = [
7617
7924
  ]
7618
7925
  }
7619
7926
  },
7927
+ {
7928
+ name: "SyncUserVolumeAccumulatorEvent",
7929
+ type: {
7930
+ kind: "struct",
7931
+ fields: [
7932
+ {
7933
+ name: "user",
7934
+ type: "pubkey"
7935
+ },
7936
+ {
7937
+ name: "total_claimed_tokens_before",
7938
+ type: "u64"
7939
+ },
7940
+ {
7941
+ name: "total_claimed_tokens_after",
7942
+ type: "u64"
7943
+ }
7944
+ ]
7945
+ }
7946
+ },
7620
7947
  {
7621
7948
  name: "TradeEvent",
7622
7949
  type: {
@@ -7741,6 +8068,10 @@ var types = [
7741
8068
  {
7742
8069
  name: "last_update_timestamp",
7743
8070
  type: "i64"
8071
+ },
8072
+ {
8073
+ name: "has_total_claimed_tokens",
8074
+ type: "bool"
7744
8075
  }
7745
8076
  ]
7746
8077
  }
@@ -7902,10 +8233,16 @@ declare class PumpSdk {
7902
8233
  collectCoinCreatorFeeInstructions(coinCreator: PublicKey): Promise<TransactionInstruction[]>;
7903
8234
  adminSetCoinCreatorInstructions(newCoinCreator: PublicKey, mint: PublicKey): Promise<TransactionInstruction[]>;
7904
8235
  getCreatorVaultBalance(creator: PublicKey): Promise<BN>;
7905
- adminUpdateTokenIncentives(startTime: BN, endTime: BN, dayNumber: BN, tokenSupplyPerDay: BN, secondsInADay?: BN, mint?: PublicKey, tokenProgram?: PublicKey): Promise<TransactionInstruction[]>;
7906
- claimTokenIncentives(user: PublicKey, payer: PublicKey, mint?: PublicKey, tokenProgram?: PublicKey): Promise<TransactionInstruction[]>;
8236
+ adminUpdateTokenIncentives(startTime: BN, endTime: BN, dayNumber: BN, tokenSupplyPerDay: BN, secondsInADay?: BN, mint?: PublicKey, tokenProgram?: PublicKey): Promise<TransactionInstruction>;
8237
+ adminUpdateTokenIncentivesBothPrograms(startTime: BN, endTime: BN, dayNumber: BN, tokenSupplyPerDay: BN, secondsInADay?: BN, mint?: PublicKey, tokenProgram?: PublicKey): Promise<TransactionInstruction[]>;
8238
+ claimTokenIncentives(user: PublicKey, payer: PublicKey, mint?: PublicKey, tokenProgram?: PublicKey): Promise<TransactionInstruction>;
8239
+ claimTokenIncentivesBothPrograms(user: PublicKey, payer: PublicKey, mint?: PublicKey, tokenProgram?: PublicKey): Promise<TransactionInstruction[]>;
7907
8240
  getTotalUnclaimedTokens(user: PublicKey): Promise<BN>;
8241
+ getTotalUnclaimedTokensBothPrograms(user: PublicKey): Promise<BN>;
7908
8242
  getCurrentDayTokens(user: PublicKey): Promise<BN>;
8243
+ getCurrentDayTokensBothPrograms(user: PublicKey): Promise<BN>;
8244
+ syncUserVolumeAccumulator(user: PublicKey): Promise<TransactionInstruction>;
8245
+ syncUserVolumeAccumulatorBothPrograms(user: PublicKey): Promise<TransactionInstruction[]>;
7909
8246
  }
7910
8247
 
7911
8248
  declare function totalUnclaimedTokens(globalVolumeAccumulator: GlobalVolumeAccumulator, userVolumeAccumulator: UserVolumeAccumulator, currentTimestamp?: number): BN;