@whetstone-research/doppler-sdk 1.0.16 → 1.0.17

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.
@@ -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,217 @@ 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
+ ["migratedPool", getAddressEncoder()],
5122
+ ["migratedPosition", getAddressEncoder()],
5123
+ ["reserved", fixEncoderSize(getBytesEncoder(), 64)]
5124
+ ]),
5125
+ (value) => ({ ...value, discriminator: LAUNCH_FEE_STATE_DISCRIMINATOR })
5126
+ );
5127
+ }
5128
+ function getLaunchFeeStateDecoder() {
5129
+ return getStructDecoder([
5130
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
5131
+ ["launch", getAddressDecoder()],
5132
+ ["protocolBeneficiary", getAddressDecoder()],
5133
+ ["beneficiaryLen", getU8Decoder()],
5134
+ ["bump", getU8Decoder()],
5135
+ ["protocolFeeBps", getU16Decoder()],
5136
+ ["swapFeeBps", getU16Decoder()],
5137
+ ["version", getU8Decoder()],
5138
+ ["pad0", fixDecoderSize(getBytesDecoder(), 1)],
5139
+ ["beneficiaries", getArrayDecoder(getFeeBeneficiaryDecoder(), { size: 8 })],
5140
+ ["cumulatedBaseFees", getU64Decoder()],
5141
+ ["cumulatedQuoteFees", getU64Decoder()],
5142
+ ["distributedProtocolBaseFees", getU64Decoder()],
5143
+ ["distributedProtocolQuoteFees", getU64Decoder()],
5144
+ [
5145
+ "distributedBaseByBeneficiary",
5146
+ getArrayDecoder(getU64Decoder(), { size: 8 })
5147
+ ],
5148
+ [
5149
+ "distributedQuoteByBeneficiary",
5150
+ getArrayDecoder(getU64Decoder(), { size: 8 })
5151
+ ],
5152
+ ["migratedPool", getAddressDecoder()],
5153
+ ["migratedPosition", getAddressDecoder()],
5154
+ ["reserved", fixDecoderSize(getBytesDecoder(), 64)]
5155
+ ]);
5156
+ }
5157
+ function getLaunchFeeStateCodec() {
5158
+ return combineCodec(getLaunchFeeStateEncoder(), getLaunchFeeStateDecoder());
5159
+ }
5160
+ var CLAIM_FEES_DISCRIMINATOR = new Uint8Array([
5161
+ 82,
5162
+ 251,
5163
+ 233,
5164
+ 156,
5165
+ 12,
5166
+ 52,
5167
+ 184,
5168
+ 202
5169
+ ]);
5170
+ function getClaimFeesInstructionDataEncoder() {
5171
+ return transformEncoder(
5172
+ getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)]]),
5173
+ (value) => ({ ...value, discriminator: CLAIM_FEES_DISCRIMINATOR })
5174
+ );
5175
+ }
5176
+ async function getClaimFeesInstructionAsync(input, config) {
5177
+ const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;
5178
+ const originalAccounts = {
5179
+ launch: { value: input.launch ?? null, isWritable: false },
5180
+ launchFeeState: { value: input.launchFeeState ?? null, isWritable: true },
5181
+ launchAuthority: {
5182
+ value: input.launchAuthority ?? null,
5183
+ isWritable: false
5184
+ },
5185
+ recipient: { value: input.recipient ?? null, isWritable: false },
5186
+ baseMint: { value: input.baseMint ?? null, isWritable: false },
5187
+ quoteMint: { value: input.quoteMint ?? null, isWritable: false },
5188
+ baseVault: { value: input.baseVault ?? null, isWritable: true },
5189
+ quoteVault: { value: input.quoteVault ?? null, isWritable: true },
5190
+ recipientBaseAta: {
5191
+ value: input.recipientBaseAta ?? null,
5192
+ isWritable: true
5193
+ },
5194
+ recipientQuoteAta: {
5195
+ value: input.recipientQuoteAta ?? null,
5196
+ isWritable: true
5197
+ },
5198
+ baseTokenProgram: {
5199
+ value: input.baseTokenProgram ?? null,
5200
+ isWritable: false
5201
+ },
5202
+ quoteTokenProgram: {
5203
+ value: input.quoteTokenProgram ?? null,
5204
+ isWritable: false
5205
+ }
5206
+ };
5207
+ const accounts = originalAccounts;
5208
+ if (!accounts.launchFeeState.value) {
5209
+ accounts.launchFeeState.value = await getProgramDerivedAddress({
5210
+ programAddress,
5211
+ seeds: [
5212
+ getBytesEncoder().encode(
5213
+ new Uint8Array([
5214
+ 108,
5215
+ 97,
5216
+ 117,
5217
+ 110,
5218
+ 99,
5219
+ 104,
5220
+ 95,
5221
+ 102,
5222
+ 101,
5223
+ 101,
5224
+ 95,
5225
+ 115,
5226
+ 116,
5227
+ 97,
5228
+ 116,
5229
+ 101
5230
+ ])
5231
+ ),
5232
+ getAddressEncoder().encode(
5233
+ getAddressFromResolvedInstructionAccount(
5234
+ "launch",
5235
+ accounts.launch.value
5236
+ )
5237
+ )
5238
+ ]
5239
+ });
5240
+ }
5241
+ if (!accounts.launchAuthority.value) {
5242
+ accounts.launchAuthority.value = await getProgramDerivedAddress({
5243
+ programAddress,
5244
+ seeds: [
5245
+ getBytesEncoder().encode(
5246
+ new Uint8Array([
5247
+ 108,
5248
+ 97,
5249
+ 117,
5250
+ 110,
5251
+ 99,
5252
+ 104,
5253
+ 95,
5254
+ 97,
5255
+ 117,
5256
+ 116,
5257
+ 104,
5258
+ 111,
5259
+ 114,
5260
+ 105,
5261
+ 116,
5262
+ 121
5263
+ ])
5264
+ ),
5265
+ getAddressEncoder().encode(
5266
+ getAddressFromResolvedInstructionAccount(
5267
+ "launch",
5268
+ accounts.launch.value
5269
+ )
5270
+ )
5271
+ ]
5272
+ });
5273
+ }
5274
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
5275
+ return Object.freeze({
5276
+ accounts: [
5277
+ getAccountMeta("launch", accounts.launch),
5278
+ getAccountMeta("launchFeeState", accounts.launchFeeState),
5279
+ getAccountMeta("launchAuthority", accounts.launchAuthority),
5280
+ getAccountMeta("recipient", accounts.recipient),
5281
+ getAccountMeta("baseMint", accounts.baseMint),
5282
+ getAccountMeta("quoteMint", accounts.quoteMint),
5283
+ getAccountMeta("baseVault", accounts.baseVault),
5284
+ getAccountMeta("quoteVault", accounts.quoteVault),
5285
+ getAccountMeta("recipientBaseAta", accounts.recipientBaseAta),
5286
+ getAccountMeta("recipientQuoteAta", accounts.recipientQuoteAta),
5287
+ getAccountMeta("baseTokenProgram", accounts.baseTokenProgram),
5288
+ getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram)
5289
+ ],
5290
+ data: getClaimFeesInstructionDataEncoder().encode({}),
5291
+ programAddress
5292
+ });
5293
+ }
5018
5294
  var CURVE_SWAP_EXACT_IN_DISCRIMINATOR = new Uint8Array([
5019
5295
  196,
5020
5296
  247,
@@ -5036,6 +5312,153 @@ function getCurveSwapExactInInstructionDataEncoder() {
5036
5312
  (value) => ({ ...value, discriminator: CURVE_SWAP_EXACT_IN_DISCRIMINATOR })
5037
5313
  );
5038
5314
  }
5315
+ var HARVEST_MIGRATED_FEES_DISCRIMINATOR = new Uint8Array([
5316
+ 63,
5317
+ 77,
5318
+ 73,
5319
+ 117,
5320
+ 2,
5321
+ 43,
5322
+ 255,
5323
+ 176
5324
+ ]);
5325
+ function getHarvestMigratedFeesInstructionDataEncoder() {
5326
+ return transformEncoder(
5327
+ getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)]]),
5328
+ (value) => ({
5329
+ ...value,
5330
+ discriminator: HARVEST_MIGRATED_FEES_DISCRIMINATOR
5331
+ })
5332
+ );
5333
+ }
5334
+ async function getHarvestMigratedFeesInstructionAsync(input, config) {
5335
+ const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;
5336
+ const originalAccounts = {
5337
+ launch: { value: input.launch ?? null, isWritable: false },
5338
+ launchFeeState: { value: input.launchFeeState ?? null, isWritable: true },
5339
+ launchAuthority: {
5340
+ value: input.launchAuthority ?? null,
5341
+ isWritable: false
5342
+ },
5343
+ baseMint: { value: input.baseMint ?? null, isWritable: false },
5344
+ quoteMint: { value: input.quoteMint ?? null, isWritable: false },
5345
+ baseVault: { value: input.baseVault ?? null, isWritable: true },
5346
+ quoteVault: { value: input.quoteVault ?? null, isWritable: true },
5347
+ pool: { value: input.pool ?? null, isWritable: true },
5348
+ launchLpPosition: {
5349
+ value: input.launchLpPosition ?? null,
5350
+ isWritable: true
5351
+ },
5352
+ poolAuthority: { value: input.poolAuthority ?? null, isWritable: false },
5353
+ poolVault0: { value: input.poolVault0 ?? null, isWritable: true },
5354
+ poolVault1: { value: input.poolVault1 ?? null, isWritable: true },
5355
+ token0Mint: { value: input.token0Mint ?? null, isWritable: false },
5356
+ token1Mint: { value: input.token1Mint ?? null, isWritable: false },
5357
+ cpmmProgram: { value: input.cpmmProgram ?? null, isWritable: false },
5358
+ baseTokenProgram: {
5359
+ value: input.baseTokenProgram ?? null,
5360
+ isWritable: false
5361
+ },
5362
+ quoteTokenProgram: {
5363
+ value: input.quoteTokenProgram ?? null,
5364
+ isWritable: false
5365
+ }
5366
+ };
5367
+ const accounts = originalAccounts;
5368
+ if (!accounts.launchFeeState.value) {
5369
+ accounts.launchFeeState.value = await getProgramDerivedAddress({
5370
+ programAddress,
5371
+ seeds: [
5372
+ getBytesEncoder().encode(
5373
+ new Uint8Array([
5374
+ 108,
5375
+ 97,
5376
+ 117,
5377
+ 110,
5378
+ 99,
5379
+ 104,
5380
+ 95,
5381
+ 102,
5382
+ 101,
5383
+ 101,
5384
+ 95,
5385
+ 115,
5386
+ 116,
5387
+ 97,
5388
+ 116,
5389
+ 101
5390
+ ])
5391
+ ),
5392
+ getAddressEncoder().encode(
5393
+ getAddressFromResolvedInstructionAccount(
5394
+ "launch",
5395
+ accounts.launch.value
5396
+ )
5397
+ )
5398
+ ]
5399
+ });
5400
+ }
5401
+ if (!accounts.launchAuthority.value) {
5402
+ accounts.launchAuthority.value = await getProgramDerivedAddress({
5403
+ programAddress,
5404
+ seeds: [
5405
+ getBytesEncoder().encode(
5406
+ new Uint8Array([
5407
+ 108,
5408
+ 97,
5409
+ 117,
5410
+ 110,
5411
+ 99,
5412
+ 104,
5413
+ 95,
5414
+ 97,
5415
+ 117,
5416
+ 116,
5417
+ 104,
5418
+ 111,
5419
+ 114,
5420
+ 105,
5421
+ 116,
5422
+ 121
5423
+ ])
5424
+ ),
5425
+ getAddressEncoder().encode(
5426
+ getAddressFromResolvedInstructionAccount(
5427
+ "launch",
5428
+ accounts.launch.value
5429
+ )
5430
+ )
5431
+ ]
5432
+ });
5433
+ }
5434
+ if (!accounts.cpmmProgram.value) {
5435
+ accounts.cpmmProgram.value = "9PSxVPoPfnbZ8Q1uQhgS6ZxvBjFboZtebNsu34umxkgQ";
5436
+ }
5437
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
5438
+ return Object.freeze({
5439
+ accounts: [
5440
+ getAccountMeta("launch", accounts.launch),
5441
+ getAccountMeta("launchFeeState", accounts.launchFeeState),
5442
+ getAccountMeta("launchAuthority", accounts.launchAuthority),
5443
+ getAccountMeta("baseMint", accounts.baseMint),
5444
+ getAccountMeta("quoteMint", accounts.quoteMint),
5445
+ getAccountMeta("baseVault", accounts.baseVault),
5446
+ getAccountMeta("quoteVault", accounts.quoteVault),
5447
+ getAccountMeta("pool", accounts.pool),
5448
+ getAccountMeta("launchLpPosition", accounts.launchLpPosition),
5449
+ getAccountMeta("poolAuthority", accounts.poolAuthority),
5450
+ getAccountMeta("poolVault0", accounts.poolVault0),
5451
+ getAccountMeta("poolVault1", accounts.poolVault1),
5452
+ getAccountMeta("token0Mint", accounts.token0Mint),
5453
+ getAccountMeta("token1Mint", accounts.token1Mint),
5454
+ getAccountMeta("cpmmProgram", accounts.cpmmProgram),
5455
+ getAccountMeta("baseTokenProgram", accounts.baseTokenProgram),
5456
+ getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram)
5457
+ ],
5458
+ data: getHarvestMigratedFeesInstructionDataEncoder().encode({}),
5459
+ programAddress
5460
+ });
5461
+ }
5039
5462
  var INITIALIZE_CONFIG_DISCRIMINATOR3 = new Uint8Array([
5040
5463
  208,
5041
5464
  127,
@@ -5051,7 +5474,10 @@ function getInitializeConfigInstructionDataEncoder3() {
5051
5474
  getStructEncoder([
5052
5475
  ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
5053
5476
  ["migratorAllowlist", getArrayEncoder(getAddressEncoder())],
5054
- ["hookAllowlist", getArrayEncoder(getAddressEncoder())]
5477
+ ["hookAllowlist", getArrayEncoder(getAddressEncoder())],
5478
+ ["protocolFeeBps", getU16Encoder()],
5479
+ ["minSwapFeeBps", getU16Encoder()],
5480
+ ["maxSwapFeeBps", getU16Encoder()]
5055
5481
  ]),
5056
5482
  (value) => ({ ...value, discriminator: INITIALIZE_CONFIG_DISCRIMINATOR3 })
5057
5483
  );
@@ -5078,7 +5504,7 @@ function getInitializeLaunchInstructionDataEncoder() {
5078
5504
  ["baseForLiquidity", getU64Encoder()],
5079
5505
  ["curveVirtualBase", getU64Encoder()],
5080
5506
  ["curveVirtualQuote", getU64Encoder()],
5081
- ["curveFeeBps", getU16Encoder()],
5507
+ ["swapFeeBps", getU16Encoder()],
5082
5508
  ["curveKind", getU8Encoder()],
5083
5509
  ["curveParams", addEncoderSizePrefix(getBytesEncoder(), getU32Encoder())],
5084
5510
  ["allowBuy", getU8Encoder()],
@@ -5111,7 +5537,8 @@ function getInitializeLaunchInstructionDataEncoder() {
5111
5537
  "metadataSymbol",
5112
5538
  addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())
5113
5539
  ],
5114
- ["metadataUri", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())]
5540
+ ["metadataUri", addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
5541
+ ["feeBeneficiaries", getArrayEncoder(getFeeBeneficiaryInputEncoder())]
5115
5542
  ]),
5116
5543
  (value) => ({ ...value, discriminator: INITIALIZE_LAUNCH_DISCRIMINATOR })
5117
5544
  );
@@ -5139,6 +5566,135 @@ function getPreviewSwapExactInInstructionDataEncoder2() {
5139
5566
  })
5140
5567
  );
5141
5568
  }
5569
+ var REPLACE_FEE_BENEFICIARY_DISCRIMINATOR = new Uint8Array([
5570
+ 125,
5571
+ 194,
5572
+ 227,
5573
+ 81,
5574
+ 175,
5575
+ 100,
5576
+ 78,
5577
+ 200
5578
+ ]);
5579
+ function getReplaceFeeBeneficiaryInstructionDataEncoder() {
5580
+ return transformEncoder(
5581
+ getStructEncoder([
5582
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
5583
+ ["newBeneficiary", getAddressEncoder()]
5584
+ ]),
5585
+ (value) => ({
5586
+ ...value,
5587
+ discriminator: REPLACE_FEE_BENEFICIARY_DISCRIMINATOR
5588
+ })
5589
+ );
5590
+ }
5591
+ async function getReplaceFeeBeneficiaryInstructionAsync(input, config) {
5592
+ const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;
5593
+ const originalAccounts = {
5594
+ launch: { value: input.launch ?? null, isWritable: false },
5595
+ launchFeeState: { value: input.launchFeeState ?? null, isWritable: true },
5596
+ currentBeneficiary: {
5597
+ value: input.currentBeneficiary ?? null,
5598
+ isWritable: false
5599
+ }
5600
+ };
5601
+ const accounts = originalAccounts;
5602
+ const args = { ...input };
5603
+ if (!accounts.launchFeeState.value) {
5604
+ accounts.launchFeeState.value = await getProgramDerivedAddress({
5605
+ programAddress,
5606
+ seeds: [
5607
+ getBytesEncoder().encode(
5608
+ new Uint8Array([
5609
+ 108,
5610
+ 97,
5611
+ 117,
5612
+ 110,
5613
+ 99,
5614
+ 104,
5615
+ 95,
5616
+ 102,
5617
+ 101,
5618
+ 101,
5619
+ 95,
5620
+ 115,
5621
+ 116,
5622
+ 97,
5623
+ 116,
5624
+ 101
5625
+ ])
5626
+ ),
5627
+ getAddressEncoder().encode(
5628
+ getAddressFromResolvedInstructionAccount(
5629
+ "launch",
5630
+ accounts.launch.value
5631
+ )
5632
+ )
5633
+ ]
5634
+ });
5635
+ }
5636
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
5637
+ return Object.freeze({
5638
+ accounts: [
5639
+ getAccountMeta("launch", accounts.launch),
5640
+ getAccountMeta("launchFeeState", accounts.launchFeeState),
5641
+ getAccountMeta("currentBeneficiary", accounts.currentBeneficiary)
5642
+ ],
5643
+ data: getReplaceFeeBeneficiaryInstructionDataEncoder().encode(
5644
+ args
5645
+ ),
5646
+ programAddress
5647
+ });
5648
+ }
5649
+ var SET_FEE_POLICY_DISCRIMINATOR = new Uint8Array([
5650
+ 91,
5651
+ 32,
5652
+ 224,
5653
+ 109,
5654
+ 147,
5655
+ 98,
5656
+ 71,
5657
+ 132
5658
+ ]);
5659
+ function getSetFeePolicyInstructionDataEncoder() {
5660
+ return transformEncoder(
5661
+ getStructEncoder([
5662
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
5663
+ ["protocolFeeBps", getU16Encoder()],
5664
+ ["minSwapFeeBps", getU16Encoder()],
5665
+ ["maxSwapFeeBps", getU16Encoder()]
5666
+ ]),
5667
+ (value) => ({ ...value, discriminator: SET_FEE_POLICY_DISCRIMINATOR })
5668
+ );
5669
+ }
5670
+ async function getSetFeePolicyInstructionAsync(input, config) {
5671
+ const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;
5672
+ const originalAccounts = {
5673
+ config: { value: input.config ?? null, isWritable: true },
5674
+ admin: { value: input.admin ?? null, isWritable: false }
5675
+ };
5676
+ const accounts = originalAccounts;
5677
+ const args = { ...input };
5678
+ if (!accounts.config.value) {
5679
+ accounts.config.value = await getProgramDerivedAddress({
5680
+ programAddress,
5681
+ seeds: [
5682
+ getBytesEncoder().encode(new Uint8Array([99, 111, 110, 102, 105, 103]))
5683
+ ]
5684
+ });
5685
+ }
5686
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
5687
+ return Object.freeze({
5688
+ accounts: [
5689
+ getAccountMeta("config", accounts.config),
5690
+ getAccountMeta("admin", accounts.admin)
5691
+ ],
5692
+ data: getSetFeePolicyInstructionDataEncoder().encode(
5693
+ args
5694
+ ),
5695
+ programAddress
5696
+ });
5697
+ }
5142
5698
  var SET_HOOK_ALLOWLIST_DISCRIMINATOR = new Uint8Array([
5143
5699
  232,
5144
5700
  28,
@@ -5180,6 +5736,9 @@ function getSetMigratorAllowlistInstructionDataEncoder() {
5180
5736
  })
5181
5737
  );
5182
5738
  }
5739
+
5740
+ // src/solana/generated/initializer/programs/initializer.ts
5741
+ var INITIALIZER_PROGRAM_ADDRESS = "4h3Dqyo5qmteJoMxXt3tdtfXELDB6pdRTPU9mWruiKp1";
5183
5742
  if (process.env.NODE_ENV !== "production") ;
5184
5743
  var addressCodec2 = getAddressCodec();
5185
5744
  var textEncoder3 = new TextEncoder();
@@ -5223,6 +5782,15 @@ async function getLaunchAuthorityAddress(launch, programId = INITIALIZER_PROGRAM
5223
5782
  ]
5224
5783
  });
5225
5784
  }
5785
+ async function getLaunchFeeStateAddress(launch, programId = INITIALIZER_PROGRAM_ID) {
5786
+ return getProgramDerivedAddress({
5787
+ programAddress: programId,
5788
+ seeds: [
5789
+ textEncoder3.encode(SEED_LAUNCH_FEE_STATE),
5790
+ addressCodec2.encode(launch)
5791
+ ]
5792
+ });
5793
+ }
5226
5794
  function launchIdFromU64(launchId) {
5227
5795
  const out = new Uint8Array(32);
5228
5796
  out.set(encodeU64LE(launchId), 0);
@@ -5786,7 +6354,7 @@ function getLaunchEncoder2() {
5786
6354
  ["baseForCurve", getU64Encoder()],
5787
6355
  ["curveVirtualBase", getU64Encoder()],
5788
6356
  ["curveVirtualQuote", getU64Encoder()],
5789
- ["curveFeeBps", getU16Encoder()],
6357
+ ["swapFeeBps", getU16Encoder()],
5790
6358
  ["pad1", fixEncoderSize(getBytesEncoder(), 6)],
5791
6359
  ["allowBuy", getU8Encoder()],
5792
6360
  ["allowSell", getU8Encoder()],
@@ -5828,7 +6396,7 @@ function getLaunchDecoder2() {
5828
6396
  ["baseForCurve", getU64Decoder()],
5829
6397
  ["curveVirtualBase", getU64Decoder()],
5830
6398
  ["curveVirtualQuote", getU64Decoder()],
5831
- ["curveFeeBps", getU16Decoder()],
6399
+ ["swapFeeBps", getU16Decoder()],
5832
6400
  ["pad1", fixDecoderSize(getBytesDecoder(), 6)],
5833
6401
  ["allowBuy", getU8Decoder()],
5834
6402
  ["allowSell", getU8Decoder()],
@@ -7329,6 +7897,7 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
7329
7897
  quoteMint,
7330
7898
  baseVault,
7331
7899
  quoteVault,
7900
+ launchFeeState,
7332
7901
  payer,
7333
7902
  authority,
7334
7903
  hookProgram,
@@ -7353,6 +7922,10 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
7353
7922
  const hookCreateRemainingAccountAddresses = hookCreateRemainingAccounts.map(
7354
7923
  (account) => isTransactionSigner5(account) ? account.address : account
7355
7924
  );
7925
+ const swapFeeBps = args.swapFeeBps ?? args.curveFeeBps;
7926
+ if (swapFeeBps === void 0) {
7927
+ throw new Error("swapFeeBps is required");
7928
+ }
7356
7929
  const keys = [
7357
7930
  { address: config, role: AccountRole.READONLY },
7358
7931
  { address: launch, role: AccountRole.WRITABLE },
@@ -7361,6 +7934,10 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
7361
7934
  { address: quoteMint, role: AccountRole.READONLY },
7362
7935
  createAccountMeta(baseVault, AccountRole.WRITABLE_SIGNER),
7363
7936
  createAccountMeta(quoteVault, AccountRole.WRITABLE_SIGNER),
7937
+ {
7938
+ address: launchFeeState ?? (await getLaunchFeeStateAddress(launch, programId))[0],
7939
+ role: AccountRole.WRITABLE
7940
+ },
7364
7941
  createAccountMeta(payer, AccountRole.WRITABLE_SIGNER)
7365
7942
  ];
7366
7943
  keys.push(
@@ -7385,6 +7962,8 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
7385
7962
  }
7386
7963
  const encoderArgs = {
7387
7964
  ...args,
7965
+ swapFeeBps,
7966
+ feeBeneficiaries: args.feeBeneficiaries ?? [],
7388
7967
  allowBuy: args.allowBuy ? 1 : 0,
7389
7968
  allowSell: args.allowSell ? 1 : 0,
7390
7969
  hookProgram: args.hookProgram ?? hookProgram ?? SYSTEM_PROGRAM_ADDRESS,
@@ -7476,6 +8055,7 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
7476
8055
  quoteMint,
7477
8056
  user,
7478
8057
  hookProgram = SYSTEM_PROGRAM_ADDRESS,
8058
+ launchFeeState,
7479
8059
  baseTokenProgram = TOKEN_PROGRAM_ADDRESS,
7480
8060
  quoteTokenProgram = TOKEN_PROGRAM_ADDRESS,
7481
8061
  remainingAccounts = []
@@ -7495,6 +8075,7 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
7495
8075
  // slot (token_program follows it). Always emit it — use SYSTEM_PROGRAM_ADDRESS as the
7496
8076
  // no-op placeholder when no real hook is configured.
7497
8077
  { address: hookProgram, role: AccountRole.READONLY },
8078
+ { address: launchFeeState, role: AccountRole.WRITABLE },
7498
8079
  { address: baseTokenProgram, role: AccountRole.READONLY },
7499
8080
  { address: quoteTokenProgram, role: AccountRole.READONLY },
7500
8081
  ...remainingAccounts.map(createRemainingAccountMeta)
@@ -7522,6 +8103,7 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
7522
8103
  quoteMint,
7523
8104
  baseVault,
7524
8105
  quoteVault,
8106
+ launchFeeState,
7525
8107
  migratorProgram,
7526
8108
  payer,
7527
8109
  baseTokenProgram = TOKEN_PROGRAM_ADDRESS,
@@ -7537,6 +8119,7 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
7537
8119
  { address: quoteMint, role: AccountRole.READONLY },
7538
8120
  { address: baseVault, role: AccountRole.WRITABLE },
7539
8121
  { address: quoteVault, role: AccountRole.WRITABLE },
8122
+ { address: launchFeeState, role: AccountRole.READONLY },
7540
8123
  { address: migratorProgram, role: AccountRole.READONLY },
7541
8124
  createSignerAccountMeta4(payer, AccountRole.WRITABLE_SIGNER),
7542
8125
  { address: baseTokenProgram, role: AccountRole.READONLY },
@@ -7572,6 +8155,7 @@ var previewSwapExactInResultCodec = getStructCodec([
7572
8155
  function createPreviewSwapExactInInstruction(accounts, args, programId = INITIALIZER_PROGRAM_ID) {
7573
8156
  const {
7574
8157
  launch,
8158
+ launchFeeState,
7575
8159
  baseVault,
7576
8160
  quoteVault,
7577
8161
  hookProgram,
@@ -7579,6 +8163,7 @@ function createPreviewSwapExactInInstruction(accounts, args, programId = INITIAL
7579
8163
  } = accounts;
7580
8164
  const keys = [
7581
8165
  { address: launch, role: AccountRole.READONLY },
8166
+ { address: launchFeeState, role: AccountRole.READONLY },
7582
8167
  { address: baseVault, role: AccountRole.READONLY },
7583
8168
  { address: quoteVault, role: AccountRole.READONLY }
7584
8169
  ];