@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/index.d.ts 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;
package/dist/index.js CHANGED
@@ -2771,6 +2771,134 @@ var pump_default = {
2771
2771
  }
2772
2772
  ]
2773
2773
  },
2774
+ {
2775
+ name: "sync_user_volume_accumulator",
2776
+ discriminator: [
2777
+ 86,
2778
+ 31,
2779
+ 192,
2780
+ 87,
2781
+ 163,
2782
+ 87,
2783
+ 79,
2784
+ 238
2785
+ ],
2786
+ accounts: [
2787
+ {
2788
+ name: "user"
2789
+ },
2790
+ {
2791
+ name: "global_volume_accumulator",
2792
+ pda: {
2793
+ seeds: [
2794
+ {
2795
+ kind: "const",
2796
+ value: [
2797
+ 103,
2798
+ 108,
2799
+ 111,
2800
+ 98,
2801
+ 97,
2802
+ 108,
2803
+ 95,
2804
+ 118,
2805
+ 111,
2806
+ 108,
2807
+ 117,
2808
+ 109,
2809
+ 101,
2810
+ 95,
2811
+ 97,
2812
+ 99,
2813
+ 99,
2814
+ 117,
2815
+ 109,
2816
+ 117,
2817
+ 108,
2818
+ 97,
2819
+ 116,
2820
+ 111,
2821
+ 114
2822
+ ]
2823
+ }
2824
+ ]
2825
+ }
2826
+ },
2827
+ {
2828
+ name: "user_volume_accumulator",
2829
+ writable: true,
2830
+ pda: {
2831
+ seeds: [
2832
+ {
2833
+ kind: "const",
2834
+ value: [
2835
+ 117,
2836
+ 115,
2837
+ 101,
2838
+ 114,
2839
+ 95,
2840
+ 118,
2841
+ 111,
2842
+ 108,
2843
+ 117,
2844
+ 109,
2845
+ 101,
2846
+ 95,
2847
+ 97,
2848
+ 99,
2849
+ 99,
2850
+ 117,
2851
+ 109,
2852
+ 117,
2853
+ 108,
2854
+ 97,
2855
+ 116,
2856
+ 111,
2857
+ 114
2858
+ ]
2859
+ },
2860
+ {
2861
+ kind: "account",
2862
+ path: "user"
2863
+ }
2864
+ ]
2865
+ }
2866
+ },
2867
+ {
2868
+ name: "event_authority",
2869
+ pda: {
2870
+ seeds: [
2871
+ {
2872
+ kind: "const",
2873
+ value: [
2874
+ 95,
2875
+ 95,
2876
+ 101,
2877
+ 118,
2878
+ 101,
2879
+ 110,
2880
+ 116,
2881
+ 95,
2882
+ 97,
2883
+ 117,
2884
+ 116,
2885
+ 104,
2886
+ 111,
2887
+ 114,
2888
+ 105,
2889
+ 116,
2890
+ 121
2891
+ ]
2892
+ }
2893
+ ]
2894
+ }
2895
+ },
2896
+ {
2897
+ name: "program"
2898
+ }
2899
+ ],
2900
+ args: []
2901
+ },
2774
2902
  {
2775
2903
  name: "update_global_authority",
2776
2904
  discriminator: [
@@ -3047,6 +3175,19 @@ var pump_default = {
3047
3175
  131
3048
3176
  ]
3049
3177
  },
3178
+ {
3179
+ name: "SyncUserVolumeAccumulatorEvent",
3180
+ discriminator: [
3181
+ 197,
3182
+ 122,
3183
+ 167,
3184
+ 124,
3185
+ 116,
3186
+ 81,
3187
+ 91,
3188
+ 255
3189
+ ]
3190
+ },
3050
3191
  {
3051
3192
  name: "TradeEvent",
3052
3193
  discriminator: [
@@ -3790,6 +3931,26 @@ var pump_default = {
3790
3931
  ]
3791
3932
  }
3792
3933
  },
3934
+ {
3935
+ name: "SyncUserVolumeAccumulatorEvent",
3936
+ type: {
3937
+ kind: "struct",
3938
+ fields: [
3939
+ {
3940
+ name: "user",
3941
+ type: "pubkey"
3942
+ },
3943
+ {
3944
+ name: "total_claimed_tokens_before",
3945
+ type: "u64"
3946
+ },
3947
+ {
3948
+ name: "total_claimed_tokens_after",
3949
+ type: "u64"
3950
+ }
3951
+ ]
3952
+ }
3953
+ },
3793
3954
  {
3794
3955
  name: "TradeEvent",
3795
3956
  type: {
@@ -3914,6 +4075,10 @@ var pump_default = {
3914
4075
  {
3915
4076
  name: "last_update_timestamp",
3916
4077
  type: "i64"
4078
+ },
4079
+ {
4080
+ name: "has_total_claimed_tokens",
4081
+ type: "bool"
3917
4082
  }
3918
4083
  ]
3919
4084
  }
@@ -4537,6 +4702,15 @@ var PumpSdk = class {
4537
4702
  await this.pumpAmmSdk.getCurrentDayTokens(user)
4538
4703
  );
4539
4704
  }
4705
+ async syncUserVolumeAccumulator(user) {
4706
+ return await this.offlinePumpProgram.methods.syncUserVolumeAccumulator().accountsPartial({ user }).instruction();
4707
+ }
4708
+ async syncUserVolumeAccumulatorBothPrograms(user) {
4709
+ return [
4710
+ await this.syncUserVolumeAccumulator(user),
4711
+ await this.pumpAmmSdk.syncUserVolumeAccumulator(user)
4712
+ ];
4713
+ }
4540
4714
  };
4541
4715
  function getFeeRecipient(global) {
4542
4716
  const feeRecipients = [global.feeRecipient, ...global.feeRecipients];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pump-fun/pump-sdk",
3
- "version": "1.8.1",
3
+ "version": "1.9.0",
4
4
  "description": "Pump Bonding Curve SDK",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/pump-fun/pump-sdk#readme",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@coral-xyz/anchor": "^0.31.1",
42
- "@pump-fun/pump-swap-sdk": "^0.0.1-beta.86",
42
+ "@pump-fun/pump-swap-sdk": "^0.0.1-beta.87",
43
43
  "@solana/spl-token": "^0.4.13",
44
44
  "@solana/web3.js": "^1.98.2",
45
45
  "bn.js": "^5.2.2",