@pump-fun/pump-sdk 1.27.0 → 1.28.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.js CHANGED
@@ -1821,7 +1821,7 @@ __export(index_exports, {
1821
1821
  MAYHEM_PROGRAM_ID: () => MAYHEM_PROGRAM_ID,
1822
1822
  NoShareholdersError: () => NoShareholdersError,
1823
1823
  OnlinePumpSdk: () => OnlinePumpSdk,
1824
- PUMP_AMM_EVENT_AUTHORITY_PDA: () => PUMP_AMM_EVENT_AUTHORITY_PDA2,
1824
+ PUMP_AMM_EVENT_AUTHORITY_PDA: () => PUMP_AMM_EVENT_AUTHORITY_PDA,
1825
1825
  PUMP_AMM_PROGRAM_ID: () => PUMP_AMM_PROGRAM_ID,
1826
1826
  PUMP_EVENT_AUTHORITY_PDA: () => PUMP_EVENT_AUTHORITY_PDA,
1827
1827
  PUMP_FEE_CONFIG_PDA: () => PUMP_FEE_CONFIG_PDA,
@@ -1834,7 +1834,7 @@ __export(index_exports, {
1834
1834
  ShareCalculationOverflowError: () => ShareCalculationOverflowError,
1835
1835
  TooManyShareholdersError: () => TooManyShareholdersError,
1836
1836
  ZeroShareError: () => ZeroShareError,
1837
- ammCreatorVaultPda: () => ammCreatorVaultPda2,
1837
+ ammCreatorVaultPda: () => ammCreatorVaultPda,
1838
1838
  bondingCurveMarketCap: () => bondingCurveMarketCap,
1839
1839
  bondingCurvePda: () => bondingCurvePda,
1840
1840
  canonicalPumpPoolPda: () => canonicalPumpPoolPda,
@@ -3049,6 +3049,103 @@ var pump_default = {
3049
3049
  }
3050
3050
  ]
3051
3051
  },
3052
+ {
3053
+ name: "claim_cashback",
3054
+ discriminator: [
3055
+ 37,
3056
+ 58,
3057
+ 35,
3058
+ 126,
3059
+ 190,
3060
+ 53,
3061
+ 228,
3062
+ 197
3063
+ ],
3064
+ accounts: [
3065
+ {
3066
+ name: "user",
3067
+ writable: true
3068
+ },
3069
+ {
3070
+ name: "user_volume_accumulator",
3071
+ writable: true,
3072
+ pda: {
3073
+ seeds: [
3074
+ {
3075
+ kind: "const",
3076
+ value: [
3077
+ 117,
3078
+ 115,
3079
+ 101,
3080
+ 114,
3081
+ 95,
3082
+ 118,
3083
+ 111,
3084
+ 108,
3085
+ 117,
3086
+ 109,
3087
+ 101,
3088
+ 95,
3089
+ 97,
3090
+ 99,
3091
+ 99,
3092
+ 117,
3093
+ 109,
3094
+ 117,
3095
+ 108,
3096
+ 97,
3097
+ 116,
3098
+ 111,
3099
+ 114
3100
+ ]
3101
+ },
3102
+ {
3103
+ kind: "account",
3104
+ path: "user"
3105
+ }
3106
+ ]
3107
+ }
3108
+ },
3109
+ {
3110
+ name: "system_program",
3111
+ address: "11111111111111111111111111111111"
3112
+ },
3113
+ {
3114
+ name: "event_authority",
3115
+ pda: {
3116
+ seeds: [
3117
+ {
3118
+ kind: "const",
3119
+ value: [
3120
+ 95,
3121
+ 95,
3122
+ 101,
3123
+ 118,
3124
+ 101,
3125
+ 110,
3126
+ 116,
3127
+ 95,
3128
+ 97,
3129
+ 117,
3130
+ 116,
3131
+ 104,
3132
+ 111,
3133
+ 114,
3134
+ 105,
3135
+ 116,
3136
+ 121
3137
+ ]
3138
+ }
3139
+ ]
3140
+ }
3141
+ },
3142
+ {
3143
+ name: "program",
3144
+ address: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
3145
+ }
3146
+ ],
3147
+ args: []
3148
+ },
3052
3149
  {
3053
3150
  name: "claim_token_incentives",
3054
3151
  discriminator: [
@@ -4242,6 +4339,14 @@ var pump_default = {
4242
4339
  {
4243
4340
  name: "is_mayhem_mode",
4244
4341
  type: "bool"
4342
+ },
4343
+ {
4344
+ name: "is_cashback_enabled",
4345
+ type: {
4346
+ defined: {
4347
+ name: "OptionBool"
4348
+ }
4349
+ }
4245
4350
  }
4246
4351
  ]
4247
4352
  },
@@ -5442,7 +5547,10 @@ var pump_default = {
5442
5547
  {
5443
5548
  name: "sell",
5444
5549
  docs: [
5445
- "Sells tokens into a bonding curve."
5550
+ "Sells tokens into a bonding curve.",
5551
+ "For cashback coins, optionally pass user_volume_accumulator as remaining_accounts[0].",
5552
+ "If provided and valid, creator_fee goes to user_volume_accumulator.",
5553
+ "Otherwise, falls back to transferring creator_fee to creator_vault."
5446
5554
  ],
5447
5555
  discriminator: [
5448
5556
  51,
@@ -6670,6 +6778,86 @@ var pump_default = {
6670
6778
  ],
6671
6779
  args: []
6672
6780
  },
6781
+ {
6782
+ name: "toggle_cashback_enabled",
6783
+ discriminator: [
6784
+ 115,
6785
+ 103,
6786
+ 224,
6787
+ 255,
6788
+ 189,
6789
+ 89,
6790
+ 86,
6791
+ 195
6792
+ ],
6793
+ accounts: [
6794
+ {
6795
+ name: "global",
6796
+ writable: true,
6797
+ pda: {
6798
+ seeds: [
6799
+ {
6800
+ kind: "const",
6801
+ value: [
6802
+ 103,
6803
+ 108,
6804
+ 111,
6805
+ 98,
6806
+ 97,
6807
+ 108
6808
+ ]
6809
+ }
6810
+ ]
6811
+ }
6812
+ },
6813
+ {
6814
+ name: "authority",
6815
+ writable: true,
6816
+ signer: true,
6817
+ relations: [
6818
+ "global"
6819
+ ]
6820
+ },
6821
+ {
6822
+ name: "event_authority",
6823
+ pda: {
6824
+ seeds: [
6825
+ {
6826
+ kind: "const",
6827
+ value: [
6828
+ 95,
6829
+ 95,
6830
+ 101,
6831
+ 118,
6832
+ 101,
6833
+ 110,
6834
+ 116,
6835
+ 95,
6836
+ 97,
6837
+ 117,
6838
+ 116,
6839
+ 104,
6840
+ 111,
6841
+ 114,
6842
+ 105,
6843
+ 116,
6844
+ 121
6845
+ ]
6846
+ }
6847
+ ]
6848
+ }
6849
+ },
6850
+ {
6851
+ name: "program"
6852
+ }
6853
+ ],
6854
+ args: [
6855
+ {
6856
+ name: "enabled",
6857
+ type: "bool"
6858
+ }
6859
+ ]
6860
+ },
6673
6861
  {
6674
6862
  name: "toggle_create_v2",
6675
6863
  discriminator: [
@@ -7028,6 +7216,19 @@ var pump_default = {
7028
7216
  222
7029
7217
  ]
7030
7218
  },
7219
+ {
7220
+ name: "ClaimCashbackEvent",
7221
+ discriminator: [
7222
+ 226,
7223
+ 214,
7224
+ 246,
7225
+ 33,
7226
+ 7,
7227
+ 242,
7228
+ 147,
7229
+ 229
7230
+ ]
7231
+ },
7031
7232
  {
7032
7233
  name: "ClaimTokenIncentivesEvent",
7033
7234
  discriminator: [
@@ -7541,6 +7742,11 @@ var pump_default = {
7541
7742
  code: 6055,
7542
7743
  name: "InvalidShareBps",
7543
7744
  msg: "Share bps must be greater than 0"
7745
+ },
7746
+ {
7747
+ code: 6056,
7748
+ name: "CashbackNotEnabled",
7749
+ msg: "Cashback is not enabled"
7544
7750
  }
7545
7751
  ],
7546
7752
  types: [
@@ -7660,6 +7866,38 @@ var pump_default = {
7660
7866
  {
7661
7867
  name: "is_mayhem_mode",
7662
7868
  type: "bool"
7869
+ },
7870
+ {
7871
+ name: "is_cashback_coin",
7872
+ type: "bool"
7873
+ }
7874
+ ]
7875
+ }
7876
+ },
7877
+ {
7878
+ name: "ClaimCashbackEvent",
7879
+ type: {
7880
+ kind: "struct",
7881
+ fields: [
7882
+ {
7883
+ name: "user",
7884
+ type: "pubkey"
7885
+ },
7886
+ {
7887
+ name: "amount",
7888
+ type: "u64"
7889
+ },
7890
+ {
7891
+ name: "timestamp",
7892
+ type: "i64"
7893
+ },
7894
+ {
7895
+ name: "total_claimed",
7896
+ type: "u64"
7897
+ },
7898
+ {
7899
+ name: "total_cashback_earned",
7900
+ type: "u64"
7663
7901
  }
7664
7902
  ]
7665
7903
  }
@@ -7886,6 +8124,10 @@ var pump_default = {
7886
8124
  {
7887
8125
  name: "is_mayhem_mode",
7888
8126
  type: "bool"
8127
+ },
8128
+ {
8129
+ name: "is_cashback_enabled",
8130
+ type: "bool"
7889
8131
  }
7890
8132
  ]
7891
8133
  }
@@ -8134,6 +8376,10 @@ var pump_default = {
8134
8376
  7
8135
8377
  ]
8136
8378
  }
8379
+ },
8380
+ {
8381
+ name: "is_cashback_enabled",
8382
+ type: "bool"
8137
8383
  }
8138
8384
  ]
8139
8385
  }
@@ -8592,6 +8838,14 @@ var pump_default = {
8592
8838
  {
8593
8839
  name: "mayhem_mode",
8594
8840
  type: "bool"
8841
+ },
8842
+ {
8843
+ name: "cashback_fee_basis_points",
8844
+ type: "u64"
8845
+ },
8846
+ {
8847
+ name: "cashback",
8848
+ type: "u64"
8595
8849
  }
8596
8850
  ]
8597
8851
  }
@@ -8692,6 +8946,14 @@ var pump_default = {
8692
8946
  {
8693
8947
  name: "has_total_claimed_tokens",
8694
8948
  type: "bool"
8949
+ },
8950
+ {
8951
+ name: "cashback_earned",
8952
+ type: "u64"
8953
+ },
8954
+ {
8955
+ name: "total_cashback_claimed",
8956
+ type: "u64"
8695
8957
  }
8696
8958
  ]
8697
8959
  }
@@ -8700,12 +8962,12 @@ var pump_default = {
8700
8962
  };
8701
8963
 
8702
8964
  // src/bondingCurve.ts
8703
- var import_bn2 = __toESM(require("bn.js"));
8704
8965
  var import_web32 = require("@solana/web3.js");
8966
+ var import_bn2 = __toESM(require("bn.js"));
8705
8967
 
8706
8968
  // src/fees.ts
8707
- var import_bn = __toESM(require("bn.js"));
8708
8969
  var import_web3 = require("@solana/web3.js");
8970
+ var import_bn = __toESM(require("bn.js"));
8709
8971
  var ONE_BILLION_SUPPLY = new import_bn.default(1e15);
8710
8972
  function getFee({
8711
8973
  global,
@@ -8773,12 +9035,14 @@ function ceilDiv(a, b) {
8773
9035
  }
8774
9036
  function getFeeRecipient(global, mayhemMode) {
8775
9037
  if (mayhemMode) {
8776
- const feeRecipients = [global.reservedFeeRecipient, ...global.reservedFeeRecipients];
8777
- return feeRecipients[Math.floor(Math.random() * feeRecipients.length)];
8778
- } else {
8779
- const feeRecipients = [global.feeRecipient, ...global.feeRecipients];
8780
- return feeRecipients[Math.floor(Math.random() * feeRecipients.length)];
9038
+ const feeRecipients2 = [
9039
+ global.reservedFeeRecipient,
9040
+ ...global.reservedFeeRecipients
9041
+ ];
9042
+ return feeRecipients2[Math.floor(Math.random() * feeRecipients2.length)];
8781
9043
  }
9044
+ const feeRecipients = [global.feeRecipient, ...global.feeRecipients];
9045
+ return feeRecipients[Math.floor(Math.random() * feeRecipients.length)];
8782
9046
  }
8783
9047
 
8784
9048
  // src/bondingCurve.ts
@@ -8944,12 +9208,14 @@ function bondingCurveMarketCap({
8944
9208
  }
8945
9209
 
8946
9210
  // src/pda.ts
8947
- var import_web35 = require("@solana/web3.js");
8948
- var import_spl_token3 = require("@solana/spl-token");
8949
9211
  var import_pump_swap_sdk3 = require("@pump-fun/pump-swap-sdk");
9212
+ var import_spl_token3 = require("@solana/spl-token");
9213
+ var import_web35 = require("@solana/web3.js");
9214
+ var import_buffer = __toESM(require_buffer());
8950
9215
 
8951
9216
  // src/sdk.ts
8952
9217
  var import_anchor = require("@coral-xyz/anchor");
9218
+ var import_pump_swap_sdk2 = require("@pump-fun/pump-swap-sdk");
8953
9219
  var import_spl_token2 = require("@solana/spl-token");
8954
9220
  var import_web34 = require("@solana/web3.js");
8955
9221
  var import_bn5 = __toESM(require("bn.js"));
@@ -8984,7 +9250,9 @@ var ShareCalculationOverflowError = class extends Error {
8984
9250
  };
8985
9251
  var InvalidShareTotalError = class extends Error {
8986
9252
  constructor(total) {
8987
- super(`Invalid share total. Must equal 10,000 basis points (100%). Got ${total}`);
9253
+ super(
9254
+ `Invalid share total. Must equal 10,000 basis points (100%). Got ${total}`
9255
+ );
8988
9256
  this.total = total;
8989
9257
  this.name = "InvalidShareTotalError";
8990
9258
  }
@@ -8997,475 +9265,13 @@ var DuplicateShareholderError = class extends Error {
8997
9265
  };
8998
9266
  var PoolRequiredForGraduatedError = class extends Error {
8999
9267
  constructor() {
9000
- super("Pool parameter is required for graduated coins (bondingCurve.complete = true)");
9268
+ super(
9269
+ "Pool parameter is required for graduated coins (bondingCurve.complete = true)"
9270
+ );
9001
9271
  this.name = "PoolRequiredForGraduatedError";
9002
9272
  }
9003
9273
  };
9004
9274
 
9005
- // src/onlineSdk.ts
9006
- var import_pump_swap_sdk = require("@pump-fun/pump-swap-sdk");
9007
- var import_spl_token = require("@solana/spl-token");
9008
- var import_web33 = require("@solana/web3.js");
9009
- var import_bn4 = __toESM(require("bn.js"));
9010
-
9011
- // src/tokenIncentives.ts
9012
- var import_bn3 = __toESM(require("bn.js"));
9013
- function totalUnclaimedTokens(globalVolumeAccumulator, userVolumeAccumulator, currentTimestamp = Date.now() / 1e3) {
9014
- const { startTime, endTime, secondsInADay, totalTokenSupply, solVolumes } = globalVolumeAccumulator;
9015
- const { totalUnclaimedTokens: totalUnclaimedTokens2, currentSolVolume, lastUpdateTimestamp } = userVolumeAccumulator;
9016
- const result = totalUnclaimedTokens2;
9017
- if (startTime.eqn(0) || endTime.eqn(0) || secondsInADay.eqn(0)) {
9018
- return result;
9019
- }
9020
- let currentTimestampBn = new import_bn3.default(currentTimestamp);
9021
- if (currentTimestampBn.lt(startTime)) {
9022
- return result;
9023
- }
9024
- const currentDayIndex = currentTimestampBn.sub(startTime).div(secondsInADay).toNumber();
9025
- if (lastUpdateTimestamp.lt(startTime)) {
9026
- return result;
9027
- }
9028
- const lastUpdatedIndex = lastUpdateTimestamp.sub(startTime).div(secondsInADay).toNumber();
9029
- if (endTime.lt(startTime)) {
9030
- return result;
9031
- }
9032
- const endDayIndex = endTime.sub(startTime).div(secondsInADay).toNumber();
9033
- if (currentDayIndex > lastUpdatedIndex && lastUpdatedIndex <= endDayIndex) {
9034
- const lastUpdatedDayTokenSupply = totalTokenSupply[lastUpdatedIndex];
9035
- const lastUpdatedDaySolVolume = solVolumes[lastUpdatedIndex];
9036
- if (lastUpdatedDaySolVolume.eqn(0)) {
9037
- return result;
9038
- }
9039
- return result.add(
9040
- currentSolVolume.mul(lastUpdatedDayTokenSupply).div(lastUpdatedDaySolVolume)
9041
- );
9042
- }
9043
- return result;
9044
- }
9045
- function currentDayTokens(globalVolumeAccumulator, userVolumeAccumulator, currentTimestamp = Date.now() / 1e3) {
9046
- const { startTime, endTime, secondsInADay, totalTokenSupply, solVolumes } = globalVolumeAccumulator;
9047
- const { currentSolVolume, lastUpdateTimestamp } = userVolumeAccumulator;
9048
- if (startTime.eqn(0) || endTime.eqn(0) || secondsInADay.eqn(0)) {
9049
- return new import_bn3.default(0);
9050
- }
9051
- let currentTimestampBn = new import_bn3.default(currentTimestamp);
9052
- if (currentTimestampBn.lt(startTime) || currentTimestampBn.gt(endTime)) {
9053
- return new import_bn3.default(0);
9054
- }
9055
- const currentDayIndex = currentTimestampBn.sub(startTime).div(secondsInADay).toNumber();
9056
- if (lastUpdateTimestamp.lt(startTime)) {
9057
- return new import_bn3.default(0);
9058
- }
9059
- const lastUpdatedIndex = lastUpdateTimestamp.sub(startTime).div(secondsInADay).toNumber();
9060
- if (endTime.lt(startTime)) {
9061
- return new import_bn3.default(0);
9062
- }
9063
- if (currentDayIndex !== lastUpdatedIndex) {
9064
- return new import_bn3.default(0);
9065
- }
9066
- const currentDayTokenSupply = totalTokenSupply[currentDayIndex];
9067
- const currentDaySolVolume = solVolumes[currentDayIndex];
9068
- if (currentDaySolVolume.eqn(0)) {
9069
- return new import_bn3.default(0);
9070
- }
9071
- return currentSolVolume.mul(currentDayTokenSupply).div(currentDaySolVolume);
9072
- }
9073
-
9074
- // src/onlineSdk.ts
9075
- var OFFLINE_PUMP_PROGRAM = getPumpProgram(null);
9076
- var OnlinePumpSdk = class {
9077
- constructor(connection) {
9078
- this.connection = connection;
9079
- this.pumpProgram = getPumpProgram(connection);
9080
- this.offlinePumpProgram = OFFLINE_PUMP_PROGRAM;
9081
- this.pumpAmmProgram = getPumpAmmProgram(connection);
9082
- this.pumpAmmSdk = new import_pump_swap_sdk.OnlinePumpAmmSdk(connection);
9083
- this.pumpAmmAdminSdk = new import_pump_swap_sdk.PumpAmmAdminSdk(connection);
9084
- }
9085
- async fetchGlobal() {
9086
- return await this.pumpProgram.account.global.fetch(GLOBAL_PDA);
9087
- }
9088
- async fetchFeeConfig() {
9089
- return await this.pumpProgram.account.feeConfig.fetch(PUMP_FEE_CONFIG_PDA);
9090
- }
9091
- async fetchBondingCurve(mint) {
9092
- return await this.pumpProgram.account.bondingCurve.fetch(
9093
- bondingCurvePda(mint)
9094
- );
9095
- }
9096
- async fetchBuyState(mint, user, tokenProgram = import_spl_token.TOKEN_PROGRAM_ID) {
9097
- const [bondingCurveAccountInfo, associatedUserAccountInfo] = await this.connection.getMultipleAccountsInfo([
9098
- bondingCurvePda(mint),
9099
- (0, import_spl_token.getAssociatedTokenAddressSync)(mint, user, true, tokenProgram)
9100
- ]);
9101
- if (!bondingCurveAccountInfo) {
9102
- throw new Error(
9103
- `Bonding curve account not found for mint: ${mint.toBase58()}`
9104
- );
9105
- }
9106
- const bondingCurve = PUMP_SDK.decodeBondingCurve(bondingCurveAccountInfo);
9107
- return { bondingCurveAccountInfo, bondingCurve, associatedUserAccountInfo };
9108
- }
9109
- async fetchSellState(mint, user, tokenProgram = import_spl_token.TOKEN_PROGRAM_ID) {
9110
- const [bondingCurveAccountInfo, associatedUserAccountInfo] = await this.connection.getMultipleAccountsInfo([
9111
- bondingCurvePda(mint),
9112
- (0, import_spl_token.getAssociatedTokenAddressSync)(mint, user, true, tokenProgram)
9113
- ]);
9114
- if (!bondingCurveAccountInfo) {
9115
- throw new Error(
9116
- `Bonding curve account not found for mint: ${mint.toBase58()}`
9117
- );
9118
- }
9119
- if (!associatedUserAccountInfo) {
9120
- throw new Error(
9121
- `Associated token account not found for mint: ${mint.toBase58()} and user: ${user.toBase58()}`
9122
- );
9123
- }
9124
- const bondingCurve = PUMP_SDK.decodeBondingCurve(bondingCurveAccountInfo);
9125
- return { bondingCurveAccountInfo, bondingCurve };
9126
- }
9127
- async fetchGlobalVolumeAccumulator() {
9128
- return await this.pumpProgram.account.globalVolumeAccumulator.fetch(
9129
- GLOBAL_VOLUME_ACCUMULATOR_PDA
9130
- );
9131
- }
9132
- async fetchUserVolumeAccumulator(user) {
9133
- return await this.pumpProgram.account.userVolumeAccumulator.fetchNullable(
9134
- userVolumeAccumulatorPda(user)
9135
- );
9136
- }
9137
- async fetchUserVolumeAccumulatorTotalStats(user) {
9138
- const userVolumeAccumulator = await this.fetchUserVolumeAccumulator(
9139
- user
9140
- ) ?? {
9141
- totalUnclaimedTokens: new import_bn4.default(0),
9142
- totalClaimedTokens: new import_bn4.default(0),
9143
- currentSolVolume: new import_bn4.default(0)
9144
- };
9145
- const userVolumeAccumulatorAmm = await this.pumpAmmSdk.fetchUserVolumeAccumulator(user) ?? {
9146
- totalUnclaimedTokens: new import_bn4.default(0),
9147
- totalClaimedTokens: new import_bn4.default(0),
9148
- currentSolVolume: new import_bn4.default(0)
9149
- };
9150
- return {
9151
- totalUnclaimedTokens: userVolumeAccumulator.totalUnclaimedTokens.add(
9152
- userVolumeAccumulatorAmm.totalUnclaimedTokens
9153
- ),
9154
- totalClaimedTokens: userVolumeAccumulator.totalClaimedTokens.add(
9155
- userVolumeAccumulatorAmm.totalClaimedTokens
9156
- ),
9157
- currentSolVolume: userVolumeAccumulator.currentSolVolume.add(
9158
- userVolumeAccumulatorAmm.currentSolVolume
9159
- )
9160
- };
9161
- }
9162
- async collectCoinCreatorFeeInstructions(coinCreator, feePayer) {
9163
- let quoteMint = import_spl_token.NATIVE_MINT;
9164
- let quoteTokenProgram = import_spl_token.TOKEN_PROGRAM_ID;
9165
- let coinCreatorVaultAuthority = (0, import_pump_swap_sdk.coinCreatorVaultAuthorityPda)(coinCreator);
9166
- let coinCreatorVaultAta = (0, import_pump_swap_sdk.coinCreatorVaultAtaPda)(
9167
- coinCreatorVaultAuthority,
9168
- quoteMint,
9169
- quoteTokenProgram
9170
- );
9171
- let coinCreatorTokenAccount = (0, import_spl_token.getAssociatedTokenAddressSync)(
9172
- quoteMint,
9173
- coinCreator,
9174
- true,
9175
- quoteTokenProgram
9176
- );
9177
- const [coinCreatorVaultAtaAccountInfo, coinCreatorTokenAccountInfo] = await this.connection.getMultipleAccountsInfo([
9178
- coinCreatorVaultAta,
9179
- coinCreatorTokenAccount
9180
- ]);
9181
- return [
9182
- await this.offlinePumpProgram.methods.collectCreatorFee().accountsPartial({
9183
- creator: coinCreator
9184
- }).instruction(),
9185
- ...await import_pump_swap_sdk.PUMP_AMM_SDK.collectCoinCreatorFee({
9186
- coinCreator,
9187
- quoteMint,
9188
- quoteTokenProgram,
9189
- coinCreatorVaultAuthority,
9190
- coinCreatorVaultAta,
9191
- coinCreatorTokenAccount,
9192
- coinCreatorVaultAtaAccountInfo,
9193
- coinCreatorTokenAccountInfo
9194
- }, feePayer)
9195
- ];
9196
- }
9197
- async adminSetCoinCreatorInstructions(newCoinCreator, mint) {
9198
- const global = await this.fetchGlobal();
9199
- return [
9200
- await this.offlinePumpProgram.methods.adminSetCreator(newCoinCreator).accountsPartial({
9201
- adminSetCreatorAuthority: global.adminSetCreatorAuthority,
9202
- mint
9203
- }).instruction(),
9204
- await this.pumpAmmAdminSdk.adminSetCoinCreator(mint, newCoinCreator)
9205
- ];
9206
- }
9207
- async getCreatorVaultBalance(creator) {
9208
- const creatorVault = creatorVaultPda(creator);
9209
- const accountInfo = await this.connection.getAccountInfo(creatorVault);
9210
- if (accountInfo === null) {
9211
- return new import_bn4.default(0);
9212
- }
9213
- const rentExemptionLamports = await this.connection.getMinimumBalanceForRentExemption(
9214
- accountInfo.data.length
9215
- );
9216
- if (accountInfo.lamports < rentExemptionLamports) {
9217
- return new import_bn4.default(0);
9218
- }
9219
- return new import_bn4.default(accountInfo.lamports - rentExemptionLamports);
9220
- }
9221
- async getCreatorVaultBalanceBothPrograms(creator) {
9222
- const balance = await this.getCreatorVaultBalance(creator);
9223
- const ammBalance = await this.pumpAmmSdk.getCoinCreatorVaultBalance(creator);
9224
- return balance.add(ammBalance);
9225
- }
9226
- async adminUpdateTokenIncentives(startTime, endTime, dayNumber, tokenSupplyPerDay, secondsInADay = new import_bn4.default(86400), mint = PUMP_TOKEN_MINT, tokenProgram = import_spl_token.TOKEN_2022_PROGRAM_ID) {
9227
- const { authority } = await this.fetchGlobal();
9228
- return await this.offlinePumpProgram.methods.adminUpdateTokenIncentives(
9229
- startTime,
9230
- endTime,
9231
- secondsInADay,
9232
- dayNumber,
9233
- tokenSupplyPerDay
9234
- ).accountsPartial({
9235
- authority,
9236
- mint,
9237
- tokenProgram
9238
- }).instruction();
9239
- }
9240
- async adminUpdateTokenIncentivesBothPrograms(startTime, endTime, dayNumber, tokenSupplyPerDay, secondsInADay = new import_bn4.default(86400), mint = PUMP_TOKEN_MINT, tokenProgram = import_spl_token.TOKEN_2022_PROGRAM_ID) {
9241
- return [
9242
- await this.adminUpdateTokenIncentives(
9243
- startTime,
9244
- endTime,
9245
- dayNumber,
9246
- tokenSupplyPerDay,
9247
- secondsInADay,
9248
- mint,
9249
- tokenProgram
9250
- ),
9251
- await this.pumpAmmAdminSdk.adminUpdateTokenIncentives(
9252
- startTime,
9253
- endTime,
9254
- dayNumber,
9255
- tokenSupplyPerDay,
9256
- secondsInADay,
9257
- mint,
9258
- tokenProgram
9259
- )
9260
- ];
9261
- }
9262
- async claimTokenIncentives(user, payer) {
9263
- const { mint } = await this.fetchGlobalVolumeAccumulator();
9264
- if (mint.equals(import_web33.PublicKey.default)) {
9265
- return [];
9266
- }
9267
- const [mintAccountInfo, userAccumulatorAccountInfo] = await this.connection.getMultipleAccountsInfo([
9268
- mint,
9269
- userVolumeAccumulatorPda(user)
9270
- ]);
9271
- if (!mintAccountInfo) {
9272
- return [];
9273
- }
9274
- if (!userAccumulatorAccountInfo) {
9275
- return [];
9276
- }
9277
- return [
9278
- await this.offlinePumpProgram.methods.claimTokenIncentives().accountsPartial({
9279
- user,
9280
- payer,
9281
- mint,
9282
- tokenProgram: mintAccountInfo.owner
9283
- }).instruction()
9284
- ];
9285
- }
9286
- async claimTokenIncentivesBothPrograms(user, payer) {
9287
- return [
9288
- ...await this.claimTokenIncentives(user, payer),
9289
- ...await this.pumpAmmSdk.claimTokenIncentives(user, payer)
9290
- ];
9291
- }
9292
- async getTotalUnclaimedTokens(user) {
9293
- const [
9294
- globalVolumeAccumulatorAccountInfo,
9295
- userVolumeAccumulatorAccountInfo
9296
- ] = await this.connection.getMultipleAccountsInfo([
9297
- GLOBAL_VOLUME_ACCUMULATOR_PDA,
9298
- userVolumeAccumulatorPda(user)
9299
- ]);
9300
- if (!globalVolumeAccumulatorAccountInfo || !userVolumeAccumulatorAccountInfo) {
9301
- return new import_bn4.default(0);
9302
- }
9303
- const globalVolumeAccumulator = PUMP_SDK.decodeGlobalVolumeAccumulator(
9304
- globalVolumeAccumulatorAccountInfo
9305
- );
9306
- const userVolumeAccumulator = PUMP_SDK.decodeUserVolumeAccumulator(
9307
- userVolumeAccumulatorAccountInfo
9308
- );
9309
- return totalUnclaimedTokens(globalVolumeAccumulator, userVolumeAccumulator);
9310
- }
9311
- async getTotalUnclaimedTokensBothPrograms(user) {
9312
- return (await this.getTotalUnclaimedTokens(user)).add(
9313
- await this.pumpAmmSdk.getTotalUnclaimedTokens(user)
9314
- );
9315
- }
9316
- async getCurrentDayTokens(user) {
9317
- const [
9318
- globalVolumeAccumulatorAccountInfo,
9319
- userVolumeAccumulatorAccountInfo
9320
- ] = await this.connection.getMultipleAccountsInfo([
9321
- GLOBAL_VOLUME_ACCUMULATOR_PDA,
9322
- userVolumeAccumulatorPda(user)
9323
- ]);
9324
- if (!globalVolumeAccumulatorAccountInfo || !userVolumeAccumulatorAccountInfo) {
9325
- return new import_bn4.default(0);
9326
- }
9327
- const globalVolumeAccumulator = PUMP_SDK.decodeGlobalVolumeAccumulator(
9328
- globalVolumeAccumulatorAccountInfo
9329
- );
9330
- const userVolumeAccumulator = PUMP_SDK.decodeUserVolumeAccumulator(
9331
- userVolumeAccumulatorAccountInfo
9332
- );
9333
- return currentDayTokens(globalVolumeAccumulator, userVolumeAccumulator);
9334
- }
9335
- async getCurrentDayTokensBothPrograms(user) {
9336
- return (await this.getCurrentDayTokens(user)).add(
9337
- await this.pumpAmmSdk.getCurrentDayTokens(user)
9338
- );
9339
- }
9340
- async syncUserVolumeAccumulatorBothPrograms(user) {
9341
- return [
9342
- await PUMP_SDK.syncUserVolumeAccumulator(user),
9343
- await import_pump_swap_sdk.PUMP_AMM_SDK.syncUserVolumeAccumulator(user)
9344
- ];
9345
- }
9346
- /**
9347
- * Gets the minimum distributable fee for a token's fee sharing configuration.
9348
- *
9349
- * This method handles both graduated (AMM) and non-graduated (bonding curve) tokens.
9350
- * For graduated tokens, it automatically consolidates fees from the AMM vault before
9351
- * calculating the minimum distributable fee.
9352
- *
9353
- * @param mint - The mint address of the token
9354
- * @param simulationSigner - Optional signer address for transaction simulation.
9355
- * Must have a non-zero SOL balance. Defaults to a known funded address.
9356
- * @returns The minimum distributable fee information including whether distribution is possible
9357
- */
9358
- async getMinimumDistributableFee(mint, simulationSigner = new import_web33.PublicKey("UqN2p5bAzBqYdHXcgB6WLtuVrdvmy9JSAtgqZb3CMKw")) {
9359
- const sharingConfigPubkey = feeSharingConfigPda(mint);
9360
- const poolAddress = canonicalPumpPoolPda(mint);
9361
- const coinCreatorVaultAuthority = (0, import_pump_swap_sdk.coinCreatorVaultAuthorityPda)(sharingConfigPubkey);
9362
- const ammVaultAta = (0, import_pump_swap_sdk.coinCreatorVaultAtaPda)(
9363
- coinCreatorVaultAuthority,
9364
- import_spl_token.NATIVE_MINT,
9365
- import_spl_token.TOKEN_PROGRAM_ID
9366
- );
9367
- const [sharingConfigAccountInfo, poolAccountInfo, ammVaultAtaInfo] = await this.connection.getMultipleAccountsInfo([
9368
- sharingConfigPubkey,
9369
- poolAddress,
9370
- ammVaultAta
9371
- ]);
9372
- if (!sharingConfigAccountInfo) {
9373
- throw new Error(`Sharing config not found for mint: ${mint.toBase58()}`);
9374
- }
9375
- const sharingConfig = PUMP_SDK.decodeSharingConfig(sharingConfigAccountInfo);
9376
- const instructions = [];
9377
- const isGraduated = poolAccountInfo !== null;
9378
- if (isGraduated && ammVaultAtaInfo) {
9379
- const transferCreatorFeesToPumpIx = await this.pumpAmmProgram.methods.transferCreatorFeesToPump().accountsPartial({
9380
- wsolMint: import_spl_token.NATIVE_MINT,
9381
- tokenProgram: import_spl_token.TOKEN_PROGRAM_ID,
9382
- coinCreator: sharingConfigPubkey
9383
- }).instruction();
9384
- instructions.push(transferCreatorFeesToPumpIx);
9385
- }
9386
- const getMinFeeIx = await PUMP_SDK.getMinimumDistributableFee({
9387
- mint,
9388
- sharingConfig,
9389
- sharingConfigAddress: sharingConfigPubkey
9390
- });
9391
- instructions.push(getMinFeeIx);
9392
- const { blockhash } = await this.connection.getLatestBlockhash();
9393
- const tx = new import_web33.VersionedTransaction(
9394
- new import_web33.TransactionMessage({
9395
- payerKey: simulationSigner,
9396
- recentBlockhash: blockhash,
9397
- instructions
9398
- }).compileToV0Message()
9399
- );
9400
- const result = await this.connection.simulateTransaction(tx);
9401
- let minimumDistributableFee = {
9402
- minimumRequired: new import_bn4.default(0),
9403
- distributableFees: new import_bn4.default(0),
9404
- canDistribute: false
9405
- };
9406
- if (!result.value.err) {
9407
- const [data, encoding] = result.value.returnData?.data ?? [];
9408
- if (data) {
9409
- const buffer = Buffer.from(data, encoding);
9410
- minimumDistributableFee = PUMP_SDK.decodeMinimumDistributableFee(buffer);
9411
- }
9412
- }
9413
- return {
9414
- ...minimumDistributableFee,
9415
- isGraduated
9416
- };
9417
- }
9418
- /**
9419
- * Gets the instructions to distribute creator fees for a token's fee sharing configuration.
9420
- *
9421
- * This method handles both graduated (AMM) and non-graduated (bonding curve) tokens.
9422
- * For graduated tokens, it automatically includes an instruction to consolidate fees
9423
- * from the AMM vault before distributing.
9424
- *
9425
- * @param mint - The mint address of the token
9426
- * @returns The instructions to distribute creator fees and whether the token is graduated
9427
- */
9428
- async buildDistributeCreatorFeesInstructions(mint) {
9429
- const sharingConfigPubkey = feeSharingConfigPda(mint);
9430
- const poolAddress = canonicalPumpPoolPda(mint);
9431
- const coinCreatorVaultAuthority = (0, import_pump_swap_sdk.coinCreatorVaultAuthorityPda)(sharingConfigPubkey);
9432
- const ammVaultAta = (0, import_pump_swap_sdk.coinCreatorVaultAtaPda)(
9433
- coinCreatorVaultAuthority,
9434
- import_spl_token.NATIVE_MINT,
9435
- import_spl_token.TOKEN_PROGRAM_ID
9436
- );
9437
- const [sharingConfigAccountInfo, poolAccountInfo, ammVaultAtaInfo] = await this.connection.getMultipleAccountsInfo([
9438
- sharingConfigPubkey,
9439
- poolAddress,
9440
- ammVaultAta
9441
- ]);
9442
- if (!sharingConfigAccountInfo) {
9443
- throw new Error(`Sharing config not found for mint: ${mint.toBase58()}`);
9444
- }
9445
- const sharingConfig = PUMP_SDK.decodeSharingConfig(sharingConfigAccountInfo);
9446
- const instructions = [];
9447
- const isGraduated = poolAccountInfo !== null;
9448
- if (isGraduated && ammVaultAtaInfo) {
9449
- const transferCreatorFeesToPumpIx = await this.pumpAmmProgram.methods.transferCreatorFeesToPump().accountsPartial({
9450
- wsolMint: import_spl_token.NATIVE_MINT,
9451
- tokenProgram: import_spl_token.TOKEN_PROGRAM_ID,
9452
- coinCreator: sharingConfigPubkey
9453
- }).instruction();
9454
- instructions.push(transferCreatorFeesToPumpIx);
9455
- }
9456
- const distributeCreatorFeesIx = await PUMP_SDK.distributeCreatorFees({
9457
- mint,
9458
- sharingConfig,
9459
- sharingConfigAddress: sharingConfigPubkey
9460
- });
9461
- instructions.push(distributeCreatorFeesIx);
9462
- return {
9463
- instructions,
9464
- isGraduated
9465
- };
9466
- }
9467
- };
9468
-
9469
9275
  // src/idl/pump_amm.json
9470
9276
  var pump_amm_default = {
9471
9277
  address: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA",
@@ -9759,6 +9565,10 @@ var pump_amm_default = {
9759
9565
  },
9760
9566
  {
9761
9567
  name: "buy",
9568
+ docs: [
9569
+ "For cashback coins, optionally pass user_volume_accumulator_wsol_ata as remaining_accounts[0].",
9570
+ "If provided and valid, the ATA will be initialized if needed."
9571
+ ],
9762
9572
  discriminator: [
9763
9573
  102,
9764
9574
  6,
@@ -10185,7 +9995,10 @@ var pump_amm_default = {
10185
9995
  "Make sure the payer has enough SOL to cover creation of the following accounts (unless already created):",
10186
9996
  "- protocol_fee_recipient_token_account: rent.minimum_balance(TokenAccount::LEN)",
10187
9997
  "- coin_creator_vault_ata: rent.minimum_balance(TokenAccount::LEN)",
10188
- "- user_volume_accumulator: rent.minimum_balance(UserVolumeAccumulator::LEN)"
9998
+ "- user_volume_accumulator: rent.minimum_balance(UserVolumeAccumulator::LEN)",
9999
+ "",
10000
+ "For cashback coins, optionally pass user_volume_accumulator_wsol_ata as remaining_accounts[0].",
10001
+ "If provided and valid, the ATA will be initialized if needed."
10189
10002
  ],
10190
10003
  discriminator: [
10191
10004
  198,
@@ -10512,95 +10325,312 @@ var pump_amm_default = {
10512
10325
  kind: "account",
10513
10326
  path: "user"
10514
10327
  }
10515
- ]
10328
+ ]
10329
+ }
10330
+ },
10331
+ {
10332
+ name: "fee_config",
10333
+ pda: {
10334
+ seeds: [
10335
+ {
10336
+ kind: "const",
10337
+ value: [
10338
+ 102,
10339
+ 101,
10340
+ 101,
10341
+ 95,
10342
+ 99,
10343
+ 111,
10344
+ 110,
10345
+ 102,
10346
+ 105,
10347
+ 103
10348
+ ]
10349
+ },
10350
+ {
10351
+ kind: "const",
10352
+ value: [
10353
+ 12,
10354
+ 20,
10355
+ 222,
10356
+ 252,
10357
+ 130,
10358
+ 94,
10359
+ 198,
10360
+ 118,
10361
+ 148,
10362
+ 37,
10363
+ 8,
10364
+ 24,
10365
+ 187,
10366
+ 101,
10367
+ 64,
10368
+ 101,
10369
+ 244,
10370
+ 41,
10371
+ 141,
10372
+ 49,
10373
+ 86,
10374
+ 213,
10375
+ 113,
10376
+ 180,
10377
+ 212,
10378
+ 248,
10379
+ 9,
10380
+ 12,
10381
+ 24,
10382
+ 233,
10383
+ 168,
10384
+ 99
10385
+ ]
10386
+ }
10387
+ ],
10388
+ program: {
10389
+ kind: "account",
10390
+ path: "fee_program"
10391
+ }
10392
+ }
10393
+ },
10394
+ {
10395
+ name: "fee_program",
10396
+ address: "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"
10397
+ }
10398
+ ],
10399
+ args: [
10400
+ {
10401
+ name: "spendable_quote_in",
10402
+ type: "u64"
10403
+ },
10404
+ {
10405
+ name: "min_base_amount_out",
10406
+ type: "u64"
10407
+ },
10408
+ {
10409
+ name: "track_volume",
10410
+ type: {
10411
+ defined: {
10412
+ name: "OptionBool"
10413
+ }
10414
+ }
10415
+ }
10416
+ ]
10417
+ },
10418
+ {
10419
+ name: "claim_cashback",
10420
+ discriminator: [
10421
+ 37,
10422
+ 58,
10423
+ 35,
10424
+ 126,
10425
+ 190,
10426
+ 53,
10427
+ 228,
10428
+ 197
10429
+ ],
10430
+ accounts: [
10431
+ {
10432
+ name: "user",
10433
+ writable: true
10434
+ },
10435
+ {
10436
+ name: "user_volume_accumulator",
10437
+ writable: true,
10438
+ pda: {
10439
+ seeds: [
10440
+ {
10441
+ kind: "const",
10442
+ value: [
10443
+ 117,
10444
+ 115,
10445
+ 101,
10446
+ 114,
10447
+ 95,
10448
+ 118,
10449
+ 111,
10450
+ 108,
10451
+ 117,
10452
+ 109,
10453
+ 101,
10454
+ 95,
10455
+ 97,
10456
+ 99,
10457
+ 99,
10458
+ 117,
10459
+ 109,
10460
+ 117,
10461
+ 108,
10462
+ 97,
10463
+ 116,
10464
+ 111,
10465
+ 114
10466
+ ]
10467
+ },
10468
+ {
10469
+ kind: "account",
10470
+ path: "user"
10471
+ }
10472
+ ]
10473
+ }
10474
+ },
10475
+ {
10476
+ name: "quote_mint"
10477
+ },
10478
+ {
10479
+ name: "quote_token_program"
10480
+ },
10481
+ {
10482
+ name: "user_volume_accumulator_wsol_token_account",
10483
+ writable: true,
10484
+ pda: {
10485
+ seeds: [
10486
+ {
10487
+ kind: "account",
10488
+ path: "user_volume_accumulator"
10489
+ },
10490
+ {
10491
+ kind: "account",
10492
+ path: "quote_token_program"
10493
+ },
10494
+ {
10495
+ kind: "account",
10496
+ path: "quote_mint"
10497
+ }
10498
+ ],
10499
+ program: {
10500
+ kind: "const",
10501
+ value: [
10502
+ 140,
10503
+ 151,
10504
+ 37,
10505
+ 143,
10506
+ 78,
10507
+ 36,
10508
+ 137,
10509
+ 241,
10510
+ 187,
10511
+ 61,
10512
+ 16,
10513
+ 41,
10514
+ 20,
10515
+ 142,
10516
+ 13,
10517
+ 131,
10518
+ 11,
10519
+ 90,
10520
+ 19,
10521
+ 153,
10522
+ 218,
10523
+ 255,
10524
+ 16,
10525
+ 132,
10526
+ 4,
10527
+ 142,
10528
+ 123,
10529
+ 216,
10530
+ 219,
10531
+ 233,
10532
+ 248,
10533
+ 89
10534
+ ]
10535
+ }
10536
+ }
10537
+ },
10538
+ {
10539
+ name: "user_wsol_token_account",
10540
+ writable: true,
10541
+ pda: {
10542
+ seeds: [
10543
+ {
10544
+ kind: "account",
10545
+ path: "user"
10546
+ },
10547
+ {
10548
+ kind: "account",
10549
+ path: "quote_token_program"
10550
+ },
10551
+ {
10552
+ kind: "account",
10553
+ path: "quote_mint"
10554
+ }
10555
+ ],
10556
+ program: {
10557
+ kind: "const",
10558
+ value: [
10559
+ 140,
10560
+ 151,
10561
+ 37,
10562
+ 143,
10563
+ 78,
10564
+ 36,
10565
+ 137,
10566
+ 241,
10567
+ 187,
10568
+ 61,
10569
+ 16,
10570
+ 41,
10571
+ 20,
10572
+ 142,
10573
+ 13,
10574
+ 131,
10575
+ 11,
10576
+ 90,
10577
+ 19,
10578
+ 153,
10579
+ 218,
10580
+ 255,
10581
+ 16,
10582
+ 132,
10583
+ 4,
10584
+ 142,
10585
+ 123,
10586
+ 216,
10587
+ 219,
10588
+ 233,
10589
+ 248,
10590
+ 89
10591
+ ]
10592
+ }
10516
10593
  }
10517
10594
  },
10518
10595
  {
10519
- name: "fee_config",
10596
+ name: "system_program",
10597
+ address: "11111111111111111111111111111111"
10598
+ },
10599
+ {
10600
+ name: "event_authority",
10520
10601
  pda: {
10521
10602
  seeds: [
10522
10603
  {
10523
10604
  kind: "const",
10524
10605
  value: [
10525
- 102,
10606
+ 95,
10607
+ 95,
10526
10608
  101,
10609
+ 118,
10527
10610
  101,
10611
+ 110,
10612
+ 116,
10528
10613
  95,
10529
- 99,
10614
+ 97,
10615
+ 117,
10616
+ 116,
10617
+ 104,
10530
10618
  111,
10531
- 110,
10532
- 102,
10619
+ 114,
10533
10620
  105,
10534
- 103
10535
- ]
10536
- },
10537
- {
10538
- kind: "const",
10539
- value: [
10540
- 12,
10541
- 20,
10542
- 222,
10543
- 252,
10544
- 130,
10545
- 94,
10546
- 198,
10547
- 118,
10548
- 148,
10549
- 37,
10550
- 8,
10551
- 24,
10552
- 187,
10553
- 101,
10554
- 64,
10555
- 101,
10556
- 244,
10557
- 41,
10558
- 141,
10559
- 49,
10560
- 86,
10561
- 213,
10562
- 113,
10563
- 180,
10564
- 212,
10565
- 248,
10566
- 9,
10567
- 12,
10568
- 24,
10569
- 233,
10570
- 168,
10571
- 99
10621
+ 116,
10622
+ 121
10572
10623
  ]
10573
10624
  }
10574
- ],
10575
- program: {
10576
- kind: "account",
10577
- path: "fee_program"
10578
- }
10625
+ ]
10579
10626
  }
10580
10627
  },
10581
10628
  {
10582
- name: "fee_program",
10583
- address: "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"
10629
+ name: "program",
10630
+ address: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"
10584
10631
  }
10585
10632
  ],
10586
- args: [
10587
- {
10588
- name: "spendable_quote_in",
10589
- type: "u64"
10590
- },
10591
- {
10592
- name: "min_base_amount_out",
10593
- type: "u64"
10594
- },
10595
- {
10596
- name: "track_volume",
10597
- type: {
10598
- defined: {
10599
- name: "OptionBool"
10600
- }
10601
- }
10602
- }
10603
- ]
10633
+ args: []
10604
10634
  },
10605
10635
  {
10606
10636
  name: "claim_token_incentives",
@@ -11556,6 +11586,14 @@ var pump_amm_default = {
11556
11586
  {
11557
11587
  name: "is_mayhem_mode",
11558
11588
  type: "bool"
11589
+ },
11590
+ {
11591
+ name: "is_cashback_coin",
11592
+ type: {
11593
+ defined: {
11594
+ name: "OptionBool"
11595
+ }
11596
+ }
11559
11597
  }
11560
11598
  ]
11561
11599
  },
@@ -12847,6 +12885,70 @@ var pump_amm_default = {
12847
12885
  ],
12848
12886
  args: []
12849
12887
  },
12888
+ {
12889
+ name: "toggle_cashback_enabled",
12890
+ discriminator: [
12891
+ 115,
12892
+ 103,
12893
+ 224,
12894
+ 255,
12895
+ 189,
12896
+ 89,
12897
+ 86,
12898
+ 195
12899
+ ],
12900
+ accounts: [
12901
+ {
12902
+ name: "admin",
12903
+ signer: true,
12904
+ relations: [
12905
+ "global_config"
12906
+ ]
12907
+ },
12908
+ {
12909
+ name: "global_config",
12910
+ writable: true
12911
+ },
12912
+ {
12913
+ name: "event_authority",
12914
+ pda: {
12915
+ seeds: [
12916
+ {
12917
+ kind: "const",
12918
+ value: [
12919
+ 95,
12920
+ 95,
12921
+ 101,
12922
+ 118,
12923
+ 101,
12924
+ 110,
12925
+ 116,
12926
+ 95,
12927
+ 97,
12928
+ 117,
12929
+ 116,
12930
+ 104,
12931
+ 111,
12932
+ 114,
12933
+ 105,
12934
+ 116,
12935
+ 121
12936
+ ]
12937
+ }
12938
+ ]
12939
+ }
12940
+ },
12941
+ {
12942
+ name: "program"
12943
+ }
12944
+ ],
12945
+ args: [
12946
+ {
12947
+ name: "enabled",
12948
+ type: "bool"
12949
+ }
12950
+ ]
12951
+ },
12850
12952
  {
12851
12953
  name: "toggle_mayhem_mode",
12852
12954
  discriminator: [
@@ -13544,6 +13646,19 @@ var pump_amm_default = {
13544
13646
  119
13545
13647
  ]
13546
13648
  },
13649
+ {
13650
+ name: "ClaimCashbackEvent",
13651
+ discriminator: [
13652
+ 226,
13653
+ 214,
13654
+ 246,
13655
+ 33,
13656
+ 7,
13657
+ 242,
13658
+ 147,
13659
+ 229
13660
+ ]
13661
+ },
13547
13662
  {
13548
13663
  name: "ClaimTokenIncentivesEvent",
13549
13664
  discriminator: [
@@ -13979,6 +14094,23 @@ var pump_amm_default = {
13979
14094
  code: 6048,
13980
14095
  name: "CreatorVaultMigratedToSharingConfig",
13981
14096
  msg: "creator_vault has been migrated to sharing config, use pump:distribute_creator_fees instead"
14097
+ },
14098
+ {
14099
+ code: 6049,
14100
+ name: "CashbackNotEnabled",
14101
+ msg: "Cashback is disabled"
14102
+ },
14103
+ {
14104
+ code: 6050,
14105
+ name: "OnlyPumpPoolsCashback"
14106
+ },
14107
+ {
14108
+ code: 6051,
14109
+ name: "CashbackNotInDesiredState"
14110
+ },
14111
+ {
14112
+ code: 6052,
14113
+ name: "CashbackEarnedDoesNotMatchTokenInVault"
13982
14114
  }
13983
14115
  ],
13984
14116
  types: [
@@ -14086,6 +14218,10 @@ var pump_amm_default = {
14086
14218
  {
14087
14219
  name: "is_mayhem_mode",
14088
14220
  type: "bool"
14221
+ },
14222
+ {
14223
+ name: "is_cashback_coin",
14224
+ type: "bool"
14089
14225
  }
14090
14226
  ]
14091
14227
  }
@@ -14187,36 +14323,72 @@ var pump_amm_default = {
14187
14323
  type: "u64"
14188
14324
  },
14189
14325
  {
14190
- name: "coin_creator_fee",
14326
+ name: "coin_creator_fee",
14327
+ type: "u64"
14328
+ },
14329
+ {
14330
+ name: "track_volume",
14331
+ type: "bool"
14332
+ },
14333
+ {
14334
+ name: "total_unclaimed_tokens",
14335
+ type: "u64"
14336
+ },
14337
+ {
14338
+ name: "total_claimed_tokens",
14339
+ type: "u64"
14340
+ },
14341
+ {
14342
+ name: "current_sol_volume",
14343
+ type: "u64"
14344
+ },
14345
+ {
14346
+ name: "last_update_timestamp",
14347
+ type: "i64"
14348
+ },
14349
+ {
14350
+ name: "min_base_amount_out",
14191
14351
  type: "u64"
14192
14352
  },
14193
14353
  {
14194
- name: "track_volume",
14195
- type: "bool"
14354
+ name: "ix_name",
14355
+ type: "string"
14196
14356
  },
14197
14357
  {
14198
- name: "total_unclaimed_tokens",
14358
+ name: "cashback_fee_basis_points",
14199
14359
  type: "u64"
14200
14360
  },
14201
14361
  {
14202
- name: "total_claimed_tokens",
14362
+ name: "cashback",
14203
14363
  type: "u64"
14364
+ }
14365
+ ]
14366
+ }
14367
+ },
14368
+ {
14369
+ name: "ClaimCashbackEvent",
14370
+ type: {
14371
+ kind: "struct",
14372
+ fields: [
14373
+ {
14374
+ name: "user",
14375
+ type: "pubkey"
14204
14376
  },
14205
14377
  {
14206
- name: "current_sol_volume",
14378
+ name: "amount",
14207
14379
  type: "u64"
14208
14380
  },
14209
14381
  {
14210
- name: "last_update_timestamp",
14382
+ name: "timestamp",
14211
14383
  type: "i64"
14212
14384
  },
14213
14385
  {
14214
- name: "min_base_amount_out",
14386
+ name: "total_claimed",
14215
14387
  type: "u64"
14216
14388
  },
14217
14389
  {
14218
- name: "ix_name",
14219
- type: "string"
14390
+ name: "total_cashback_earned",
14391
+ type: "u64"
14220
14392
  }
14221
14393
  ]
14222
14394
  }
@@ -14745,6 +14917,10 @@ var pump_amm_default = {
14745
14917
  7
14746
14918
  ]
14747
14919
  }
14920
+ },
14921
+ {
14922
+ name: "is_cashback_enabled",
14923
+ type: "bool"
14748
14924
  }
14749
14925
  ]
14750
14926
  }
@@ -14903,6 +15079,10 @@ var pump_amm_default = {
14903
15079
  {
14904
15080
  name: "is_mayhem_mode",
14905
15081
  type: "bool"
15082
+ },
15083
+ {
15084
+ name: "is_cashback_coin",
15085
+ type: "bool"
14906
15086
  }
14907
15087
  ]
14908
15088
  }
@@ -15028,6 +15208,14 @@ var pump_amm_default = {
15028
15208
  {
15029
15209
  name: "coin_creator_fee",
15030
15210
  type: "u64"
15211
+ },
15212
+ {
15213
+ name: "cashback_fee_basis_points",
15214
+ type: "u64"
15215
+ },
15216
+ {
15217
+ name: "cashback",
15218
+ type: "u64"
15031
15219
  }
15032
15220
  ]
15033
15221
  }
@@ -15061,7 +15249,226 @@ var pump_amm_default = {
15061
15249
  }
15062
15250
  },
15063
15251
  {
15064
- name: "SetMetaplexCoinCreatorEvent",
15252
+ name: "SetMetaplexCoinCreatorEvent",
15253
+ type: {
15254
+ kind: "struct",
15255
+ fields: [
15256
+ {
15257
+ name: "timestamp",
15258
+ type: "i64"
15259
+ },
15260
+ {
15261
+ name: "base_mint",
15262
+ type: "pubkey"
15263
+ },
15264
+ {
15265
+ name: "pool",
15266
+ type: "pubkey"
15267
+ },
15268
+ {
15269
+ name: "metadata",
15270
+ type: "pubkey"
15271
+ },
15272
+ {
15273
+ name: "coin_creator",
15274
+ type: "pubkey"
15275
+ }
15276
+ ]
15277
+ }
15278
+ },
15279
+ {
15280
+ name: "Shareholder",
15281
+ type: {
15282
+ kind: "struct",
15283
+ fields: [
15284
+ {
15285
+ name: "address",
15286
+ type: "pubkey"
15287
+ },
15288
+ {
15289
+ name: "share_bps",
15290
+ type: "u16"
15291
+ }
15292
+ ]
15293
+ }
15294
+ },
15295
+ {
15296
+ name: "SharingConfig",
15297
+ type: {
15298
+ kind: "struct",
15299
+ fields: [
15300
+ {
15301
+ name: "bump",
15302
+ type: "u8"
15303
+ },
15304
+ {
15305
+ name: "version",
15306
+ type: "u8"
15307
+ },
15308
+ {
15309
+ name: "status",
15310
+ type: {
15311
+ defined: {
15312
+ name: "ConfigStatus"
15313
+ }
15314
+ }
15315
+ },
15316
+ {
15317
+ name: "mint",
15318
+ type: "pubkey"
15319
+ },
15320
+ {
15321
+ name: "admin",
15322
+ type: "pubkey"
15323
+ },
15324
+ {
15325
+ name: "admin_revoked",
15326
+ type: "bool"
15327
+ },
15328
+ {
15329
+ name: "shareholders",
15330
+ type: {
15331
+ vec: {
15332
+ defined: {
15333
+ name: "Shareholder"
15334
+ }
15335
+ }
15336
+ }
15337
+ }
15338
+ ]
15339
+ }
15340
+ },
15341
+ {
15342
+ name: "SyncUserVolumeAccumulatorEvent",
15343
+ type: {
15344
+ kind: "struct",
15345
+ fields: [
15346
+ {
15347
+ name: "user",
15348
+ type: "pubkey"
15349
+ },
15350
+ {
15351
+ name: "total_claimed_tokens_before",
15352
+ type: "u64"
15353
+ },
15354
+ {
15355
+ name: "total_claimed_tokens_after",
15356
+ type: "u64"
15357
+ },
15358
+ {
15359
+ name: "timestamp",
15360
+ type: "i64"
15361
+ }
15362
+ ]
15363
+ }
15364
+ },
15365
+ {
15366
+ name: "UpdateAdminEvent",
15367
+ type: {
15368
+ kind: "struct",
15369
+ fields: [
15370
+ {
15371
+ name: "timestamp",
15372
+ type: "i64"
15373
+ },
15374
+ {
15375
+ name: "admin",
15376
+ type: "pubkey"
15377
+ },
15378
+ {
15379
+ name: "new_admin",
15380
+ type: "pubkey"
15381
+ }
15382
+ ]
15383
+ }
15384
+ },
15385
+ {
15386
+ name: "UpdateFeeConfigEvent",
15387
+ type: {
15388
+ kind: "struct",
15389
+ fields: [
15390
+ {
15391
+ name: "timestamp",
15392
+ type: "i64"
15393
+ },
15394
+ {
15395
+ name: "admin",
15396
+ type: "pubkey"
15397
+ },
15398
+ {
15399
+ name: "lp_fee_basis_points",
15400
+ type: "u64"
15401
+ },
15402
+ {
15403
+ name: "protocol_fee_basis_points",
15404
+ type: "u64"
15405
+ },
15406
+ {
15407
+ name: "protocol_fee_recipients",
15408
+ type: {
15409
+ array: [
15410
+ "pubkey",
15411
+ 8
15412
+ ]
15413
+ }
15414
+ },
15415
+ {
15416
+ name: "coin_creator_fee_basis_points",
15417
+ type: "u64"
15418
+ },
15419
+ {
15420
+ name: "admin_set_coin_creator_authority",
15421
+ type: "pubkey"
15422
+ }
15423
+ ]
15424
+ }
15425
+ },
15426
+ {
15427
+ name: "UserVolumeAccumulator",
15428
+ type: {
15429
+ kind: "struct",
15430
+ fields: [
15431
+ {
15432
+ name: "user",
15433
+ type: "pubkey"
15434
+ },
15435
+ {
15436
+ name: "needs_claim",
15437
+ type: "bool"
15438
+ },
15439
+ {
15440
+ name: "total_unclaimed_tokens",
15441
+ type: "u64"
15442
+ },
15443
+ {
15444
+ name: "total_claimed_tokens",
15445
+ type: "u64"
15446
+ },
15447
+ {
15448
+ name: "current_sol_volume",
15449
+ type: "u64"
15450
+ },
15451
+ {
15452
+ name: "last_update_timestamp",
15453
+ type: "i64"
15454
+ },
15455
+ {
15456
+ name: "has_total_claimed_tokens",
15457
+ type: "bool"
15458
+ },
15459
+ {
15460
+ name: "cashback_earned",
15461
+ type: "u64"
15462
+ },
15463
+ {
15464
+ name: "total_cashback_claimed",
15465
+ type: "u64"
15466
+ }
15467
+ ]
15468
+ }
15469
+ },
15470
+ {
15471
+ name: "WithdrawEvent",
15065
15472
  type: {
15066
15473
  kind: "struct",
15067
15474
  fields: [
@@ -15070,308 +15477,610 @@ var pump_amm_default = {
15070
15477
  type: "i64"
15071
15478
  },
15072
15479
  {
15073
- name: "base_mint",
15074
- type: "pubkey"
15480
+ name: "lp_token_amount_in",
15481
+ type: "u64"
15075
15482
  },
15076
15483
  {
15077
- name: "pool",
15078
- type: "pubkey"
15484
+ name: "min_base_amount_out",
15485
+ type: "u64"
15079
15486
  },
15080
15487
  {
15081
- name: "metadata",
15082
- type: "pubkey"
15488
+ name: "min_quote_amount_out",
15489
+ type: "u64"
15083
15490
  },
15084
15491
  {
15085
- name: "coin_creator",
15086
- type: "pubkey"
15087
- }
15088
- ]
15089
- }
15090
- },
15091
- {
15092
- name: "Shareholder",
15093
- type: {
15094
- kind: "struct",
15095
- fields: [
15492
+ name: "user_base_token_reserves",
15493
+ type: "u64"
15494
+ },
15096
15495
  {
15097
- name: "address",
15098
- type: "pubkey"
15496
+ name: "user_quote_token_reserves",
15497
+ type: "u64"
15099
15498
  },
15100
15499
  {
15101
- name: "share_bps",
15102
- type: "u16"
15103
- }
15104
- ]
15105
- }
15106
- },
15107
- {
15108
- name: "SharingConfig",
15109
- type: {
15110
- kind: "struct",
15111
- fields: [
15500
+ name: "pool_base_token_reserves",
15501
+ type: "u64"
15502
+ },
15112
15503
  {
15113
- name: "bump",
15114
- type: "u8"
15504
+ name: "pool_quote_token_reserves",
15505
+ type: "u64"
15115
15506
  },
15116
15507
  {
15117
- name: "version",
15118
- type: "u8"
15508
+ name: "base_amount_out",
15509
+ type: "u64"
15119
15510
  },
15120
15511
  {
15121
- name: "status",
15122
- type: {
15123
- defined: {
15124
- name: "ConfigStatus"
15125
- }
15126
- }
15512
+ name: "quote_amount_out",
15513
+ type: "u64"
15127
15514
  },
15128
15515
  {
15129
- name: "mint",
15516
+ name: "lp_mint_supply",
15517
+ type: "u64"
15518
+ },
15519
+ {
15520
+ name: "pool",
15130
15521
  type: "pubkey"
15131
15522
  },
15132
15523
  {
15133
- name: "admin",
15524
+ name: "user",
15134
15525
  type: "pubkey"
15135
15526
  },
15136
15527
  {
15137
- name: "admin_revoked",
15138
- type: "bool"
15528
+ name: "user_base_token_account",
15529
+ type: "pubkey"
15139
15530
  },
15140
15531
  {
15141
- name: "shareholders",
15142
- type: {
15143
- vec: {
15144
- defined: {
15145
- name: "Shareholder"
15146
- }
15532
+ name: "user_quote_token_account",
15533
+ type: "pubkey"
15534
+ },
15535
+ {
15536
+ name: "user_pool_token_account",
15537
+ type: "pubkey"
15538
+ }
15539
+ ]
15540
+ }
15541
+ }
15542
+ ]
15543
+ };
15544
+
15545
+ // src/idl/pump_fees.json
15546
+ var pump_fees_default = {
15547
+ address: "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ",
15548
+ metadata: {
15549
+ name: "pump_fees",
15550
+ version: "0.1.0",
15551
+ spec: "0.1.0",
15552
+ description: "Created with Anchor"
15553
+ },
15554
+ instructions: [
15555
+ {
15556
+ name: "claim_social_fee_pda",
15557
+ discriminator: [
15558
+ 225,
15559
+ 21,
15560
+ 251,
15561
+ 133,
15562
+ 161,
15563
+ 30,
15564
+ 199,
15565
+ 226
15566
+ ],
15567
+ accounts: [
15568
+ {
15569
+ name: "recipient",
15570
+ writable: true
15571
+ },
15572
+ {
15573
+ name: "social_fee_pda",
15574
+ writable: true
15575
+ },
15576
+ {
15577
+ name: "fee_program_global",
15578
+ pda: {
15579
+ seeds: [
15580
+ {
15581
+ kind: "const",
15582
+ value: [
15583
+ 102,
15584
+ 101,
15585
+ 101,
15586
+ 45,
15587
+ 112,
15588
+ 114,
15589
+ 111,
15590
+ 103,
15591
+ 114,
15592
+ 97,
15593
+ 109,
15594
+ 45,
15595
+ 103,
15596
+ 108,
15597
+ 111,
15598
+ 98,
15599
+ 97,
15600
+ 108
15601
+ ]
15602
+ }
15603
+ ]
15604
+ }
15605
+ },
15606
+ {
15607
+ name: "social_claim_authority",
15608
+ signer: true,
15609
+ relations: [
15610
+ "fee_program_global"
15611
+ ]
15612
+ },
15613
+ {
15614
+ name: "event_authority",
15615
+ pda: {
15616
+ seeds: [
15617
+ {
15618
+ kind: "const",
15619
+ value: [
15620
+ 95,
15621
+ 95,
15622
+ 101,
15623
+ 118,
15624
+ 101,
15625
+ 110,
15626
+ 116,
15627
+ 95,
15628
+ 97,
15629
+ 117,
15630
+ 116,
15631
+ 104,
15632
+ 111,
15633
+ 114,
15634
+ 105,
15635
+ 116,
15636
+ 121
15637
+ ]
15638
+ }
15639
+ ]
15640
+ }
15641
+ },
15642
+ {
15643
+ name: "program"
15644
+ }
15645
+ ],
15646
+ args: [
15647
+ {
15648
+ name: "user_id",
15649
+ type: "string"
15650
+ },
15651
+ {
15652
+ name: "platform",
15653
+ type: "u8"
15654
+ }
15655
+ ],
15656
+ returns: {
15657
+ option: {
15658
+ defined: {
15659
+ name: "SocialFeePdaClaimed"
15660
+ }
15661
+ }
15662
+ }
15663
+ },
15664
+ {
15665
+ name: "create_fee_sharing_config",
15666
+ docs: [
15667
+ "Create Fee Sharing Config"
15668
+ ],
15669
+ discriminator: [
15670
+ 195,
15671
+ 78,
15672
+ 86,
15673
+ 76,
15674
+ 111,
15675
+ 52,
15676
+ 251,
15677
+ 213
15678
+ ],
15679
+ accounts: [
15680
+ {
15681
+ name: "event_authority",
15682
+ pda: {
15683
+ seeds: [
15684
+ {
15685
+ kind: "const",
15686
+ value: [
15687
+ 95,
15688
+ 95,
15689
+ 101,
15690
+ 118,
15691
+ 101,
15692
+ 110,
15693
+ 116,
15694
+ 95,
15695
+ 97,
15696
+ 117,
15697
+ 116,
15698
+ 104,
15699
+ 111,
15700
+ 114,
15701
+ 105,
15702
+ 116,
15703
+ 121
15704
+ ]
15705
+ }
15706
+ ]
15707
+ }
15708
+ },
15709
+ {
15710
+ name: "program",
15711
+ address: "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"
15712
+ },
15713
+ {
15714
+ name: "payer",
15715
+ writable: true,
15716
+ signer: true
15717
+ },
15718
+ {
15719
+ name: "global",
15720
+ pda: {
15721
+ seeds: [
15722
+ {
15723
+ kind: "const",
15724
+ value: [
15725
+ 103,
15726
+ 108,
15727
+ 111,
15728
+ 98,
15729
+ 97,
15730
+ 108
15731
+ ]
15147
15732
  }
15733
+ ],
15734
+ program: {
15735
+ kind: "const",
15736
+ value: [
15737
+ 1,
15738
+ 86,
15739
+ 224,
15740
+ 246,
15741
+ 147,
15742
+ 102,
15743
+ 90,
15744
+ 207,
15745
+ 68,
15746
+ 219,
15747
+ 21,
15748
+ 104,
15749
+ 191,
15750
+ 23,
15751
+ 91,
15752
+ 170,
15753
+ 81,
15754
+ 137,
15755
+ 203,
15756
+ 151,
15757
+ 245,
15758
+ 210,
15759
+ 255,
15760
+ 59,
15761
+ 101,
15762
+ 93,
15763
+ 43,
15764
+ 182,
15765
+ 253,
15766
+ 109,
15767
+ 24,
15768
+ 176
15769
+ ]
15148
15770
  }
15149
15771
  }
15150
- ]
15151
- }
15152
- },
15153
- {
15154
- name: "SyncUserVolumeAccumulatorEvent",
15155
- type: {
15156
- kind: "struct",
15157
- fields: [
15158
- {
15159
- name: "user",
15160
- type: "pubkey"
15161
- },
15162
- {
15163
- name: "total_claimed_tokens_before",
15164
- type: "u64"
15165
- },
15166
- {
15167
- name: "total_claimed_tokens_after",
15168
- type: "u64"
15169
- },
15170
- {
15171
- name: "timestamp",
15172
- type: "i64"
15772
+ },
15773
+ {
15774
+ name: "mint"
15775
+ },
15776
+ {
15777
+ name: "sharing_config",
15778
+ writable: true,
15779
+ pda: {
15780
+ seeds: [
15781
+ {
15782
+ kind: "const",
15783
+ value: [
15784
+ 115,
15785
+ 104,
15786
+ 97,
15787
+ 114,
15788
+ 105,
15789
+ 110,
15790
+ 103,
15791
+ 45,
15792
+ 99,
15793
+ 111,
15794
+ 110,
15795
+ 102,
15796
+ 105,
15797
+ 103
15798
+ ]
15799
+ },
15800
+ {
15801
+ kind: "account",
15802
+ path: "mint"
15803
+ }
15804
+ ]
15173
15805
  }
15174
- ]
15175
- }
15176
- },
15177
- {
15178
- name: "UpdateAdminEvent",
15179
- type: {
15180
- kind: "struct",
15181
- fields: [
15182
- {
15183
- name: "timestamp",
15184
- type: "i64"
15185
- },
15186
- {
15187
- name: "admin",
15188
- type: "pubkey"
15189
- },
15190
- {
15191
- name: "new_admin",
15192
- type: "pubkey"
15806
+ },
15807
+ {
15808
+ name: "system_program",
15809
+ address: "11111111111111111111111111111111"
15810
+ },
15811
+ {
15812
+ name: "bonding_curve",
15813
+ writable: true,
15814
+ pda: {
15815
+ seeds: [
15816
+ {
15817
+ kind: "const",
15818
+ value: [
15819
+ 98,
15820
+ 111,
15821
+ 110,
15822
+ 100,
15823
+ 105,
15824
+ 110,
15825
+ 103,
15826
+ 45,
15827
+ 99,
15828
+ 117,
15829
+ 114,
15830
+ 118,
15831
+ 101
15832
+ ]
15833
+ },
15834
+ {
15835
+ kind: "account",
15836
+ path: "mint"
15837
+ }
15838
+ ],
15839
+ program: {
15840
+ kind: "const",
15841
+ value: [
15842
+ 1,
15843
+ 86,
15844
+ 224,
15845
+ 246,
15846
+ 147,
15847
+ 102,
15848
+ 90,
15849
+ 207,
15850
+ 68,
15851
+ 219,
15852
+ 21,
15853
+ 104,
15854
+ 191,
15855
+ 23,
15856
+ 91,
15857
+ 170,
15858
+ 81,
15859
+ 137,
15860
+ 203,
15861
+ 151,
15862
+ 245,
15863
+ 210,
15864
+ 255,
15865
+ 59,
15866
+ 101,
15867
+ 93,
15868
+ 43,
15869
+ 182,
15870
+ 253,
15871
+ 109,
15872
+ 24,
15873
+ 176
15874
+ ]
15875
+ }
15193
15876
  }
15194
- ]
15195
- }
15196
- },
15197
- {
15198
- name: "UpdateFeeConfigEvent",
15199
- type: {
15200
- kind: "struct",
15201
- fields: [
15202
- {
15203
- name: "timestamp",
15204
- type: "i64"
15205
- },
15206
- {
15207
- name: "admin",
15208
- type: "pubkey"
15209
- },
15210
- {
15211
- name: "lp_fee_basis_points",
15212
- type: "u64"
15213
- },
15214
- {
15215
- name: "protocol_fee_basis_points",
15216
- type: "u64"
15217
- },
15218
- {
15219
- name: "protocol_fee_recipients",
15220
- type: {
15221
- array: [
15222
- "pubkey",
15223
- 8
15877
+ },
15878
+ {
15879
+ name: "pump_program",
15880
+ address: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
15881
+ },
15882
+ {
15883
+ name: "pump_event_authority",
15884
+ pda: {
15885
+ seeds: [
15886
+ {
15887
+ kind: "const",
15888
+ value: [
15889
+ 95,
15890
+ 95,
15891
+ 101,
15892
+ 118,
15893
+ 101,
15894
+ 110,
15895
+ 116,
15896
+ 95,
15897
+ 97,
15898
+ 117,
15899
+ 116,
15900
+ 104,
15901
+ 111,
15902
+ 114,
15903
+ 105,
15904
+ 116,
15905
+ 121
15906
+ ]
15907
+ }
15908
+ ],
15909
+ program: {
15910
+ kind: "const",
15911
+ value: [
15912
+ 1,
15913
+ 86,
15914
+ 224,
15915
+ 246,
15916
+ 147,
15917
+ 102,
15918
+ 90,
15919
+ 207,
15920
+ 68,
15921
+ 219,
15922
+ 21,
15923
+ 104,
15924
+ 191,
15925
+ 23,
15926
+ 91,
15927
+ 170,
15928
+ 81,
15929
+ 137,
15930
+ 203,
15931
+ 151,
15932
+ 245,
15933
+ 210,
15934
+ 255,
15935
+ 59,
15936
+ 101,
15937
+ 93,
15938
+ 43,
15939
+ 182,
15940
+ 253,
15941
+ 109,
15942
+ 24,
15943
+ 176
15224
15944
  ]
15225
15945
  }
15226
- },
15227
- {
15228
- name: "coin_creator_fee_basis_points",
15229
- type: "u64"
15230
- },
15231
- {
15232
- name: "admin_set_coin_creator_authority",
15233
- type: "pubkey"
15234
15946
  }
15235
- ]
15236
- }
15237
- },
15238
- {
15239
- name: "UserVolumeAccumulator",
15240
- type: {
15241
- kind: "struct",
15242
- fields: [
15243
- {
15244
- name: "user",
15245
- type: "pubkey"
15246
- },
15247
- {
15248
- name: "needs_claim",
15249
- type: "bool"
15250
- },
15251
- {
15252
- name: "total_unclaimed_tokens",
15253
- type: "u64"
15254
- },
15255
- {
15256
- name: "total_claimed_tokens",
15257
- type: "u64"
15258
- },
15259
- {
15260
- name: "current_sol_volume",
15261
- type: "u64"
15262
- },
15263
- {
15264
- name: "last_update_timestamp",
15265
- type: "i64"
15266
- },
15267
- {
15268
- name: "has_total_claimed_tokens",
15269
- type: "bool"
15947
+ },
15948
+ {
15949
+ name: "pool",
15950
+ writable: true,
15951
+ optional: true
15952
+ },
15953
+ {
15954
+ name: "pump_amm_program",
15955
+ optional: true,
15956
+ address: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"
15957
+ },
15958
+ {
15959
+ name: "pump_amm_event_authority",
15960
+ optional: true,
15961
+ pda: {
15962
+ seeds: [
15963
+ {
15964
+ kind: "const",
15965
+ value: [
15966
+ 95,
15967
+ 95,
15968
+ 101,
15969
+ 118,
15970
+ 101,
15971
+ 110,
15972
+ 116,
15973
+ 95,
15974
+ 97,
15975
+ 117,
15976
+ 116,
15977
+ 104,
15978
+ 111,
15979
+ 114,
15980
+ 105,
15981
+ 116,
15982
+ 121
15983
+ ]
15984
+ }
15985
+ ],
15986
+ program: {
15987
+ kind: "const",
15988
+ value: [
15989
+ 12,
15990
+ 20,
15991
+ 222,
15992
+ 252,
15993
+ 130,
15994
+ 94,
15995
+ 198,
15996
+ 118,
15997
+ 148,
15998
+ 37,
15999
+ 8,
16000
+ 24,
16001
+ 187,
16002
+ 101,
16003
+ 64,
16004
+ 101,
16005
+ 244,
16006
+ 41,
16007
+ 141,
16008
+ 49,
16009
+ 86,
16010
+ 213,
16011
+ 113,
16012
+ 180,
16013
+ 212,
16014
+ 248,
16015
+ 9,
16016
+ 12,
16017
+ 24,
16018
+ 233,
16019
+ 168,
16020
+ 99
16021
+ ]
16022
+ }
15270
16023
  }
15271
- ]
15272
- }
16024
+ }
16025
+ ],
16026
+ args: []
15273
16027
  },
15274
16028
  {
15275
- name: "WithdrawEvent",
15276
- type: {
15277
- kind: "struct",
15278
- fields: [
15279
- {
15280
- name: "timestamp",
15281
- type: "i64"
15282
- },
15283
- {
15284
- name: "lp_token_amount_in",
15285
- type: "u64"
15286
- },
15287
- {
15288
- name: "min_base_amount_out",
15289
- type: "u64"
15290
- },
15291
- {
15292
- name: "min_quote_amount_out",
15293
- type: "u64"
15294
- },
15295
- {
15296
- name: "user_base_token_reserves",
15297
- type: "u64"
15298
- },
15299
- {
15300
- name: "user_quote_token_reserves",
15301
- type: "u64"
15302
- },
15303
- {
15304
- name: "pool_base_token_reserves",
15305
- type: "u64"
15306
- },
15307
- {
15308
- name: "pool_quote_token_reserves",
15309
- type: "u64"
15310
- },
15311
- {
15312
- name: "base_amount_out",
15313
- type: "u64"
15314
- },
15315
- {
15316
- name: "quote_amount_out",
15317
- type: "u64"
15318
- },
15319
- {
15320
- name: "lp_mint_supply",
15321
- type: "u64"
15322
- },
15323
- {
15324
- name: "pool",
15325
- type: "pubkey"
15326
- },
15327
- {
15328
- name: "user",
15329
- type: "pubkey"
15330
- },
15331
- {
15332
- name: "user_base_token_account",
15333
- type: "pubkey"
15334
- },
15335
- {
15336
- name: "user_quote_token_account",
15337
- type: "pubkey"
15338
- },
15339
- {
15340
- name: "user_pool_token_account",
15341
- type: "pubkey"
15342
- }
15343
- ]
15344
- }
15345
- }
15346
- ]
15347
- };
15348
-
15349
- // src/idl/pump_fees.json
15350
- var pump_fees_default = {
15351
- address: "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ",
15352
- metadata: {
15353
- name: "pump_fees",
15354
- version: "0.1.0",
15355
- spec: "0.1.0",
15356
- description: "Created with Anchor"
15357
- },
15358
- instructions: [
15359
- {
15360
- name: "create_fee_sharing_config",
15361
- docs: [
15362
- "Create Fee Sharing Config"
15363
- ],
16029
+ name: "create_social_fee_pda",
15364
16030
  discriminator: [
15365
- 195,
15366
- 78,
15367
- 86,
15368
- 76,
15369
- 111,
15370
- 52,
15371
- 251,
15372
- 213
16031
+ 144,
16032
+ 224,
16033
+ 59,
16034
+ 211,
16035
+ 78,
16036
+ 248,
16037
+ 202,
16038
+ 220
15373
16039
  ],
15374
16040
  accounts: [
16041
+ {
16042
+ name: "payer",
16043
+ writable: true,
16044
+ signer: true
16045
+ },
16046
+ {
16047
+ name: "social_fee_pda",
16048
+ writable: true
16049
+ },
16050
+ {
16051
+ name: "system_program",
16052
+ address: "11111111111111111111111111111111"
16053
+ },
16054
+ {
16055
+ name: "fee_program_global",
16056
+ pda: {
16057
+ seeds: [
16058
+ {
16059
+ kind: "const",
16060
+ value: [
16061
+ 102,
16062
+ 101,
16063
+ 101,
16064
+ 45,
16065
+ 112,
16066
+ 114,
16067
+ 111,
16068
+ 103,
16069
+ 114,
16070
+ 97,
16071
+ 109,
16072
+ 45,
16073
+ 103,
16074
+ 108,
16075
+ 111,
16076
+ 98,
16077
+ 97,
16078
+ 108
16079
+ ]
16080
+ }
16081
+ ]
16082
+ }
16083
+ },
15375
16084
  {
15376
16085
  name: "event_authority",
15377
16086
  pda: {
@@ -15402,88 +16111,120 @@ var pump_fees_default = {
15402
16111
  }
15403
16112
  },
15404
16113
  {
15405
- name: "program",
15406
- address: "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"
15407
- },
16114
+ name: "program"
16115
+ }
16116
+ ],
16117
+ args: [
15408
16118
  {
15409
- name: "payer",
15410
- writable: true,
15411
- signer: true
16119
+ name: "user_id",
16120
+ type: "string"
15412
16121
  },
15413
16122
  {
15414
- name: "global",
16123
+ name: "platform",
16124
+ type: "u8"
16125
+ }
16126
+ ]
16127
+ },
16128
+ {
16129
+ name: "get_fees",
16130
+ docs: [
16131
+ "Get Fees"
16132
+ ],
16133
+ discriminator: [
16134
+ 231,
16135
+ 37,
16136
+ 126,
16137
+ 85,
16138
+ 207,
16139
+ 91,
16140
+ 63,
16141
+ 52
16142
+ ],
16143
+ accounts: [
16144
+ {
16145
+ name: "fee_config",
15415
16146
  pda: {
15416
16147
  seeds: [
15417
16148
  {
15418
16149
  kind: "const",
15419
16150
  value: [
15420
- 103,
15421
- 108,
16151
+ 102,
16152
+ 101,
16153
+ 101,
16154
+ 95,
16155
+ 99,
15422
16156
  111,
15423
- 98,
15424
- 97,
15425
- 108
16157
+ 110,
16158
+ 102,
16159
+ 105,
16160
+ 103
15426
16161
  ]
16162
+ },
16163
+ {
16164
+ kind: "account",
16165
+ path: "config_program_id"
15427
16166
  }
15428
- ],
15429
- program: {
15430
- kind: "const",
15431
- value: [
15432
- 1,
15433
- 86,
15434
- 224,
15435
- 246,
15436
- 147,
15437
- 102,
15438
- 90,
15439
- 207,
15440
- 68,
15441
- 219,
15442
- 21,
15443
- 104,
15444
- 191,
15445
- 23,
15446
- 91,
15447
- 170,
15448
- 81,
15449
- 137,
15450
- 203,
15451
- 151,
15452
- 245,
15453
- 210,
15454
- 255,
15455
- 59,
15456
- 101,
15457
- 93,
15458
- 43,
15459
- 182,
15460
- 253,
15461
- 109,
15462
- 24,
15463
- 176
15464
- ]
15465
- }
16167
+ ]
15466
16168
  }
15467
16169
  },
15468
16170
  {
15469
- name: "mint"
16171
+ name: "config_program_id"
16172
+ }
16173
+ ],
16174
+ args: [
16175
+ {
16176
+ name: "is_pump_pool",
16177
+ type: "bool"
15470
16178
  },
15471
16179
  {
15472
- name: "sharing_config",
16180
+ name: "market_cap_lamports",
16181
+ type: "u128"
16182
+ },
16183
+ {
16184
+ name: "trade_size_lamports",
16185
+ type: "u64"
16186
+ }
16187
+ ],
16188
+ returns: {
16189
+ defined: {
16190
+ name: "Fees"
16191
+ }
16192
+ }
16193
+ },
16194
+ {
16195
+ name: "initialize_fee_config",
16196
+ docs: [
16197
+ "Initialize FeeConfig admin"
16198
+ ],
16199
+ discriminator: [
16200
+ 62,
16201
+ 162,
16202
+ 20,
16203
+ 133,
16204
+ 121,
16205
+ 65,
16206
+ 145,
16207
+ 27
16208
+ ],
16209
+ accounts: [
16210
+ {
16211
+ name: "admin",
16212
+ writable: true,
16213
+ signer: true,
16214
+ address: "8LWu7QM2dGR1G8nKDHthckea57bkCzXyBTAKPJUBDHo8"
16215
+ },
16216
+ {
16217
+ name: "fee_config",
15473
16218
  writable: true,
15474
16219
  pda: {
15475
16220
  seeds: [
15476
16221
  {
15477
16222
  kind: "const",
15478
16223
  value: [
15479
- 115,
15480
- 104,
15481
- 97,
15482
- 114,
15483
- 105,
15484
- 110,
15485
- 103,
15486
- 45,
16224
+ 102,
16225
+ 101,
16226
+ 101,
16227
+ 95,
15487
16228
  99,
15488
16229
  111,
15489
16230
  110,
@@ -15494,7 +16235,7 @@ var pump_fees_default = {
15494
16235
  },
15495
16236
  {
15496
16237
  kind: "account",
15497
- path: "mint"
16238
+ path: "config_program_id"
15498
16239
  }
15499
16240
  ]
15500
16241
  }
@@ -15504,31 +16245,78 @@ var pump_fees_default = {
15504
16245
  address: "11111111111111111111111111111111"
15505
16246
  },
15506
16247
  {
15507
- name: "bonding_curve",
15508
- writable: true,
16248
+ name: "config_program_id"
16249
+ },
16250
+ {
16251
+ name: "event_authority",
15509
16252
  pda: {
15510
16253
  seeds: [
15511
16254
  {
15512
16255
  kind: "const",
15513
16256
  value: [
15514
- 98,
15515
- 111,
16257
+ 95,
16258
+ 95,
16259
+ 101,
16260
+ 118,
16261
+ 101,
15516
16262
  110,
15517
- 100,
16263
+ 116,
16264
+ 95,
16265
+ 97,
16266
+ 117,
16267
+ 116,
16268
+ 104,
16269
+ 111,
16270
+ 114,
15518
16271
  105,
15519
- 110,
16272
+ 116,
16273
+ 121
16274
+ ]
16275
+ }
16276
+ ]
16277
+ }
16278
+ },
16279
+ {
16280
+ name: "program"
16281
+ }
16282
+ ],
16283
+ args: []
16284
+ },
16285
+ {
16286
+ name: "initialize_fee_program_global",
16287
+ discriminator: [
16288
+ 35,
16289
+ 215,
16290
+ 130,
16291
+ 84,
16292
+ 233,
16293
+ 56,
16294
+ 124,
16295
+ 167
16296
+ ],
16297
+ accounts: [
16298
+ {
16299
+ name: "authority",
16300
+ writable: true,
16301
+ signer: true,
16302
+ relations: [
16303
+ "pump_global"
16304
+ ]
16305
+ },
16306
+ {
16307
+ name: "pump_global",
16308
+ pda: {
16309
+ seeds: [
16310
+ {
16311
+ kind: "const",
16312
+ value: [
15520
16313
  103,
15521
- 45,
15522
- 99,
15523
- 117,
15524
- 114,
15525
- 118,
15526
- 101
16314
+ 108,
16315
+ 111,
16316
+ 98,
16317
+ 97,
16318
+ 108
15527
16319
  ]
15528
- },
15529
- {
15530
- kind: "account",
15531
- path: "mint"
15532
16320
  }
15533
16321
  ],
15534
16322
  program: {
@@ -15571,11 +16359,42 @@ var pump_fees_default = {
15571
16359
  }
15572
16360
  },
15573
16361
  {
15574
- name: "pump_program",
15575
- address: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
16362
+ name: "fee_program_global",
16363
+ writable: true,
16364
+ pda: {
16365
+ seeds: [
16366
+ {
16367
+ kind: "const",
16368
+ value: [
16369
+ 102,
16370
+ 101,
16371
+ 101,
16372
+ 45,
16373
+ 112,
16374
+ 114,
16375
+ 111,
16376
+ 103,
16377
+ 114,
16378
+ 97,
16379
+ 109,
16380
+ 45,
16381
+ 103,
16382
+ 108,
16383
+ 111,
16384
+ 98,
16385
+ 97,
16386
+ 108
16387
+ ]
16388
+ }
16389
+ ]
16390
+ }
15576
16391
  },
15577
16392
  {
15578
- name: "pump_event_authority",
16393
+ name: "system_program",
16394
+ address: "11111111111111111111111111111111"
16395
+ },
16396
+ {
16397
+ name: "event_authority",
15579
16398
  pda: {
15580
16399
  seeds: [
15581
16400
  {
@@ -15600,6 +16419,63 @@ var pump_fees_default = {
15600
16419
  121
15601
16420
  ]
15602
16421
  }
16422
+ ]
16423
+ }
16424
+ },
16425
+ {
16426
+ name: "program"
16427
+ }
16428
+ ],
16429
+ args: [
16430
+ {
16431
+ name: "social_claim_authority",
16432
+ type: "pubkey"
16433
+ },
16434
+ {
16435
+ name: "disable_flags",
16436
+ type: "u8"
16437
+ },
16438
+ {
16439
+ name: "claim_rate_limit",
16440
+ type: "u64"
16441
+ }
16442
+ ]
16443
+ },
16444
+ {
16445
+ name: "reset_fee_sharing_config",
16446
+ docs: [
16447
+ "Reset Fee Sharing Config, make sure to distribute all the fees before calling this"
16448
+ ],
16449
+ discriminator: [
16450
+ 10,
16451
+ 2,
16452
+ 182,
16453
+ 95,
16454
+ 16,
16455
+ 127,
16456
+ 129,
16457
+ 186
16458
+ ],
16459
+ accounts: [
16460
+ {
16461
+ name: "authority",
16462
+ signer: true
16463
+ },
16464
+ {
16465
+ name: "global",
16466
+ pda: {
16467
+ seeds: [
16468
+ {
16469
+ kind: "const",
16470
+ value: [
16471
+ 103,
16472
+ 108,
16473
+ 111,
16474
+ 98,
16475
+ 97,
16476
+ 108
16477
+ ]
16478
+ }
15603
16479
  ],
15604
16480
  program: {
15605
16481
  kind: "const",
@@ -15641,18 +16517,47 @@ var pump_fees_default = {
15641
16517
  }
15642
16518
  },
15643
16519
  {
15644
- name: "pool",
15645
- writable: true,
15646
- optional: true
16520
+ name: "new_admin"
15647
16521
  },
15648
16522
  {
15649
- name: "pump_amm_program",
15650
- optional: true,
15651
- address: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"
16523
+ name: "mint",
16524
+ relations: [
16525
+ "sharing_config"
16526
+ ]
15652
16527
  },
15653
16528
  {
15654
- name: "pump_amm_event_authority",
15655
- optional: true,
16529
+ name: "sharing_config",
16530
+ writable: true,
16531
+ pda: {
16532
+ seeds: [
16533
+ {
16534
+ kind: "const",
16535
+ value: [
16536
+ 115,
16537
+ 104,
16538
+ 97,
16539
+ 114,
16540
+ 105,
16541
+ 110,
16542
+ 103,
16543
+ 45,
16544
+ 99,
16545
+ 111,
16546
+ 110,
16547
+ 102,
16548
+ 105,
16549
+ 103
16550
+ ]
16551
+ },
16552
+ {
16553
+ kind: "account",
16554
+ path: "mint"
16555
+ }
16556
+ ]
16557
+ }
16558
+ },
16559
+ {
16560
+ name: "event_authority",
15656
16561
  pda: {
15657
16562
  seeds: [
15658
16563
  {
@@ -15677,76 +16582,112 @@ var pump_fees_default = {
15677
16582
  121
15678
16583
  ]
15679
16584
  }
15680
- ],
15681
- program: {
15682
- kind: "const",
15683
- value: [
15684
- 12,
15685
- 20,
15686
- 222,
15687
- 252,
15688
- 130,
15689
- 94,
15690
- 198,
15691
- 118,
15692
- 148,
15693
- 37,
15694
- 8,
15695
- 24,
15696
- 187,
15697
- 101,
15698
- 64,
15699
- 101,
15700
- 244,
15701
- 41,
15702
- 141,
15703
- 49,
15704
- 86,
15705
- 213,
15706
- 113,
15707
- 180,
15708
- 212,
15709
- 248,
15710
- 9,
15711
- 12,
15712
- 24,
15713
- 233,
15714
- 168,
15715
- 99
15716
- ]
15717
- }
16585
+ ]
15718
16586
  }
16587
+ },
16588
+ {
16589
+ name: "program"
15719
16590
  }
15720
16591
  ],
15721
16592
  args: []
15722
16593
  },
15723
16594
  {
15724
- name: "get_fees",
16595
+ name: "revoke_fee_sharing_authority",
15725
16596
  docs: [
15726
- "Get Fees"
16597
+ "Revoke Fee Sharing Authority"
15727
16598
  ],
15728
16599
  discriminator: [
15729
- 231,
15730
- 37,
15731
- 126,
15732
- 85,
16600
+ 18,
16601
+ 233,
16602
+ 158,
16603
+ 39,
16604
+ 185,
15733
16605
  207,
15734
- 91,
15735
- 63,
15736
- 52
16606
+ 58,
16607
+ 104
15737
16608
  ],
15738
16609
  accounts: [
15739
16610
  {
15740
- name: "fee_config",
16611
+ name: "authority",
16612
+ signer: true
16613
+ },
16614
+ {
16615
+ name: "global",
16616
+ pda: {
16617
+ seeds: [
16618
+ {
16619
+ kind: "const",
16620
+ value: [
16621
+ 103,
16622
+ 108,
16623
+ 111,
16624
+ 98,
16625
+ 97,
16626
+ 108
16627
+ ]
16628
+ }
16629
+ ],
16630
+ program: {
16631
+ kind: "const",
16632
+ value: [
16633
+ 1,
16634
+ 86,
16635
+ 224,
16636
+ 246,
16637
+ 147,
16638
+ 102,
16639
+ 90,
16640
+ 207,
16641
+ 68,
16642
+ 219,
16643
+ 21,
16644
+ 104,
16645
+ 191,
16646
+ 23,
16647
+ 91,
16648
+ 170,
16649
+ 81,
16650
+ 137,
16651
+ 203,
16652
+ 151,
16653
+ 245,
16654
+ 210,
16655
+ 255,
16656
+ 59,
16657
+ 101,
16658
+ 93,
16659
+ 43,
16660
+ 182,
16661
+ 253,
16662
+ 109,
16663
+ 24,
16664
+ 176
16665
+ ]
16666
+ }
16667
+ }
16668
+ },
16669
+ {
16670
+ name: "mint",
16671
+ relations: [
16672
+ "sharing_config"
16673
+ ]
16674
+ },
16675
+ {
16676
+ name: "sharing_config",
16677
+ writable: true,
15741
16678
  pda: {
15742
16679
  seeds: [
15743
16680
  {
15744
16681
  kind: "const",
15745
16682
  value: [
15746
- 102,
15747
- 101,
15748
- 101,
15749
- 95,
16683
+ 115,
16684
+ 104,
16685
+ 97,
16686
+ 114,
16687
+ 105,
16688
+ 110,
16689
+ 103,
16690
+ 45,
15750
16691
  99,
15751
16692
  111,
15752
16693
  110,
@@ -15757,59 +16698,69 @@ var pump_fees_default = {
15757
16698
  },
15758
16699
  {
15759
16700
  kind: "account",
15760
- path: "config_program_id"
16701
+ path: "mint"
15761
16702
  }
15762
16703
  ]
15763
16704
  }
15764
16705
  },
15765
16706
  {
15766
- name: "config_program_id"
15767
- }
15768
- ],
15769
- args: [
15770
- {
15771
- name: "is_pump_pool",
15772
- type: "bool"
15773
- },
15774
- {
15775
- name: "market_cap_lamports",
15776
- type: "u128"
16707
+ name: "event_authority",
16708
+ pda: {
16709
+ seeds: [
16710
+ {
16711
+ kind: "const",
16712
+ value: [
16713
+ 95,
16714
+ 95,
16715
+ 101,
16716
+ 118,
16717
+ 101,
16718
+ 110,
16719
+ 116,
16720
+ 95,
16721
+ 97,
16722
+ 117,
16723
+ 116,
16724
+ 104,
16725
+ 111,
16726
+ 114,
16727
+ 105,
16728
+ 116,
16729
+ 121
16730
+ ]
16731
+ }
16732
+ ]
16733
+ }
15777
16734
  },
15778
16735
  {
15779
- name: "trade_size_lamports",
15780
- type: "u64"
16736
+ name: "program"
15781
16737
  }
15782
16738
  ],
15783
- returns: {
15784
- defined: {
15785
- name: "Fees"
15786
- }
15787
- }
16739
+ args: []
15788
16740
  },
15789
16741
  {
15790
- name: "initialize_fee_config",
15791
- docs: [
15792
- "Initialize FeeConfig admin"
15793
- ],
16742
+ name: "set_authority",
15794
16743
  discriminator: [
15795
- 62,
15796
- 162,
15797
- 20,
15798
16744
  133,
15799
- 121,
15800
- 65,
15801
- 145,
15802
- 27
16745
+ 250,
16746
+ 37,
16747
+ 21,
16748
+ 110,
16749
+ 163,
16750
+ 26,
16751
+ 121
15803
16752
  ],
15804
16753
  accounts: [
15805
16754
  {
15806
- name: "admin",
16755
+ name: "authority",
15807
16756
  writable: true,
15808
16757
  signer: true,
15809
- address: "8LWu7QM2dGR1G8nKDHthckea57bkCzXyBTAKPJUBDHo8"
16758
+ relations: [
16759
+ "fee_program_global"
16760
+ ]
15810
16761
  },
15811
16762
  {
15812
- name: "fee_config",
16763
+ name: "fee_program_global",
15813
16764
  writable: true,
15814
16765
  pda: {
15815
16766
  seeds: [
@@ -15819,29 +16770,26 @@ var pump_fees_default = {
15819
16770
  102,
15820
16771
  101,
15821
16772
  101,
15822
- 95,
15823
- 99,
16773
+ 45,
16774
+ 112,
16775
+ 114,
15824
16776
  111,
15825
- 110,
15826
- 102,
15827
- 105,
15828
- 103
16777
+ 103,
16778
+ 114,
16779
+ 97,
16780
+ 109,
16781
+ 45,
16782
+ 103,
16783
+ 108,
16784
+ 111,
16785
+ 98,
16786
+ 97,
16787
+ 108
15829
16788
  ]
15830
- },
15831
- {
15832
- kind: "account",
15833
- path: "config_program_id"
15834
16789
  }
15835
16790
  ]
15836
16791
  }
15837
16792
  },
15838
- {
15839
- name: "system_program",
15840
- address: "11111111111111111111111111111111"
15841
- },
15842
- {
15843
- name: "config_program_id"
15844
- },
15845
16793
  {
15846
16794
  name: "event_authority",
15847
16795
  pda: {
@@ -15875,35 +16823,54 @@ var pump_fees_default = {
15875
16823
  name: "program"
15876
16824
  }
15877
16825
  ],
15878
- args: []
16826
+ args: [
16827
+ {
16828
+ name: "new_authority",
16829
+ type: "pubkey"
16830
+ }
16831
+ ]
15879
16832
  },
15880
16833
  {
15881
- name: "reset_fee_sharing_config",
15882
- docs: [
15883
- "Reset Fee Sharing Config, make sure to distribute all the fees before calling this"
15884
- ],
16834
+ name: "set_claim_rate_limit",
15885
16835
  discriminator: [
15886
- 10,
15887
- 2,
15888
- 182,
15889
- 95,
15890
- 16,
15891
- 127,
15892
- 129,
15893
- 186
16836
+ 185,
16837
+ 211,
16838
+ 159,
16839
+ 174,
16840
+ 212,
16841
+ 49,
16842
+ 88,
16843
+ 4
15894
16844
  ],
15895
16845
  accounts: [
15896
16846
  {
15897
16847
  name: "authority",
15898
- signer: true
16848
+ writable: true,
16849
+ signer: true,
16850
+ relations: [
16851
+ "fee_program_global"
16852
+ ]
15899
16853
  },
15900
16854
  {
15901
- name: "global",
16855
+ name: "fee_program_global",
16856
+ writable: true,
15902
16857
  pda: {
15903
16858
  seeds: [
15904
16859
  {
15905
16860
  kind: "const",
15906
16861
  value: [
16862
+ 102,
16863
+ 101,
16864
+ 101,
16865
+ 45,
16866
+ 112,
16867
+ 114,
16868
+ 111,
16869
+ 103,
16870
+ 114,
16871
+ 97,
16872
+ 109,
16873
+ 45,
15907
16874
  103,
15908
16875
  108,
15909
16876
  111,
@@ -15912,82 +16879,97 @@ var pump_fees_default = {
15912
16879
  108
15913
16880
  ]
15914
16881
  }
15915
- ],
15916
- program: {
15917
- kind: "const",
15918
- value: [
15919
- 1,
15920
- 86,
15921
- 224,
15922
- 246,
15923
- 147,
15924
- 102,
15925
- 90,
15926
- 207,
15927
- 68,
15928
- 219,
15929
- 21,
15930
- 104,
15931
- 191,
15932
- 23,
15933
- 91,
15934
- 170,
15935
- 81,
15936
- 137,
15937
- 203,
15938
- 151,
15939
- 245,
15940
- 210,
15941
- 255,
15942
- 59,
15943
- 101,
15944
- 93,
15945
- 43,
15946
- 182,
15947
- 253,
15948
- 109,
15949
- 24,
15950
- 176
15951
- ]
15952
- }
16882
+ ]
15953
16883
  }
15954
16884
  },
15955
16885
  {
15956
- name: "new_admin"
16886
+ name: "event_authority",
16887
+ pda: {
16888
+ seeds: [
16889
+ {
16890
+ kind: "const",
16891
+ value: [
16892
+ 95,
16893
+ 95,
16894
+ 101,
16895
+ 118,
16896
+ 101,
16897
+ 110,
16898
+ 116,
16899
+ 95,
16900
+ 97,
16901
+ 117,
16902
+ 116,
16903
+ 104,
16904
+ 111,
16905
+ 114,
16906
+ 105,
16907
+ 116,
16908
+ 121
16909
+ ]
16910
+ }
16911
+ ]
16912
+ }
15957
16913
  },
15958
16914
  {
15959
- name: "mint",
16915
+ name: "program"
16916
+ }
16917
+ ],
16918
+ args: [
16919
+ {
16920
+ name: "claim_rate_limit",
16921
+ type: "u64"
16922
+ }
16923
+ ]
16924
+ },
16925
+ {
16926
+ name: "set_disable_flags",
16927
+ discriminator: [
16928
+ 194,
16929
+ 217,
16930
+ 112,
16931
+ 35,
16932
+ 114,
16933
+ 222,
16934
+ 51,
16935
+ 190
16936
+ ],
16937
+ accounts: [
16938
+ {
16939
+ name: "authority",
16940
+ writable: true,
16941
+ signer: true,
15960
16942
  relations: [
15961
- "sharing_config"
16943
+ "fee_program_global"
15962
16944
  ]
15963
16945
  },
15964
16946
  {
15965
- name: "sharing_config",
16947
+ name: "fee_program_global",
15966
16948
  writable: true,
15967
16949
  pda: {
15968
16950
  seeds: [
15969
16951
  {
15970
16952
  kind: "const",
15971
16953
  value: [
15972
- 115,
15973
- 104,
15974
- 97,
16954
+ 102,
16955
+ 101,
16956
+ 101,
16957
+ 45,
16958
+ 112,
15975
16959
  114,
15976
- 105,
15977
- 110,
16960
+ 111,
15978
16961
  103,
16962
+ 114,
16963
+ 97,
16964
+ 109,
15979
16965
  45,
15980
- 99,
16966
+ 103,
16967
+ 108,
15981
16968
  111,
15982
- 110,
15983
- 102,
15984
- 105,
15985
- 103
16969
+ 98,
16970
+ 97,
16971
+ 108
15986
16972
  ]
15987
- },
15988
- {
15989
- kind: "account",
15990
- path: "mint"
15991
16973
  }
15992
16974
  ]
15993
16975
  }
@@ -16025,116 +17007,61 @@ var pump_fees_default = {
16025
17007
  name: "program"
16026
17008
  }
16027
17009
  ],
16028
- args: []
17010
+ args: [
17011
+ {
17012
+ name: "disable_flags",
17013
+ type: "u8"
17014
+ }
17015
+ ]
16029
17016
  },
16030
17017
  {
16031
- name: "revoke_fee_sharing_authority",
16032
- docs: [
16033
- "Revoke Fee Sharing Authority"
16034
- ],
17018
+ name: "set_social_claim_authority",
16035
17019
  discriminator: [
16036
- 18,
16037
- 233,
16038
- 158,
16039
- 39,
17020
+ 147,
17021
+ 54,
17022
+ 184,
17023
+ 154,
17024
+ 136,
17025
+ 237,
16040
17026
  185,
16041
- 207,
16042
- 58,
16043
- 104
17027
+ 153
16044
17028
  ],
16045
17029
  accounts: [
16046
17030
  {
16047
17031
  name: "authority",
16048
- signer: true
16049
- },
16050
- {
16051
- name: "global",
16052
- pda: {
16053
- seeds: [
16054
- {
16055
- kind: "const",
16056
- value: [
16057
- 103,
16058
- 108,
16059
- 111,
16060
- 98,
16061
- 97,
16062
- 108
16063
- ]
16064
- }
16065
- ],
16066
- program: {
16067
- kind: "const",
16068
- value: [
16069
- 1,
16070
- 86,
16071
- 224,
16072
- 246,
16073
- 147,
16074
- 102,
16075
- 90,
16076
- 207,
16077
- 68,
16078
- 219,
16079
- 21,
16080
- 104,
16081
- 191,
16082
- 23,
16083
- 91,
16084
- 170,
16085
- 81,
16086
- 137,
16087
- 203,
16088
- 151,
16089
- 245,
16090
- 210,
16091
- 255,
16092
- 59,
16093
- 101,
16094
- 93,
16095
- 43,
16096
- 182,
16097
- 253,
16098
- 109,
16099
- 24,
16100
- 176
16101
- ]
16102
- }
16103
- }
16104
- },
16105
- {
16106
- name: "mint",
17032
+ writable: true,
17033
+ signer: true,
16107
17034
  relations: [
16108
- "sharing_config"
17035
+ "fee_program_global"
16109
17036
  ]
16110
17037
  },
16111
17038
  {
16112
- name: "sharing_config",
17039
+ name: "fee_program_global",
16113
17040
  writable: true,
16114
17041
  pda: {
16115
17042
  seeds: [
16116
17043
  {
16117
17044
  kind: "const",
16118
17045
  value: [
16119
- 115,
16120
- 104,
16121
- 97,
17046
+ 102,
17047
+ 101,
17048
+ 101,
17049
+ 45,
17050
+ 112,
16122
17051
  114,
16123
- 105,
16124
- 110,
17052
+ 111,
16125
17053
  103,
17054
+ 114,
17055
+ 97,
17056
+ 109,
16126
17057
  45,
16127
- 99,
17058
+ 103,
17059
+ 108,
16128
17060
  111,
16129
- 110,
16130
- 102,
16131
- 105,
16132
- 103
17061
+ 98,
17062
+ 97,
17063
+ 108
16133
17064
  ]
16134
- },
16135
- {
16136
- kind: "account",
16137
- path: "mint"
16138
17065
  }
16139
17066
  ]
16140
17067
  }
@@ -16172,7 +17099,12 @@ var pump_fees_default = {
16172
17099
  name: "program"
16173
17100
  }
16174
17101
  ],
16175
- args: []
17102
+ args: [
17103
+ {
17104
+ name: "social_claim_authority",
17105
+ type: "pubkey"
17106
+ }
17107
+ ]
16176
17108
  },
16177
17109
  {
16178
17110
  name: "transfer_fee_sharing_authority",
@@ -17172,6 +18104,19 @@ var pump_fees_default = {
17172
18104
  155
17173
18105
  ]
17174
18106
  },
18107
+ {
18108
+ name: "FeeProgramGlobal",
18109
+ discriminator: [
18110
+ 162,
18111
+ 165,
18112
+ 245,
18113
+ 49,
18114
+ 29,
18115
+ 37,
18116
+ 55,
18117
+ 242
18118
+ ]
18119
+ },
17175
18120
  {
17176
18121
  name: "Global",
17177
18122
  discriminator: [
@@ -17210,6 +18155,19 @@ var pump_fees_default = {
17210
18155
  93,
17211
18156
  75
17212
18157
  ]
18158
+ },
18159
+ {
18160
+ name: "SocialFeePda",
18161
+ discriminator: [
18162
+ 139,
18163
+ 96,
18164
+ 53,
18165
+ 17,
18166
+ 42,
18167
+ 169,
18168
+ 206,
18169
+ 150
18170
+ ]
17213
18171
  }
17214
18172
  ],
17215
18173
  events: [
@@ -17239,6 +18197,19 @@ var pump_fees_default = {
17239
18197
  126
17240
18198
  ]
17241
18199
  },
18200
+ {
18201
+ name: "InitializeFeeProgramGlobalEvent",
18202
+ discriminator: [
18203
+ 40,
18204
+ 233,
18205
+ 156,
18206
+ 78,
18207
+ 95,
18208
+ 0,
18209
+ 8,
18210
+ 199
18211
+ ]
18212
+ },
17242
18213
  {
17243
18214
  name: "ResetFeeSharingConfigEvent",
17244
18215
  discriminator: [
@@ -17265,6 +18236,84 @@ var pump_fees_default = {
17265
18236
  62
17266
18237
  ]
17267
18238
  },
18239
+ {
18240
+ name: "SetAuthorityEvent",
18241
+ discriminator: [
18242
+ 18,
18243
+ 175,
18244
+ 132,
18245
+ 66,
18246
+ 208,
18247
+ 201,
18248
+ 87,
18249
+ 242
18250
+ ]
18251
+ },
18252
+ {
18253
+ name: "SetClaimRateLimitEvent",
18254
+ discriminator: [
18255
+ 13,
18256
+ 143,
18257
+ 143,
18258
+ 235,
18259
+ 181,
18260
+ 19,
18261
+ 51,
18262
+ 40
18263
+ ]
18264
+ },
18265
+ {
18266
+ name: "SetDisableFlagsEvent",
18267
+ discriminator: [
18268
+ 5,
18269
+ 8,
18270
+ 179,
18271
+ 65,
18272
+ 49,
18273
+ 55,
18274
+ 145,
18275
+ 126
18276
+ ]
18277
+ },
18278
+ {
18279
+ name: "SetSocialClaimAuthorityEvent",
18280
+ discriminator: [
18281
+ 60,
18282
+ 118,
18283
+ 127,
18284
+ 132,
18285
+ 239,
18286
+ 52,
18287
+ 254,
18288
+ 14
18289
+ ]
18290
+ },
18291
+ {
18292
+ name: "SocialFeePdaClaimed",
18293
+ discriminator: [
18294
+ 50,
18295
+ 18,
18296
+ 193,
18297
+ 65,
18298
+ 237,
18299
+ 210,
18300
+ 234,
18301
+ 236
18302
+ ]
18303
+ },
18304
+ {
18305
+ name: "SocialFeePdaCreated",
18306
+ discriminator: [
18307
+ 183,
18308
+ 183,
18309
+ 218,
18310
+ 147,
18311
+ 24,
18312
+ 124,
18313
+ 137,
18314
+ 169
18315
+ ]
18316
+ },
17268
18317
  {
17269
18318
  name: "TransferFeeSharingAuthorityEvent",
17270
18319
  discriminator: [
@@ -17436,6 +18485,16 @@ var pump_fees_default = {
17436
18485
  code: 6020,
17437
18486
  name: "ShareholderAccountMismatch",
17438
18487
  msg: "Remaining account key doesn't match shareholder address"
18488
+ },
18489
+ {
18490
+ code: 6021,
18491
+ name: "FeatureDeactivated",
18492
+ msg: "Feature is currently deactivated"
18493
+ },
18494
+ {
18495
+ code: 6022,
18496
+ name: "UserIdTooLong",
18497
+ msg: "User ID exceeds maximum length"
17439
18498
  }
17440
18499
  ],
17441
18500
  types: [
@@ -17591,6 +18650,43 @@ var pump_fees_default = {
17591
18650
  ]
17592
18651
  }
17593
18652
  },
18653
+ {
18654
+ name: "FeeProgramGlobal",
18655
+ type: {
18656
+ kind: "struct",
18657
+ fields: [
18658
+ {
18659
+ name: "bump",
18660
+ type: "u8"
18661
+ },
18662
+ {
18663
+ name: "authority",
18664
+ type: "pubkey"
18665
+ },
18666
+ {
18667
+ name: "disable_flags",
18668
+ type: "u8"
18669
+ },
18670
+ {
18671
+ name: "social_claim_authority",
18672
+ type: "pubkey"
18673
+ },
18674
+ {
18675
+ name: "claim_rate_limit",
18676
+ type: "u64"
18677
+ },
18678
+ {
18679
+ name: "_reserved",
18680
+ type: {
18681
+ array: [
18682
+ "u8",
18683
+ 256
18684
+ ]
18685
+ }
18686
+ }
18687
+ ]
18688
+ }
18689
+ },
17594
18690
  {
17595
18691
  name: "FeeTier",
17596
18692
  type: {
@@ -17749,6 +18845,34 @@ var pump_fees_default = {
17749
18845
  ]
17750
18846
  }
17751
18847
  },
18848
+ {
18849
+ name: "InitializeFeeProgramGlobalEvent",
18850
+ type: {
18851
+ kind: "struct",
18852
+ fields: [
18853
+ {
18854
+ name: "timestamp",
18855
+ type: "i64"
18856
+ },
18857
+ {
18858
+ name: "authority",
18859
+ type: "pubkey"
18860
+ },
18861
+ {
18862
+ name: "social_claim_authority",
18863
+ type: "pubkey"
18864
+ },
18865
+ {
18866
+ name: "disable_flags",
18867
+ type: "u8"
18868
+ },
18869
+ {
18870
+ name: "claim_rate_limit",
18871
+ type: "u64"
18872
+ }
18873
+ ]
18874
+ }
18875
+ },
17752
18876
  {
17753
18877
  name: "Pool",
17754
18878
  type: {
@@ -17873,6 +18997,74 @@ var pump_fees_default = {
17873
18997
  ]
17874
18998
  }
17875
18999
  },
19000
+ {
19001
+ name: "SetAuthorityEvent",
19002
+ type: {
19003
+ kind: "struct",
19004
+ fields: [
19005
+ {
19006
+ name: "timestamp",
19007
+ type: "i64"
19008
+ },
19009
+ {
19010
+ name: "old_authority",
19011
+ type: "pubkey"
19012
+ },
19013
+ {
19014
+ name: "new_authority",
19015
+ type: "pubkey"
19016
+ }
19017
+ ]
19018
+ }
19019
+ },
19020
+ {
19021
+ name: "SetClaimRateLimitEvent",
19022
+ type: {
19023
+ kind: "struct",
19024
+ fields: [
19025
+ {
19026
+ name: "timestamp",
19027
+ type: "i64"
19028
+ },
19029
+ {
19030
+ name: "claim_rate_limit",
19031
+ type: "u64"
19032
+ }
19033
+ ]
19034
+ }
19035
+ },
19036
+ {
19037
+ name: "SetDisableFlagsEvent",
19038
+ type: {
19039
+ kind: "struct",
19040
+ fields: [
19041
+ {
19042
+ name: "timestamp",
19043
+ type: "i64"
19044
+ },
19045
+ {
19046
+ name: "disable_flags",
19047
+ type: "u8"
19048
+ }
19049
+ ]
19050
+ }
19051
+ },
19052
+ {
19053
+ name: "SetSocialClaimAuthorityEvent",
19054
+ type: {
19055
+ kind: "struct",
19056
+ fields: [
19057
+ {
19058
+ name: "timestamp",
19059
+ type: "i64"
19060
+ },
19061
+ {
19062
+ name: "social_claim_authority",
19063
+ type: "pubkey"
19064
+ }
19065
+ ]
19066
+ }
19067
+ },
17876
19068
  {
17877
19069
  name: "Shareholder",
17878
19070
  type: {
@@ -17935,6 +19127,134 @@ var pump_fees_default = {
17935
19127
  ]
17936
19128
  }
17937
19129
  },
19130
+ {
19131
+ name: "SocialFeePda",
19132
+ docs: [
19133
+ "Platform identifier: 0=pump, 1=twitter, etc."
19134
+ ],
19135
+ type: {
19136
+ kind: "struct",
19137
+ fields: [
19138
+ {
19139
+ name: "bump",
19140
+ type: "u8"
19141
+ },
19142
+ {
19143
+ name: "version",
19144
+ type: "u8"
19145
+ },
19146
+ {
19147
+ name: "user_id",
19148
+ docs: [
19149
+ "Max 20 characters to fit u64::MAX (18,446,744,073,709,551,615) as a string.",
19150
+ "Actual storage: 4 bytes (length prefix) + 20 bytes (content) = 24 bytes."
19151
+ ],
19152
+ type: "string"
19153
+ },
19154
+ {
19155
+ name: "platform",
19156
+ type: "u8"
19157
+ },
19158
+ {
19159
+ name: "total_claimed",
19160
+ type: "u64"
19161
+ },
19162
+ {
19163
+ name: "last_claimed",
19164
+ type: "u64"
19165
+ },
19166
+ {
19167
+ name: "_reserved",
19168
+ type: {
19169
+ array: [
19170
+ "u8",
19171
+ 128
19172
+ ]
19173
+ }
19174
+ }
19175
+ ]
19176
+ }
19177
+ },
19178
+ {
19179
+ name: "SocialFeePdaClaimed",
19180
+ type: {
19181
+ kind: "struct",
19182
+ fields: [
19183
+ {
19184
+ name: "timestamp",
19185
+ type: "i64"
19186
+ },
19187
+ {
19188
+ name: "user_id",
19189
+ type: "string"
19190
+ },
19191
+ {
19192
+ name: "platform",
19193
+ type: "u8"
19194
+ },
19195
+ {
19196
+ name: "social_fee_pda",
19197
+ type: "pubkey"
19198
+ },
19199
+ {
19200
+ name: "recipient",
19201
+ type: "pubkey"
19202
+ },
19203
+ {
19204
+ name: "social_claim_authority",
19205
+ type: "pubkey"
19206
+ },
19207
+ {
19208
+ name: "amount_claimed",
19209
+ type: "u64"
19210
+ },
19211
+ {
19212
+ name: "claimable_before",
19213
+ type: "u64"
19214
+ },
19215
+ {
19216
+ name: "lifetime_claimed",
19217
+ type: "u64"
19218
+ },
19219
+ {
19220
+ name: "recipient_balance_before",
19221
+ type: "u64"
19222
+ },
19223
+ {
19224
+ name: "recipient_balance_after",
19225
+ type: "u64"
19226
+ }
19227
+ ]
19228
+ }
19229
+ },
19230
+ {
19231
+ name: "SocialFeePdaCreated",
19232
+ type: {
19233
+ kind: "struct",
19234
+ fields: [
19235
+ {
19236
+ name: "timestamp",
19237
+ type: "i64"
19238
+ },
19239
+ {
19240
+ name: "user_id",
19241
+ type: "string"
19242
+ },
19243
+ {
19244
+ name: "platform",
19245
+ type: "u8"
19246
+ },
19247
+ {
19248
+ name: "social_fee_pda",
19249
+ type: "pubkey"
19250
+ },
19251
+ {
19252
+ name: "created_by",
19253
+ type: "pubkey"
19254
+ }
19255
+ ]
19256
+ }
19257
+ },
17938
19258
  {
17939
19259
  name: "TransferFeeSharingAuthorityEvent",
17940
19260
  type: {
@@ -18089,28 +19409,533 @@ var pump_fees_default = {
18089
19409
  ]
18090
19410
  }
18091
19411
  }
18092
- ],
18093
- constants: [
18094
- {
18095
- name: "FEE_CONFIG_SEED",
18096
- type: "bytes",
18097
- value: "[102, 101, 101, 95, 99, 111, 110, 102, 105, 103]"
18098
- },
18099
- {
18100
- name: "SHARING_CONFIG_SEED",
18101
- type: {
18102
- array: [
18103
- "u8",
18104
- 14
18105
- ]
18106
- },
18107
- value: "[115, 104, 97, 114, 105, 110, 103, 45, 99, 111, 110, 102, 105, 103]"
19412
+ ],
19413
+ constants: [
19414
+ {
19415
+ name: "FEE_CONFIG_SEED",
19416
+ type: "bytes",
19417
+ value: "[102, 101, 101, 95, 99, 111, 110, 102, 105, 103]"
19418
+ },
19419
+ {
19420
+ name: "FEE_PROGRAM_GLOBAL_SEED",
19421
+ type: {
19422
+ array: [
19423
+ "u8",
19424
+ 18
19425
+ ]
19426
+ },
19427
+ value: "[102, 101, 101, 45, 112, 114, 111, 103, 114, 97, 109, 45, 103, 108, 111, 98, 97, 108]"
19428
+ },
19429
+ {
19430
+ name: "PUMP_GLOBAL_SEED",
19431
+ docs: [
19432
+ "Bonding Curve Program Global Seed"
19433
+ ],
19434
+ type: {
19435
+ array: [
19436
+ "u8",
19437
+ 6
19438
+ ]
19439
+ },
19440
+ value: "[103, 108, 111, 98, 97, 108]"
19441
+ },
19442
+ {
19443
+ name: "SHARING_CONFIG_SEED",
19444
+ type: {
19445
+ array: [
19446
+ "u8",
19447
+ 14
19448
+ ]
19449
+ },
19450
+ value: "[115, 104, 97, 114, 105, 110, 103, 45, 99, 111, 110, 102, 105, 103]"
19451
+ },
19452
+ {
19453
+ name: "SOCIAL_FEE_PDA_SEED",
19454
+ type: {
19455
+ array: [
19456
+ "u8",
19457
+ 14
19458
+ ]
19459
+ },
19460
+ value: "[115, 111, 99, 105, 97, 108, 45, 102, 101, 101, 45, 112, 100, 97]"
19461
+ }
19462
+ ]
19463
+ };
19464
+
19465
+ // src/onlineSdk.ts
19466
+ var import_pump_swap_sdk = require("@pump-fun/pump-swap-sdk");
19467
+ var import_spl_token = require("@solana/spl-token");
19468
+ var import_web33 = require("@solana/web3.js");
19469
+ var import_bn4 = __toESM(require("bn.js"));
19470
+
19471
+ // src/tokenIncentives.ts
19472
+ var import_bn3 = __toESM(require("bn.js"));
19473
+ function totalUnclaimedTokens(globalVolumeAccumulator, userVolumeAccumulator, currentTimestamp = Date.now() / 1e3) {
19474
+ const { startTime, endTime, secondsInADay, totalTokenSupply, solVolumes } = globalVolumeAccumulator;
19475
+ const { totalUnclaimedTokens: totalUnclaimedTokens2, currentSolVolume, lastUpdateTimestamp } = userVolumeAccumulator;
19476
+ const result = totalUnclaimedTokens2;
19477
+ if (startTime.eqn(0) || endTime.eqn(0) || secondsInADay.eqn(0)) {
19478
+ return result;
19479
+ }
19480
+ const currentTimestampBn = new import_bn3.default(currentTimestamp);
19481
+ if (currentTimestampBn.lt(startTime)) {
19482
+ return result;
19483
+ }
19484
+ const currentDayIndex = currentTimestampBn.sub(startTime).div(secondsInADay).toNumber();
19485
+ if (lastUpdateTimestamp.lt(startTime)) {
19486
+ return result;
19487
+ }
19488
+ const lastUpdatedIndex = lastUpdateTimestamp.sub(startTime).div(secondsInADay).toNumber();
19489
+ if (endTime.lt(startTime)) {
19490
+ return result;
19491
+ }
19492
+ const endDayIndex = endTime.sub(startTime).div(secondsInADay).toNumber();
19493
+ if (currentDayIndex > lastUpdatedIndex && lastUpdatedIndex <= endDayIndex) {
19494
+ const lastUpdatedDayTokenSupply = totalTokenSupply[lastUpdatedIndex];
19495
+ const lastUpdatedDaySolVolume = solVolumes[lastUpdatedIndex];
19496
+ if (lastUpdatedDaySolVolume.eqn(0)) {
19497
+ return result;
19498
+ }
19499
+ return result.add(
19500
+ currentSolVolume.mul(lastUpdatedDayTokenSupply).div(lastUpdatedDaySolVolume)
19501
+ );
19502
+ }
19503
+ return result;
19504
+ }
19505
+ function currentDayTokens(globalVolumeAccumulator, userVolumeAccumulator, currentTimestamp = Date.now() / 1e3) {
19506
+ const { startTime, endTime, secondsInADay, totalTokenSupply, solVolumes } = globalVolumeAccumulator;
19507
+ const { currentSolVolume, lastUpdateTimestamp } = userVolumeAccumulator;
19508
+ if (startTime.eqn(0) || endTime.eqn(0) || secondsInADay.eqn(0)) {
19509
+ return new import_bn3.default(0);
19510
+ }
19511
+ const currentTimestampBn = new import_bn3.default(currentTimestamp);
19512
+ if (currentTimestampBn.lt(startTime) || currentTimestampBn.gt(endTime)) {
19513
+ return new import_bn3.default(0);
19514
+ }
19515
+ const currentDayIndex = currentTimestampBn.sub(startTime).div(secondsInADay).toNumber();
19516
+ if (lastUpdateTimestamp.lt(startTime)) {
19517
+ return new import_bn3.default(0);
19518
+ }
19519
+ const lastUpdatedIndex = lastUpdateTimestamp.sub(startTime).div(secondsInADay).toNumber();
19520
+ if (endTime.lt(startTime)) {
19521
+ return new import_bn3.default(0);
19522
+ }
19523
+ if (currentDayIndex !== lastUpdatedIndex) {
19524
+ return new import_bn3.default(0);
19525
+ }
19526
+ const currentDayTokenSupply = totalTokenSupply[currentDayIndex];
19527
+ const currentDaySolVolume = solVolumes[currentDayIndex];
19528
+ if (currentDaySolVolume.eqn(0)) {
19529
+ return new import_bn3.default(0);
19530
+ }
19531
+ return currentSolVolume.mul(currentDayTokenSupply).div(currentDaySolVolume);
19532
+ }
19533
+
19534
+ // src/onlineSdk.ts
19535
+ var OFFLINE_PUMP_PROGRAM = getPumpProgram(null);
19536
+ var OnlinePumpSdk = class {
19537
+ constructor(connection) {
19538
+ this.connection = connection;
19539
+ this.pumpProgram = getPumpProgram(connection);
19540
+ this.offlinePumpProgram = OFFLINE_PUMP_PROGRAM;
19541
+ this.pumpAmmProgram = getPumpAmmProgram(connection);
19542
+ this.pumpAmmSdk = new import_pump_swap_sdk.OnlinePumpAmmSdk(connection);
19543
+ this.pumpAmmAdminSdk = new import_pump_swap_sdk.PumpAmmAdminSdk(connection);
19544
+ }
19545
+ async fetchGlobal() {
19546
+ return await this.pumpProgram.account.global.fetch(GLOBAL_PDA);
19547
+ }
19548
+ async fetchFeeConfig() {
19549
+ return await this.pumpProgram.account.feeConfig.fetch(PUMP_FEE_CONFIG_PDA);
19550
+ }
19551
+ async fetchBondingCurve(mint) {
19552
+ return await this.pumpProgram.account.bondingCurve.fetch(
19553
+ bondingCurvePda(mint)
19554
+ );
19555
+ }
19556
+ async fetchBuyState(mint, user, tokenProgram = import_spl_token.TOKEN_PROGRAM_ID) {
19557
+ const [bondingCurveAccountInfo, associatedUserAccountInfo] = await this.connection.getMultipleAccountsInfo([
19558
+ bondingCurvePda(mint),
19559
+ (0, import_spl_token.getAssociatedTokenAddressSync)(mint, user, true, tokenProgram)
19560
+ ]);
19561
+ if (!bondingCurveAccountInfo) {
19562
+ throw new Error(
19563
+ `Bonding curve account not found for mint: ${mint.toBase58()}`
19564
+ );
19565
+ }
19566
+ const bondingCurve = PUMP_SDK.decodeBondingCurve(bondingCurveAccountInfo);
19567
+ return { bondingCurveAccountInfo, bondingCurve, associatedUserAccountInfo };
19568
+ }
19569
+ async fetchSellState(mint, user, tokenProgram = import_spl_token.TOKEN_PROGRAM_ID) {
19570
+ const [bondingCurveAccountInfo, associatedUserAccountInfo] = await this.connection.getMultipleAccountsInfo([
19571
+ bondingCurvePda(mint),
19572
+ (0, import_spl_token.getAssociatedTokenAddressSync)(mint, user, true, tokenProgram)
19573
+ ]);
19574
+ if (!bondingCurveAccountInfo) {
19575
+ throw new Error(
19576
+ `Bonding curve account not found for mint: ${mint.toBase58()}`
19577
+ );
19578
+ }
19579
+ if (!associatedUserAccountInfo) {
19580
+ throw new Error(
19581
+ `Associated token account not found for mint: ${mint.toBase58()} and user: ${user.toBase58()}`
19582
+ );
19583
+ }
19584
+ const bondingCurve = PUMP_SDK.decodeBondingCurve(bondingCurveAccountInfo);
19585
+ return { bondingCurveAccountInfo, bondingCurve };
19586
+ }
19587
+ async fetchGlobalVolumeAccumulator() {
19588
+ return await this.pumpProgram.account.globalVolumeAccumulator.fetch(
19589
+ GLOBAL_VOLUME_ACCUMULATOR_PDA
19590
+ );
19591
+ }
19592
+ async fetchUserVolumeAccumulator(user) {
19593
+ return await this.pumpProgram.account.userVolumeAccumulator.fetchNullable(
19594
+ userVolumeAccumulatorPda(user)
19595
+ );
19596
+ }
19597
+ async fetchUserVolumeAccumulatorTotalStats(user) {
19598
+ const userVolumeAccumulator = await this.fetchUserVolumeAccumulator(
19599
+ user
19600
+ ) ?? {
19601
+ totalUnclaimedTokens: new import_bn4.default(0),
19602
+ totalClaimedTokens: new import_bn4.default(0),
19603
+ currentSolVolume: new import_bn4.default(0)
19604
+ };
19605
+ const userVolumeAccumulatorAmm = await this.pumpAmmSdk.fetchUserVolumeAccumulator(user) ?? {
19606
+ totalUnclaimedTokens: new import_bn4.default(0),
19607
+ totalClaimedTokens: new import_bn4.default(0),
19608
+ currentSolVolume: new import_bn4.default(0)
19609
+ };
19610
+ return {
19611
+ totalUnclaimedTokens: userVolumeAccumulator.totalUnclaimedTokens.add(
19612
+ userVolumeAccumulatorAmm.totalUnclaimedTokens
19613
+ ),
19614
+ totalClaimedTokens: userVolumeAccumulator.totalClaimedTokens.add(
19615
+ userVolumeAccumulatorAmm.totalClaimedTokens
19616
+ ),
19617
+ currentSolVolume: userVolumeAccumulator.currentSolVolume.add(
19618
+ userVolumeAccumulatorAmm.currentSolVolume
19619
+ )
19620
+ };
19621
+ }
19622
+ async collectCoinCreatorFeeInstructions(coinCreator, feePayer) {
19623
+ const quoteMint = import_spl_token.NATIVE_MINT;
19624
+ const quoteTokenProgram = import_spl_token.TOKEN_PROGRAM_ID;
19625
+ const coinCreatorVaultAuthority = (0, import_pump_swap_sdk.coinCreatorVaultAuthorityPda)(coinCreator);
19626
+ const coinCreatorVaultAta = (0, import_pump_swap_sdk.coinCreatorVaultAtaPda)(
19627
+ coinCreatorVaultAuthority,
19628
+ quoteMint,
19629
+ quoteTokenProgram
19630
+ );
19631
+ const coinCreatorTokenAccount = (0, import_spl_token.getAssociatedTokenAddressSync)(
19632
+ quoteMint,
19633
+ coinCreator,
19634
+ true,
19635
+ quoteTokenProgram
19636
+ );
19637
+ const [coinCreatorVaultAtaAccountInfo, coinCreatorTokenAccountInfo] = await this.connection.getMultipleAccountsInfo([
19638
+ coinCreatorVaultAta,
19639
+ coinCreatorTokenAccount
19640
+ ]);
19641
+ return [
19642
+ await this.offlinePumpProgram.methods.collectCreatorFee().accountsPartial({
19643
+ creator: coinCreator
19644
+ }).instruction(),
19645
+ ...await import_pump_swap_sdk.PUMP_AMM_SDK.collectCoinCreatorFee(
19646
+ {
19647
+ coinCreator,
19648
+ quoteMint,
19649
+ quoteTokenProgram,
19650
+ coinCreatorVaultAuthority,
19651
+ coinCreatorVaultAta,
19652
+ coinCreatorTokenAccount,
19653
+ coinCreatorVaultAtaAccountInfo,
19654
+ coinCreatorTokenAccountInfo
19655
+ },
19656
+ feePayer
19657
+ )
19658
+ ];
19659
+ }
19660
+ async adminSetCoinCreatorInstructions(newCoinCreator, mint) {
19661
+ const global = await this.fetchGlobal();
19662
+ return [
19663
+ await this.offlinePumpProgram.methods.adminSetCreator(newCoinCreator).accountsPartial({
19664
+ adminSetCreatorAuthority: global.adminSetCreatorAuthority,
19665
+ mint
19666
+ }).instruction(),
19667
+ await this.pumpAmmAdminSdk.adminSetCoinCreator(mint, newCoinCreator)
19668
+ ];
19669
+ }
19670
+ async getCreatorVaultBalance(creator) {
19671
+ const creatorVault = creatorVaultPda(creator);
19672
+ const accountInfo = await this.connection.getAccountInfo(creatorVault);
19673
+ if (accountInfo === null) {
19674
+ return new import_bn4.default(0);
19675
+ }
19676
+ const rentExemptionLamports = await this.connection.getMinimumBalanceForRentExemption(
19677
+ accountInfo.data.length
19678
+ );
19679
+ if (accountInfo.lamports < rentExemptionLamports) {
19680
+ return new import_bn4.default(0);
19681
+ }
19682
+ return new import_bn4.default(accountInfo.lamports - rentExemptionLamports);
19683
+ }
19684
+ async getCreatorVaultBalanceBothPrograms(creator) {
19685
+ const balance = await this.getCreatorVaultBalance(creator);
19686
+ const ammBalance = await this.pumpAmmSdk.getCoinCreatorVaultBalance(creator);
19687
+ return balance.add(ammBalance);
19688
+ }
19689
+ async adminUpdateTokenIncentives(startTime, endTime, dayNumber, tokenSupplyPerDay, secondsInADay = new import_bn4.default(86400), mint = PUMP_TOKEN_MINT, tokenProgram = import_spl_token.TOKEN_2022_PROGRAM_ID) {
19690
+ const { authority } = await this.fetchGlobal();
19691
+ return await this.offlinePumpProgram.methods.adminUpdateTokenIncentives(
19692
+ startTime,
19693
+ endTime,
19694
+ secondsInADay,
19695
+ dayNumber,
19696
+ tokenSupplyPerDay
19697
+ ).accountsPartial({
19698
+ authority,
19699
+ mint,
19700
+ tokenProgram
19701
+ }).instruction();
19702
+ }
19703
+ async adminUpdateTokenIncentivesBothPrograms(startTime, endTime, dayNumber, tokenSupplyPerDay, secondsInADay = new import_bn4.default(86400), mint = PUMP_TOKEN_MINT, tokenProgram = import_spl_token.TOKEN_2022_PROGRAM_ID) {
19704
+ return [
19705
+ await this.adminUpdateTokenIncentives(
19706
+ startTime,
19707
+ endTime,
19708
+ dayNumber,
19709
+ tokenSupplyPerDay,
19710
+ secondsInADay,
19711
+ mint,
19712
+ tokenProgram
19713
+ ),
19714
+ await this.pumpAmmAdminSdk.adminUpdateTokenIncentives(
19715
+ startTime,
19716
+ endTime,
19717
+ dayNumber,
19718
+ tokenSupplyPerDay,
19719
+ secondsInADay,
19720
+ mint,
19721
+ tokenProgram
19722
+ )
19723
+ ];
19724
+ }
19725
+ async claimTokenIncentives(user, payer) {
19726
+ const { mint } = await this.fetchGlobalVolumeAccumulator();
19727
+ if (mint.equals(import_web33.PublicKey.default)) {
19728
+ return [];
19729
+ }
19730
+ const [mintAccountInfo, userAccumulatorAccountInfo] = await this.connection.getMultipleAccountsInfo([
19731
+ mint,
19732
+ userVolumeAccumulatorPda(user)
19733
+ ]);
19734
+ if (!mintAccountInfo) {
19735
+ return [];
19736
+ }
19737
+ if (!userAccumulatorAccountInfo) {
19738
+ return [];
19739
+ }
19740
+ return [
19741
+ await this.offlinePumpProgram.methods.claimTokenIncentives().accountsPartial({
19742
+ user,
19743
+ payer,
19744
+ mint,
19745
+ tokenProgram: mintAccountInfo.owner
19746
+ }).instruction()
19747
+ ];
19748
+ }
19749
+ async claimTokenIncentivesBothPrograms(user, payer) {
19750
+ return [
19751
+ ...await this.claimTokenIncentives(user, payer),
19752
+ ...await this.pumpAmmSdk.claimTokenIncentives(user, payer)
19753
+ ];
19754
+ }
19755
+ async getTotalUnclaimedTokens(user) {
19756
+ const [
19757
+ globalVolumeAccumulatorAccountInfo,
19758
+ userVolumeAccumulatorAccountInfo
19759
+ ] = await this.connection.getMultipleAccountsInfo([
19760
+ GLOBAL_VOLUME_ACCUMULATOR_PDA,
19761
+ userVolumeAccumulatorPda(user)
19762
+ ]);
19763
+ if (!globalVolumeAccumulatorAccountInfo || !userVolumeAccumulatorAccountInfo) {
19764
+ return new import_bn4.default(0);
19765
+ }
19766
+ const globalVolumeAccumulator = PUMP_SDK.decodeGlobalVolumeAccumulator(
19767
+ globalVolumeAccumulatorAccountInfo
19768
+ );
19769
+ const userVolumeAccumulator = PUMP_SDK.decodeUserVolumeAccumulator(
19770
+ userVolumeAccumulatorAccountInfo
19771
+ );
19772
+ return totalUnclaimedTokens(globalVolumeAccumulator, userVolumeAccumulator);
19773
+ }
19774
+ async getTotalUnclaimedTokensBothPrograms(user) {
19775
+ return (await this.getTotalUnclaimedTokens(user)).add(
19776
+ await this.pumpAmmSdk.getTotalUnclaimedTokens(user)
19777
+ );
19778
+ }
19779
+ async getCurrentDayTokens(user) {
19780
+ const [
19781
+ globalVolumeAccumulatorAccountInfo,
19782
+ userVolumeAccumulatorAccountInfo
19783
+ ] = await this.connection.getMultipleAccountsInfo([
19784
+ GLOBAL_VOLUME_ACCUMULATOR_PDA,
19785
+ userVolumeAccumulatorPda(user)
19786
+ ]);
19787
+ if (!globalVolumeAccumulatorAccountInfo || !userVolumeAccumulatorAccountInfo) {
19788
+ return new import_bn4.default(0);
19789
+ }
19790
+ const globalVolumeAccumulator = PUMP_SDK.decodeGlobalVolumeAccumulator(
19791
+ globalVolumeAccumulatorAccountInfo
19792
+ );
19793
+ const userVolumeAccumulator = PUMP_SDK.decodeUserVolumeAccumulator(
19794
+ userVolumeAccumulatorAccountInfo
19795
+ );
19796
+ return currentDayTokens(globalVolumeAccumulator, userVolumeAccumulator);
19797
+ }
19798
+ async getCurrentDayTokensBothPrograms(user) {
19799
+ return (await this.getCurrentDayTokens(user)).add(
19800
+ await this.pumpAmmSdk.getCurrentDayTokens(user)
19801
+ );
19802
+ }
19803
+ async syncUserVolumeAccumulatorBothPrograms(user) {
19804
+ return [
19805
+ await PUMP_SDK.syncUserVolumeAccumulator(user),
19806
+ await import_pump_swap_sdk.PUMP_AMM_SDK.syncUserVolumeAccumulator(user)
19807
+ ];
19808
+ }
19809
+ /**
19810
+ * Gets the minimum distributable fee for a token's fee sharing configuration.
19811
+ *
19812
+ * This method handles both graduated (AMM) and non-graduated (bonding curve) tokens.
19813
+ * For graduated tokens, it automatically consolidates fees from the AMM vault before
19814
+ * calculating the minimum distributable fee.
19815
+ *
19816
+ * @param mint - The mint address of the token
19817
+ * @param simulationSigner - Optional signer address for transaction simulation.
19818
+ * Must have a non-zero SOL balance. Defaults to a known funded address.
19819
+ * @returns The minimum distributable fee information including whether distribution is possible
19820
+ */
19821
+ async getMinimumDistributableFee(mint, simulationSigner = new import_web33.PublicKey(
19822
+ "UqN2p5bAzBqYdHXcgB6WLtuVrdvmy9JSAtgqZb3CMKw"
19823
+ )) {
19824
+ const sharingConfigPubkey = feeSharingConfigPda(mint);
19825
+ const poolAddress = canonicalPumpPoolPda(mint);
19826
+ const coinCreatorVaultAuthority = (0, import_pump_swap_sdk.coinCreatorVaultAuthorityPda)(sharingConfigPubkey);
19827
+ const ammVaultAta = (0, import_pump_swap_sdk.coinCreatorVaultAtaPda)(
19828
+ coinCreatorVaultAuthority,
19829
+ import_spl_token.NATIVE_MINT,
19830
+ import_spl_token.TOKEN_PROGRAM_ID
19831
+ );
19832
+ const [sharingConfigAccountInfo, poolAccountInfo, ammVaultAtaInfo] = await this.connection.getMultipleAccountsInfo([
19833
+ sharingConfigPubkey,
19834
+ poolAddress,
19835
+ ammVaultAta
19836
+ ]);
19837
+ if (!sharingConfigAccountInfo) {
19838
+ throw new Error(`Sharing config not found for mint: ${mint.toBase58()}`);
19839
+ }
19840
+ const sharingConfig = PUMP_SDK.decodeSharingConfig(
19841
+ sharingConfigAccountInfo
19842
+ );
19843
+ const instructions = [];
19844
+ const isGraduated = poolAccountInfo !== null;
19845
+ if (isGraduated && ammVaultAtaInfo) {
19846
+ const transferCreatorFeesToPumpIx = await this.pumpAmmProgram.methods.transferCreatorFeesToPump().accountsPartial({
19847
+ wsolMint: import_spl_token.NATIVE_MINT,
19848
+ tokenProgram: import_spl_token.TOKEN_PROGRAM_ID,
19849
+ coinCreator: sharingConfigPubkey
19850
+ }).instruction();
19851
+ instructions.push(transferCreatorFeesToPumpIx);
19852
+ }
19853
+ const getMinFeeIx = await PUMP_SDK.getMinimumDistributableFee({
19854
+ mint,
19855
+ sharingConfig,
19856
+ sharingConfigAddress: sharingConfigPubkey
19857
+ });
19858
+ instructions.push(getMinFeeIx);
19859
+ const { blockhash } = await this.connection.getLatestBlockhash();
19860
+ const tx = new import_web33.VersionedTransaction(
19861
+ new import_web33.TransactionMessage({
19862
+ payerKey: simulationSigner,
19863
+ recentBlockhash: blockhash,
19864
+ instructions
19865
+ }).compileToV0Message()
19866
+ );
19867
+ const result = await this.connection.simulateTransaction(tx);
19868
+ let minimumDistributableFee = {
19869
+ minimumRequired: new import_bn4.default(0),
19870
+ distributableFees: new import_bn4.default(0),
19871
+ canDistribute: false
19872
+ };
19873
+ if (!result.value.err) {
19874
+ const [data, encoding] = result.value.returnData?.data ?? [];
19875
+ if (data) {
19876
+ const buffer = Buffer.from(data, encoding);
19877
+ minimumDistributableFee = PUMP_SDK.decodeMinimumDistributableFee(buffer);
19878
+ }
19879
+ }
19880
+ return {
19881
+ ...minimumDistributableFee,
19882
+ isGraduated
19883
+ };
19884
+ }
19885
+ /**
19886
+ * Gets the instructions to distribute creator fees for a token's fee sharing configuration.
19887
+ *
19888
+ * This method handles both graduated (AMM) and non-graduated (bonding curve) tokens.
19889
+ * For graduated tokens, it automatically includes an instruction to consolidate fees
19890
+ * from the AMM vault before distributing.
19891
+ *
19892
+ * @param mint - The mint address of the token
19893
+ * @returns The instructions to distribute creator fees and whether the token is graduated
19894
+ */
19895
+ async buildDistributeCreatorFeesInstructions(mint) {
19896
+ const sharingConfigPubkey = feeSharingConfigPda(mint);
19897
+ const poolAddress = canonicalPumpPoolPda(mint);
19898
+ const coinCreatorVaultAuthority = (0, import_pump_swap_sdk.coinCreatorVaultAuthorityPda)(sharingConfigPubkey);
19899
+ const ammVaultAta = (0, import_pump_swap_sdk.coinCreatorVaultAtaPda)(
19900
+ coinCreatorVaultAuthority,
19901
+ import_spl_token.NATIVE_MINT,
19902
+ import_spl_token.TOKEN_PROGRAM_ID
19903
+ );
19904
+ const [sharingConfigAccountInfo, poolAccountInfo, ammVaultAtaInfo] = await this.connection.getMultipleAccountsInfo([
19905
+ sharingConfigPubkey,
19906
+ poolAddress,
19907
+ ammVaultAta
19908
+ ]);
19909
+ if (!sharingConfigAccountInfo) {
19910
+ throw new Error(`Sharing config not found for mint: ${mint.toBase58()}`);
18108
19911
  }
18109
- ]
19912
+ const sharingConfig = PUMP_SDK.decodeSharingConfig(
19913
+ sharingConfigAccountInfo
19914
+ );
19915
+ const instructions = [];
19916
+ const isGraduated = poolAccountInfo !== null;
19917
+ if (isGraduated && ammVaultAtaInfo) {
19918
+ const transferCreatorFeesToPumpIx = await this.pumpAmmProgram.methods.transferCreatorFeesToPump().accountsPartial({
19919
+ wsolMint: import_spl_token.NATIVE_MINT,
19920
+ tokenProgram: import_spl_token.TOKEN_PROGRAM_ID,
19921
+ coinCreator: sharingConfigPubkey
19922
+ }).instruction();
19923
+ instructions.push(transferCreatorFeesToPumpIx);
19924
+ }
19925
+ const distributeCreatorFeesIx = await PUMP_SDK.distributeCreatorFees({
19926
+ mint,
19927
+ sharingConfig,
19928
+ sharingConfigAddress: sharingConfigPubkey
19929
+ });
19930
+ instructions.push(distributeCreatorFeesIx);
19931
+ return {
19932
+ instructions,
19933
+ isGraduated
19934
+ };
19935
+ }
18110
19936
  };
18111
19937
 
18112
19938
  // src/sdk.ts
18113
- var import_pump_swap_sdk2 = require("@pump-fun/pump-swap-sdk");
18114
19939
  function getPumpProgram(connection) {
18115
19940
  return new import_anchor.Program(
18116
19941
  pump_default,
@@ -18178,7 +20003,7 @@ var PumpSdk = class {
18178
20003
  }
18179
20004
  decodeBondingCurveNullable(accountInfo) {
18180
20005
  try {
18181
- let data = accountInfo.data;
20006
+ const data = accountInfo.data;
18182
20007
  if (data.length < 82) {
18183
20008
  const padded = Buffer.alloc(82);
18184
20009
  data.copy(padded);
@@ -18188,8 +20013,8 @@ var PumpSdk = class {
18188
20013
  };
18189
20014
  }
18190
20015
  return this.decodeBondingCurve(accountInfo);
18191
- } catch (e) {
18192
- console.warn("Failed to decode bonding curve", e);
20016
+ } catch (error) {
20017
+ console.warn("Failed to decode bonding curve", error);
18193
20018
  return null;
18194
20019
  }
18195
20020
  }
@@ -18208,8 +20033,8 @@ var PumpSdk = class {
18208
20033
  decodeUserVolumeAccumulatorNullable(accountInfo) {
18209
20034
  try {
18210
20035
  return this.decodeUserVolumeAccumulator(accountInfo);
18211
- } catch (e) {
18212
- console.warn("Failed to decode user volume accumulator", e);
20036
+ } catch (error) {
20037
+ console.warn("Failed to decode user volume accumulator", error);
18213
20038
  return null;
18214
20039
  }
18215
20040
  }
@@ -18243,9 +20068,10 @@ var PumpSdk = class {
18243
20068
  uri,
18244
20069
  creator,
18245
20070
  user,
18246
- mayhemMode
20071
+ mayhemMode,
20072
+ cashback = false
18247
20073
  }) {
18248
- return await this.offlinePumpProgram.methods.createV2(name, symbol, uri, creator, mayhemMode).accountsPartial({
20074
+ return await this.offlinePumpProgram.methods.createV2(name, symbol, uri, creator, mayhemMode, [cashback ?? false]).accountsPartial({
18249
20075
  mint,
18250
20076
  user,
18251
20077
  tokenProgram: import_spl_token2.TOKEN_2022_PROGRAM_ID,
@@ -18320,7 +20146,8 @@ var PumpSdk = class {
18320
20146
  user,
18321
20147
  amount,
18322
20148
  solAmount,
18323
- mayhemMode
20149
+ mayhemMode,
20150
+ cashback = false
18324
20151
  }) {
18325
20152
  const associatedUser = (0, import_spl_token2.getAssociatedTokenAddressSync)(
18326
20153
  mint,
@@ -18336,7 +20163,8 @@ var PumpSdk = class {
18336
20163
  uri,
18337
20164
  creator,
18338
20165
  user,
18339
- mayhemMode
20166
+ mayhemMode,
20167
+ cashback
18340
20168
  }),
18341
20169
  await this.extendAccountInstruction({
18342
20170
  account: bondingCurvePda(mint),
@@ -18439,7 +20267,8 @@ var PumpSdk = class {
18439
20267
  solAmount,
18440
20268
  slippage,
18441
20269
  tokenProgram = import_spl_token2.TOKEN_PROGRAM_ID,
18442
- mayhemMode = false
20270
+ mayhemMode = false,
20271
+ cashback = false
18443
20272
  }) {
18444
20273
  const instructions = [];
18445
20274
  if (bondingCurveAccountInfo.data.length < BONDING_CURVE_NEW_SIZE) {
@@ -18460,7 +20289,8 @@ var PumpSdk = class {
18460
20289
  solAmount: solAmount.sub(
18461
20290
  solAmount.mul(new import_bn5.default(Math.floor(slippage * 10))).div(new import_bn5.default(1e3))
18462
20291
  ),
18463
- tokenProgram
20292
+ tokenProgram,
20293
+ cashback
18464
20294
  })
18465
20295
  );
18466
20296
  return instructions;
@@ -18582,7 +20412,8 @@ var PumpSdk = class {
18582
20412
  amount,
18583
20413
  solAmount,
18584
20414
  feeRecipient = getStaticRandomFeeRecipient(),
18585
- tokenProgram = import_spl_token2.TOKEN_PROGRAM_ID
20415
+ tokenProgram = import_spl_token2.TOKEN_PROGRAM_ID,
20416
+ cashback = false
18586
20417
  }) {
18587
20418
  return await this.getSellInstructionInternal({
18588
20419
  user,
@@ -18591,7 +20422,8 @@ var PumpSdk = class {
18591
20422
  feeRecipient,
18592
20423
  amount,
18593
20424
  solAmount,
18594
- tokenProgram
20425
+ tokenProgram,
20426
+ cashback
18595
20427
  });
18596
20428
  }
18597
20429
  async getSellInstructionInternal({
@@ -18601,8 +20433,10 @@ var PumpSdk = class {
18601
20433
  feeRecipient,
18602
20434
  amount,
18603
20435
  solAmount,
18604
- tokenProgram
20436
+ tokenProgram,
20437
+ cashback = false
18605
20438
  }) {
20439
+ const userVolumeAccumulator = userVolumeAccumulatorPda(user);
18606
20440
  return await this.offlinePumpProgram.methods.sell(amount, solAmount).accountsPartial({
18607
20441
  feeRecipient,
18608
20442
  mint,
@@ -18615,7 +20449,15 @@ var PumpSdk = class {
18615
20449
  user,
18616
20450
  creatorVault: creatorVaultPda(creator),
18617
20451
  tokenProgram
18618
- }).instruction();
20452
+ }).remainingAccounts(
20453
+ cashback ? [
20454
+ {
20455
+ pubkey: userVolumeAccumulator,
20456
+ isWritable: true,
20457
+ isSigner: false
20458
+ }
20459
+ ] : []
20460
+ ).instruction();
18619
20461
  }
18620
20462
  /**
18621
20463
  * Creates a fee sharing configuration for a token.
@@ -18644,7 +20486,6 @@ var PumpSdk = class {
18644
20486
  * @param params.mint - The mint address of the token
18645
20487
  * @param params.curShareholders - Array of current shareholders
18646
20488
  * @param params.newShareholders - Array of new shareholders and their share percentages
18647
- *
18648
20489
  * @requirements for newShareholders:
18649
20490
  * - Must contain at least 1 shareholder (cannot be empty)
18650
20491
  * - Maximum of 10 shareholders allowed
@@ -18652,13 +20493,11 @@ var PumpSdk = class {
18652
20493
  * - Total shares must equal exactly 10,000 basis points (100%)
18653
20494
  * - No duplicate addresses allowed
18654
20495
  * - shareBps is in basis points where 1 bps = 0.01% (e.g., 1500 = 15%)
18655
- *
18656
20496
  * @throws {NoShareholdersError} If shareholders array is empty
18657
20497
  * @throws {TooManyShareholdersError} If more than 10 shareholders
18658
20498
  * @throws {ZeroShareError} If any shareholder has zero or negative shares
18659
20499
  * @throws {InvalidShareTotalError} If total shares don't equal 10,000 basis points
18660
20500
  * @throws {DuplicateShareholderError} If duplicate addresses are found
18661
- *
18662
20501
  * @example
18663
20502
  * ```typescript
18664
20503
  * const instruction = await PUMP_SDK.updateFeeShares({
@@ -18683,7 +20522,10 @@ var PumpSdk = class {
18683
20522
  throw new NoShareholdersError();
18684
20523
  }
18685
20524
  if (newShareholders.length > MAX_SHAREHOLDERS) {
18686
- throw new TooManyShareholdersError(newShareholders.length, MAX_SHAREHOLDERS);
20525
+ throw new TooManyShareholdersError(
20526
+ newShareholders.length,
20527
+ MAX_SHAREHOLDERS
20528
+ );
18687
20529
  }
18688
20530
  let totalShares = 0;
18689
20531
  const addresses = /* @__PURE__ */ new Set();
@@ -18710,7 +20552,11 @@ var PumpSdk = class {
18710
20552
  ).accountsPartial({
18711
20553
  authority,
18712
20554
  mint,
18713
- coinCreatorVaultAta: (0, import_pump_swap_sdk2.coinCreatorVaultAtaPda)(coinCreatorVaultAuthority, import_spl_token2.NATIVE_MINT, import_spl_token2.TOKEN_PROGRAM_ID)
20555
+ coinCreatorVaultAta: (0, import_pump_swap_sdk2.coinCreatorVaultAtaPda)(
20556
+ coinCreatorVaultAuthority,
20557
+ import_spl_token2.NATIVE_MINT,
20558
+ import_spl_token2.TOKEN_PROGRAM_ID
20559
+ )
18714
20560
  }).remainingAccounts(
18715
20561
  currentShareholders.map((pubkey) => ({
18716
20562
  pubkey,
@@ -18763,6 +20609,13 @@ var PumpSdk = class {
18763
20609
  }))
18764
20610
  ).instruction();
18765
20611
  }
20612
+ async claimCashbackInstruction({
20613
+ user
20614
+ }) {
20615
+ return await this.offlinePumpProgram.methods.claimCashback().accountsPartial({
20616
+ user
20617
+ }).instruction();
20618
+ }
18766
20619
  };
18767
20620
  var PUMP_SDK = new PumpSdk();
18768
20621
  function isCreatorUsingSharingConfig({
@@ -18773,7 +20626,6 @@ function isCreatorUsingSharingConfig({
18773
20626
  }
18774
20627
 
18775
20628
  // src/pda.ts
18776
- var import_buffer = __toESM(require_buffer());
18777
20629
  var GLOBAL_PDA = (0, import_pump_swap_sdk3.pumpPda)([import_buffer.Buffer.from("global")]);
18778
20630
  var AMM_GLOBAL_PDA = (0, import_pump_swap_sdk3.pumpAmmPda)([import_buffer.Buffer.from("amm_global")]);
18779
20631
  var PUMP_FEE_CONFIG_PDA = (0, import_pump_swap_sdk3.pumpFeePda)([
@@ -18787,7 +20639,7 @@ var AMM_GLOBAL_VOLUME_ACCUMULATOR_PDA = (0, import_pump_swap_sdk3.pumpAmmPda)([
18787
20639
  import_buffer.Buffer.from("global_volume_accumulator")
18788
20640
  ]);
18789
20641
  var PUMP_EVENT_AUTHORITY_PDA = getEventAuthorityPda(PUMP_PROGRAM_ID);
18790
- var PUMP_AMM_EVENT_AUTHORITY_PDA2 = getEventAuthorityPda(PUMP_AMM_PROGRAM_ID);
20642
+ var PUMP_AMM_EVENT_AUTHORITY_PDA = getEventAuthorityPda(PUMP_AMM_PROGRAM_ID);
18791
20643
  var PUMP_FEE_EVENT_AUTHORITY_PDA = getEventAuthorityPda(PUMP_FEE_PROGRAM_ID);
18792
20644
  function getEventAuthorityPda(programId) {
18793
20645
  return import_web35.PublicKey.findProgramAddressSync(
@@ -18846,12 +20698,9 @@ var getTokenVaultPda = (mintPubkey) => {
18846
20698
  );
18847
20699
  };
18848
20700
  var feeSharingConfigPda = (mint) => {
18849
- return (0, import_pump_swap_sdk3.pumpFeePda)([
18850
- import_buffer.Buffer.from("sharing-config"),
18851
- mint.toBuffer()
18852
- ]);
20701
+ return (0, import_pump_swap_sdk3.pumpFeePda)([import_buffer.Buffer.from("sharing-config"), mint.toBuffer()]);
18853
20702
  };
18854
- var ammCreatorVaultPda2 = (creator) => {
20703
+ var ammCreatorVaultPda = (creator) => {
18855
20704
  return import_web35.PublicKey.findProgramAddressSync(
18856
20705
  [import_buffer.Buffer.from("creator_vault"), creator.toBuffer()],
18857
20706
  PUMP_AMM_PROGRAM_ID