@pump-fun/pump-sdk 1.17.5 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -667,6 +667,7 @@ type Pump = {
667
667
  },
668
668
  {
669
669
  "name": "program";
670
+ "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P";
670
671
  },
671
672
  {
672
673
  "name": "globalVolumeAccumulator";
@@ -745,6 +746,75 @@ type Pump = {
745
746
  }
746
747
  ];
747
748
  };
749
+ },
750
+ {
751
+ "name": "feeConfig";
752
+ "optional": true;
753
+ "pda": {
754
+ "seeds": [
755
+ {
756
+ "kind": "const";
757
+ "value": [
758
+ 102,
759
+ 101,
760
+ 101,
761
+ 95,
762
+ 99,
763
+ 111,
764
+ 110,
765
+ 102,
766
+ 105,
767
+ 103
768
+ ];
769
+ },
770
+ {
771
+ "kind": "const";
772
+ "value": [
773
+ 1,
774
+ 86,
775
+ 224,
776
+ 246,
777
+ 147,
778
+ 102,
779
+ 90,
780
+ 207,
781
+ 68,
782
+ 219,
783
+ 21,
784
+ 104,
785
+ 191,
786
+ 23,
787
+ 91,
788
+ 170,
789
+ 81,
790
+ 137,
791
+ 203,
792
+ 151,
793
+ 245,
794
+ 210,
795
+ 255,
796
+ 59,
797
+ 101,
798
+ 93,
799
+ 43,
800
+ 182,
801
+ 253,
802
+ 109,
803
+ 24,
804
+ 176
805
+ ];
806
+ }
807
+ ];
808
+ "program": {
809
+ "kind": "account";
810
+ "path": "feeProgram";
811
+ };
812
+ };
813
+ },
814
+ {
815
+ "name": "feeProgram";
816
+ "optional": true;
817
+ "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ";
748
818
  }
749
819
  ];
750
820
  "args": [
@@ -1021,6 +1091,7 @@ type Pump = {
1021
1091
  },
1022
1092
  {
1023
1093
  "name": "program";
1094
+ "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P";
1024
1095
  },
1025
1096
  {
1026
1097
  "name": "payer";
@@ -2503,6 +2574,76 @@ type Pump = {
2503
2574
  },
2504
2575
  {
2505
2576
  "name": "program";
2577
+ "address": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P";
2578
+ },
2579
+ {
2580
+ "name": "feeConfig";
2581
+ "optional": true;
2582
+ "pda": {
2583
+ "seeds": [
2584
+ {
2585
+ "kind": "const";
2586
+ "value": [
2587
+ 102,
2588
+ 101,
2589
+ 101,
2590
+ 95,
2591
+ 99,
2592
+ 111,
2593
+ 110,
2594
+ 102,
2595
+ 105,
2596
+ 103
2597
+ ];
2598
+ },
2599
+ {
2600
+ "kind": "const";
2601
+ "value": [
2602
+ 1,
2603
+ 86,
2604
+ 224,
2605
+ 246,
2606
+ 147,
2607
+ 102,
2608
+ 90,
2609
+ 207,
2610
+ 68,
2611
+ 219,
2612
+ 21,
2613
+ 104,
2614
+ 191,
2615
+ 23,
2616
+ 91,
2617
+ 170,
2618
+ 81,
2619
+ 137,
2620
+ 203,
2621
+ 151,
2622
+ 245,
2623
+ 210,
2624
+ 255,
2625
+ 59,
2626
+ 101,
2627
+ 93,
2628
+ 43,
2629
+ 182,
2630
+ 253,
2631
+ 109,
2632
+ 24,
2633
+ 176
2634
+ ];
2635
+ }
2636
+ ];
2637
+ "program": {
2638
+ "kind": "account";
2639
+ "path": "feeProgram";
2640
+ };
2641
+ };
2642
+ },
2643
+ {
2644
+ "name": "feeProgram";
2645
+ "optional": true;
2646
+ "address": "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ";
2506
2647
  }
2507
2648
  ];
2508
2649
  "args": [
@@ -3253,6 +3394,19 @@ type Pump = {
3253
3394
  96
3254
3395
  ];
3255
3396
  },
3397
+ {
3398
+ "name": "feeConfig";
3399
+ "discriminator": [
3400
+ 143,
3401
+ 52,
3402
+ 146,
3403
+ 187,
3404
+ 219,
3405
+ 123,
3406
+ 76,
3407
+ 155
3408
+ ];
3409
+ },
3256
3410
  {
3257
3411
  "name": "global";
3258
3412
  "discriminator": [
@@ -4058,6 +4212,80 @@ type Pump = {
4058
4212
  ];
4059
4213
  };
4060
4214
  },
4215
+ {
4216
+ "name": "feeConfig";
4217
+ "type": {
4218
+ "kind": "struct";
4219
+ "fields": [
4220
+ {
4221
+ "name": "bump";
4222
+ "type": "u8";
4223
+ },
4224
+ {
4225
+ "name": "admin";
4226
+ "type": "pubkey";
4227
+ },
4228
+ {
4229
+ "name": "flatFees";
4230
+ "type": {
4231
+ "defined": {
4232
+ "name": "fees";
4233
+ };
4234
+ };
4235
+ },
4236
+ {
4237
+ "name": "feeTiers";
4238
+ "type": {
4239
+ "vec": {
4240
+ "defined": {
4241
+ "name": "feeTier";
4242
+ };
4243
+ };
4244
+ };
4245
+ }
4246
+ ];
4247
+ };
4248
+ },
4249
+ {
4250
+ "name": "feeTier";
4251
+ "type": {
4252
+ "kind": "struct";
4253
+ "fields": [
4254
+ {
4255
+ "name": "marketCapLamportsThreshold";
4256
+ "type": "u128";
4257
+ },
4258
+ {
4259
+ "name": "fees";
4260
+ "type": {
4261
+ "defined": {
4262
+ "name": "fees";
4263
+ };
4264
+ };
4265
+ }
4266
+ ];
4267
+ };
4268
+ },
4269
+ {
4270
+ "name": "fees";
4271
+ "type": {
4272
+ "kind": "struct";
4273
+ "fields": [
4274
+ {
4275
+ "name": "lpFeeBps";
4276
+ "type": "u64";
4277
+ },
4278
+ {
4279
+ "name": "protocolFeeBps";
4280
+ "type": "u64";
4281
+ },
4282
+ {
4283
+ "name": "creatorFeeBps";
4284
+ "type": "u64";
4285
+ }
4286
+ ];
4287
+ };
4288
+ },
4061
4289
  {
4062
4290
  "name": "global";
4063
4291
  "type": {
@@ -5166,7 +5394,8 @@ var instructions = [
5166
5394
  }
5167
5395
  },
5168
5396
  {
5169
- name: "program"
5397
+ name: "program",
5398
+ address: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
5170
5399
  },
5171
5400
  {
5172
5401
  name: "global_volume_accumulator",
@@ -5245,6 +5474,75 @@ var instructions = [
5245
5474
  }
5246
5475
  ]
5247
5476
  }
5477
+ },
5478
+ {
5479
+ name: "fee_config",
5480
+ optional: true,
5481
+ pda: {
5482
+ seeds: [
5483
+ {
5484
+ kind: "const",
5485
+ value: [
5486
+ 102,
5487
+ 101,
5488
+ 101,
5489
+ 95,
5490
+ 99,
5491
+ 111,
5492
+ 110,
5493
+ 102,
5494
+ 105,
5495
+ 103
5496
+ ]
5497
+ },
5498
+ {
5499
+ kind: "const",
5500
+ value: [
5501
+ 1,
5502
+ 86,
5503
+ 224,
5504
+ 246,
5505
+ 147,
5506
+ 102,
5507
+ 90,
5508
+ 207,
5509
+ 68,
5510
+ 219,
5511
+ 21,
5512
+ 104,
5513
+ 191,
5514
+ 23,
5515
+ 91,
5516
+ 170,
5517
+ 81,
5518
+ 137,
5519
+ 203,
5520
+ 151,
5521
+ 245,
5522
+ 210,
5523
+ 255,
5524
+ 59,
5525
+ 101,
5526
+ 93,
5527
+ 43,
5528
+ 182,
5529
+ 253,
5530
+ 109,
5531
+ 24,
5532
+ 176
5533
+ ]
5534
+ }
5535
+ ],
5536
+ program: {
5537
+ kind: "account",
5538
+ path: "fee_program"
5539
+ }
5540
+ }
5541
+ },
5542
+ {
5543
+ name: "fee_program",
5544
+ optional: true,
5545
+ address: "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"
5248
5546
  }
5249
5547
  ],
5250
5548
  args: [
@@ -5520,7 +5818,8 @@ var instructions = [
5520
5818
  }
5521
5819
  },
5522
5820
  {
5523
- name: "program"
5821
+ name: "program",
5822
+ address: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
5524
5823
  },
5525
5824
  {
5526
5825
  name: "payer",
@@ -7009,7 +7308,77 @@ var instructions = [
7009
7308
  }
7010
7309
  },
7011
7310
  {
7012
- name: "program"
7311
+ name: "program",
7312
+ address: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
7313
+ },
7314
+ {
7315
+ name: "fee_config",
7316
+ optional: true,
7317
+ pda: {
7318
+ seeds: [
7319
+ {
7320
+ kind: "const",
7321
+ value: [
7322
+ 102,
7323
+ 101,
7324
+ 101,
7325
+ 95,
7326
+ 99,
7327
+ 111,
7328
+ 110,
7329
+ 102,
7330
+ 105,
7331
+ 103
7332
+ ]
7333
+ },
7334
+ {
7335
+ kind: "const",
7336
+ value: [
7337
+ 1,
7338
+ 86,
7339
+ 224,
7340
+ 246,
7341
+ 147,
7342
+ 102,
7343
+ 90,
7344
+ 207,
7345
+ 68,
7346
+ 219,
7347
+ 21,
7348
+ 104,
7349
+ 191,
7350
+ 23,
7351
+ 91,
7352
+ 170,
7353
+ 81,
7354
+ 137,
7355
+ 203,
7356
+ 151,
7357
+ 245,
7358
+ 210,
7359
+ 255,
7360
+ 59,
7361
+ 101,
7362
+ 93,
7363
+ 43,
7364
+ 182,
7365
+ 253,
7366
+ 109,
7367
+ 24,
7368
+ 176
7369
+ ]
7370
+ }
7371
+ ],
7372
+ program: {
7373
+ kind: "account",
7374
+ path: "fee_program"
7375
+ }
7376
+ }
7377
+ },
7378
+ {
7379
+ name: "fee_program",
7380
+ optional: true,
7381
+ address: "pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ"
7013
7382
  }
7014
7383
  ],
7015
7384
  args: [
@@ -7763,6 +8132,19 @@ var accounts = [
7763
8132
  96
7764
8133
  ]
7765
8134
  },
8135
+ {
8136
+ name: "FeeConfig",
8137
+ discriminator: [
8138
+ 143,
8139
+ 52,
8140
+ 146,
8141
+ 187,
8142
+ 219,
8143
+ 123,
8144
+ 76,
8145
+ 155
8146
+ ]
8147
+ },
7766
8148
  {
7767
8149
  name: "Global",
7768
8150
  discriminator: [
@@ -8568,6 +8950,80 @@ var types = [
8568
8950
  ]
8569
8951
  }
8570
8952
  },
8953
+ {
8954
+ name: "FeeConfig",
8955
+ type: {
8956
+ kind: "struct",
8957
+ fields: [
8958
+ {
8959
+ name: "bump",
8960
+ type: "u8"
8961
+ },
8962
+ {
8963
+ name: "admin",
8964
+ type: "pubkey"
8965
+ },
8966
+ {
8967
+ name: "flat_fees",
8968
+ type: {
8969
+ defined: {
8970
+ name: "Fees"
8971
+ }
8972
+ }
8973
+ },
8974
+ {
8975
+ name: "fee_tiers",
8976
+ type: {
8977
+ vec: {
8978
+ defined: {
8979
+ name: "FeeTier"
8980
+ }
8981
+ }
8982
+ }
8983
+ }
8984
+ ]
8985
+ }
8986
+ },
8987
+ {
8988
+ name: "FeeTier",
8989
+ type: {
8990
+ kind: "struct",
8991
+ fields: [
8992
+ {
8993
+ name: "market_cap_lamports_threshold",
8994
+ type: "u128"
8995
+ },
8996
+ {
8997
+ name: "fees",
8998
+ type: {
8999
+ defined: {
9000
+ name: "Fees"
9001
+ }
9002
+ }
9003
+ }
9004
+ ]
9005
+ }
9006
+ },
9007
+ {
9008
+ name: "Fees",
9009
+ type: {
9010
+ kind: "struct",
9011
+ fields: [
9012
+ {
9013
+ name: "lp_fee_bps",
9014
+ type: "u64"
9015
+ },
9016
+ {
9017
+ name: "protocol_fee_bps",
9018
+ type: "u64"
9019
+ },
9020
+ {
9021
+ name: "creator_fee_bps",
9022
+ type: "u64"
9023
+ }
9024
+ ]
9025
+ }
9026
+ },
8571
9027
  {
8572
9028
  name: "Global",
8573
9029
  type: {
@@ -9073,6 +9529,22 @@ interface UserVolumeAccumulatorTotalStats {
9073
9529
  totalClaimedTokens: BN;
9074
9530
  currentSolVolume: BN;
9075
9531
  }
9532
+ interface FeeConfig {
9533
+ admin: PublicKey;
9534
+ flatFees: Fees;
9535
+ feeTiers: FeeTier[];
9536
+ }
9537
+ interface FeeTier {
9538
+ marketCapLamportsThreshold: BN;
9539
+ fees: Fees;
9540
+ }
9541
+ interface Fees {
9542
+ lpFeeBps: BN;
9543
+ protocolFeeBps: BN;
9544
+ creatorFeeBps: BN;
9545
+ }
9546
+
9547
+ declare function createFeeConfigFromGlobalConfig(globalConfig: Global): FeeConfig;
9076
9548
 
9077
9549
  declare function newBondingCurve(global: Global): BondingCurve;
9078
9550
  declare function getBuySolAmountFromTokenAmountQuote({ minAmount, virtualTokenReserves, virtualSolReserves, }: {
@@ -9090,9 +9562,32 @@ declare function getSellSolAmountFromTokenAmountQuote({ inputAmount, virtualToke
9090
9562
  virtualTokenReserves: BN;
9091
9563
  virtualSolReserves: BN;
9092
9564
  }): BN;
9093
- declare function getBuyTokenAmountFromSolAmount(global: Global, bondingCurve: BondingCurve | null, amount: BN): BN;
9094
- declare function getBuySolAmountFromTokenAmount(global: Global, bondingCurve: BondingCurve | null, amount: BN): BN;
9095
- declare function getSellSolAmountFromTokenAmount(global: Global, bondingCurve: BondingCurve, amount: BN): BN;
9565
+ declare function getBuyTokenAmountFromSolAmount({ global, feeConfig, mintSupply, bondingCurve, amount, }: {
9566
+ global: Global;
9567
+ feeConfig: FeeConfig | null;
9568
+ mintSupply: BN | null;
9569
+ bondingCurve: BondingCurve | null;
9570
+ amount: BN;
9571
+ }): BN;
9572
+ declare function getBuySolAmountFromTokenAmount({ global, feeConfig, mintSupply, bondingCurve, amount, }: {
9573
+ global: Global;
9574
+ feeConfig: FeeConfig | null;
9575
+ mintSupply: BN | null;
9576
+ bondingCurve: BondingCurve | null;
9577
+ amount: BN;
9578
+ }): BN;
9579
+ declare function getSellSolAmountFromTokenAmount({ global, feeConfig, mintSupply, bondingCurve, amount, }: {
9580
+ global: Global;
9581
+ feeConfig: FeeConfig | null;
9582
+ mintSupply: BN | null;
9583
+ bondingCurve: BondingCurve;
9584
+ amount: BN;
9585
+ }): BN;
9586
+ declare function bondingCurveMarketCap({ mintSupply, virtualSolReserves, virtualTokenReserves, }: {
9587
+ mintSupply: BN;
9588
+ virtualSolReserves: BN;
9589
+ virtualTokenReserves: BN;
9590
+ }): BN;
9096
9591
 
9097
9592
  declare function globalPda(): PublicKey;
9098
9593
  declare function bondingCurvePda(mint: PublicKeyInitData): PublicKey;
@@ -9116,10 +9611,12 @@ declare class PumpSdk {
9116
9611
  constructor(connection: Connection);
9117
9612
  programId(): PublicKey;
9118
9613
  decodeGlobal(accountInfo: AccountInfo<Buffer>): Global;
9614
+ decodeFeeConfig(accountInfo: AccountInfo<Buffer>): FeeConfig;
9119
9615
  decodeBondingCurve(accountInfo: AccountInfo<Buffer>): BondingCurve;
9120
9616
  decodeGlobalVolumeAccumulator(accountInfo: AccountInfo<Buffer>): GlobalVolumeAccumulator;
9121
9617
  decodeUserVolumeAccumulator(accountInfo: AccountInfo<Buffer>): UserVolumeAccumulator;
9122
9618
  fetchGlobal(): Promise<Global>;
9619
+ fetchFeeConfig(): Promise<FeeConfig>;
9123
9620
  fetchBondingCurve(mint: PublicKeyInitData): Promise<BondingCurve>;
9124
9621
  fetchBuyState(mint: PublicKey, user: PublicKey): Promise<{
9125
9622
  bondingCurveAccountInfo: AccountInfo<Buffer<ArrayBufferLike>>;
@@ -9230,4 +9727,4 @@ declare class PumpSdk {
9230
9727
  declare function totalUnclaimedTokens(globalVolumeAccumulator: GlobalVolumeAccumulator, userVolumeAccumulator: UserVolumeAccumulator, currentTimestamp?: number): BN;
9231
9728
  declare function currentDayTokens(globalVolumeAccumulator: GlobalVolumeAccumulator, userVolumeAccumulator: UserVolumeAccumulator, currentTimestamp?: number): BN;
9232
9729
 
9233
- export { BONDING_CURVE_NEW_SIZE, type BondingCurve, CANONICAL_POOL_INDEX, type Global, type GlobalVolumeAccumulator, PUMP_AMM_PROGRAM_ID, PUMP_PROGRAM_ID, type Pump, PumpSdk, type UserVolumeAccumulator, type UserVolumeAccumulatorTotalStats, bondingCurvePda, canonicalPumpPoolPda, creatorVaultPda, currentDayTokens, getBuySolAmountFromTokenAmount, getBuySolAmountFromTokenAmountQuote, getBuyTokenAmountFromSolAmount, getBuyTokenAmountFromSolAmountQuote, getPumpProgram, getSellSolAmountFromTokenAmount, getSellSolAmountFromTokenAmountQuote, globalPda, globalVolumeAccumulatorPda, newBondingCurve, pump as pumpIdl, pumpPoolAuthorityPda, totalUnclaimedTokens, userVolumeAccumulatorPda };
9730
+ export { BONDING_CURVE_NEW_SIZE, type BondingCurve, CANONICAL_POOL_INDEX, type Global, type GlobalVolumeAccumulator, PUMP_AMM_PROGRAM_ID, PUMP_PROGRAM_ID, type Pump, PumpSdk, type UserVolumeAccumulator, type UserVolumeAccumulatorTotalStats, bondingCurveMarketCap, bondingCurvePda, canonicalPumpPoolPda, createFeeConfigFromGlobalConfig, creatorVaultPda, currentDayTokens, getBuySolAmountFromTokenAmount, getBuySolAmountFromTokenAmountQuote, getBuyTokenAmountFromSolAmount, getBuyTokenAmountFromSolAmountQuote, getPumpProgram, getSellSolAmountFromTokenAmount, getSellSolAmountFromTokenAmountQuote, globalPda, globalVolumeAccumulatorPda, newBondingCurve, pump as pumpIdl, pumpPoolAuthorityPda, totalUnclaimedTokens, userVolumeAccumulatorPda };