@pump-fun/pump-sdk 1.20.0-devnet.1 → 1.20.0-devnet.3

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
@@ -1827,8 +1827,12 @@ __export(index_exports, {
1827
1827
  currentDayTokens: () => currentDayTokens,
1828
1828
  getBuySolAmountFromTokenAmount: () => getBuySolAmountFromTokenAmount,
1829
1829
  getBuyTokenAmountFromSolAmount: () => getBuyTokenAmountFromSolAmount,
1830
+ getGlobalParamsPda: () => getGlobalParamsPda,
1831
+ getMayhemStatePda: () => getMayhemStatePda,
1830
1832
  getPumpProgram: () => getPumpProgram,
1831
1833
  getSellSolAmountFromTokenAmount: () => getSellSolAmountFromTokenAmount,
1834
+ getSolVaultPda: () => getSolVaultPda,
1835
+ getTokenVaultPda: () => getTokenVaultPda,
1832
1836
  newBondingCurve: () => newBondingCurve,
1833
1837
  pumpIdl: () => pump_default,
1834
1838
  pumpPoolAuthorityPda: () => pumpPoolAuthorityPda,
@@ -3956,6 +3960,26 @@ var pump_default = {
3956
3960
  name: "associated_token_program",
3957
3961
  address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
3958
3962
  },
3963
+ {
3964
+ name: "mayhem_program_id",
3965
+ writable: true
3966
+ },
3967
+ {
3968
+ name: "global_params",
3969
+ writable: true
3970
+ },
3971
+ {
3972
+ name: "sol_vault",
3973
+ writable: true
3974
+ },
3975
+ {
3976
+ name: "mayhem_state",
3977
+ writable: true
3978
+ },
3979
+ {
3980
+ name: "mayhem_token_vault",
3981
+ writable: true
3982
+ },
3959
3983
  {
3960
3984
  name: "event_authority",
3961
3985
  pda: {
@@ -4005,6 +4029,10 @@ var pump_default = {
4005
4029
  {
4006
4030
  name: "creator",
4007
4031
  type: "pubkey"
4032
+ },
4033
+ {
4034
+ name: "is_mayhem_mode",
4035
+ type: "bool"
4008
4036
  }
4009
4037
  ]
4010
4038
  },
@@ -5502,6 +5530,90 @@ var pump_default = {
5502
5530
  }
5503
5531
  ]
5504
5532
  },
5533
+ {
5534
+ name: "set_reserved_fee_recipient",
5535
+ discriminator: [
5536
+ 207,
5537
+ 189,
5538
+ 178,
5539
+ 71,
5540
+ 167,
5541
+ 122,
5542
+ 68,
5543
+ 180
5544
+ ],
5545
+ accounts: [
5546
+ {
5547
+ name: "global",
5548
+ writable: true,
5549
+ pda: {
5550
+ seeds: [
5551
+ {
5552
+ kind: "const",
5553
+ value: [
5554
+ 103,
5555
+ 108,
5556
+ 111,
5557
+ 98,
5558
+ 97,
5559
+ 108
5560
+ ]
5561
+ }
5562
+ ]
5563
+ }
5564
+ },
5565
+ {
5566
+ name: "authority",
5567
+ writable: true,
5568
+ signer: true,
5569
+ relations: [
5570
+ "global"
5571
+ ]
5572
+ },
5573
+ {
5574
+ name: "event_authority",
5575
+ pda: {
5576
+ seeds: [
5577
+ {
5578
+ kind: "const",
5579
+ value: [
5580
+ 95,
5581
+ 95,
5582
+ 101,
5583
+ 118,
5584
+ 101,
5585
+ 110,
5586
+ 116,
5587
+ 95,
5588
+ 97,
5589
+ 117,
5590
+ 116,
5591
+ 104,
5592
+ 111,
5593
+ 114,
5594
+ 105,
5595
+ 116,
5596
+ 121
5597
+ ]
5598
+ }
5599
+ ]
5600
+ }
5601
+ },
5602
+ {
5603
+ name: "program"
5604
+ }
5605
+ ],
5606
+ args: [
5607
+ {
5608
+ name: "reserved_fee_recipient",
5609
+ type: "pubkey"
5610
+ },
5611
+ {
5612
+ name: "whitelist_pda",
5613
+ type: "pubkey"
5614
+ }
5615
+ ]
5616
+ },
5505
5617
  {
5506
5618
  name: "sync_user_volume_accumulator",
5507
5619
  discriminator: [
@@ -5710,6 +5822,86 @@ var pump_default = {
5710
5822
  }
5711
5823
  ]
5712
5824
  },
5825
+ {
5826
+ name: "toggle_mayhem_mode",
5827
+ discriminator: [
5828
+ 1,
5829
+ 9,
5830
+ 111,
5831
+ 208,
5832
+ 100,
5833
+ 31,
5834
+ 255,
5835
+ 163
5836
+ ],
5837
+ accounts: [
5838
+ {
5839
+ name: "global",
5840
+ writable: true,
5841
+ pda: {
5842
+ seeds: [
5843
+ {
5844
+ kind: "const",
5845
+ value: [
5846
+ 103,
5847
+ 108,
5848
+ 111,
5849
+ 98,
5850
+ 97,
5851
+ 108
5852
+ ]
5853
+ }
5854
+ ]
5855
+ }
5856
+ },
5857
+ {
5858
+ name: "authority",
5859
+ writable: true,
5860
+ signer: true,
5861
+ relations: [
5862
+ "global"
5863
+ ]
5864
+ },
5865
+ {
5866
+ name: "event_authority",
5867
+ pda: {
5868
+ seeds: [
5869
+ {
5870
+ kind: "const",
5871
+ value: [
5872
+ 95,
5873
+ 95,
5874
+ 101,
5875
+ 118,
5876
+ 101,
5877
+ 110,
5878
+ 116,
5879
+ 95,
5880
+ 97,
5881
+ 117,
5882
+ 116,
5883
+ 104,
5884
+ 111,
5885
+ 114,
5886
+ 105,
5887
+ 116,
5888
+ 121
5889
+ ]
5890
+ }
5891
+ ]
5892
+ }
5893
+ },
5894
+ {
5895
+ name: "program"
5896
+ }
5897
+ ],
5898
+ args: [
5899
+ {
5900
+ name: "enabled",
5901
+ type: "bool"
5902
+ }
5903
+ ]
5904
+ },
5713
5905
  {
5714
5906
  name: "update_global_authority",
5715
5907
  discriminator: [
@@ -6300,6 +6492,14 @@ var pump_default = {
6300
6492
  {
6301
6493
  code: 6046,
6302
6494
  name: "CreateV2Disabled"
6495
+ },
6496
+ {
6497
+ code: 6047,
6498
+ name: "CpitializeMayhemFailed"
6499
+ },
6500
+ {
6501
+ code: 6048,
6502
+ name: "MayhemModeDisabled"
6303
6503
  }
6304
6504
  ],
6305
6505
  types: [
@@ -6415,6 +6615,10 @@ var pump_default = {
6415
6615
  {
6416
6616
  name: "creator",
6417
6617
  type: "pubkey"
6618
+ },
6619
+ {
6620
+ name: "is_mayhem_mode",
6621
+ type: "bool"
6418
6622
  }
6419
6623
  ]
6420
6624
  }
@@ -6623,6 +6827,10 @@ var pump_default = {
6623
6827
  {
6624
6828
  name: "token_program",
6625
6829
  type: "pubkey"
6830
+ },
6831
+ {
6832
+ name: "is_mayhem_mode",
6833
+ type: "bool"
6626
6834
  }
6627
6835
  ]
6628
6836
  }
@@ -6808,6 +7016,18 @@ var pump_default = {
6808
7016
  {
6809
7017
  name: "create_v2_enabled",
6810
7018
  type: "bool"
7019
+ },
7020
+ {
7021
+ name: "whitelist_pda",
7022
+ type: "pubkey"
7023
+ },
7024
+ {
7025
+ name: "reserved_fee_recipient",
7026
+ type: "pubkey"
7027
+ },
7028
+ {
7029
+ name: "mayhem_mode_enabled",
7030
+ type: "bool"
6811
7031
  }
6812
7032
  ]
6813
7033
  }
@@ -7271,7 +7491,8 @@ function newBondingCurve(global) {
7271
7491
  realSolReserves: new import_bn2.default(0),
7272
7492
  tokenTotalSupply: global.tokenTotalSupply,
7273
7493
  complete: false,
7274
- creator: import_web32.PublicKey.default
7494
+ creator: import_web32.PublicKey.default,
7495
+ isMayhemMode: global.mayhemModeEnabled
7275
7496
  };
7276
7497
  }
7277
7498
  function getBuySolAmountFromTokenAmountQuote({
@@ -7790,10 +8011,13 @@ var PUMP_PROGRAM_ID = new import_web34.PublicKey(
7790
8011
  var PUMP_AMM_PROGRAM_ID = new import_web34.PublicKey(
7791
8012
  "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"
7792
8013
  );
8014
+ var MAYHEM_PROGRAM_ID = new import_web34.PublicKey(
8015
+ "MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e"
8016
+ );
7793
8017
  var PUMP_FEE_PROGRAM_ID = new import_web34.PublicKey(
7794
8018
  "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"
7795
8019
  );
7796
- var BONDING_CURVE_NEW_SIZE = 150;
8020
+ var BONDING_CURVE_NEW_SIZE = 151;
7797
8021
  var PUMP_TOKEN_MINT = new import_web34.PublicKey(
7798
8022
  "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn"
7799
8023
  );
@@ -7870,12 +8094,18 @@ var PumpSdk = class {
7870
8094
  symbol,
7871
8095
  uri,
7872
8096
  creator,
7873
- user
8097
+ user,
8098
+ mayhemMode
7874
8099
  }) {
7875
- return await this.offlinePumpProgram.methods.createV2(name, symbol, uri, creator).accountsPartial({
8100
+ return await this.offlinePumpProgram.methods.createV2(name, symbol, uri, creator, mayhemMode).accountsPartial({
7876
8101
  mint,
7877
8102
  user,
7878
- tokenProgram: import_spl_token2.TOKEN_2022_PROGRAM_ID
8103
+ tokenProgram: import_spl_token2.TOKEN_2022_PROGRAM_ID,
8104
+ mayhemProgramId: MAYHEM_PROGRAM_ID,
8105
+ globalParams: getGlobalParamsPda(),
8106
+ solVault: getSolVaultPda(),
8107
+ mayhemState: getMayhemStatePda(mint),
8108
+ mayhemTokenVault: getTokenVaultPda(mint)
7879
8109
  }).instruction();
7880
8110
  }
7881
8111
  async buyInstructions({
@@ -7921,7 +8151,8 @@ var PumpSdk = class {
7921
8151
  amount,
7922
8152
  solAmount,
7923
8153
  slippage,
7924
- tokenProgram
8154
+ tokenProgram,
8155
+ mayhemMode: bondingCurve.isMayhemMode
7925
8156
  })
7926
8157
  );
7927
8158
  return instructions;
@@ -7935,11 +8166,12 @@ var PumpSdk = class {
7935
8166
  creator,
7936
8167
  user,
7937
8168
  amount,
7938
- solAmount
8169
+ solAmount,
8170
+ mayhemMode
7939
8171
  }) {
7940
8172
  const associatedUser = (0, import_spl_token2.getAssociatedTokenAddressSync)(mint, user, true, import_spl_token2.TOKEN_2022_PROGRAM_ID);
7941
8173
  return [
7942
- await this.createV2Instruction({ mint, name, symbol, uri, creator, user }),
8174
+ await this.createV2Instruction({ mint, name, symbol, uri, creator, user, mayhemMode }),
7943
8175
  await this.extendAccountInstruction({
7944
8176
  account: bondingCurvePda(mint),
7945
8177
  user
@@ -8012,14 +8244,15 @@ var PumpSdk = class {
8012
8244
  amount,
8013
8245
  solAmount,
8014
8246
  slippage,
8015
- tokenProgram
8247
+ tokenProgram,
8248
+ mayhemMode = false
8016
8249
  }) {
8017
8250
  return await this.getBuyInstructionInternal({
8018
8251
  user,
8019
8252
  associatedUser,
8020
8253
  mint,
8021
8254
  creator,
8022
- feeRecipient: getFeeRecipient(global),
8255
+ feeRecipient: getFeeRecipient(global, mayhemMode),
8023
8256
  amount,
8024
8257
  solAmount: solAmount.add(
8025
8258
  solAmount.mul(new import_bn5.default(Math.floor(slippage * 10))).div(new import_bn5.default(1e3))
@@ -8036,7 +8269,8 @@ var PumpSdk = class {
8036
8269
  amount,
8037
8270
  solAmount,
8038
8271
  slippage,
8039
- tokenProgram = import_spl_token2.TOKEN_PROGRAM_ID
8272
+ tokenProgram = import_spl_token2.TOKEN_PROGRAM_ID,
8273
+ mayhemMode = false
8040
8274
  }) {
8041
8275
  const instructions = [];
8042
8276
  if (bondingCurveAccountInfo.data.length < BONDING_CURVE_NEW_SIZE) {
@@ -8052,7 +8286,7 @@ var PumpSdk = class {
8052
8286
  user,
8053
8287
  mint,
8054
8288
  creator: bondingCurve.creator,
8055
- feeRecipient: getFeeRecipient(global),
8289
+ feeRecipient: getFeeRecipient(global, mayhemMode),
8056
8290
  amount,
8057
8291
  solAmount: solAmount.sub(
8058
8292
  solAmount.mul(new import_bn5.default(Math.floor(slippage * 10))).div(new import_bn5.default(1e3))
@@ -8197,9 +8431,13 @@ var PumpSdk = class {
8197
8431
  }
8198
8432
  };
8199
8433
  var PUMP_SDK = new PumpSdk();
8200
- function getFeeRecipient(global) {
8201
- const feeRecipients = [global.feeRecipient, ...global.feeRecipients];
8202
- return feeRecipients[Math.floor(Math.random() * feeRecipients.length)];
8434
+ function getFeeRecipient(global, mayhemMode) {
8435
+ if (!mayhemMode) {
8436
+ const feeRecipients = [global.feeRecipient, ...global.feeRecipients];
8437
+ return feeRecipients[Math.floor(Math.random() * feeRecipients.length)];
8438
+ } else {
8439
+ return global.reservedFeeRecipient;
8440
+ }
8203
8441
  }
8204
8442
 
8205
8443
  // src/pda.ts
@@ -8236,6 +8474,32 @@ function canonicalPumpPoolPda(mint) {
8236
8474
  function userVolumeAccumulatorPda(user) {
8237
8475
  return (0, import_pump_swap_sdk3.pumpPda)([import_buffer.Buffer.from("user_volume_accumulator"), user.toBuffer()]);
8238
8476
  }
8477
+ var getGlobalParamsPda = () => {
8478
+ return import_web35.PublicKey.findProgramAddressSync(
8479
+ [import_buffer.Buffer.from("global-params")],
8480
+ MAYHEM_PROGRAM_ID
8481
+ )[0];
8482
+ };
8483
+ var getMayhemStatePda = (mint) => {
8484
+ return import_web35.PublicKey.findProgramAddressSync(
8485
+ [import_buffer.Buffer.from("mayhem-state"), mint.toBuffer()],
8486
+ MAYHEM_PROGRAM_ID
8487
+ )[0];
8488
+ };
8489
+ var getSolVaultPda = () => {
8490
+ return import_web35.PublicKey.findProgramAddressSync(
8491
+ [import_buffer.Buffer.from("sol-vault")],
8492
+ MAYHEM_PROGRAM_ID
8493
+ )[0];
8494
+ };
8495
+ var getTokenVaultPda = (mintPubkey) => {
8496
+ return (0, import_spl_token3.getAssociatedTokenAddressSync)(
8497
+ mintPubkey,
8498
+ getSolVaultPda(),
8499
+ true,
8500
+ import_spl_token3.TOKEN_2022_PROGRAM_ID
8501
+ );
8502
+ };
8239
8503
  /*! Bundled license information:
8240
8504
 
8241
8505
  ieee754/index.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pump-fun/pump-sdk",
3
- "version": "1.20.0-devnet.1",
3
+ "version": "1.20.0-devnet.3",
4
4
  "description": "Pump Bonding Curve SDK",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/pump-fun/pump-sdk#readme",
@@ -12,6 +12,7 @@ export function newBondingCurve(global: Global): BondingCurve {
12
12
  tokenTotalSupply: global.tokenTotalSupply,
13
13
  complete: false,
14
14
  creator: PublicKey.default,
15
+ isMayhemMode: global.mayhemModeEnabled,
15
16
  };
16
17
  }
17
18
 
package/src/idl/pump.json CHANGED
@@ -2116,6 +2116,26 @@
2116
2116
  "name": "associated_token_program",
2117
2117
  "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
2118
2118
  },
2119
+ {
2120
+ "name": "mayhem_program_id",
2121
+ "writable": true
2122
+ },
2123
+ {
2124
+ "name": "global_params",
2125
+ "writable": true
2126
+ },
2127
+ {
2128
+ "name": "sol_vault",
2129
+ "writable": true
2130
+ },
2131
+ {
2132
+ "name": "mayhem_state",
2133
+ "writable": true
2134
+ },
2135
+ {
2136
+ "name": "mayhem_token_vault",
2137
+ "writable": true
2138
+ },
2119
2139
  {
2120
2140
  "name": "event_authority",
2121
2141
  "pda": {
@@ -2165,6 +2185,10 @@
2165
2185
  {
2166
2186
  "name": "creator",
2167
2187
  "type": "pubkey"
2188
+ },
2189
+ {
2190
+ "name": "is_mayhem_mode",
2191
+ "type": "bool"
2168
2192
  }
2169
2193
  ]
2170
2194
  },
@@ -3662,6 +3686,90 @@
3662
3686
  }
3663
3687
  ]
3664
3688
  },
3689
+ {
3690
+ "name": "set_reserved_fee_recipient",
3691
+ "discriminator": [
3692
+ 207,
3693
+ 189,
3694
+ 178,
3695
+ 71,
3696
+ 167,
3697
+ 122,
3698
+ 68,
3699
+ 180
3700
+ ],
3701
+ "accounts": [
3702
+ {
3703
+ "name": "global",
3704
+ "writable": true,
3705
+ "pda": {
3706
+ "seeds": [
3707
+ {
3708
+ "kind": "const",
3709
+ "value": [
3710
+ 103,
3711
+ 108,
3712
+ 111,
3713
+ 98,
3714
+ 97,
3715
+ 108
3716
+ ]
3717
+ }
3718
+ ]
3719
+ }
3720
+ },
3721
+ {
3722
+ "name": "authority",
3723
+ "writable": true,
3724
+ "signer": true,
3725
+ "relations": [
3726
+ "global"
3727
+ ]
3728
+ },
3729
+ {
3730
+ "name": "event_authority",
3731
+ "pda": {
3732
+ "seeds": [
3733
+ {
3734
+ "kind": "const",
3735
+ "value": [
3736
+ 95,
3737
+ 95,
3738
+ 101,
3739
+ 118,
3740
+ 101,
3741
+ 110,
3742
+ 116,
3743
+ 95,
3744
+ 97,
3745
+ 117,
3746
+ 116,
3747
+ 104,
3748
+ 111,
3749
+ 114,
3750
+ 105,
3751
+ 116,
3752
+ 121
3753
+ ]
3754
+ }
3755
+ ]
3756
+ }
3757
+ },
3758
+ {
3759
+ "name": "program"
3760
+ }
3761
+ ],
3762
+ "args": [
3763
+ {
3764
+ "name": "reserved_fee_recipient",
3765
+ "type": "pubkey"
3766
+ },
3767
+ {
3768
+ "name": "whitelist_pda",
3769
+ "type": "pubkey"
3770
+ }
3771
+ ]
3772
+ },
3665
3773
  {
3666
3774
  "name": "sync_user_volume_accumulator",
3667
3775
  "discriminator": [
@@ -3870,6 +3978,86 @@
3870
3978
  }
3871
3979
  ]
3872
3980
  },
3981
+ {
3982
+ "name": "toggle_mayhem_mode",
3983
+ "discriminator": [
3984
+ 1,
3985
+ 9,
3986
+ 111,
3987
+ 208,
3988
+ 100,
3989
+ 31,
3990
+ 255,
3991
+ 163
3992
+ ],
3993
+ "accounts": [
3994
+ {
3995
+ "name": "global",
3996
+ "writable": true,
3997
+ "pda": {
3998
+ "seeds": [
3999
+ {
4000
+ "kind": "const",
4001
+ "value": [
4002
+ 103,
4003
+ 108,
4004
+ 111,
4005
+ 98,
4006
+ 97,
4007
+ 108
4008
+ ]
4009
+ }
4010
+ ]
4011
+ }
4012
+ },
4013
+ {
4014
+ "name": "authority",
4015
+ "writable": true,
4016
+ "signer": true,
4017
+ "relations": [
4018
+ "global"
4019
+ ]
4020
+ },
4021
+ {
4022
+ "name": "event_authority",
4023
+ "pda": {
4024
+ "seeds": [
4025
+ {
4026
+ "kind": "const",
4027
+ "value": [
4028
+ 95,
4029
+ 95,
4030
+ 101,
4031
+ 118,
4032
+ 101,
4033
+ 110,
4034
+ 116,
4035
+ 95,
4036
+ 97,
4037
+ 117,
4038
+ 116,
4039
+ 104,
4040
+ 111,
4041
+ 114,
4042
+ 105,
4043
+ 116,
4044
+ 121
4045
+ ]
4046
+ }
4047
+ ]
4048
+ }
4049
+ },
4050
+ {
4051
+ "name": "program"
4052
+ }
4053
+ ],
4054
+ "args": [
4055
+ {
4056
+ "name": "enabled",
4057
+ "type": "bool"
4058
+ }
4059
+ ]
4060
+ },
3873
4061
  {
3874
4062
  "name": "update_global_authority",
3875
4063
  "discriminator": [
@@ -4460,6 +4648,14 @@
4460
4648
  {
4461
4649
  "code": 6046,
4462
4650
  "name": "CreateV2Disabled"
4651
+ },
4652
+ {
4653
+ "code": 6047,
4654
+ "name": "CpitializeMayhemFailed"
4655
+ },
4656
+ {
4657
+ "code": 6048,
4658
+ "name": "MayhemModeDisabled"
4463
4659
  }
4464
4660
  ],
4465
4661
  "types": [
@@ -4575,6 +4771,10 @@
4575
4771
  {
4576
4772
  "name": "creator",
4577
4773
  "type": "pubkey"
4774
+ },
4775
+ {
4776
+ "name": "is_mayhem_mode",
4777
+ "type": "bool"
4578
4778
  }
4579
4779
  ]
4580
4780
  }
@@ -4783,6 +4983,10 @@
4783
4983
  {
4784
4984
  "name": "token_program",
4785
4985
  "type": "pubkey"
4986
+ },
4987
+ {
4988
+ "name": "is_mayhem_mode",
4989
+ "type": "bool"
4786
4990
  }
4787
4991
  ]
4788
4992
  }
@@ -4968,6 +5172,18 @@
4968
5172
  {
4969
5173
  "name": "create_v2_enabled",
4970
5174
  "type": "bool"
5175
+ },
5176
+ {
5177
+ "name": "whitelist_pda",
5178
+ "type": "pubkey"
5179
+ },
5180
+ {
5181
+ "name": "reserved_fee_recipient",
5182
+ "type": "pubkey"
5183
+ },
5184
+ {
5185
+ "name": "mayhem_mode_enabled",
5186
+ "type": "bool"
4971
5187
  }
4972
5188
  ]
4973
5189
  }