@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/src/idl/pump.json CHANGED
@@ -2715,6 +2715,134 @@
2715
2715
  }
2716
2716
  ]
2717
2717
  },
2718
+ {
2719
+ "name": "sync_user_volume_accumulator",
2720
+ "discriminator": [
2721
+ 86,
2722
+ 31,
2723
+ 192,
2724
+ 87,
2725
+ 163,
2726
+ 87,
2727
+ 79,
2728
+ 238
2729
+ ],
2730
+ "accounts": [
2731
+ {
2732
+ "name": "user"
2733
+ },
2734
+ {
2735
+ "name": "global_volume_accumulator",
2736
+ "pda": {
2737
+ "seeds": [
2738
+ {
2739
+ "kind": "const",
2740
+ "value": [
2741
+ 103,
2742
+ 108,
2743
+ 111,
2744
+ 98,
2745
+ 97,
2746
+ 108,
2747
+ 95,
2748
+ 118,
2749
+ 111,
2750
+ 108,
2751
+ 117,
2752
+ 109,
2753
+ 101,
2754
+ 95,
2755
+ 97,
2756
+ 99,
2757
+ 99,
2758
+ 117,
2759
+ 109,
2760
+ 117,
2761
+ 108,
2762
+ 97,
2763
+ 116,
2764
+ 111,
2765
+ 114
2766
+ ]
2767
+ }
2768
+ ]
2769
+ }
2770
+ },
2771
+ {
2772
+ "name": "user_volume_accumulator",
2773
+ "writable": true,
2774
+ "pda": {
2775
+ "seeds": [
2776
+ {
2777
+ "kind": "const",
2778
+ "value": [
2779
+ 117,
2780
+ 115,
2781
+ 101,
2782
+ 114,
2783
+ 95,
2784
+ 118,
2785
+ 111,
2786
+ 108,
2787
+ 117,
2788
+ 109,
2789
+ 101,
2790
+ 95,
2791
+ 97,
2792
+ 99,
2793
+ 99,
2794
+ 117,
2795
+ 109,
2796
+ 117,
2797
+ 108,
2798
+ 97,
2799
+ 116,
2800
+ 111,
2801
+ 114
2802
+ ]
2803
+ },
2804
+ {
2805
+ "kind": "account",
2806
+ "path": "user"
2807
+ }
2808
+ ]
2809
+ }
2810
+ },
2811
+ {
2812
+ "name": "event_authority",
2813
+ "pda": {
2814
+ "seeds": [
2815
+ {
2816
+ "kind": "const",
2817
+ "value": [
2818
+ 95,
2819
+ 95,
2820
+ 101,
2821
+ 118,
2822
+ 101,
2823
+ 110,
2824
+ 116,
2825
+ 95,
2826
+ 97,
2827
+ 117,
2828
+ 116,
2829
+ 104,
2830
+ 111,
2831
+ 114,
2832
+ 105,
2833
+ 116,
2834
+ 121
2835
+ ]
2836
+ }
2837
+ ]
2838
+ }
2839
+ },
2840
+ {
2841
+ "name": "program"
2842
+ }
2843
+ ],
2844
+ "args": []
2845
+ },
2718
2846
  {
2719
2847
  "name": "update_global_authority",
2720
2848
  "discriminator": [
@@ -2991,6 +3119,19 @@
2991
3119
  131
2992
3120
  ]
2993
3121
  },
3122
+ {
3123
+ "name": "SyncUserVolumeAccumulatorEvent",
3124
+ "discriminator": [
3125
+ 197,
3126
+ 122,
3127
+ 167,
3128
+ 124,
3129
+ 116,
3130
+ 81,
3131
+ 91,
3132
+ 255
3133
+ ]
3134
+ },
2994
3135
  {
2995
3136
  "name": "TradeEvent",
2996
3137
  "discriminator": [
@@ -3734,6 +3875,26 @@
3734
3875
  ]
3735
3876
  }
3736
3877
  },
3878
+ {
3879
+ "name": "SyncUserVolumeAccumulatorEvent",
3880
+ "type": {
3881
+ "kind": "struct",
3882
+ "fields": [
3883
+ {
3884
+ "name": "user",
3885
+ "type": "pubkey"
3886
+ },
3887
+ {
3888
+ "name": "total_claimed_tokens_before",
3889
+ "type": "u64"
3890
+ },
3891
+ {
3892
+ "name": "total_claimed_tokens_after",
3893
+ "type": "u64"
3894
+ }
3895
+ ]
3896
+ }
3897
+ },
3737
3898
  {
3738
3899
  "name": "TradeEvent",
3739
3900
  "type": {
@@ -3858,6 +4019,10 @@
3858
4019
  {
3859
4020
  "name": "last_update_timestamp",
3860
4021
  "type": "i64"
4022
+ },
4023
+ {
4024
+ "name": "has_total_claimed_tokens",
4025
+ "type": "bool"
3861
4026
  }
3862
4027
  ]
3863
4028
  }
package/src/idl/pump.ts CHANGED
@@ -2721,6 +2721,134 @@ export type Pump = {
2721
2721
  }
2722
2722
  ]
2723
2723
  },
2724
+ {
2725
+ "name": "syncUserVolumeAccumulator",
2726
+ "discriminator": [
2727
+ 86,
2728
+ 31,
2729
+ 192,
2730
+ 87,
2731
+ 163,
2732
+ 87,
2733
+ 79,
2734
+ 238
2735
+ ],
2736
+ "accounts": [
2737
+ {
2738
+ "name": "user"
2739
+ },
2740
+ {
2741
+ "name": "globalVolumeAccumulator",
2742
+ "pda": {
2743
+ "seeds": [
2744
+ {
2745
+ "kind": "const",
2746
+ "value": [
2747
+ 103,
2748
+ 108,
2749
+ 111,
2750
+ 98,
2751
+ 97,
2752
+ 108,
2753
+ 95,
2754
+ 118,
2755
+ 111,
2756
+ 108,
2757
+ 117,
2758
+ 109,
2759
+ 101,
2760
+ 95,
2761
+ 97,
2762
+ 99,
2763
+ 99,
2764
+ 117,
2765
+ 109,
2766
+ 117,
2767
+ 108,
2768
+ 97,
2769
+ 116,
2770
+ 111,
2771
+ 114
2772
+ ]
2773
+ }
2774
+ ]
2775
+ }
2776
+ },
2777
+ {
2778
+ "name": "userVolumeAccumulator",
2779
+ "writable": true,
2780
+ "pda": {
2781
+ "seeds": [
2782
+ {
2783
+ "kind": "const",
2784
+ "value": [
2785
+ 117,
2786
+ 115,
2787
+ 101,
2788
+ 114,
2789
+ 95,
2790
+ 118,
2791
+ 111,
2792
+ 108,
2793
+ 117,
2794
+ 109,
2795
+ 101,
2796
+ 95,
2797
+ 97,
2798
+ 99,
2799
+ 99,
2800
+ 117,
2801
+ 109,
2802
+ 117,
2803
+ 108,
2804
+ 97,
2805
+ 116,
2806
+ 111,
2807
+ 114
2808
+ ]
2809
+ },
2810
+ {
2811
+ "kind": "account",
2812
+ "path": "user"
2813
+ }
2814
+ ]
2815
+ }
2816
+ },
2817
+ {
2818
+ "name": "eventAuthority",
2819
+ "pda": {
2820
+ "seeds": [
2821
+ {
2822
+ "kind": "const",
2823
+ "value": [
2824
+ 95,
2825
+ 95,
2826
+ 101,
2827
+ 118,
2828
+ 101,
2829
+ 110,
2830
+ 116,
2831
+ 95,
2832
+ 97,
2833
+ 117,
2834
+ 116,
2835
+ 104,
2836
+ 111,
2837
+ 114,
2838
+ 105,
2839
+ 116,
2840
+ 121
2841
+ ]
2842
+ }
2843
+ ]
2844
+ }
2845
+ },
2846
+ {
2847
+ "name": "program"
2848
+ }
2849
+ ],
2850
+ "args": []
2851
+ },
2724
2852
  {
2725
2853
  "name": "updateGlobalAuthority",
2726
2854
  "discriminator": [
@@ -2997,6 +3125,19 @@ export type Pump = {
2997
3125
  131
2998
3126
  ]
2999
3127
  },
3128
+ {
3129
+ "name": "syncUserVolumeAccumulatorEvent",
3130
+ "discriminator": [
3131
+ 197,
3132
+ 122,
3133
+ 167,
3134
+ 124,
3135
+ 116,
3136
+ 81,
3137
+ 91,
3138
+ 255
3139
+ ]
3140
+ },
3000
3141
  {
3001
3142
  "name": "tradeEvent",
3002
3143
  "discriminator": [
@@ -3740,6 +3881,26 @@ export type Pump = {
3740
3881
  ]
3741
3882
  }
3742
3883
  },
3884
+ {
3885
+ "name": "syncUserVolumeAccumulatorEvent",
3886
+ "type": {
3887
+ "kind": "struct",
3888
+ "fields": [
3889
+ {
3890
+ "name": "user",
3891
+ "type": "pubkey"
3892
+ },
3893
+ {
3894
+ "name": "totalClaimedTokensBefore",
3895
+ "type": "u64"
3896
+ },
3897
+ {
3898
+ "name": "totalClaimedTokensAfter",
3899
+ "type": "u64"
3900
+ }
3901
+ ]
3902
+ }
3903
+ },
3743
3904
  {
3744
3905
  "name": "tradeEvent",
3745
3906
  "type": {
@@ -3864,6 +4025,10 @@ export type Pump = {
3864
4025
  {
3865
4026
  "name": "lastUpdateTimestamp",
3866
4027
  "type": "i64"
4028
+ },
4029
+ {
4030
+ "name": "hasTotalClaimedTokens",
4031
+ "type": "bool"
3867
4032
  }
3868
4033
  ]
3869
4034
  }
package/src/sdk.ts CHANGED
@@ -716,6 +716,24 @@ export class PumpSdk {
716
716
  await this.pumpAmmSdk.getCurrentDayTokens(user),
717
717
  );
718
718
  }
719
+
720
+ async syncUserVolumeAccumulator(
721
+ user: PublicKey
722
+ ): Promise<TransactionInstruction> {
723
+ return await this.offlinePumpProgram.methods
724
+ .syncUserVolumeAccumulator()
725
+ .accountsPartial({ user })
726
+ .instruction();
727
+ }
728
+
729
+ async syncUserVolumeAccumulatorBothPrograms(
730
+ user: PublicKey,
731
+ ): Promise<TransactionInstruction[]> {
732
+ return [
733
+ await this.syncUserVolumeAccumulator(user),
734
+ await this.pumpAmmSdk.syncUserVolumeAccumulator(user),
735
+ ];
736
+ }
719
737
  }
720
738
 
721
739
  function getFeeRecipient(global: Global): PublicKey {