@pump-fun/pump-sdk 1.8.1 → 1.9.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.
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
  }
@@ -4490,6 +4655,15 @@ var PumpSdk = class {
4490
4655
  await this.pumpAmmSdk.getCurrentDayTokens(user)
4491
4656
  );
4492
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
+ }
4493
4667
  };
4494
4668
  function getFeeRecipient(global) {
4495
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
  }
@@ -7910,6 +8241,8 @@ declare class PumpSdk {
7910
8241
  getTotalUnclaimedTokensBothPrograms(user: PublicKey): Promise<BN>;
7911
8242
  getCurrentDayTokens(user: PublicKey): Promise<BN>;
7912
8243
  getCurrentDayTokensBothPrograms(user: PublicKey): Promise<BN>;
8244
+ syncUserVolumeAccumulator(user: PublicKey): Promise<TransactionInstruction>;
8245
+ syncUserVolumeAccumulatorBothPrograms(user: PublicKey): Promise<TransactionInstruction[]>;
7913
8246
  }
7914
8247
 
7915
8248
  declare function totalUnclaimedTokens(globalVolumeAccumulator: GlobalVolumeAccumulator, userVolumeAccumulator: UserVolumeAccumulator, currentTimestamp?: number): BN;