@whetstone-research/doppler-sdk 1.0.16 → 1.0.18

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.
Files changed (35) hide show
  1. package/dist/{chunk-TVBSIQIX.js → chunk-6TOPYGOG.js} +4 -3
  2. package/dist/chunk-6TOPYGOG.js.map +1 -0
  3. package/dist/{chunk-3BW6IVP3.cjs → chunk-AKLS6T3R.cjs} +4 -3
  4. package/dist/chunk-AKLS6T3R.cjs.map +1 -0
  5. package/dist/{chunk-NMTYI3TB.js → chunk-C2D7CIXP.js} +6 -4
  6. package/dist/{chunk-NMTYI3TB.js.map → chunk-C2D7CIXP.js.map} +1 -1
  7. package/dist/{chunk-W5TMS4RD.cjs → chunk-GUGN3EYX.cjs} +39 -37
  8. package/dist/{chunk-W5TMS4RD.cjs.map → chunk-GUGN3EYX.cjs.map} +1 -1
  9. package/dist/evm/index.cjs +10 -0
  10. package/dist/evm/index.cjs.map +1 -1
  11. package/dist/evm/index.d.cts +14 -1
  12. package/dist/evm/index.d.ts +14 -1
  13. package/dist/evm/index.js +10 -1
  14. package/dist/evm/index.js.map +1 -1
  15. package/dist/{oracle-DN8BrGPh.d.ts → oracle-7PmpwwPx.d.cts} +2 -0
  16. package/dist/{oracle-DN8BrGPh.d.cts → oracle-7PmpwwPx.d.ts} +2 -0
  17. package/dist/{pda-5D3GD5S6.js → pda-N6ULJYLG.js} +3 -3
  18. package/dist/pda-N6ULJYLG.js.map +1 -0
  19. package/dist/{pda-GNZYNRUH.cjs → pda-PZRHQJMK.cjs} +16 -16
  20. package/dist/pda-PZRHQJMK.cjs.map +1 -0
  21. package/dist/solana/index.cjs +866 -185
  22. package/dist/solana/index.cjs.map +1 -1
  23. package/dist/solana/index.d.cts +383 -24
  24. package/dist/solana/index.d.ts +383 -24
  25. package/dist/solana/index.js +707 -26
  26. package/dist/solana/index.js.map +1 -1
  27. package/dist/solana/react/index.cjs +47 -47
  28. package/dist/solana/react/index.d.cts +1 -1
  29. package/dist/solana/react/index.d.ts +1 -1
  30. package/dist/solana/react/index.js +3 -3
  31. package/package.json +1 -1
  32. package/dist/chunk-3BW6IVP3.cjs.map +0 -1
  33. package/dist/chunk-TVBSIQIX.js.map +0 -1
  34. package/dist/pda-5D3GD5S6.js.map +0 -1
  35. package/dist/pda-GNZYNRUH.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
- import { transferAdminArgsCodec, swapExactInArgsCodec, sortPositionsByShares, sortPoolsByReserves, setRouteArgsCodec, setHookArgsCodec, setFeesArgsCodec, removeLiquidityArgsCodec, ratioToNumber, quoteToNumeraireArgsCodec, q64ToNumber, q64Mul, q64Div, positionDataCodec, poolExists, poolDataCodec, oracleStateDataCodec, oracleConsultArgsCodec, observationCodec, numberToQ64, minBigInt, maxBigInt, isqrt, isOracleStale, initializePoolArgsCodec, initializeOracleArgsCodec, initializeConfigArgsCodec, getTvl, getSwapQuoteExactOut, getSwapQuote, getSpotPrice1, getSpotPrice0, getRemoveLiquidityQuote, getPositionValue, getPositionAddressFromParams, getPoolByMints, getPoolAddressFromMints, getPendingFees, getOracleSpotPrices, getOracleForPool, getOracleDeviation, getOracleBufferStats, getOracleAge, getOracleAddressFromPool, getK, getAddLiquidityQuote, filterPoolsByMint, filterActivePositions, fetchUserPositions, fetchPositionsBatch, fetchPositionByParams, fetchPosition, fetchPoolsBatch, fetchPoolPositions, fetchPool, fetchOraclesBatch, fetchOracle, fetchAllPools, encodeTransferAdminArgs, encodeSwapExactInArgs, encodeSetRouteArgs, encodeSetHookArgs, encodeSetFeesArgs, encodeRemoveLiquidityArgs, encodeQuoteToNumeraireArgs, encodeOracleConsultArgs, encodeInstructionData, encodeInitializePoolArgs, encodeInitializeOracleArgs, encodeInitializeConfigArgs, encodeCreatePositionArgs, encodeCollectProtocolFeesArgs, encodeCollectFeesArgs, encodeAddLiquidityArgs, decodePosition, decodePool, decodeOracleState, decodeAmmConfig, createPositionArgsCodec, consultTwap, computePrice1Q64, computePrice0Q64, comparePoolAndOraclePrices, collectProtocolFeesArgsCodec, collectFeesArgsCodec, ceilDiv, calculateTwapNumber, calculateTwap, calculateAccruedFees, ammConfigDataCodec, addLiquidityArgsCodec } from '../chunk-NMTYI3TB.js';
2
- import { sortMints, getSwapAddresses, getProtocolFeePositionAddress, getPositionAddress, getPoolVault1Address, getPoolVault0Address, getPoolInitAddresses, getPoolAuthorityAddress, getPoolAddress, getOracleAddress, getLiquidityAddresses, getConfigAddress, CPMM_PROGRAM_ID, areMintsOrdered, TOKEN_METADATA_PROGRAM_ID, SEED_PROTOCOL_FEE_POSITION, SEED_POSITION, SEED_POOL, SEED_ORACLE, SEED_CONFIG, SEED_AUTHORITY, Q64_ONE, MAX_ORACLE_OBSERVATIONS, MAX_HOOK_ALLOWLIST, INSTRUCTION_DISCRIMINATORS, HOOK_NO_CHANGE, HF_REQUIRE_ORACLE, HF_FORWARD_READONLY_SIGNERS, HF_BEFORE_SWAP, HF_BEFORE_REMOVE_LIQ, HF_BEFORE_ADD_LIQ, HF_AFTER_SWAP, HF_AFTER_REMOVE_LIQ, HF_AFTER_ADD_LIQ, BPS_DENOM, ACCOUNT_VERSION, ACCOUNT_DISCRIMINATORS, TOKEN_PROGRAM_ADDRESS, SYSTEM_PROGRAM_ADDRESS } from '../chunk-TVBSIQIX.js';
1
+ import { transferAdminArgsCodec, swapExactInArgsCodec, sortPositionsByShares, sortPoolsByReserves, setRouteArgsCodec, setHookArgsCodec, setFeesArgsCodec, removeLiquidityArgsCodec, ratioToNumber, quoteToNumeraireArgsCodec, q64ToNumber, q64Mul, q64Div, positionDataCodec, poolExists, poolDataCodec, oracleStateDataCodec, oracleConsultArgsCodec, observationCodec, numberToQ64, minBigInt, maxBigInt, isqrt, isOracleStale, initializePoolArgsCodec, initializeOracleArgsCodec, initializeConfigArgsCodec, getTvl, getSwapQuoteExactOut, getSwapQuote, getSpotPrice1, getSpotPrice0, getRemoveLiquidityQuote, getPositionValue, getPositionAddressFromParams, getPoolByMints, getPoolAddressFromMints, getPendingFees, getOracleSpotPrices, getOracleForPool, getOracleDeviation, getOracleBufferStats, getOracleAge, getOracleAddressFromPool, getK, getAddLiquidityQuote, filterPoolsByMint, filterActivePositions, fetchUserPositions, fetchPositionsBatch, fetchPositionByParams, fetchPosition, fetchPoolsBatch, fetchPoolPositions, fetchPool, fetchOraclesBatch, fetchOracle, fetchAllPools, encodeTransferAdminArgs, encodeSwapExactInArgs, encodeSetRouteArgs, encodeSetHookArgs, encodeSetFeesArgs, encodeRemoveLiquidityArgs, encodeQuoteToNumeraireArgs, encodeOracleConsultArgs, encodeInstructionData, encodeInitializePoolArgs, encodeInitializeOracleArgs, encodeInitializeConfigArgs, encodeCreatePositionArgs, encodeCollectProtocolFeesArgs, encodeCollectFeesArgs, encodeAddLiquidityArgs, decodePosition, decodePool, decodeOracleState, decodeAmmConfig, createPositionArgsCodec, consultTwap, computePrice1Q64, computePrice0Q64, comparePoolAndOraclePrices, collectProtocolFeesArgsCodec, collectFeesArgsCodec, ceilDiv, calculateTwapNumber, calculateTwap, calculateAccruedFees, ammConfigDataCodec, addLiquidityArgsCodec } from '../chunk-C2D7CIXP.js';
2
+ import { sortMints, getSwapAddresses, getProtocolFeePositionAddress, getPositionAddress, getPoolVault1Address, getPoolVault0Address, getPoolInitAddresses, getPoolAuthorityAddress, getPoolAddress, getOracleAddress, getLiquidityAddresses, getConfigAddress, CPMM_PROGRAM_ID, areMintsOrdered, TOKEN_METADATA_PROGRAM_ID, SEED_PROTOCOL_FEE_POSITION, SEED_POSITION, SEED_POOL, SEED_ORACLE, SEED_CONFIG, SEED_AUTHORITY, Q64_ONE, MAX_ORACLE_OBSERVATIONS, MAX_HOOK_ALLOWLIST, INSTRUCTION_DISCRIMINATORS, HOOK_NO_CHANGE, HF_REQUIRE_ORACLE, HF_FORWARD_READONLY_SIGNERS, HF_BEFORE_SWAP, HF_BEFORE_REMOVE_LIQ, HF_BEFORE_ADD_LIQ, HF_AFTER_SWAP, HF_AFTER_REMOVE_LIQ, HF_AFTER_ADD_LIQ, BPS_DENOM, ACCOUNT_VERSION, ACCOUNT_DISCRIMINATORS, TOKEN_PROGRAM_ADDRESS, SYSTEM_PROGRAM_ADDRESS } from '../chunk-6TOPYGOG.js';
3
3
  import { __export } from '../chunk-PZ5AY32C.js';
4
4
  import { getAddressCodec, getProgramDerivedAddress, fixEncoderSize, getBytesEncoder, transformEncoder, getStructEncoder, getU64Encoder, getU128Encoder, getBooleanEncoder, getStructDecoder, fixDecoderSize, getU64Decoder, getU128Decoder, getBooleanDecoder, getBytesDecoder, combineCodec, getAddressEncoder, SolanaError, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, getU16Encoder, getU8Encoder, getArrayEncoder, getAddressDecoder, getU16Decoder, getU8Decoder, getArrayDecoder, getU32Encoder, getU32Decoder, getOptionEncoder, getOptionDecoder, createNoopSigner, decodeAccount, assertAccountExists, fetchEncodedAccount, assertAccountsExist, fetchEncodedAccounts, containsBytes, SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, assertIsInstructionWithAccounts, isProgramError, address, addEncoderSizePrefix, getUtf8Encoder, addDecoderSizePrefix, getUtf8Decoder, AccountRole, getStructCodec, getU64Codec, compressTransactionMessageUsingAddressLookupTables, mergeBytes } from '@solana/kit';
5
5
  import { getAddressFromResolvedInstructionAccount, getAccountMetaFactory, getNonNullResolvedInstructionInput, addSelfPlanAndSendFunctions, addSelfFetchFunctions } from '@solana/program-client-core';
@@ -1714,7 +1714,9 @@ function getInitializePoolInstructionDataEncoder() {
1714
1714
  ["initialSwapFeeBps", getU16Encoder()],
1715
1715
  ["initialFeeSplitBps", getU16Encoder()],
1716
1716
  ["liquidityMeasureTokenIndex", getU8Encoder()],
1717
- ["numeraireMintOverride", getOptionEncoder(getAddressEncoder())]
1717
+ ["numeraireMintOverride", getOptionEncoder(getAddressEncoder())],
1718
+ ["hookProgram", getAddressEncoder()],
1719
+ ["hookFlags", getU32Encoder()]
1718
1720
  ]),
1719
1721
  (value) => ({ ...value, discriminator: INITIALIZE_POOL_DISCRIMINATOR })
1720
1722
  );
@@ -1727,7 +1729,9 @@ function getInitializePoolInstructionDataDecoder() {
1727
1729
  ["initialSwapFeeBps", getU16Decoder()],
1728
1730
  ["initialFeeSplitBps", getU16Decoder()],
1729
1731
  ["liquidityMeasureTokenIndex", getU8Decoder()],
1730
- ["numeraireMintOverride", getOptionDecoder(getAddressDecoder())]
1732
+ ["numeraireMintOverride", getOptionDecoder(getAddressDecoder())],
1733
+ ["hookProgram", getAddressDecoder()],
1734
+ ["hookFlags", getU32Decoder()]
1731
1735
  ]);
1732
1736
  }
1733
1737
  function getInitializePoolInstructionDataCodec() {
@@ -4555,6 +4559,7 @@ __export(initializer_exports, {
4555
4559
  SEED_CONFIG: () => SEED_CONFIG2,
4556
4560
  SEED_LAUNCH: () => SEED_LAUNCH,
4557
4561
  SEED_LAUNCH_AUTHORITY: () => SEED_LAUNCH_AUTHORITY,
4562
+ SEED_LAUNCH_FEE_STATE: () => SEED_LAUNCH_FEE_STATE,
4558
4563
  TRADE_DIRECTION_BUY: () => TRADE_DIRECTION_BUY,
4559
4564
  TRADE_DIRECTION_SELL: () => TRADE_DIRECTION_SELL,
4560
4565
  buildAddressLookupTableSetupInstructions: () => buildAddressLookupTableSetupInstructions,
@@ -4574,7 +4579,9 @@ __export(initializer_exports, {
4574
4579
  fetchAllLaunches: () => fetchAllLaunches,
4575
4580
  fetchLaunch: () => fetchLaunch2,
4576
4581
  fetchLaunchesByAuthority: () => fetchLaunchesByAuthority,
4582
+ getClaimFeesInstructionAsync: () => getClaimFeesInstructionAsync,
4577
4583
  getConfigAddress: () => getConfigAddress2,
4584
+ getHarvestMigratedFeesInstructionAsync: () => getHarvestMigratedFeesInstructionAsync,
4578
4585
  getInitConfigCodec: () => getInitConfigCodec,
4579
4586
  getInitConfigDecoder: () => getInitConfigDecoder,
4580
4587
  getInitConfigEncoder: () => getInitConfigEncoder,
@@ -4590,7 +4597,13 @@ __export(initializer_exports, {
4590
4597
  getLaunchCodec: () => getLaunchCodec,
4591
4598
  getLaunchDecoder: () => getLaunchDecoder,
4592
4599
  getLaunchEncoder: () => getLaunchEncoder,
4600
+ getLaunchFeeStateAddress: () => getLaunchFeeStateAddress,
4601
+ getLaunchFeeStateCodec: () => getLaunchFeeStateCodec,
4602
+ getLaunchFeeStateDecoder: () => getLaunchFeeStateDecoder,
4603
+ getLaunchFeeStateEncoder: () => getLaunchFeeStateEncoder,
4593
4604
  getProgramDataAddress: () => getProgramDataAddress,
4605
+ getReplaceFeeBeneficiaryInstructionAsync: () => getReplaceFeeBeneficiaryInstructionAsync,
4606
+ getSetFeePolicyInstructionAsync: () => getSetFeePolicyInstructionAsync,
4594
4607
  getTokenMetadataAddress: () => getTokenMetadataAddress,
4595
4608
  launchExists: () => launchExists,
4596
4609
  launchIdFromU64: () => launchIdFromU64,
@@ -4611,6 +4624,7 @@ var PREDICTION_HOOK_PROGRAM_ID = address(
4611
4624
  var SEED_CONFIG2 = "config";
4612
4625
  var SEED_LAUNCH = "launch";
4613
4626
  var SEED_LAUNCH_AUTHORITY = "launch_authority";
4627
+ var SEED_LAUNCH_FEE_STATE = "launch_fee_state";
4614
4628
  var EMPTY_REMAINING_ACCOUNTS_HASH = new Uint8Array([
4615
4629
  232,
4616
4630
  231,
@@ -4757,7 +4771,18 @@ var INITIALIZER_ACCOUNT_DISCRIMINATORS = {
4757
4771
  // SHA256("account:InitConfig")[0:8]
4758
4772
  InitConfig: new Uint8Array([97, 166, 35, 7, 20, 2, 164, 126]),
4759
4773
  // SHA256("account:Launch")[0:8]
4760
- Launch: new Uint8Array([144, 51, 51, 163, 206, 85, 213, 38])
4774
+ Launch: new Uint8Array([144, 51, 51, 163, 206, 85, 213, 38]),
4775
+ // SHA256("account:LaunchFeeState")[0:8]
4776
+ LaunchFeeState: new Uint8Array([
4777
+ 1,
4778
+ 106,
4779
+ 55,
4780
+ 241,
4781
+ 179,
4782
+ 18,
4783
+ 230,
4784
+ 232
4785
+ ])
4761
4786
  };
4762
4787
  var INIT_CONFIG_DISCRIMINATOR = new Uint8Array([
4763
4788
  97,
@@ -4780,7 +4805,10 @@ function getInitConfigEncoder() {
4780
4805
  ["hookAllowlist", getArrayEncoder(getAddressEncoder(), { size: 32 })],
4781
4806
  ["bump", getU8Encoder()],
4782
4807
  ["version", getU8Encoder()],
4783
- ["reserved", fixEncoderSize(getBytesEncoder(), 31)]
4808
+ ["protocolFeeBps", getU16Encoder()],
4809
+ ["minSwapFeeBps", getU16Encoder()],
4810
+ ["maxSwapFeeBps", getU16Encoder()],
4811
+ ["reserved", fixEncoderSize(getBytesEncoder(), 24)]
4784
4812
  ]),
4785
4813
  (value) => ({ ...value, discriminator: INIT_CONFIG_DISCRIMINATOR })
4786
4814
  );
@@ -4795,22 +4823,57 @@ function getInitConfigDecoder() {
4795
4823
  ["hookAllowlist", getArrayDecoder(getAddressDecoder(), { size: 32 })],
4796
4824
  ["bump", getU8Decoder()],
4797
4825
  ["version", getU8Decoder()],
4798
- ["reserved", fixDecoderSize(getBytesDecoder(), 31)]
4826
+ ["protocolFeeBps", getU16Decoder()],
4827
+ ["minSwapFeeBps", getU16Decoder()],
4828
+ ["maxSwapFeeBps", getU16Decoder()],
4829
+ ["reserved", fixDecoderSize(getBytesDecoder(), 24)]
4799
4830
  ]);
4800
4831
  }
4801
4832
  function getInitConfigCodec() {
4802
4833
  return combineCodec(getInitConfigEncoder(), getInitConfigDecoder());
4803
4834
  }
4835
+ function getFeeBeneficiaryEncoder() {
4836
+ return getStructEncoder([
4837
+ ["wallet", getAddressEncoder()],
4838
+ ["shareBps", getU16Encoder()],
4839
+ ["pad", fixEncoderSize(getBytesEncoder(), 6)]
4840
+ ]);
4841
+ }
4842
+ function getFeeBeneficiaryDecoder() {
4843
+ return getStructDecoder([
4844
+ ["wallet", getAddressDecoder()],
4845
+ ["shareBps", getU16Decoder()],
4846
+ ["pad", fixDecoderSize(getBytesDecoder(), 6)]
4847
+ ]);
4848
+ }
4849
+ function getFeeBeneficiaryInputEncoder() {
4850
+ return getStructEncoder([
4851
+ ["wallet", getAddressEncoder()],
4852
+ ["shareBps", getU16Encoder()]
4853
+ ]);
4854
+ }
4855
+ function getFeeBeneficiaryInputDecoder() {
4856
+ return getStructDecoder([
4857
+ ["wallet", getAddressDecoder()],
4858
+ ["shareBps", getU16Decoder()]
4859
+ ]);
4860
+ }
4804
4861
  function getInitializeConfigArgsEncoder2() {
4805
4862
  return getStructEncoder([
4806
4863
  ["migratorAllowlist", getArrayEncoder(getAddressEncoder())],
4807
- ["hookAllowlist", getArrayEncoder(getAddressEncoder())]
4864
+ ["hookAllowlist", getArrayEncoder(getAddressEncoder())],
4865
+ ["protocolFeeBps", getU16Encoder()],
4866
+ ["minSwapFeeBps", getU16Encoder()],
4867
+ ["maxSwapFeeBps", getU16Encoder()]
4808
4868
  ]);
4809
4869
  }
4810
4870
  function getInitializeConfigArgsDecoder2() {
4811
4871
  return getStructDecoder([
4812
4872
  ["migratorAllowlist", getArrayDecoder(getAddressDecoder())],
4813
- ["hookAllowlist", getArrayDecoder(getAddressDecoder())]
4873
+ ["hookAllowlist", getArrayDecoder(getAddressDecoder())],
4874
+ ["protocolFeeBps", getU16Decoder()],
4875
+ ["minSwapFeeBps", getU16Decoder()],
4876
+ ["maxSwapFeeBps", getU16Decoder()]
4814
4877
  ]);
4815
4878
  }
4816
4879
  function getInitializeConfigArgsCodec2() {
@@ -4829,7 +4892,7 @@ function getInitializeLaunchArgsEncoder() {
4829
4892
  ["baseForLiquidity", getU64Encoder()],
4830
4893
  ["curveVirtualBase", getU64Encoder()],
4831
4894
  ["curveVirtualQuote", getU64Encoder()],
4832
- ["curveFeeBps", getU16Encoder()],
4895
+ ["swapFeeBps", getU16Encoder()],
4833
4896
  ["curveKind", getU8Encoder()],
4834
4897
  ["curveParams", addEncoderSizePrefix(getBytesEncoder(), getU32Encoder())],
4835
4898
  ["allowBuy", getU8Encoder()],
@@ -4856,7 +4919,8 @@ function getInitializeLaunchArgsEncoder() {
4856
4919
  ["migratorRemainingAccountsHash", fixEncoderSize(getBytesEncoder(), 32)],
4857
4920
  ["metadataName", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
4858
4921
  ["metadataSymbol", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
4859
- ["metadataUri", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())]
4922
+ ["metadataUri", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
4923
+ ["feeBeneficiaries", getArrayEncoder(getFeeBeneficiaryInputEncoder())]
4860
4924
  ]);
4861
4925
  }
4862
4926
  function getInitializeLaunchArgsDecoder() {
@@ -4869,7 +4933,7 @@ function getInitializeLaunchArgsDecoder() {
4869
4933
  ["baseForLiquidity", getU64Decoder()],
4870
4934
  ["curveVirtualBase", getU64Decoder()],
4871
4935
  ["curveVirtualQuote", getU64Decoder()],
4872
- ["curveFeeBps", getU16Decoder()],
4936
+ ["swapFeeBps", getU16Decoder()],
4873
4937
  ["curveKind", getU8Decoder()],
4874
4938
  ["curveParams", addDecoderSizePrefix(getBytesDecoder(), getU32Decoder())],
4875
4939
  ["allowBuy", getU8Decoder()],
@@ -4896,7 +4960,8 @@ function getInitializeLaunchArgsDecoder() {
4896
4960
  ["migratorRemainingAccountsHash", fixDecoderSize(getBytesDecoder(), 32)],
4897
4961
  ["metadataName", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
4898
4962
  ["metadataSymbol", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
4899
- ["metadataUri", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())]
4963
+ ["metadataUri", addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
4964
+ ["feeBeneficiaries", getArrayDecoder(getFeeBeneficiaryInputDecoder())]
4900
4965
  ]);
4901
4966
  }
4902
4967
  function getInitializeLaunchArgsCodec() {
@@ -4950,7 +5015,7 @@ function getLaunchEncoder() {
4950
5015
  ["baseForCurve", getU64Encoder()],
4951
5016
  ["curveVirtualBase", getU64Encoder()],
4952
5017
  ["curveVirtualQuote", getU64Encoder()],
4953
- ["curveFeeBps", getU16Encoder()],
5018
+ ["swapFeeBps", getU16Encoder()],
4954
5019
  ["pad1", fixEncoderSize(getBytesEncoder(), 6)],
4955
5020
  ["allowBuy", getU8Encoder()],
4956
5021
  ["allowSell", getU8Encoder()],
@@ -4992,7 +5057,7 @@ function getLaunchDecoder() {
4992
5057
  ["baseForCurve", getU64Decoder()],
4993
5058
  ["curveVirtualBase", getU64Decoder()],
4994
5059
  ["curveVirtualQuote", getU64Decoder()],
4995
- ["curveFeeBps", getU16Decoder()],
5060
+ ["swapFeeBps", getU16Decoder()],
4996
5061
  ["pad1", fixDecoderSize(getBytesDecoder(), 6)],
4997
5062
  ["allowBuy", getU8Decoder()],
4998
5063
  ["allowSell", getU8Decoder()],
@@ -5015,6 +5080,213 @@ function getLaunchDecoder() {
5015
5080
  function getLaunchCodec() {
5016
5081
  return combineCodec(getLaunchEncoder(), getLaunchDecoder());
5017
5082
  }
5083
+ var LAUNCH_FEE_STATE_DISCRIMINATOR = new Uint8Array([
5084
+ 1,
5085
+ 106,
5086
+ 55,
5087
+ 241,
5088
+ 179,
5089
+ 18,
5090
+ 230,
5091
+ 232
5092
+ ]);
5093
+ function getLaunchFeeStateEncoder() {
5094
+ return transformEncoder(
5095
+ getStructEncoder([
5096
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
5097
+ ["launch", getAddressEncoder()],
5098
+ ["protocolBeneficiary", getAddressEncoder()],
5099
+ ["beneficiaryLen", getU8Encoder()],
5100
+ ["bump", getU8Encoder()],
5101
+ ["protocolFeeBps", getU16Encoder()],
5102
+ ["swapFeeBps", getU16Encoder()],
5103
+ ["version", getU8Encoder()],
5104
+ ["pad0", fixEncoderSize(getBytesEncoder(), 1)],
5105
+ [
5106
+ "beneficiaries",
5107
+ getArrayEncoder(getFeeBeneficiaryEncoder(), { size: 8 })
5108
+ ],
5109
+ ["cumulatedBaseFees", getU64Encoder()],
5110
+ ["cumulatedQuoteFees", getU64Encoder()],
5111
+ ["distributedProtocolBaseFees", getU64Encoder()],
5112
+ ["distributedProtocolQuoteFees", getU64Encoder()],
5113
+ [
5114
+ "distributedBaseByBeneficiary",
5115
+ getArrayEncoder(getU64Encoder(), { size: 8 })
5116
+ ],
5117
+ [
5118
+ "distributedQuoteByBeneficiary",
5119
+ getArrayEncoder(getU64Encoder(), { size: 8 })
5120
+ ],
5121
+ ["reserved", fixEncoderSize(getBytesEncoder(), 128)]
5122
+ ]),
5123
+ (value) => ({ ...value, discriminator: LAUNCH_FEE_STATE_DISCRIMINATOR })
5124
+ );
5125
+ }
5126
+ function getLaunchFeeStateDecoder() {
5127
+ return getStructDecoder([
5128
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
5129
+ ["launch", getAddressDecoder()],
5130
+ ["protocolBeneficiary", getAddressDecoder()],
5131
+ ["beneficiaryLen", getU8Decoder()],
5132
+ ["bump", getU8Decoder()],
5133
+ ["protocolFeeBps", getU16Decoder()],
5134
+ ["swapFeeBps", getU16Decoder()],
5135
+ ["version", getU8Decoder()],
5136
+ ["pad0", fixDecoderSize(getBytesDecoder(), 1)],
5137
+ ["beneficiaries", getArrayDecoder(getFeeBeneficiaryDecoder(), { size: 8 })],
5138
+ ["cumulatedBaseFees", getU64Decoder()],
5139
+ ["cumulatedQuoteFees", getU64Decoder()],
5140
+ ["distributedProtocolBaseFees", getU64Decoder()],
5141
+ ["distributedProtocolQuoteFees", getU64Decoder()],
5142
+ [
5143
+ "distributedBaseByBeneficiary",
5144
+ getArrayDecoder(getU64Decoder(), { size: 8 })
5145
+ ],
5146
+ [
5147
+ "distributedQuoteByBeneficiary",
5148
+ getArrayDecoder(getU64Decoder(), { size: 8 })
5149
+ ],
5150
+ ["reserved", fixDecoderSize(getBytesDecoder(), 128)]
5151
+ ]);
5152
+ }
5153
+ function getLaunchFeeStateCodec() {
5154
+ return combineCodec(getLaunchFeeStateEncoder(), getLaunchFeeStateDecoder());
5155
+ }
5156
+ var CLAIM_FEES_DISCRIMINATOR = new Uint8Array([
5157
+ 82,
5158
+ 251,
5159
+ 233,
5160
+ 156,
5161
+ 12,
5162
+ 52,
5163
+ 184,
5164
+ 202
5165
+ ]);
5166
+ function getClaimFeesInstructionDataEncoder() {
5167
+ return transformEncoder(
5168
+ getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)]]),
5169
+ (value) => ({ ...value, discriminator: CLAIM_FEES_DISCRIMINATOR })
5170
+ );
5171
+ }
5172
+ async function getClaimFeesInstructionAsync(input, config) {
5173
+ const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;
5174
+ const originalAccounts = {
5175
+ launch: { value: input.launch ?? null, isWritable: false },
5176
+ launchFeeState: { value: input.launchFeeState ?? null, isWritable: true },
5177
+ launchAuthority: {
5178
+ value: input.launchAuthority ?? null,
5179
+ isWritable: false
5180
+ },
5181
+ recipient: { value: input.recipient ?? null, isWritable: false },
5182
+ baseMint: { value: input.baseMint ?? null, isWritable: false },
5183
+ quoteMint: { value: input.quoteMint ?? null, isWritable: false },
5184
+ baseVault: { value: input.baseVault ?? null, isWritable: true },
5185
+ quoteVault: { value: input.quoteVault ?? null, isWritable: true },
5186
+ recipientBaseAta: {
5187
+ value: input.recipientBaseAta ?? null,
5188
+ isWritable: true
5189
+ },
5190
+ recipientQuoteAta: {
5191
+ value: input.recipientQuoteAta ?? null,
5192
+ isWritable: true
5193
+ },
5194
+ baseTokenProgram: {
5195
+ value: input.baseTokenProgram ?? null,
5196
+ isWritable: false
5197
+ },
5198
+ quoteTokenProgram: {
5199
+ value: input.quoteTokenProgram ?? null,
5200
+ isWritable: false
5201
+ }
5202
+ };
5203
+ const accounts = originalAccounts;
5204
+ if (!accounts.launchFeeState.value) {
5205
+ accounts.launchFeeState.value = await getProgramDerivedAddress({
5206
+ programAddress,
5207
+ seeds: [
5208
+ getBytesEncoder().encode(
5209
+ new Uint8Array([
5210
+ 108,
5211
+ 97,
5212
+ 117,
5213
+ 110,
5214
+ 99,
5215
+ 104,
5216
+ 95,
5217
+ 102,
5218
+ 101,
5219
+ 101,
5220
+ 95,
5221
+ 115,
5222
+ 116,
5223
+ 97,
5224
+ 116,
5225
+ 101
5226
+ ])
5227
+ ),
5228
+ getAddressEncoder().encode(
5229
+ getAddressFromResolvedInstructionAccount(
5230
+ "launch",
5231
+ accounts.launch.value
5232
+ )
5233
+ )
5234
+ ]
5235
+ });
5236
+ }
5237
+ if (!accounts.launchAuthority.value) {
5238
+ accounts.launchAuthority.value = await getProgramDerivedAddress({
5239
+ programAddress,
5240
+ seeds: [
5241
+ getBytesEncoder().encode(
5242
+ new Uint8Array([
5243
+ 108,
5244
+ 97,
5245
+ 117,
5246
+ 110,
5247
+ 99,
5248
+ 104,
5249
+ 95,
5250
+ 97,
5251
+ 117,
5252
+ 116,
5253
+ 104,
5254
+ 111,
5255
+ 114,
5256
+ 105,
5257
+ 116,
5258
+ 121
5259
+ ])
5260
+ ),
5261
+ getAddressEncoder().encode(
5262
+ getAddressFromResolvedInstructionAccount(
5263
+ "launch",
5264
+ accounts.launch.value
5265
+ )
5266
+ )
5267
+ ]
5268
+ });
5269
+ }
5270
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
5271
+ return Object.freeze({
5272
+ accounts: [
5273
+ getAccountMeta("launch", accounts.launch),
5274
+ getAccountMeta("launchFeeState", accounts.launchFeeState),
5275
+ getAccountMeta("launchAuthority", accounts.launchAuthority),
5276
+ getAccountMeta("recipient", accounts.recipient),
5277
+ getAccountMeta("baseMint", accounts.baseMint),
5278
+ getAccountMeta("quoteMint", accounts.quoteMint),
5279
+ getAccountMeta("baseVault", accounts.baseVault),
5280
+ getAccountMeta("quoteVault", accounts.quoteVault),
5281
+ getAccountMeta("recipientBaseAta", accounts.recipientBaseAta),
5282
+ getAccountMeta("recipientQuoteAta", accounts.recipientQuoteAta),
5283
+ getAccountMeta("baseTokenProgram", accounts.baseTokenProgram),
5284
+ getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram)
5285
+ ],
5286
+ data: getClaimFeesInstructionDataEncoder().encode({}),
5287
+ programAddress
5288
+ });
5289
+ }
5018
5290
  var CURVE_SWAP_EXACT_IN_DISCRIMINATOR = new Uint8Array([
5019
5291
  196,
5020
5292
  247,
@@ -5036,6 +5308,153 @@ function getCurveSwapExactInInstructionDataEncoder() {
5036
5308
  (value) => ({ ...value, discriminator: CURVE_SWAP_EXACT_IN_DISCRIMINATOR })
5037
5309
  );
5038
5310
  }
5311
+ var HARVEST_MIGRATED_FEES_DISCRIMINATOR = new Uint8Array([
5312
+ 63,
5313
+ 77,
5314
+ 73,
5315
+ 117,
5316
+ 2,
5317
+ 43,
5318
+ 255,
5319
+ 176
5320
+ ]);
5321
+ function getHarvestMigratedFeesInstructionDataEncoder() {
5322
+ return transformEncoder(
5323
+ getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)]]),
5324
+ (value) => ({
5325
+ ...value,
5326
+ discriminator: HARVEST_MIGRATED_FEES_DISCRIMINATOR
5327
+ })
5328
+ );
5329
+ }
5330
+ async function getHarvestMigratedFeesInstructionAsync(input, config) {
5331
+ const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;
5332
+ const originalAccounts = {
5333
+ launch: { value: input.launch ?? null, isWritable: false },
5334
+ launchFeeState: { value: input.launchFeeState ?? null, isWritable: true },
5335
+ launchAuthority: {
5336
+ value: input.launchAuthority ?? null,
5337
+ isWritable: false
5338
+ },
5339
+ baseMint: { value: input.baseMint ?? null, isWritable: false },
5340
+ quoteMint: { value: input.quoteMint ?? null, isWritable: false },
5341
+ baseVault: { value: input.baseVault ?? null, isWritable: true },
5342
+ quoteVault: { value: input.quoteVault ?? null, isWritable: true },
5343
+ pool: { value: input.pool ?? null, isWritable: true },
5344
+ launchLpPosition: {
5345
+ value: input.launchLpPosition ?? null,
5346
+ isWritable: true
5347
+ },
5348
+ poolAuthority: { value: input.poolAuthority ?? null, isWritable: false },
5349
+ poolVault0: { value: input.poolVault0 ?? null, isWritable: true },
5350
+ poolVault1: { value: input.poolVault1 ?? null, isWritable: true },
5351
+ token0Mint: { value: input.token0Mint ?? null, isWritable: false },
5352
+ token1Mint: { value: input.token1Mint ?? null, isWritable: false },
5353
+ cpmmProgram: { value: input.cpmmProgram ?? null, isWritable: false },
5354
+ baseTokenProgram: {
5355
+ value: input.baseTokenProgram ?? null,
5356
+ isWritable: false
5357
+ },
5358
+ quoteTokenProgram: {
5359
+ value: input.quoteTokenProgram ?? null,
5360
+ isWritable: false
5361
+ }
5362
+ };
5363
+ const accounts = originalAccounts;
5364
+ if (!accounts.launchFeeState.value) {
5365
+ accounts.launchFeeState.value = await getProgramDerivedAddress({
5366
+ programAddress,
5367
+ seeds: [
5368
+ getBytesEncoder().encode(
5369
+ new Uint8Array([
5370
+ 108,
5371
+ 97,
5372
+ 117,
5373
+ 110,
5374
+ 99,
5375
+ 104,
5376
+ 95,
5377
+ 102,
5378
+ 101,
5379
+ 101,
5380
+ 95,
5381
+ 115,
5382
+ 116,
5383
+ 97,
5384
+ 116,
5385
+ 101
5386
+ ])
5387
+ ),
5388
+ getAddressEncoder().encode(
5389
+ getAddressFromResolvedInstructionAccount(
5390
+ "launch",
5391
+ accounts.launch.value
5392
+ )
5393
+ )
5394
+ ]
5395
+ });
5396
+ }
5397
+ if (!accounts.launchAuthority.value) {
5398
+ accounts.launchAuthority.value = await getProgramDerivedAddress({
5399
+ programAddress,
5400
+ seeds: [
5401
+ getBytesEncoder().encode(
5402
+ new Uint8Array([
5403
+ 108,
5404
+ 97,
5405
+ 117,
5406
+ 110,
5407
+ 99,
5408
+ 104,
5409
+ 95,
5410
+ 97,
5411
+ 117,
5412
+ 116,
5413
+ 104,
5414
+ 111,
5415
+ 114,
5416
+ 105,
5417
+ 116,
5418
+ 121
5419
+ ])
5420
+ ),
5421
+ getAddressEncoder().encode(
5422
+ getAddressFromResolvedInstructionAccount(
5423
+ "launch",
5424
+ accounts.launch.value
5425
+ )
5426
+ )
5427
+ ]
5428
+ });
5429
+ }
5430
+ if (!accounts.cpmmProgram.value) {
5431
+ accounts.cpmmProgram.value = "9PSxVPoPfnbZ8Q1uQhgS6ZxvBjFboZtebNsu34umxkgQ";
5432
+ }
5433
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
5434
+ return Object.freeze({
5435
+ accounts: [
5436
+ getAccountMeta("launch", accounts.launch),
5437
+ getAccountMeta("launchFeeState", accounts.launchFeeState),
5438
+ getAccountMeta("launchAuthority", accounts.launchAuthority),
5439
+ getAccountMeta("baseMint", accounts.baseMint),
5440
+ getAccountMeta("quoteMint", accounts.quoteMint),
5441
+ getAccountMeta("baseVault", accounts.baseVault),
5442
+ getAccountMeta("quoteVault", accounts.quoteVault),
5443
+ getAccountMeta("pool", accounts.pool),
5444
+ getAccountMeta("launchLpPosition", accounts.launchLpPosition),
5445
+ getAccountMeta("poolAuthority", accounts.poolAuthority),
5446
+ getAccountMeta("poolVault0", accounts.poolVault0),
5447
+ getAccountMeta("poolVault1", accounts.poolVault1),
5448
+ getAccountMeta("token0Mint", accounts.token0Mint),
5449
+ getAccountMeta("token1Mint", accounts.token1Mint),
5450
+ getAccountMeta("cpmmProgram", accounts.cpmmProgram),
5451
+ getAccountMeta("baseTokenProgram", accounts.baseTokenProgram),
5452
+ getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram)
5453
+ ],
5454
+ data: getHarvestMigratedFeesInstructionDataEncoder().encode({}),
5455
+ programAddress
5456
+ });
5457
+ }
5039
5458
  var INITIALIZE_CONFIG_DISCRIMINATOR3 = new Uint8Array([
5040
5459
  208,
5041
5460
  127,
@@ -5051,7 +5470,10 @@ function getInitializeConfigInstructionDataEncoder3() {
5051
5470
  getStructEncoder([
5052
5471
  ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
5053
5472
  ["migratorAllowlist", getArrayEncoder(getAddressEncoder())],
5054
- ["hookAllowlist", getArrayEncoder(getAddressEncoder())]
5473
+ ["hookAllowlist", getArrayEncoder(getAddressEncoder())],
5474
+ ["protocolFeeBps", getU16Encoder()],
5475
+ ["minSwapFeeBps", getU16Encoder()],
5476
+ ["maxSwapFeeBps", getU16Encoder()]
5055
5477
  ]),
5056
5478
  (value) => ({ ...value, discriminator: INITIALIZE_CONFIG_DISCRIMINATOR3 })
5057
5479
  );
@@ -5078,7 +5500,7 @@ function getInitializeLaunchInstructionDataEncoder() {
5078
5500
  ["baseForLiquidity", getU64Encoder()],
5079
5501
  ["curveVirtualBase", getU64Encoder()],
5080
5502
  ["curveVirtualQuote", getU64Encoder()],
5081
- ["curveFeeBps", getU16Encoder()],
5503
+ ["swapFeeBps", getU16Encoder()],
5082
5504
  ["curveKind", getU8Encoder()],
5083
5505
  ["curveParams", addEncoderSizePrefix(getBytesEncoder(), getU32Encoder())],
5084
5506
  ["allowBuy", getU8Encoder()],
@@ -5111,7 +5533,8 @@ function getInitializeLaunchInstructionDataEncoder() {
5111
5533
  "metadataSymbol",
5112
5534
  addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())
5113
5535
  ],
5114
- ["metadataUri", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())]
5536
+ ["metadataUri", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
5537
+ ["feeBeneficiaries", getArrayEncoder(getFeeBeneficiaryInputEncoder())]
5115
5538
  ]),
5116
5539
  (value) => ({ ...value, discriminator: INITIALIZE_LAUNCH_DISCRIMINATOR })
5117
5540
  );
@@ -5139,6 +5562,135 @@ function getPreviewSwapExactInInstructionDataEncoder2() {
5139
5562
  })
5140
5563
  );
5141
5564
  }
5565
+ var REPLACE_FEE_BENEFICIARY_DISCRIMINATOR = new Uint8Array([
5566
+ 125,
5567
+ 194,
5568
+ 227,
5569
+ 81,
5570
+ 175,
5571
+ 100,
5572
+ 78,
5573
+ 200
5574
+ ]);
5575
+ function getReplaceFeeBeneficiaryInstructionDataEncoder() {
5576
+ return transformEncoder(
5577
+ getStructEncoder([
5578
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
5579
+ ["newBeneficiary", getAddressEncoder()]
5580
+ ]),
5581
+ (value) => ({
5582
+ ...value,
5583
+ discriminator: REPLACE_FEE_BENEFICIARY_DISCRIMINATOR
5584
+ })
5585
+ );
5586
+ }
5587
+ async function getReplaceFeeBeneficiaryInstructionAsync(input, config) {
5588
+ const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;
5589
+ const originalAccounts = {
5590
+ launch: { value: input.launch ?? null, isWritable: false },
5591
+ launchFeeState: { value: input.launchFeeState ?? null, isWritable: true },
5592
+ currentBeneficiary: {
5593
+ value: input.currentBeneficiary ?? null,
5594
+ isWritable: false
5595
+ }
5596
+ };
5597
+ const accounts = originalAccounts;
5598
+ const args = { ...input };
5599
+ if (!accounts.launchFeeState.value) {
5600
+ accounts.launchFeeState.value = await getProgramDerivedAddress({
5601
+ programAddress,
5602
+ seeds: [
5603
+ getBytesEncoder().encode(
5604
+ new Uint8Array([
5605
+ 108,
5606
+ 97,
5607
+ 117,
5608
+ 110,
5609
+ 99,
5610
+ 104,
5611
+ 95,
5612
+ 102,
5613
+ 101,
5614
+ 101,
5615
+ 95,
5616
+ 115,
5617
+ 116,
5618
+ 97,
5619
+ 116,
5620
+ 101
5621
+ ])
5622
+ ),
5623
+ getAddressEncoder().encode(
5624
+ getAddressFromResolvedInstructionAccount(
5625
+ "launch",
5626
+ accounts.launch.value
5627
+ )
5628
+ )
5629
+ ]
5630
+ });
5631
+ }
5632
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
5633
+ return Object.freeze({
5634
+ accounts: [
5635
+ getAccountMeta("launch", accounts.launch),
5636
+ getAccountMeta("launchFeeState", accounts.launchFeeState),
5637
+ getAccountMeta("currentBeneficiary", accounts.currentBeneficiary)
5638
+ ],
5639
+ data: getReplaceFeeBeneficiaryInstructionDataEncoder().encode(
5640
+ args
5641
+ ),
5642
+ programAddress
5643
+ });
5644
+ }
5645
+ var SET_FEE_POLICY_DISCRIMINATOR = new Uint8Array([
5646
+ 91,
5647
+ 32,
5648
+ 224,
5649
+ 109,
5650
+ 147,
5651
+ 98,
5652
+ 71,
5653
+ 132
5654
+ ]);
5655
+ function getSetFeePolicyInstructionDataEncoder() {
5656
+ return transformEncoder(
5657
+ getStructEncoder([
5658
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
5659
+ ["protocolFeeBps", getU16Encoder()],
5660
+ ["minSwapFeeBps", getU16Encoder()],
5661
+ ["maxSwapFeeBps", getU16Encoder()]
5662
+ ]),
5663
+ (value) => ({ ...value, discriminator: SET_FEE_POLICY_DISCRIMINATOR })
5664
+ );
5665
+ }
5666
+ async function getSetFeePolicyInstructionAsync(input, config) {
5667
+ const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;
5668
+ const originalAccounts = {
5669
+ config: { value: input.config ?? null, isWritable: true },
5670
+ admin: { value: input.admin ?? null, isWritable: false }
5671
+ };
5672
+ const accounts = originalAccounts;
5673
+ const args = { ...input };
5674
+ if (!accounts.config.value) {
5675
+ accounts.config.value = await getProgramDerivedAddress({
5676
+ programAddress,
5677
+ seeds: [
5678
+ getBytesEncoder().encode(new Uint8Array([99, 111, 110, 102, 105, 103]))
5679
+ ]
5680
+ });
5681
+ }
5682
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
5683
+ return Object.freeze({
5684
+ accounts: [
5685
+ getAccountMeta("config", accounts.config),
5686
+ getAccountMeta("admin", accounts.admin)
5687
+ ],
5688
+ data: getSetFeePolicyInstructionDataEncoder().encode(
5689
+ args
5690
+ ),
5691
+ programAddress
5692
+ });
5693
+ }
5142
5694
  var SET_HOOK_ALLOWLIST_DISCRIMINATOR = new Uint8Array([
5143
5695
  232,
5144
5696
  28,
@@ -5180,6 +5732,9 @@ function getSetMigratorAllowlistInstructionDataEncoder() {
5180
5732
  })
5181
5733
  );
5182
5734
  }
5735
+
5736
+ // src/solana/generated/initializer/programs/initializer.ts
5737
+ var INITIALIZER_PROGRAM_ADDRESS = "4h3Dqyo5qmteJoMxXt3tdtfXELDB6pdRTPU9mWruiKp1";
5183
5738
  if (process.env.NODE_ENV !== "production") ;
5184
5739
  var addressCodec2 = getAddressCodec();
5185
5740
  var textEncoder3 = new TextEncoder();
@@ -5223,6 +5778,15 @@ async function getLaunchAuthorityAddress(launch, programId = INITIALIZER_PROGRAM
5223
5778
  ]
5224
5779
  });
5225
5780
  }
5781
+ async function getLaunchFeeStateAddress(launch, programId = INITIALIZER_PROGRAM_ID) {
5782
+ return getProgramDerivedAddress({
5783
+ programAddress: programId,
5784
+ seeds: [
5785
+ textEncoder3.encode(SEED_LAUNCH_FEE_STATE),
5786
+ addressCodec2.encode(launch)
5787
+ ]
5788
+ });
5789
+ }
5226
5790
  function launchIdFromU64(launchId) {
5227
5791
  const out = new Uint8Array(32);
5228
5792
  out.set(encodeU64LE(launchId), 0);
@@ -5572,6 +6136,84 @@ async function fetchAllMaybeEntryByMint(rpc, addresses, config) {
5572
6136
  function getEntryByMintSize() {
5573
6137
  return 112;
5574
6138
  }
6139
+ var INIT_CONFIG_DISCRIMINATOR2 = new Uint8Array([
6140
+ 97,
6141
+ 166,
6142
+ 35,
6143
+ 7,
6144
+ 20,
6145
+ 2,
6146
+ 164,
6147
+ 126
6148
+ ]);
6149
+ function getInitConfigDiscriminatorBytes() {
6150
+ return fixEncoderSize(getBytesEncoder(), 8).encode(INIT_CONFIG_DISCRIMINATOR2);
6151
+ }
6152
+ function getInitConfigEncoder2() {
6153
+ return transformEncoder(
6154
+ getStructEncoder([
6155
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
6156
+ ["admin", getAddressEncoder()],
6157
+ ["migratorAllowlistLen", getU8Encoder()],
6158
+ ["migratorAllowlist", getArrayEncoder(getAddressEncoder(), { size: 32 })],
6159
+ ["hookAllowlistLen", getU8Encoder()],
6160
+ ["hookAllowlist", getArrayEncoder(getAddressEncoder(), { size: 32 })],
6161
+ ["bump", getU8Encoder()],
6162
+ ["version", getU8Encoder()],
6163
+ ["protocolFeeBps", getU16Encoder()],
6164
+ ["minSwapFeeBps", getU16Encoder()],
6165
+ ["maxSwapFeeBps", getU16Encoder()],
6166
+ ["reserved", fixEncoderSize(getBytesEncoder(), 24)]
6167
+ ]),
6168
+ (value) => ({ ...value, discriminator: INIT_CONFIG_DISCRIMINATOR2 })
6169
+ );
6170
+ }
6171
+ function getInitConfigDecoder2() {
6172
+ return getStructDecoder([
6173
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
6174
+ ["admin", getAddressDecoder()],
6175
+ ["migratorAllowlistLen", getU8Decoder()],
6176
+ ["migratorAllowlist", getArrayDecoder(getAddressDecoder(), { size: 32 })],
6177
+ ["hookAllowlistLen", getU8Decoder()],
6178
+ ["hookAllowlist", getArrayDecoder(getAddressDecoder(), { size: 32 })],
6179
+ ["bump", getU8Decoder()],
6180
+ ["version", getU8Decoder()],
6181
+ ["protocolFeeBps", getU16Decoder()],
6182
+ ["minSwapFeeBps", getU16Decoder()],
6183
+ ["maxSwapFeeBps", getU16Decoder()],
6184
+ ["reserved", fixDecoderSize(getBytesDecoder(), 24)]
6185
+ ]);
6186
+ }
6187
+ function getInitConfigCodec2() {
6188
+ return combineCodec(getInitConfigEncoder2(), getInitConfigDecoder2());
6189
+ }
6190
+ function decodeInitConfig(encodedAccount) {
6191
+ return decodeAccount(
6192
+ encodedAccount,
6193
+ getInitConfigDecoder2()
6194
+ );
6195
+ }
6196
+ async function fetchInitConfig(rpc, address3, config) {
6197
+ const maybeAccount = await fetchMaybeInitConfig(rpc, address3, config);
6198
+ assertAccountExists(maybeAccount);
6199
+ return maybeAccount;
6200
+ }
6201
+ async function fetchMaybeInitConfig(rpc, address3, config) {
6202
+ const maybeAccount = await fetchEncodedAccount(rpc, address3, config);
6203
+ return decodeInitConfig(maybeAccount);
6204
+ }
6205
+ async function fetchAllInitConfig(rpc, addresses, config) {
6206
+ const maybeAccounts = await fetchAllMaybeInitConfig(rpc, addresses, config);
6207
+ assertAccountsExist(maybeAccounts);
6208
+ return maybeAccounts;
6209
+ }
6210
+ async function fetchAllMaybeInitConfig(rpc, addresses, config) {
6211
+ const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
6212
+ return maybeAccounts.map((maybeAccount) => decodeInitConfig(maybeAccount));
6213
+ }
6214
+ function getInitConfigSize() {
6215
+ return 2123;
6216
+ }
5575
6217
  function getAccumulatorUpdatedEncoder() {
5576
6218
  return getStructEncoder([
5577
6219
  ["market", getAddressEncoder()],
@@ -5786,7 +6428,7 @@ function getLaunchEncoder2() {
5786
6428
  ["baseForCurve", getU64Encoder()],
5787
6429
  ["curveVirtualBase", getU64Encoder()],
5788
6430
  ["curveVirtualQuote", getU64Encoder()],
5789
- ["curveFeeBps", getU16Encoder()],
6431
+ ["swapFeeBps", getU16Encoder()],
5790
6432
  ["pad1", fixEncoderSize(getBytesEncoder(), 6)],
5791
6433
  ["allowBuy", getU8Encoder()],
5792
6434
  ["allowSell", getU8Encoder()],
@@ -5828,7 +6470,7 @@ function getLaunchDecoder2() {
5828
6470
  ["baseForCurve", getU64Decoder()],
5829
6471
  ["curveVirtualBase", getU64Decoder()],
5830
6472
  ["curveVirtualQuote", getU64Decoder()],
5831
- ["curveFeeBps", getU16Decoder()],
6473
+ ["swapFeeBps", getU16Decoder()],
5832
6474
  ["pad1", fixDecoderSize(getBytesDecoder(), 6)],
5833
6475
  ["allowBuy", getU8Decoder()],
5834
6476
  ["allowSell", getU8Decoder()],
@@ -7042,9 +7684,10 @@ var PredictionMigratorAccount = /* @__PURE__ */ ((PredictionMigratorAccount2) =>
7042
7684
  PredictionMigratorAccount2[PredictionMigratorAccount2["ClaimReceipt"] = 0] = "ClaimReceipt";
7043
7685
  PredictionMigratorAccount2[PredictionMigratorAccount2["Entry"] = 1] = "Entry";
7044
7686
  PredictionMigratorAccount2[PredictionMigratorAccount2["EntryByMint"] = 2] = "EntryByMint";
7045
- PredictionMigratorAccount2[PredictionMigratorAccount2["Launch"] = 3] = "Launch";
7046
- PredictionMigratorAccount2[PredictionMigratorAccount2["Market"] = 4] = "Market";
7047
- PredictionMigratorAccount2[PredictionMigratorAccount2["OracleState"] = 5] = "OracleState";
7687
+ PredictionMigratorAccount2[PredictionMigratorAccount2["InitConfig"] = 3] = "InitConfig";
7688
+ PredictionMigratorAccount2[PredictionMigratorAccount2["Launch"] = 4] = "Launch";
7689
+ PredictionMigratorAccount2[PredictionMigratorAccount2["Market"] = 5] = "Market";
7690
+ PredictionMigratorAccount2[PredictionMigratorAccount2["OracleState"] = 6] = "OracleState";
7048
7691
  return PredictionMigratorAccount2;
7049
7692
  })(PredictionMigratorAccount || {});
7050
7693
  function identifyPredictionMigratorAccount(account) {
@@ -7076,6 +7719,15 @@ function identifyPredictionMigratorAccount(account) {
7076
7719
  )) {
7077
7720
  return 2 /* EntryByMint */;
7078
7721
  }
7722
+ if (containsBytes(
7723
+ data,
7724
+ fixEncoderSize(getBytesEncoder(), 8).encode(
7725
+ new Uint8Array([97, 166, 35, 7, 20, 2, 164, 126])
7726
+ ),
7727
+ 0
7728
+ )) {
7729
+ return 3 /* InitConfig */;
7730
+ }
7079
7731
  if (containsBytes(
7080
7732
  data,
7081
7733
  fixEncoderSize(getBytesEncoder(), 8).encode(
@@ -7083,7 +7735,7 @@ function identifyPredictionMigratorAccount(account) {
7083
7735
  ),
7084
7736
  0
7085
7737
  )) {
7086
- return 3 /* Launch */;
7738
+ return 4 /* Launch */;
7087
7739
  }
7088
7740
  if (containsBytes(
7089
7741
  data,
@@ -7092,7 +7744,7 @@ function identifyPredictionMigratorAccount(account) {
7092
7744
  ),
7093
7745
  0
7094
7746
  )) {
7095
- return 4 /* Market */;
7747
+ return 5 /* Market */;
7096
7748
  }
7097
7749
  if (containsBytes(
7098
7750
  data,
@@ -7101,7 +7753,7 @@ function identifyPredictionMigratorAccount(account) {
7101
7753
  ),
7102
7754
  0
7103
7755
  )) {
7104
- return 5 /* OracleState */;
7756
+ return 6 /* OracleState */;
7105
7757
  }
7106
7758
  throw new SolanaError(
7107
7759
  SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,
@@ -7208,6 +7860,7 @@ function predictionMigratorProgram() {
7208
7860
  claimReceipt: addSelfFetchFunctions(client, getClaimReceiptCodec()),
7209
7861
  entry: addSelfFetchFunctions(client, getEntryCodec()),
7210
7862
  entryByMint: addSelfFetchFunctions(client, getEntryByMintCodec()),
7863
+ initConfig: addSelfFetchFunctions(client, getInitConfigCodec2()),
7211
7864
  launch: addSelfFetchFunctions(client, getLaunchCodec2()),
7212
7865
  market: addSelfFetchFunctions(client, getMarketCodec()),
7213
7866
  oracleState: addSelfFetchFunctions(client, getOracleStateCodec2())
@@ -7329,6 +7982,7 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
7329
7982
  quoteMint,
7330
7983
  baseVault,
7331
7984
  quoteVault,
7985
+ launchFeeState,
7332
7986
  payer,
7333
7987
  authority,
7334
7988
  hookProgram,
@@ -7353,6 +8007,10 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
7353
8007
  const hookCreateRemainingAccountAddresses = hookCreateRemainingAccounts.map(
7354
8008
  (account) => isTransactionSigner5(account) ? account.address : account
7355
8009
  );
8010
+ const swapFeeBps = args.swapFeeBps ?? args.curveFeeBps;
8011
+ if (swapFeeBps === void 0) {
8012
+ throw new Error("swapFeeBps is required");
8013
+ }
7356
8014
  const keys = [
7357
8015
  { address: config, role: AccountRole.READONLY },
7358
8016
  { address: launch, role: AccountRole.WRITABLE },
@@ -7361,6 +8019,10 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
7361
8019
  { address: quoteMint, role: AccountRole.READONLY },
7362
8020
  createAccountMeta(baseVault, AccountRole.WRITABLE_SIGNER),
7363
8021
  createAccountMeta(quoteVault, AccountRole.WRITABLE_SIGNER),
8022
+ {
8023
+ address: launchFeeState ?? (await getLaunchFeeStateAddress(launch, programId))[0],
8024
+ role: AccountRole.WRITABLE
8025
+ },
7364
8026
  createAccountMeta(payer, AccountRole.WRITABLE_SIGNER)
7365
8027
  ];
7366
8028
  keys.push(
@@ -7385,6 +8047,8 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
7385
8047
  }
7386
8048
  const encoderArgs = {
7387
8049
  ...args,
8050
+ swapFeeBps,
8051
+ feeBeneficiaries: args.feeBeneficiaries ?? [],
7388
8052
  allowBuy: args.allowBuy ? 1 : 0,
7389
8053
  allowSell: args.allowSell ? 1 : 0,
7390
8054
  hookProgram: args.hookProgram ?? hookProgram ?? SYSTEM_PROGRAM_ADDRESS,
@@ -7476,6 +8140,7 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
7476
8140
  quoteMint,
7477
8141
  user,
7478
8142
  hookProgram = SYSTEM_PROGRAM_ADDRESS,
8143
+ launchFeeState,
7479
8144
  baseTokenProgram = TOKEN_PROGRAM_ADDRESS,
7480
8145
  quoteTokenProgram = TOKEN_PROGRAM_ADDRESS,
7481
8146
  remainingAccounts = []
@@ -7495,6 +8160,7 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
7495
8160
  // slot (token_program follows it). Always emit it — use SYSTEM_PROGRAM_ADDRESS as the
7496
8161
  // no-op placeholder when no real hook is configured.
7497
8162
  { address: hookProgram, role: AccountRole.READONLY },
8163
+ { address: launchFeeState, role: AccountRole.WRITABLE },
7498
8164
  { address: baseTokenProgram, role: AccountRole.READONLY },
7499
8165
  { address: quoteTokenProgram, role: AccountRole.READONLY },
7500
8166
  ...remainingAccounts.map(createRemainingAccountMeta)
@@ -7522,6 +8188,7 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
7522
8188
  quoteMint,
7523
8189
  baseVault,
7524
8190
  quoteVault,
8191
+ launchFeeState,
7525
8192
  migratorProgram,
7526
8193
  payer,
7527
8194
  baseTokenProgram = TOKEN_PROGRAM_ADDRESS,
@@ -7537,6 +8204,7 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
7537
8204
  { address: quoteMint, role: AccountRole.READONLY },
7538
8205
  { address: baseVault, role: AccountRole.WRITABLE },
7539
8206
  { address: quoteVault, role: AccountRole.WRITABLE },
8207
+ { address: launchFeeState, role: AccountRole.READONLY },
7540
8208
  { address: migratorProgram, role: AccountRole.READONLY },
7541
8209
  createSignerAccountMeta4(payer, AccountRole.WRITABLE_SIGNER),
7542
8210
  { address: baseTokenProgram, role: AccountRole.READONLY },
@@ -7572,6 +8240,7 @@ var previewSwapExactInResultCodec = getStructCodec([
7572
8240
  function createPreviewSwapExactInInstruction(accounts, args, programId = INITIALIZER_PROGRAM_ID) {
7573
8241
  const {
7574
8242
  launch,
8243
+ launchFeeState,
7575
8244
  baseVault,
7576
8245
  quoteVault,
7577
8246
  hookProgram,
@@ -7579,6 +8248,7 @@ function createPreviewSwapExactInInstruction(accounts, args, programId = INITIAL
7579
8248
  } = accounts;
7580
8249
  const keys = [
7581
8250
  { address: launch, role: AccountRole.READONLY },
8251
+ { address: launchFeeState, role: AccountRole.READONLY },
7582
8252
  { address: baseVault, role: AccountRole.READONLY },
7583
8253
  { address: quoteVault, role: AccountRole.READONLY }
7584
8254
  ];
@@ -8071,6 +8741,7 @@ __export(predictionMigrator_exports, {
8071
8741
  CLAIM_RECEIPT_DISCRIMINATOR: () => CLAIM_RECEIPT_DISCRIMINATOR,
8072
8742
  ENTRY_BY_MINT_DISCRIMINATOR: () => ENTRY_BY_MINT_DISCRIMINATOR,
8073
8743
  ENTRY_DISCRIMINATOR: () => ENTRY_DISCRIMINATOR,
8744
+ INIT_CONFIG_DISCRIMINATOR: () => INIT_CONFIG_DISCRIMINATOR2,
8074
8745
  LAUNCH_DISCRIMINATOR: () => LAUNCH_DISCRIMINATOR2,
8075
8746
  MARKET_DISCRIMINATOR: () => MARKET_DISCRIMINATOR,
8076
8747
  MIGRATE_ENTRY_DISCRIMINATOR: () => MIGRATE_ENTRY_DISCRIMINATOR,
@@ -8103,17 +8774,20 @@ __export(predictionMigrator_exports, {
8103
8774
  decodeClaimReceipt: () => decodeClaimReceipt,
8104
8775
  decodeEntry: () => decodeEntry,
8105
8776
  decodeEntryByMint: () => decodeEntryByMint,
8777
+ decodeInitConfig: () => decodeInitConfig,
8106
8778
  decodeLaunch: () => decodeLaunch,
8107
8779
  decodeMarket: () => decodeMarket,
8108
8780
  decodeOracleState: () => decodeOracleState2,
8109
8781
  fetchAllClaimReceipt: () => fetchAllClaimReceipt,
8110
8782
  fetchAllEntry: () => fetchAllEntry,
8111
8783
  fetchAllEntryByMint: () => fetchAllEntryByMint,
8784
+ fetchAllInitConfig: () => fetchAllInitConfig,
8112
8785
  fetchAllLaunch: () => fetchAllLaunch,
8113
8786
  fetchAllMarket: () => fetchAllMarket,
8114
8787
  fetchAllMaybeClaimReceipt: () => fetchAllMaybeClaimReceipt,
8115
8788
  fetchAllMaybeEntry: () => fetchAllMaybeEntry,
8116
8789
  fetchAllMaybeEntryByMint: () => fetchAllMaybeEntryByMint,
8790
+ fetchAllMaybeInitConfig: () => fetchAllMaybeInitConfig,
8117
8791
  fetchAllMaybeLaunch: () => fetchAllMaybeLaunch,
8118
8792
  fetchAllMaybeMarket: () => fetchAllMaybeMarket,
8119
8793
  fetchAllMaybeOracleState: () => fetchAllMaybeOracleState,
@@ -8121,11 +8795,13 @@ __export(predictionMigrator_exports, {
8121
8795
  fetchClaimReceipt: () => fetchClaimReceipt,
8122
8796
  fetchEntry: () => fetchEntry,
8123
8797
  fetchEntryByMint: () => fetchEntryByMint,
8798
+ fetchInitConfig: () => fetchInitConfig,
8124
8799
  fetchLaunch: () => fetchLaunch,
8125
8800
  fetchMarket: () => fetchMarket,
8126
8801
  fetchMaybeClaimReceipt: () => fetchMaybeClaimReceipt,
8127
8802
  fetchMaybeEntry: () => fetchMaybeEntry,
8128
8803
  fetchMaybeEntryByMint: () => fetchMaybeEntryByMint,
8804
+ fetchMaybeInitConfig: () => fetchMaybeInitConfig,
8129
8805
  fetchMaybeLaunch: () => fetchMaybeLaunch,
8130
8806
  fetchMaybeMarket: () => fetchMaybeMarket,
8131
8807
  fetchMaybeOracleState: () => fetchMaybeOracleState,
@@ -8160,6 +8836,11 @@ __export(predictionMigrator_exports, {
8160
8836
  getEntryRegisteredDecoder: () => getEntryRegisteredDecoder,
8161
8837
  getEntryRegisteredEncoder: () => getEntryRegisteredEncoder,
8162
8838
  getEntrySize: () => getEntrySize,
8839
+ getInitConfigCodec: () => getInitConfigCodec2,
8840
+ getInitConfigDecoder: () => getInitConfigDecoder2,
8841
+ getInitConfigDiscriminatorBytes: () => getInitConfigDiscriminatorBytes,
8842
+ getInitConfigEncoder: () => getInitConfigEncoder2,
8843
+ getInitConfigSize: () => getInitConfigSize,
8163
8844
  getLaunchCodec: () => getLaunchCodec2,
8164
8845
  getLaunchDecoder: () => getLaunchDecoder2,
8165
8846
  getLaunchDiscriminatorBytes: () => getLaunchDiscriminatorBytes,