@whetstone-research/doppler-sdk 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-LIXSTCMM.js → chunk-BSHIMMA4.js} +74 -31
- package/dist/chunk-BSHIMMA4.js.map +1 -0
- package/dist/{chunk-T46KDO65.js → chunk-J57ROY36.js} +16 -29
- package/dist/chunk-J57ROY36.js.map +1 -0
- package/dist/evm/index.js +2 -2
- package/dist/evm/index.js.map +1 -1
- package/dist/{oracle-B2LV97ff.d.ts → oracle-CU-nZnja.d.ts} +1 -1
- package/dist/{pda-LKHUH6JK.js → pda-TXZDXZZ4.js} +3 -3
- package/dist/pda-TXZDXZZ4.js.map +1 -0
- package/dist/solana/index.d.ts +2212 -162
- package/dist/solana/index.js +3163 -486
- package/dist/solana/index.js.map +1 -1
- package/dist/solana/react/index.d.ts +1 -1
- package/dist/solana/react/index.js +5 -5
- package/dist/solana/react/index.js.map +1 -1
- package/package.json +11 -6
- package/dist/chunk-LIXSTCMM.js.map +0 -1
- package/dist/chunk-T46KDO65.js.map +0 -1
- package/dist/pda-LKHUH6JK.js.map +0 -1
package/dist/solana/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/solana/core/tokenMetadata.ts","../../src/solana/core/marketCapHelpers.ts","../../src/solana/core/errors.ts","../../src/solana/instructions/initializeConfig.ts","../../src/solana/instructions/initializePool.ts","../../src/solana/instructions/initializeOracle.ts","../../src/solana/instructions/setFees.ts","../../src/solana/instructions/setSentinel.ts","../../src/solana/instructions/setRoute.ts","../../src/solana/instructions/pause.ts","../../src/solana/instructions/unpause.ts","../../src/solana/instructions/transferAdmin.ts","../../src/solana/instructions/skim.ts","../../src/solana/instructions/swapExactIn.ts","../../src/solana/instructions/createPosition.ts","../../src/solana/instructions/closePosition.ts","../../src/solana/instructions/addLiquidity.ts","../../src/solana/instructions/removeLiquidity.ts","../../src/solana/instructions/collectProtocolFees.ts","../../src/solana/instructions/oracleUpdate.ts","../../src/solana/instructions/oracleConsult.ts","../../src/solana/instructions/quoteToNumeraire.ts","../../src/solana/client/config.ts","../../src/solana/initializer/index.ts","../../src/solana/initializer/constants.ts","../../src/solana/generated/initializer/accounts/initConfig.ts","../../src/solana/generated/initializer/types/calldataBuf.ts","../../src/solana/generated/initializer/types/initializeConfigArgs.ts","../../src/solana/generated/initializer/types/initializeLaunchArgs.ts","../../src/solana/generated/initializer/accounts/launch.ts","../../src/solana/generated/initializer/instructions/curveSwapExactIn.ts","../../src/solana/generated/initializer/instructions/initializeConfig.ts","../../src/solana/generated/initializer/instructions/initializeLaunch.ts","../../src/solana/generated/initializer/instructions/previewSwapExactIn.ts","../../src/solana/generated/initializer/instructions/setMigratorAllowlist.ts","../../src/solana/generated/initializer/instructions/setSentinelAllowlist.ts","../../src/solana/generated/initializer/errors/initializer.ts","../../src/solana/initializer/pda.ts","../../src/solana/initializer/instructions/initializeConfig.ts","../../src/solana/initializer/instructions/setMigratorAllowlist.ts","../../src/solana/initializer/instructions/setSentinelAllowlist.ts","../../src/solana/migrators/cpmmMigrator/constants.ts","../../src/solana/generated/predictionMigrator/programs/predictionMigrator.ts","../../src/solana/initializer/instructions/initializeLaunch.ts","../../src/solana/initializer/instructions/curveSwapExactIn.ts","../../src/solana/initializer/instructions/migrateLaunch.ts","../../src/solana/initializer/instructions/abortLaunch.ts","../../src/solana/initializer/instructions/previewSwapExactIn.ts","../../src/solana/initializer/instructions/previewMigration.ts","../../src/solana/initializer/client/launch.ts","../../src/solana/migrators/cpmmMigrator/index.ts","../../src/solana/generated/cpmmMigrator/types/migrateArgs.ts","../../src/solana/generated/cpmmMigrator/types/recipient.ts","../../src/solana/generated/cpmmMigrator/types/registerLaunchArgs.ts","../../src/solana/generated/cpmmMigrator/accounts/cpmmMigratorState.ts","../../src/solana/generated/cpmmMigrator/errors/cpmmMigrator.ts","../../src/solana/migrators/cpmmMigrator/pda.ts","../../src/solana/migrators/cpmmMigrator/client.ts"],"names":["CpmmErrorCode","getStructCodec","getU128Codec","getAddressCodec","MAX_SENTINEL_ALLOWLIST","SEED_CONFIG","SENTINEL_NO_CHANGE","SF_AFTER_SWAP","SF_BEFORE_SWAP","createInitializeConfigInstruction","getConfigAddress","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getArrayEncoder","getAddressEncoder","getArrayDecoder","getAddressDecoder","combineCodec","getU8Encoder","getU64Encoder","getU16Encoder","getU8Decoder","getU64Decoder","getU16Decoder","transformEncoder","getU32Encoder","getU32Decoder","addEncoderSizePrefix","getUtf8Encoder","addressCodec","textEncoder","getProgramDerivedAddress","isTransactionSigner","createSignerAccountMeta","address","createAccountMeta","getU64Codec","base64ToBytes","getU128Encoder","getU128Decoder","getOptionEncoder","getBooleanEncoder","getOptionDecoder","getBooleanDecoder"],"mappings":";;;;;;;;AAQA,IAAM,eAAe,eAAA,EAAgB;AACrC,IAAM,WAAA,GAAc,IAAI,WAAA,EAAY;AAOpC,eAAsB,mBACpB,IAAA,EACgC;AAChC,EAAA,OAAO,wBAAA,CAAyB;AAAA,IAC9B,cAAA,EAAgB,yBAAA;AAAA,IAChB,KAAA,EAAO;AAAA,MACL,WAAA,CAAY,OAAO,UAAU,CAAA;AAAA,MAC7B,YAAA,CAAa,OAAO,yBAAyB,CAAA;AAAA,MAC7C,YAAA,CAAa,OAAO,IAAI;AAAA;AAC1B,GACD,CAAA;AACH;;;ACuBO,SAAS,qBAAA,CACd,YAAA,EACA,eAAA,EACA,YAAA,EACQ;AACR,EAAA,IAAI,gBAAgB,CAAA,EAAG;AACrB,IAAA,MAAM,IAAI,MAAM,6BAA6B,CAAA;AAAA,EAC/C;AACA,EAAA,IAAI,mBAAmB,EAAA,EAAI;AACzB,IAAA,MAAM,IAAI,MAAM,+BAA+B,CAAA;AAAA,EACjD;AAEA,EAAA,MAAM,SAAA,GAAY,MAAA,CAAO,eAAe,CAAA,GAAI,E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odec,\n getProgramDerivedAddress,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/kit';\nimport { TOKEN_METADATA_PROGRAM_ID } from './constants.js';\n\nconst addressCodec = getAddressCodec();\nconst textEncoder = new TextEncoder();\n\n/**\n * Derive Metaplex Token Metadata PDA for a given mint.\n *\n * Seeds: ['metadata', token_metadata_program_id, mint]\n */\nexport async function getMetadataAddress(\n mint: Address,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: TOKEN_METADATA_PROGRAM_ID,\n seeds: [\n textEncoder.encode('metadata'),\n addressCodec.encode(TOKEN_METADATA_PROGRAM_ID),\n addressCodec.encode(mint),\n ],\n });\n}\n","/**\n * Market cap conversion utilities for Solana token launches.\n *\n * Converts between human-readable market cap values (USD) and the raw\n * curve parameters used by the initializer program.\n *\n * For an XYK bonding curve the marginal spot price at any point is:\n *\n * spotPrice (quote/base, raw units) = (quoteReserve + curveVirtualQuote)\n * / (baseReserve + curveVirtualBase)\n *\n * At launch open (quoteReserve = 0, baseReserve = baseForCurve):\n *\n * spotPrice = curveVirtualQuote / (baseForCurve + curveVirtualBase)\n *\n * Adjusted for decimals and numeraire price:\n *\n * spotPriceUSD = spotPrice * 10^(baseDecimals - quoteDecimals) * numerairePriceUSD\n *\n * Market cap (FDV) is then:\n *\n * marketCap = spotPriceUSD * (baseTotalSupply / 10^baseDecimals)\n */\n\nimport type {\n MarketCapValidationResult,\n CurveParams,\n MarketCapToCurveParamsInput,\n CurveParamsToMarketCapInput,\n} from './types.js';\n\nexport type {\n MarketCapValidationResult,\n CurveParams,\n MarketCapToCurveParamsInput,\n CurveParamsToMarketCapInput,\n};\n\n// ============================================================================\n// Primitive helpers\n// ============================================================================\n\n/**\n * Convert a market cap (USD) and total supply to a per-token price (USD).\n *\n * @example\n * // $1M market cap, 1B tokens with 6 decimals\n * marketCapToTokenPrice(1_000_000, 1_000_000_000n * 10n**6n, 6)\n * // => 0.001\n */\nexport function marketCapToTokenPrice(\n marketCapUSD: number,\n baseTotalSupply: bigint,\n baseDecimals: number,\n): number {\n if (marketCapUSD <= 0) {\n throw new Error('Market cap must be positive');\n }\n if (baseTotalSupply <= 0n) {\n throw new Error('Token supply must be positive');\n }\n\n const supplyNum = Number(baseTotalSupply) / 10 ** baseDecimals;\n return marketCapUSD / supplyNum;\n}\n\n/**\n * Validate market cap parameters and return warnings for unusual values.\n * Does not throw — callers can decide whether to surface warnings to users.\n *\n * @example\n * const { valid, warnings } = validateMarketCapParameters(500, supply, 6);\n * if (!valid) console.warn(warnings);\n */\nexport function validateMarketCapParameters(\n marketCapUSD: number,\n baseTotalSupply: bigint,\n baseDecimals: number,\n): MarketCapValidationResult {\n const warnings: string[] = [];\n\n if (marketCapUSD < 1_000) {\n warnings.push(\n `Market cap $${marketCapUSD.toLocaleString()} is very small. Verify this is intentional.`,\n );\n }\n\n if (marketCapUSD > 1_000_000_000_000) {\n warnings.push(\n `Market cap $${marketCapUSD.toLocaleString()} exceeds $1T. Verify this is correct.`,\n );\n }\n\n const tokenPriceUSD = marketCapToTokenPrice(\n marketCapUSD,\n baseTotalSupply,\n baseDecimals,\n );\n\n if (tokenPriceUSD < 0.000_001) {\n warnings.push(\n `Implied token price $${tokenPriceUSD.toExponential(2)} is very small. This may cause precision issues.`,\n );\n }\n\n if (tokenPriceUSD > 1_000_000) {\n warnings.push(\n `Implied token price $${tokenPriceUSD.toLocaleString()} is very large. Verify token supply and market cap.`,\n );\n }\n\n return { valid: warnings.length === 0, warnings };\n}\n\n// ============================================================================\n// Market cap ↔ curve virtual reserves\n// ============================================================================\n\n/**\n * Convert a market cap range (USD) to XYK curve virtual reserve parameters.\n *\n * Returns `{ curveVirtualBase, curveVirtualQuote }` for both the start (open)\n * and end (graduation) prices, ready to pass into `InitializeLaunchArgs`.\n *\n * `baseForCurve` is the number of base tokens allocated to the curve vault\n * (baseTotalSupply - baseForDistribution - baseForLiquidity). It determines\n * the correct initial spot price alongside the virtual reserves.\n *\n * `virtualBase` defaults to `baseForCurve`. A larger value gives finer price\n * granularity at the cost of a proportionally larger `curveVirtualQuote`.\n *\n * @example\n * const totalSupply = 1_000_000_000n * 10n ** 6n;\n * const { start, end } = marketCapToCurveParams({\n * startMarketCapUSD: 100_000,\n * endMarketCapUSD: 5_000_000,\n * baseTotalSupply: totalSupply,\n * baseForCurve: totalSupply, // no distribution or liquidity allocation\n * baseDecimals: 6,\n * quoteDecimals: 9, // SOL\n * numerairePriceUSD: 150,\n * });\n * // Use start.curveVirtualBase / start.curveVirtualQuote in InitializeLaunchArgs\n */\nexport function marketCapToCurveParams(input: MarketCapToCurveParamsInput): {\n start: CurveParams;\n end: CurveParams;\n} {\n const {\n startMarketCapUSD,\n endMarketCapUSD,\n baseTotalSupply,\n baseForCurve,\n baseDecimals,\n quoteDecimals,\n numerairePriceUSD,\n virtualBase,\n } = input;\n\n if (startMarketCapUSD <= 0)\n throw new Error('startMarketCapUSD must be positive');\n if (endMarketCapUSD <= 0) throw new Error('endMarketCapUSD must be positive');\n if (startMarketCapUSD >= endMarketCapUSD) {\n throw new Error('startMarketCapUSD must be less than endMarketCapUSD');\n }\n if (baseForCurve <= 0n) throw new Error('baseForCurve must be positive');\n if (baseForCurve > baseTotalSupply)\n throw new Error('baseForCurve cannot exceed baseTotalSupply');\n if (numerairePriceUSD <= 0)\n throw new Error('numerairePriceUSD must be positive');\n\n const canonicalVirtualBase =\n virtualBase !== undefined && virtualBase > 0n ? virtualBase : baseForCurve;\n\n return {\n start: _marketCapToCurveParams(\n startMarketCapUSD,\n baseTotalSupply,\n baseForCurve,\n baseDecimals,\n quoteDecimals,\n numerairePriceUSD,\n canonicalVirtualBase,\n ),\n end: _marketCapToCurveParams(\n endMarketCapUSD,\n baseTotalSupply,\n baseForCurve,\n baseDecimals,\n quoteDecimals,\n numerairePriceUSD,\n canonicalVirtualBase,\n ),\n };\n}\n\n/**\n * Convert a single market cap (USD) to XYK curve virtual reserve parameters.\n * Use `marketCapToCurveParams` for a full start/end range.\n */\nexport function marketCapToSingleCurveParams(\n marketCapUSD: number,\n baseTotalSupply: bigint,\n baseForCurve: bigint,\n baseDecimals: number,\n quoteDecimals: number,\n numerairePriceUSD: number,\n virtualBase?: bigint,\n): CurveParams {\n if (marketCapUSD <= 0) throw new Error('marketCapUSD must be positive');\n if (baseForCurve <= 0n) throw new Error('baseForCurve must be positive');\n if (baseForCurve > baseTotalSupply)\n throw new Error('baseForCurve cannot exceed baseTotalSupply');\n if (numerairePriceUSD <= 0)\n throw new Error('numerairePriceUSD must be positive');\n\n const canonicalVirtualBase =\n virtualBase !== undefined && virtualBase > 0n ? virtualBase : baseForCurve;\n\n return _marketCapToCurveParams(\n marketCapUSD,\n baseTotalSupply,\n baseForCurve,\n baseDecimals,\n quoteDecimals,\n numerairePriceUSD,\n canonicalVirtualBase,\n );\n}\n\n/**\n * Derive the current market cap (USD) from live XYK curve state.\n *\n * Pass the virtual reserves from the `Launch` account and the current token\n * vault balances (`baseReserve`, `quoteReserve`) to get the live spot price.\n *\n * @example\n * const launch = await fetchLaunch(connection, launchAddress);\n * const [baseVaultBalance, quoteVaultBalance] = await Promise.all([\n * getTokenAccountBalance(connection, launch.baseVault),\n * getTokenAccountBalance(connection, launch.quoteVault),\n * ]);\n * // baseReserve is the curve-available portion, excluding reserved allocations\n * const baseReserve = baseVaultBalance - launch.baseForDistribution - launch.baseForLiquidity;\n * const mcap = curveParamsToMarketCap({\n * curveVirtualBase: launch.curveVirtualBase,\n * curveVirtualQuote: launch.curveVirtualQuote,\n * baseReserve,\n * quoteReserve: quoteVaultBalance,\n * baseTotalSupply: launch.baseTotalSupply,\n * baseDecimals: 6,\n * quoteDecimals: 9,\n * numerairePriceUSD: 150,\n * });\n */\nexport function curveParamsToMarketCap(\n input: CurveParamsToMarketCapInput,\n): number {\n const {\n curveVirtualBase,\n curveVirtualQuote,\n baseReserve,\n quoteReserve,\n baseTotalSupply,\n baseDecimals,\n quoteDecimals,\n numerairePriceUSD,\n } = input;\n\n if (curveVirtualBase <= 0n)\n throw new Error('curveVirtualBase must be positive');\n if (curveVirtualQuote <= 0n)\n throw new Error('curveVirtualQuote must be positive');\n if (baseReserve < 0n) throw new Error('baseReserve must be non-negative');\n if (quoteReserve < 0n) throw new Error('quoteReserve must be non-negative');\n\n const spotPriceUSD = _spotPriceUSD(\n curveVirtualBase,\n curveVirtualQuote,\n baseReserve,\n quoteReserve,\n baseDecimals,\n quoteDecimals,\n numerairePriceUSD,\n );\n\n const supplyHuman = Number(baseTotalSupply) / 10 ** baseDecimals;\n return spotPriceUSD * supplyHuman;\n}\n\n// ============================================================================\n// Internal\n// ============================================================================\n\nfunction _marketCapToCurveParams(\n marketCapUSD: number,\n baseTotalSupply: bigint,\n baseForCurve: bigint,\n baseDecimals: number,\n quoteDecimals: number,\n numerairePriceUSD: number,\n curveVirtualBase: bigint,\n): CurveParams {\n const tokenPriceUSD = marketCapToTokenPrice(\n marketCapUSD,\n baseTotalSupply,\n baseDecimals,\n );\n const priceInNumeraire = tokenPriceUSD / numerairePriceUSD;\n\n // Convert to raw units: quote_units / base_units\n const decimalScale = 10 ** (quoteDecimals - baseDecimals);\n const rawPriceQuotePerBase = priceInNumeraire * decimalScale;\n\n // spot price = virtual_quote / (baseForCurve + virtual_base)\n // => virtual_quote = rawPrice * (baseForCurve + virtual_base)\n const effectiveDenominator = baseForCurve + curveVirtualBase;\n\n const PRECISION = 1_000_000_000n;\n const rawPriceScaled = BigInt(\n Math.round(rawPriceQuotePerBase * Number(PRECISION)),\n );\n const curveVirtualQuote = (effectiveDenominator * rawPriceScaled) / PRECISION;\n\n if (curveVirtualQuote <= 0n) {\n throw new Error(\n `Computed curveVirtualQuote is zero or negative for marketCap=$${marketCapUSD.toLocaleString()}. ` +\n `Try a higher market cap or larger virtualBase.`,\n );\n }\n\n return { curveVirtualBase, curveVirtualQuote };\n}\n\nfunction _spotPriceUSD(\n curveVirtualBase: bigint,\n curveVirtualQuote: bigint,\n baseReserve: bigint,\n quoteReserve: bigint,\n baseDecimals: number,\n quoteDecimals: number,\n numerairePriceUSD: number,\n): number {\n // spot price (quote/base) = (quoteReserve + virtualQuote) / (baseReserve + virtualBase)\n const effBase = Number(baseReserve + curveVirtualBase);\n const effQuote = Number(quoteReserve + curveVirtualQuote);\n const rawRatio = effQuote / effBase;\n\n // adjust for decimals → numeraire per token (human units)\n const decimalScale = 10 ** (baseDecimals - quoteDecimals);\n return rawRatio * decimalScale * numerairePriceUSD;\n}\n","/**\n * CPMM program error codes\n *\n * These correspond to the CpmmError enum in the on-chain program.\n * Anchor errors start at 6000 (0x1770).\n */\nexport enum CpmmErrorCode {\n /** Unauthorized - caller lacks required authority */\n Unauthorized = 6000,\n /** Pool is currently locked (reentrancy protection) */\n PoolLocked = 6001,\n /** Invalid fee value (exceeds max or invalid range) */\n InvalidFee = 6002,\n /** Invalid fee split value (exceeds max or invalid range) */\n InvalidFeeSplit = 6003,\n /** Invalid swap direction (must be 0 or 1) */\n InvalidDirection = 6004,\n /** Insufficient liquidity for operation */\n InsufficientLiquidity = 6005,\n /** Output amount less than minimum (slippage exceeded) */\n SlippageExceeded = 6006,\n /** Math operation overflowed */\n MathOverflow = 6007,\n /** Mints not in canonical order */\n InvalidMintOrder = 6008,\n /** Cannot create pool with identical tokens */\n SameMintPair = 6009,\n /** Vault account invalid or mismatch */\n InvalidVault = 6010,\n /** Position account invalid or mismatch */\n InvalidPosition = 6011,\n /** Cannot close position with non-zero shares or fees */\n PositionNotEmpty = 6012,\n /** Invalid route configuration */\n InvalidRoute = 6013,\n /** Not supported in v0.1 */\n NotSupportedInV0_1 = 6014,\n /** Oracle not initialized for this pool */\n OracleNotInitialized = 6015,\n /** Zero shares out */\n ZeroSharesOut = 6016,\n /** Sentinel program rejected the operation */\n SentinelRejected = 6017,\n /** Sentinel CPI call failed */\n SentinelCpiFailed = 6018,\n /** Sentinel program account not provided */\n SentinelProgramNotProvided = 6019,\n /** Sentinel program account is not executable */\n SentinelProgramNotExecutable = 6020,\n /** Sentinel return data missing or wrong program id */\n SentinelReturnDataMissing = 6021,\n /** Sentinel return data invalid length or could not deserialize */\n SentinelReturnDataInvalid = 6022,\n /** Sentinel program not in allowlist */\n SentinelNotAllowlisted = 6023,\n /** Pool has zero shares (no liquidity) */\n TotalSharesZero = 6024,\n /** Amount cannot be zero */\n AmountZero = 6025,\n /** Pool is paused by admin */\n Paused = 6026,\n /** Internal invariant violation */\n InvariantViolation = 6027,\n /** Invalid mint address */\n InvalidMint = 6028,\n /** Invalid input parameter */\n InvalidInput = 6029,\n /** Reentrancy detected */\n Reentrancy = 6030,\n}\n\n/**\n * Human-readable error messages\n */\nexport const CPMM_ERROR_MESSAGES: Record<CpmmErrorCode, string> = {\n [CpmmErrorCode.Unauthorized]: 'Unauthorized: Caller lacks required authority',\n [CpmmErrorCode.PoolLocked]:\n 'Pool is currently locked (reentrancy protection)',\n [CpmmErrorCode.InvalidFee]:\n 'Invalid fee value (exceeds max or invalid range)',\n [CpmmErrorCode.InvalidFeeSplit]:\n 'Invalid fee split value (exceeds max or invalid range)',\n [CpmmErrorCode.InvalidDirection]: 'Invalid swap direction (must be 0 or 1)',\n [CpmmErrorCode.InsufficientLiquidity]:\n 'Insufficient liquidity for this operation',\n [CpmmErrorCode.SlippageExceeded]:\n 'Slippage exceeded: Output amount less than minimum',\n [CpmmErrorCode.MathOverflow]: 'Math operation overflowed',\n [CpmmErrorCode.InvalidMintOrder]: 'Token mints not in canonical order',\n [CpmmErrorCode.SameMintPair]: 'Cannot create pool with identical tokens',\n [CpmmErrorCode.InvalidVault]: 'Vault account is invalid or does not match',\n [CpmmErrorCode.InvalidPosition]:\n 'Position account is invalid or does not match',\n [CpmmErrorCode.PositionNotEmpty]:\n 'Cannot close position with non-zero shares or fees',\n [CpmmErrorCode.InvalidRoute]: 'Invalid route configuration',\n [CpmmErrorCode.NotSupportedInV0_1]: 'Not supported in v0.1',\n [CpmmErrorCode.OracleNotInitialized]: 'Oracle not initialized for this pool',\n [CpmmErrorCode.ZeroSharesOut]: 'Zero shares out',\n [CpmmErrorCode.SentinelRejected]: 'Sentinel program rejected the operation',\n [CpmmErrorCode.SentinelCpiFailed]: 'Sentinel CPI call failed',\n [CpmmErrorCode.SentinelProgramNotProvided]:\n 'Sentinel program account not provided',\n [CpmmErrorCode.SentinelProgramNotExecutable]:\n 'Sentinel program account is not executable',\n [CpmmErrorCode.SentinelReturnDataMissing]:\n 'Sentinel return data missing or wrong program id',\n [CpmmErrorCode.SentinelReturnDataInvalid]:\n 'Sentinel return data invalid length or could not deserialize',\n [CpmmErrorCode.SentinelNotAllowlisted]: 'Sentinel program not in allowlist',\n [CpmmErrorCode.TotalSharesZero]: 'Pool has zero shares (no liquidity)',\n [CpmmErrorCode.AmountZero]: 'Amount cannot be zero',\n [CpmmErrorCode.Paused]: 'Pool is paused by admin',\n [CpmmErrorCode.InvariantViolation]: 'Internal invariant violation',\n [CpmmErrorCode.InvalidMint]: 'Invalid mint address',\n [CpmmErrorCode.InvalidInput]: 'Invalid input parameter',\n [CpmmErrorCode.Reentrancy]: 'Reentrancy detected',\n};\n\n/**\n * Custom error class for CPMM program errors\n */\nexport class CpmmError extends Error {\n constructor(\n public readonly code: CpmmErrorCode,\n public readonly logs?: string[],\n ) {\n super(CPMM_ERROR_MESSAGES[code] || `Unknown CPMM error: ${code}`);\n this.name = 'CpmmError';\n }\n\n /**\n * Get the error code name\n */\n get codeName(): string {\n return CpmmErrorCode[this.code] || 'Unknown';\n }\n}\n\n/**\n * Parse error code from transaction logs\n */\nexport function parseErrorFromLogs(logs: string[]): CpmmError | null {\n // Look for Anchor error pattern: \"Program log: AnchorError ...\"\n // or custom error pattern: \"Program log: Error Code: ...\"\n for (const log of logs) {\n // Pattern 1: Anchor error with code\n const anchorMatch = log.match(\n /AnchorError.*Error Code:\\s*(\\w+)\\.\\s*Error Number:\\s*(\\d+)/,\n );\n if (anchorMatch) {\n const errorNumber = parseInt(anchorMatch[2], 10);\n if (errorNumber >= 6000 && errorNumber <= 6030) {\n return new CpmmError(errorNumber as CpmmErrorCode, logs);\n }\n }\n\n // Pattern 2: Error number in hex\n const hexMatch = log.match(/Error Number:\\s*0x([0-9a-fA-F]+)/);\n if (hexMatch) {\n const errorNumber = parseInt(hexMatch[1], 16);\n if (errorNumber >= 6000 && errorNumber <= 6030) {\n return new CpmmError(errorNumber as CpmmErrorCode, logs);\n }\n }\n\n // Pattern 3: Custom error message\n const customMatch = log.match(/Error Message:\\s*(.+)/);\n if (customMatch) {\n const message = customMatch[1].toLowerCase();\n // Try to match message to error code\n for (const [code, msg] of Object.entries(CPMM_ERROR_MESSAGES)) {\n if (\n msg.toLowerCase().includes(message) ||\n message.includes(msg.toLowerCase())\n ) {\n return new CpmmError(parseInt(code) as CpmmErrorCode, logs);\n }\n }\n }\n }\n\n return null;\n}\n\n/**\n * Check if an error code is a CPMM error\n */\nexport function isCpmmError(code: number): code is CpmmErrorCode {\n return code >= 6000 && code <= 6030;\n}\n\n/**\n * Get error message from code\n */\nexport function getErrorMessage(code: number): string {\n if (isCpmmError(code)) {\n return CPMM_ERROR_MESSAGES[code];\n }\n return `Unknown error code: ${code}`;\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n SYSTEM_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_WRITABLE_SIGNER,\n} from '../core/constants.js';\nimport type { InitializeConfigArgs } from '../core/types.js';\nimport {\n initializeConfigArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/**\n * Accounts required for initialize_config instruction\n */\nexport interface InitializeConfigAccounts {\n /** AmmConfig account to initialize (writable, PDA: ['config']) */\n config: Address;\n /** Payer for account creation (writable, signer) */\n payer: Address;\n /** System program */\n systemProgram?: Address;\n}\n\n/**\n * Create an initialize_config instruction\n *\n * Initializes the global AMM configuration singleton. This should only be called once\n * per deployment to set up the admin, fees, and allowlist.\n *\n * @param accounts - Required accounts for initialization\n * @param args - Instruction arguments (admin, numeraireMint, fees, allowlist)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to initialize the config\n *\n * @example\n * ```ts\n * const [configAddress] = await getConfigAddress();\n * const ix = createInitializeConfigInstruction(\n * {\n * config: configAddress,\n * payer: payerPublicKey,\n * },\n * {\n * admin: adminPublicKey,\n * numeraireMint: usdcMint,\n * maxSwapFeeBps: 100,\n * maxFeeSplitBps: 5000,\n * maxRouteHops: 3,\n * protocolFeeEnabled: true,\n * protocolFeeBps: 500,\n * sentinelAllowlist: [],\n * }\n * );\n * ```\n */\nexport function createInitializeConfigInstruction(\n accounts: InitializeConfigAccounts,\n args: InitializeConfigArgs,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const { config, payer, systemProgram = SYSTEM_PROGRAM_ID } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: ACCOUNT_ROLE_WRITABLE },\n { address: payer, role: ACCOUNT_ROLE_WRITABLE_SIGNER },\n { address: systemProgram, role: ACCOUNT_ROLE_READONLY },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.initializeConfig,\n initializeConfigArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport type { TransactionSigner, AccountSignerMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n SYSTEM_PROGRAM_ID,\n TOKEN_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_WRITABLE_SIGNER,\n} from '../core/constants.js';\nimport type { InitializePoolArgs } from '../core/types.js';\nimport {\n initializePoolArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/** Type that can be either an Address or a TransactionSigner */\ntype AddressOrSigner = Address | TransactionSigner;\n\n/** Check if value is a TransactionSigner (duck typing) */\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\n/** Create an account meta, embedding signer if provided */\nfunction createSignerAccountMeta(\n value: AddressOrSigner,\n role: typeof ACCOUNT_ROLE_WRITABLE_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return {\n address: value.address,\n role,\n signer: value,\n };\n }\n return { address: value, role };\n}\n\n/**\n * Accounts required for initialize_pool instruction\n */\nexport interface InitializePoolAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account to initialize (writable, PDA: ['pool', token0_mint, token1_mint]) */\n pool: Address;\n /** Protocol position account (writable, PDA: ['protocol_position', pool]) */\n protocolPosition: Address;\n /** Pool authority PDA (read-only, PDA: ['authority', pool]) */\n authority: Address;\n /** Vault for token0 (writable signer - pass TransactionSigner to include signer in instruction) */\n vault0: Address | TransactionSigner;\n /** Vault for token1 (writable signer - pass TransactionSigner to include signer in instruction) */\n vault1: Address | TransactionSigner;\n /** Token0 mint (read-only, must be lexicographically smaller) */\n token0Mint: Address;\n /** Token1 mint (read-only, must be lexicographically larger) */\n token1Mint: Address;\n /** Payer for account creation (writable signer - pass TransactionSigner to include signer in instruction) */\n payer: Address | TransactionSigner;\n /** SPL Token program */\n tokenProgram?: Address;\n /** System program */\n systemProgram?: Address;\n /** Rent sysvar */\n rent: Address;\n}\n\n/**\n * Create an initialize_pool instruction\n *\n * Initializes a new trading pool for a token pair. The mints must be in canonical order\n * (token0 < token1 by bytes). Use sortMints() to ensure proper ordering.\n *\n * @param accounts - Required accounts for pool initialization\n * @param args - Instruction arguments (mintA, mintB, fees, liquidityMeasureSide, numeraire override)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to initialize the pool\n *\n * @example\n * ```ts\n * const addresses = await getPoolInitAddresses(mintA, mintB);\n * const ix = createInitializePoolInstruction(\n * {\n * config: addresses.config[0],\n * pool: addresses.pool[0],\n * protocolPosition: addresses.protocolPosition[0],\n * authority: addresses.authority[0],\n * vault0: vault0Keypair.publicKey,\n * vault1: vault1Keypair.publicKey,\n * token0Mint: addresses.token0,\n * token1Mint: addresses.token1,\n * payer: payerPublicKey,\n * rent: SYSVAR_RENT_PUBKEY,\n * },\n * {\n * mintA: mintA,\n * mintB: mintB,\n * initialSwapFeeBps: 30,\n * initialFeeSplitBps: 5000,\n * liquidityMeasureSide: 0,\n * numeraireMintOverride: null,\n * }\n * );\n * ```\n */\nexport function createInitializePoolInstruction(\n accounts: InitializePoolAccounts,\n args: InitializePoolArgs,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const {\n config,\n pool,\n protocolPosition,\n authority,\n vault0,\n vault1,\n token0Mint,\n token1Mint,\n payer,\n tokenProgram = TOKEN_PROGRAM_ID,\n systemProgram = SYSTEM_PROGRAM_ID,\n rent,\n } = accounts;\n\n // Build account metas in order expected by the program\n // For signer accounts (vault0, vault1, payer), embed the signer if provided\n const keys: (AccountMeta | AccountSignerMeta)[] = [\n { address: config, role: ACCOUNT_ROLE_READONLY },\n { address: pool, role: ACCOUNT_ROLE_WRITABLE },\n { address: protocolPosition, role: ACCOUNT_ROLE_WRITABLE },\n { address: authority, role: ACCOUNT_ROLE_READONLY },\n createSignerAccountMeta(vault0, ACCOUNT_ROLE_WRITABLE_SIGNER),\n createSignerAccountMeta(vault1, ACCOUNT_ROLE_WRITABLE_SIGNER),\n { address: token0Mint, role: ACCOUNT_ROLE_READONLY },\n { address: token1Mint, role: ACCOUNT_ROLE_READONLY },\n createSignerAccountMeta(payer, ACCOUNT_ROLE_WRITABLE_SIGNER),\n { address: tokenProgram, role: ACCOUNT_ROLE_READONLY },\n { address: systemProgram, role: ACCOUNT_ROLE_READONLY },\n { address: rent, role: ACCOUNT_ROLE_READONLY },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.initializePool,\n initializePoolArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n SYSTEM_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_SIGNER,\n ACCOUNT_ROLE_WRITABLE_SIGNER,\n} from '../core/constants.js';\nimport type { InitializeOracleArgs } from '../core/types.js';\nimport {\n initializeOracleArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/**\n * Accounts required for initialize_oracle instruction\n */\nexport interface InitializeOracleAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (read-only) */\n pool: Address;\n /** Oracle PDA to initialize (writable, will be created) */\n oracle: Address;\n /** Admin authority (signer, must match config.admin) */\n admin: Address;\n /** Payer for account creation (signer, writable) */\n payer: Address;\n /** System program */\n systemProgram?: Address;\n}\n\n/**\n * Create an initialize_oracle instruction\n *\n * Initializes a TWAP oracle for a pool. The oracle tracks price movements\n * and stores observations for time-weighted average price calculations.\n *\n * @param accounts - Required accounts for the instruction\n * @param args - Instruction arguments (maxPriceChangeRatioQ64, observationIntervalSec, numObservations)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to initialize the oracle\n *\n * @example\n * ```ts\n * const ix = createInitializeOracleInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * oracle: oracleAddress,\n * admin: adminPublicKey,\n * payer: payerPublicKey,\n * },\n * {\n * maxPriceChangeRatioQ64: 1n << 64n, // 100% max change per slot\n * observationIntervalSec: 60, // 1 minute between observations\n * numObservations: 64, // Must be MAX_ORACLE_OBSERVATIONS\n * }\n * );\n * ```\n */\nexport function createInitializeOracleInstruction(\n accounts: InitializeOracleAccounts,\n args: InitializeOracleArgs,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const {\n config,\n pool,\n oracle,\n admin,\n payer,\n systemProgram = SYSTEM_PROGRAM_ID,\n } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: ACCOUNT_ROLE_READONLY },\n { address: pool, role: ACCOUNT_ROLE_READONLY },\n { address: oracle, role: ACCOUNT_ROLE_WRITABLE },\n { address: admin, role: ACCOUNT_ROLE_SIGNER },\n { address: payer, role: ACCOUNT_ROLE_WRITABLE_SIGNER },\n { address: systemProgram, role: ACCOUNT_ROLE_READONLY },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.initializeOracle,\n initializeOracleArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_SIGNER,\n} from '../core/constants.js';\nimport type { SetFeesArgs } from '../core/types.js';\nimport { setFeesArgsCodec, encodeInstructionData } from '../core/codecs.js';\n\n/**\n * Accounts required for set_fees instruction\n */\nexport interface SetFeesAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (writable) */\n pool: Address;\n /** Admin authority (signer, must match config.admin) */\n admin: Address;\n}\n\n/**\n * Create a set_fees instruction\n *\n * Admin instruction to update the swap fee and fee split on a pool.\n * Fees will be clamped to the config's max values.\n *\n * @param accounts - Required accounts for setting fees\n * @param args - Instruction arguments (swapFeeBps, feeSplitBps)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to set fees\n *\n * @example\n * ```ts\n * const ix = createSetFeesInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * admin: adminPublicKey,\n * },\n * {\n * swapFeeBps: 30, // 0.30% swap fee\n * feeSplitBps: 5000, // 50% of fees go to LPs (distributable)\n * }\n * );\n * ```\n */\nexport function createSetFeesInstruction(\n accounts: SetFeesAccounts,\n args: SetFeesArgs,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const { config, pool, admin } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: ACCOUNT_ROLE_READONLY },\n { address: pool, role: ACCOUNT_ROLE_WRITABLE },\n { address: admin, role: ACCOUNT_ROLE_SIGNER },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.setFees,\n setFeesArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_SIGNER,\n} from '../core/constants.js';\nimport type { SetSentinelArgs } from '../core/types.js';\nimport { setSentinelArgsCodec, encodeInstructionData } from '../core/codecs.js';\n\n/**\n * Accounts required for set_sentinel instruction\n */\nexport interface SetSentinelAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (writable) */\n pool: Address;\n /** Admin authority (signer, must match config.admin) */\n admin: Address;\n}\n\n/**\n * Create a set_sentinel instruction\n *\n * Admin instruction to configure a sentinel (hook) program on a pool.\n * The sentinel program must be in the config's allowlist (if the allowlist is non-empty).\n * Use Pubkey::default() to disable the sentinel.\n *\n * @param accounts - Required accounts for setting sentinel\n * @param args - Instruction arguments (sentinelProgram, sentinelFlags)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to set sentinel\n *\n * @example\n * ```ts\n * import { SF_BEFORE_SWAP, SF_AFTER_SWAP } from '@cpmm/sdk';\n *\n * const ix = createSetSentinelInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * admin: adminPublicKey,\n * },\n * {\n * sentinelProgram: sentinelProgramId,\n * sentinelFlags: SF_BEFORE_SWAP | SF_AFTER_SWAP, // Enable both hooks\n * }\n * );\n * ```\n */\nexport function createSetSentinelInstruction(\n accounts: SetSentinelAccounts,\n args: SetSentinelArgs,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const { config, pool, admin } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: ACCOUNT_ROLE_READONLY },\n { address: pool, role: ACCOUNT_ROLE_WRITABLE },\n { address: admin, role: ACCOUNT_ROLE_SIGNER },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.setSentinel,\n setSentinelArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_SIGNER,\n} from '../core/constants.js';\nimport type { SetRouteArgs } from '../core/types.js';\nimport { setRouteArgsCodec, encodeInstructionData } from '../core/codecs.js';\n\n/**\n * Accounts required for set_route instruction\n */\nexport interface SetRouteAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (writable) */\n pool: Address;\n /** Next pool in routing chain (optional, required if setting a route) */\n nextPool?: Address;\n /** Admin authority (signer, must match config.admin) */\n admin: Address;\n}\n\n/**\n * Create a set_route instruction\n *\n * Admin instruction to configure routing for a pool. This allows multi-hop swaps\n * through a chain of pools. The bridge mint must exist in both the current pool\n * and the next pool.\n *\n * To clear routing, pass Pubkey::default() for both routeNextPool and routeBridgeMint.\n *\n * @param accounts - Required accounts for setting route\n * @param args - Instruction arguments (routeNextPool, routeBridgeMint)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to set route\n *\n * @example\n * ```ts\n * // Set up routing: Pool A -> Pool B via USDC\n * const ix = createSetRouteInstruction(\n * {\n * config: configAddress,\n * pool: poolAAddress,\n * nextPool: poolBAddress,\n * admin: adminPublicKey,\n * },\n * {\n * routeNextPool: poolBAddress,\n * routeBridgeMint: usdcMint, // Must be in both pools\n * }\n * );\n *\n * // Clear routing\n * const clearIx = createSetRouteInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * admin: adminPublicKey,\n * },\n * {\n * routeNextPool: address('11111111111111111111111111111111'),\n * routeBridgeMint: address('11111111111111111111111111111111'),\n * }\n * );\n * ```\n */\nexport function createSetRouteInstruction(\n accounts: SetRouteAccounts,\n args: SetRouteArgs,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const { config, pool, nextPool, admin } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: ACCOUNT_ROLE_READONLY },\n { address: pool, role: ACCOUNT_ROLE_WRITABLE },\n ];\n\n // Add next_pool if provided (optional account)\n if (nextPool) {\n keys.push({ address: nextPool, role: ACCOUNT_ROLE_READONLY });\n }\n\n keys.push({ address: admin, role: ACCOUNT_ROLE_SIGNER });\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.setRoute,\n setRouteArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_SIGNER,\n} from '../core/constants.js';\n\n/**\n * Accounts required for pause instruction\n */\nexport interface PauseAccounts {\n /** AmmConfig account (writable) */\n config: Address;\n /** Admin authority (signer, must match config.admin) */\n admin: Address;\n}\n\n/**\n * Create a pause instruction\n *\n * Admin instruction to pause all pool operations globally. When paused,\n * swaps, liquidity additions, and liquidity removals will fail.\n *\n * @param accounts - Required accounts for pausing\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to pause the AMM\n *\n * @example\n * ```ts\n * const ix = createPauseInstruction({\n * config: configAddress,\n * admin: adminPublicKey,\n * });\n * ```\n */\nexport function createPauseInstruction(\n accounts: PauseAccounts,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const { config, admin } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: ACCOUNT_ROLE_WRITABLE },\n { address: admin, role: ACCOUNT_ROLE_SIGNER },\n ];\n\n // No args for pause instruction, just the discriminator\n const data = INSTRUCTION_DISCRIMINATORS.pause;\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_SIGNER,\n} from '../core/constants.js';\n\n/**\n * Accounts required for unpause instruction\n */\nexport interface UnpauseAccounts {\n /** AmmConfig account (writable) */\n config: Address;\n /** Admin authority (signer, must match config.admin) */\n admin: Address;\n}\n\n/**\n * Create an unpause instruction\n *\n * Admin instruction to unpause all pool operations. This re-enables\n * swaps, liquidity additions, and liquidity removals after a pause.\n *\n * @param accounts - Required accounts for unpausing\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to unpause the AMM\n *\n * @example\n * ```ts\n * const ix = createUnpauseInstruction({\n * config: configAddress,\n * admin: adminPublicKey,\n * });\n * ```\n */\nexport function createUnpauseInstruction(\n accounts: UnpauseAccounts,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const { config, admin } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: ACCOUNT_ROLE_WRITABLE },\n { address: admin, role: ACCOUNT_ROLE_SIGNER },\n ];\n\n // No args for unpause instruction, just the discriminator\n const data = INSTRUCTION_DISCRIMINATORS.unpause;\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_SIGNER,\n} from '../core/constants.js';\nimport type { TransferAdminArgs } from '../core/types.js';\nimport {\n transferAdminArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/**\n * Accounts required for transfer_admin instruction\n */\nexport interface TransferAdminAccounts {\n /** AmmConfig account (writable) */\n config: Address;\n /** Current admin authority (signer, must match config.admin) */\n admin: Address;\n}\n\n/**\n * Create a transfer_admin instruction\n *\n * Admin instruction to transfer administrative authority to a new address.\n * The new admin will have full control over the AMM configuration and all pools.\n *\n * CAUTION: This action is irreversible. Ensure the new admin address is correct\n * and that you have access to it before executing.\n *\n * @param accounts - Required accounts for transferring admin\n * @param args - Instruction arguments (newAdmin)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to transfer admin\n *\n * @example\n * ```ts\n * const ix = createTransferAdminInstruction(\n * {\n * config: configAddress,\n * admin: currentAdminPublicKey,\n * },\n * {\n * newAdmin: newAdminPublicKey,\n * }\n * );\n * ```\n */\nexport function createTransferAdminInstruction(\n accounts: TransferAdminAccounts,\n args: TransferAdminArgs,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const { config, admin } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: ACCOUNT_ROLE_WRITABLE },\n { address: admin, role: ACCOUNT_ROLE_SIGNER },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.transferAdmin,\n transferAdminArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n TOKEN_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_SIGNER,\n} from '../core/constants.js';\n\n/**\n * Accounts required for skim instruction\n */\nexport interface SkimAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (read-only) */\n pool: Address;\n /** Admin authority (signer, must match config.admin) */\n admin: Address;\n /** Pool authority PDA (read-only, PDA: ['authority', pool]) */\n authority: Address;\n /** Token0 vault (writable) */\n vault0: Address;\n /** Token1 vault (writable) */\n vault1: Address;\n /** Token0 mint (read-only) */\n token0Mint: Address;\n /** Token1 mint (read-only) */\n token1Mint: Address;\n /** Admin's token0 ATA to receive excess (writable) */\n adminAta0: Address;\n /** Admin's token1 ATA to receive excess (writable) */\n adminAta1: Address;\n /** SPL Token program */\n tokenProgram?: Address;\n}\n\n/**\n * Create a skim instruction\n *\n * Admin instruction to withdraw excess tokens from pool vaults. This recovers any\n * tokens that were accidentally sent directly to the vault accounts (outside of\n * normal pool operations).\n *\n * Only withdraws tokens in excess of (reserve + unclaimed_fees). Normal pool\n * reserves and LP fees are not affected.\n *\n * @param accounts - Required accounts for skimming\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to skim excess tokens\n *\n * @example\n * ```ts\n * const ix = createSkimInstruction({\n * config: configAddress,\n * pool: poolAddress,\n * admin: adminPublicKey,\n * authority: authorityAddress,\n * vault0: vault0Address,\n * vault1: vault1Address,\n * token0Mint: mint0,\n * token1Mint: mint1,\n * adminAta0: adminToken0Account,\n * adminAta1: adminToken1Account,\n * });\n * ```\n */\nexport function createSkimInstruction(\n accounts: SkimAccounts,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const {\n config,\n pool,\n admin,\n authority,\n vault0,\n vault1,\n token0Mint,\n token1Mint,\n adminAta0,\n adminAta1,\n tokenProgram = TOKEN_PROGRAM_ID,\n } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: ACCOUNT_ROLE_READONLY },\n { address: pool, role: ACCOUNT_ROLE_READONLY },\n { address: admin, role: ACCOUNT_ROLE_SIGNER },\n { address: authority, role: ACCOUNT_ROLE_READONLY },\n { address: vault0, role: ACCOUNT_ROLE_WRITABLE },\n { address: vault1, role: ACCOUNT_ROLE_WRITABLE },\n { address: token0Mint, role: ACCOUNT_ROLE_READONLY },\n { address: token1Mint, role: ACCOUNT_ROLE_READONLY },\n { address: adminAta0, role: ACCOUNT_ROLE_WRITABLE },\n { address: adminAta1, role: ACCOUNT_ROLE_WRITABLE },\n { address: tokenProgram, role: ACCOUNT_ROLE_READONLY },\n ];\n\n // No args for skim instruction, just the discriminator\n const data = INSTRUCTION_DISCRIMINATORS.skim;\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n TOKEN_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_SIGNER,\n} from '../core/constants.js';\nimport type { SwapExactInArgs, SwapDirection } from '../core/types.js';\nimport { encodeInstructionData, swapExactInArgsCodec } from '../core/codecs.js';\n\n/**\n * Accounts required for swap_exact_in instruction\n */\nexport interface SwapExactInAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (writable) */\n pool: Address;\n /** Pool authority PDA (read-only) */\n authority: Address;\n /** Input token vault (writable) */\n vaultIn: Address;\n /** Output token vault (writable) */\n vaultOut: Address;\n /** Token0 mint (read-only, for transfer_checked) */\n token0Mint: Address;\n /** Token1 mint (read-only, for transfer_checked) */\n token1Mint: Address;\n /** User's input token account (writable) */\n userIn: Address;\n /** User's output token account (writable) */\n userOut: Address;\n /** User authority (signer) */\n user: Address;\n /** SPL Token program */\n tokenProgram?: Address;\n /** Oracle account (optional, required if updateOracle is true) */\n oracle?: Address;\n /** Optional remaining accounts (sentinel program/state, route/oracle data) */\n remainingAccounts?: Address[];\n}\n\n/**\n * Create a swap_exact_in instruction\n *\n * Swaps an exact input amount for a minimum output amount using the CPMM formula.\n *\n * @param accounts - Required accounts for the swap\n * @param args - Instruction arguments (amountIn, minAmountOut, direction, updateOracle)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to execute the swap\n *\n * @example\n * ```ts\n * const ix = createSwapExactInInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * authority: authorityAddress,\n * vaultIn: vault0Address,\n * vaultOut: vault1Address,\n * token0Mint: mint0,\n * token1Mint: mint1,\n * userIn: userToken0Account,\n * userOut: userToken1Account,\n * user: userPublicKey,\n * },\n * {\n * amountIn: 1000000n,\n * minAmountOut: 990000n,\n * direction: 0, // token0 -> token1\n * updateOracle: false,\n * }\n * );\n * ```\n */\nexport function createSwapExactInInstruction(\n accounts: SwapExactInAccounts,\n args: SwapExactInArgs,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const {\n config,\n pool,\n authority,\n vaultIn,\n vaultOut,\n token0Mint,\n token1Mint,\n userIn,\n userOut,\n user,\n tokenProgram = TOKEN_PROGRAM_ID,\n oracle,\n remainingAccounts = [],\n } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: ACCOUNT_ROLE_READONLY },\n { address: pool, role: ACCOUNT_ROLE_WRITABLE },\n { address: authority, role: ACCOUNT_ROLE_READONLY },\n { address: vaultIn, role: ACCOUNT_ROLE_WRITABLE },\n { address: vaultOut, role: ACCOUNT_ROLE_WRITABLE },\n { address: token0Mint, role: ACCOUNT_ROLE_READONLY },\n { address: token1Mint, role: ACCOUNT_ROLE_READONLY },\n { address: userIn, role: ACCOUNT_ROLE_WRITABLE },\n { address: userOut, role: ACCOUNT_ROLE_WRITABLE },\n { address: user, role: ACCOUNT_ROLE_SIGNER },\n { address: tokenProgram, role: ACCOUNT_ROLE_READONLY },\n ];\n\n // Add oracle if provided (always writable due to Anchor #[account(mut)] constraint)\n if (oracle) {\n keys.push({ address: oracle, role: ACCOUNT_ROLE_WRITABLE });\n }\n for (const account of remainingAccounts) {\n keys.push({ address: account, role: ACCOUNT_ROLE_READONLY });\n }\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.swapExactIn,\n swapExactInArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n\n/**\n * Helper to create swap instruction with simplified parameters\n */\nexport function createSwapInstruction(params: {\n config: Address;\n pool: Address;\n authority: Address;\n vault0: Address;\n vault1: Address;\n token0Mint: Address;\n token1Mint: Address;\n userToken0: Address;\n userToken1: Address;\n user: Address;\n amountIn: bigint;\n minAmountOut: bigint;\n direction: SwapDirection;\n oracle?: Address;\n remainingAccounts?: Address[];\n updateOracle?: boolean;\n programId?: Address;\n}): Instruction {\n const {\n config,\n pool,\n authority,\n vault0,\n vault1,\n token0Mint,\n token1Mint,\n userToken0,\n userToken1,\n user,\n amountIn,\n minAmountOut,\n direction,\n oracle,\n remainingAccounts,\n updateOracle = false,\n programId = PROGRAM_ID,\n } = params;\n\n // Determine vaults and user accounts based on direction\n const [vaultIn, vaultOut] =\n direction === 0 ? [vault0, vault1] : [vault1, vault0];\n const [userIn, userOut] =\n direction === 0 ? [userToken0, userToken1] : [userToken1, userToken0];\n\n return createSwapExactInInstruction(\n {\n config,\n pool,\n authority,\n vaultIn,\n vaultOut,\n token0Mint,\n token1Mint,\n userIn,\n userOut,\n user,\n oracle,\n remainingAccounts,\n },\n {\n amountIn,\n minAmountOut,\n direction,\n updateOracle,\n },\n programId,\n );\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n SYSTEM_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_SIGNER,\n ACCOUNT_ROLE_WRITABLE_SIGNER,\n} from '../core/constants.js';\nimport type { CreatePositionArgs } from '../core/types.js';\nimport {\n createPositionArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/**\n * Accounts required for create_position instruction\n */\nexport interface CreatePositionAccounts {\n /** Pool account (read-only) */\n pool: Address;\n /** Position PDA to be created (writable, derived from ['position', pool, owner, position_id]) */\n position: Address;\n /** Owner of the position (signer) */\n owner: Address;\n /** Payer for rent (signer, writable) */\n payer: Address;\n /** System program */\n systemProgram?: Address;\n}\n\n/**\n * Create a create_position instruction\n *\n * Creates a new liquidity position for a pool. The position is a PDA derived from\n * the pool, owner, and position ID. Users can have multiple positions per pool\n * by using different position IDs.\n *\n * @param accounts - Required accounts for creating the position\n * @param args - Instruction arguments (positionId)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to create a new position\n *\n * @example\n * ```ts\n * const ix = createCreatePositionInstruction(\n * {\n * pool: poolAddress,\n * position: positionPda,\n * owner: userPublicKey,\n * payer: userPublicKey,\n * },\n * {\n * positionId: 0n,\n * }\n * );\n * ```\n */\nexport function createCreatePositionInstruction(\n accounts: CreatePositionAccounts,\n args: CreatePositionArgs,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const {\n pool,\n position,\n owner,\n payer,\n systemProgram = SYSTEM_PROGRAM_ID,\n } = accounts;\n\n // Build account metas in order expected by the program\n // Order: pool, position, owner, payer, system_program\n const keys: AccountMeta[] = [\n { address: pool, role: ACCOUNT_ROLE_READONLY },\n { address: position, role: ACCOUNT_ROLE_WRITABLE },\n { address: owner, role: ACCOUNT_ROLE_SIGNER },\n { address: payer, role: ACCOUNT_ROLE_WRITABLE_SIGNER },\n { address: systemProgram, role: ACCOUNT_ROLE_READONLY },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.createPosition,\n createPositionArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_SIGNER,\n} from '../core/constants.js';\n\n/**\n * Accounts required for close_position instruction\n */\nexport interface ClosePositionAccounts {\n /** Pool account (read-only) */\n pool: Address;\n /** Position account to close (writable) */\n position: Address;\n /** Position owner (signer) */\n owner: Address;\n /** Recipient for rent lamports (writable) */\n rentRecipient: Address;\n}\n\n/**\n * Create a close_position instruction\n *\n * Closes an empty position account, returning the rent lamports to the recipient.\n * The position must have zero shares and zero accrued fees to be closed.\n *\n * @param accounts - Required accounts for closing the position\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to close a position\n *\n * @example\n * ```ts\n * const ix = createClosePositionInstruction({\n * pool: poolAddress,\n * position: positionAddress,\n * owner: userPublicKey,\n * rentRecipient: userPublicKey,\n * });\n * ```\n */\nexport function createClosePositionInstruction(\n accounts: ClosePositionAccounts,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const { pool, position, owner, rentRecipient } = accounts;\n\n // Build account metas in order expected by the program\n // Order: pool, position, owner, rent_recipient\n const keys: AccountMeta[] = [\n { address: pool, role: ACCOUNT_ROLE_READONLY },\n { address: position, role: ACCOUNT_ROLE_WRITABLE },\n { address: owner, role: ACCOUNT_ROLE_SIGNER },\n { address: rentRecipient, role: ACCOUNT_ROLE_WRITABLE },\n ];\n\n // closePosition has no args, just the discriminator\n const data = INSTRUCTION_DISCRIMINATORS.closePosition;\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport type { Codec } from '@solana/kit';\nimport {\n PROGRAM_ID,\n TOKEN_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_SIGNER,\n} from '../core/constants.js';\nimport type { AddLiquidityArgs } from '../core/types.js';\nimport { encodeInstructionData } from '../core/codecs.js';\nimport {\n getStructCodec,\n getU64Codec,\n getU128Codec,\n getBooleanCodec,\n} from '@solana/kit';\n\n/**\n * Extended AddLiquidity args that include updateOracle flag\n * (matches the on-chain program's actual args)\n */\nexport interface AddLiquidityArgsWithOracle extends AddLiquidityArgs {\n /** Whether to update the oracle (requires oracle account) */\n updateOracle: boolean;\n}\n\n/**\n * Codec for AddLiquidity args including updateOracle\n */\nconst addLiquidityArgsWithOracleCodec: Codec<AddLiquidityArgsWithOracle> =\n getStructCodec([\n ['amount0Max', getU64Codec()],\n ['amount1Max', getU64Codec()],\n ['minSharesOut', getU128Codec()],\n ['updateOracle', getBooleanCodec()],\n ]);\n\n/**\n * Accounts required for add_liquidity instruction\n */\nexport interface AddLiquidityAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (writable) */\n pool: Address;\n /** User's position account (writable) */\n position: Address;\n /** Protocol position for protocol fees (writable) */\n protocolPosition: Address;\n /** Position owner (signer) */\n owner: Address;\n /** Pool authority PDA (read-only) */\n authority: Address;\n /** Pool vault for token0 (writable) */\n vault0: Address;\n /** Pool vault for token1 (writable) */\n vault1: Address;\n /** Token0 mint (read-only) */\n token0Mint: Address;\n /** Token1 mint (read-only) */\n token1Mint: Address;\n /** User's token0 account (writable) */\n user0: Address;\n /** User's token1 account (writable) */\n user1: Address;\n /** SPL Token program */\n tokenProgram?: Address;\n /** Oracle account (optional, required if updateOracle is true) */\n oracle?: Address;\n /** Optional remaining accounts (sentinel program/state, route/oracle data) */\n remainingAccounts?: Address[];\n}\n\n/**\n * Create an add_liquidity instruction\n *\n * Adds liquidity to a pool by depositing tokens and receiving LP shares.\n * For an empty pool (first deposit), the amount of shares is sqrt(amount0 * amount1).\n * For subsequent deposits, shares are proportional to the smaller ratio of deposit to reserves.\n *\n * @param accounts - Required accounts for adding liquidity\n * @param args - Instruction arguments (amount0Max, amount1Max, minSharesOut, updateOracle)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to add liquidity\n *\n * @example\n * ```ts\n * const ix = createAddLiquidityInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * position: positionAddress,\n * protocolPosition: protocolPositionAddress,\n * owner: userPublicKey,\n * authority: authorityPda,\n * vault0: vault0Address,\n * vault1: vault1Address,\n * token0Mint: mint0,\n * token1Mint: mint1,\n * user0: userToken0Account,\n * user1: userToken1Account,\n * },\n * {\n * amount0Max: 1000000n,\n * amount1Max: 1000000n,\n * minSharesOut: 0n,\n * updateOracle: false,\n * }\n * );\n * ```\n */\nexport function createAddLiquidityInstruction(\n accounts: AddLiquidityAccounts,\n args: AddLiquidityArgsWithOracle,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const {\n config,\n pool,\n position,\n protocolPosition,\n owner,\n authority,\n vault0,\n vault1,\n token0Mint,\n token1Mint,\n user0,\n user1,\n tokenProgram = TOKEN_PROGRAM_ID,\n oracle,\n remainingAccounts = [],\n } = accounts;\n\n // Build account metas in order expected by the program\n // Order: config, pool, position, protocol_position, owner, authority,\n // vault0, vault1, token0_mint, token1_mint, user0, user1, token_program, [oracle]\n const keys: AccountMeta[] = [\n { address: config, role: ACCOUNT_ROLE_READONLY },\n { address: pool, role: ACCOUNT_ROLE_WRITABLE },\n { address: position, role: ACCOUNT_ROLE_WRITABLE },\n { address: protocolPosition, role: ACCOUNT_ROLE_WRITABLE },\n { address: owner, role: ACCOUNT_ROLE_SIGNER },\n { address: authority, role: ACCOUNT_ROLE_READONLY },\n { address: vault0, role: ACCOUNT_ROLE_WRITABLE },\n { address: vault1, role: ACCOUNT_ROLE_WRITABLE },\n { address: token0Mint, role: ACCOUNT_ROLE_READONLY },\n { address: token1Mint, role: ACCOUNT_ROLE_READONLY },\n { address: user0, role: ACCOUNT_ROLE_WRITABLE },\n { address: user1, role: ACCOUNT_ROLE_WRITABLE },\n { address: tokenProgram, role: ACCOUNT_ROLE_READONLY },\n ];\n\n // Add oracle if provided (always writable due to Anchor #[account(mut)] constraint)\n if (oracle) {\n keys.push({ address: oracle, role: ACCOUNT_ROLE_WRITABLE });\n }\n for (const account of remainingAccounts) {\n keys.push({ address: account, role: ACCOUNT_ROLE_READONLY });\n }\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.addLiquidity,\n addLiquidityArgsWithOracleCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n TOKEN_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_SIGNER,\n} from '../core/constants.js';\nimport type { RemoveLiquidityArgs } from '../core/types.js';\nimport {\n removeLiquidityArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/**\n * Accounts required for remove_liquidity instruction\n */\nexport interface RemoveLiquidityAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (writable) */\n pool: Address;\n /** User's position account (writable) */\n position: Address;\n /** Protocol position for protocol fees (writable) */\n protocolPosition: Address;\n /** Position owner (signer) */\n owner: Address;\n /** Pool authority PDA (read-only) */\n authority: Address;\n /** Pool vault for token0 (writable) */\n vault0: Address;\n /** Pool vault for token1 (writable) */\n vault1: Address;\n /** Token0 mint (read-only) */\n token0Mint: Address;\n /** Token1 mint (read-only) */\n token1Mint: Address;\n /** User's token0 account (writable) */\n user0: Address;\n /** User's token1 account (writable) */\n user1: Address;\n /** SPL Token program */\n tokenProgram?: Address;\n /** Oracle account (optional, required if updateOracle is true) */\n oracle?: Address;\n /** Optional remaining accounts (sentinel program/state, route/oracle data) */\n remainingAccounts?: Address[];\n}\n\n/**\n * Create a remove_liquidity instruction\n *\n * Removes liquidity from a pool by burning LP shares and receiving tokens back.\n * The amount of tokens received is proportional to the share of the pool being withdrawn.\n * Also accrues any pending fees to the position before withdrawal.\n *\n * @param accounts - Required accounts for removing liquidity\n * @param args - Instruction arguments (sharesIn, minAmount0Out, minAmount1Out, updateOracle)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to remove liquidity\n *\n * @example\n * ```ts\n * const ix = createRemoveLiquidityInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * position: positionAddress,\n * protocolPosition: protocolPositionAddress,\n * owner: userPublicKey,\n * authority: authorityPda,\n * vault0: vault0Address,\n * vault1: vault1Address,\n * token0Mint: mint0,\n * token1Mint: mint1,\n * user0: userToken0Account,\n * user1: userToken1Account,\n * },\n * {\n * sharesIn: 500000n,\n * minAmount0Out: 450000n,\n * minAmount1Out: 450000n,\n * updateOracle: false,\n * }\n * );\n * ```\n */\nexport function createRemoveLiquidityInstruction(\n accounts: RemoveLiquidityAccounts,\n args: RemoveLiquidityArgs,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const {\n config,\n pool,\n position,\n protocolPosition,\n owner,\n authority,\n vault0,\n vault1,\n token0Mint,\n token1Mint,\n user0,\n user1,\n tokenProgram = TOKEN_PROGRAM_ID,\n oracle,\n remainingAccounts = [],\n } = accounts;\n\n // Build account metas in order expected by the program\n // Order: config, pool, position, protocol_position, owner, authority,\n // vault0, vault1, token0_mint, token1_mint, user0, user1, token_program, [oracle]\n const keys: AccountMeta[] = [\n { address: config, role: ACCOUNT_ROLE_READONLY },\n { address: pool, role: ACCOUNT_ROLE_WRITABLE },\n { address: position, role: ACCOUNT_ROLE_WRITABLE },\n { address: protocolPosition, role: ACCOUNT_ROLE_WRITABLE },\n { address: owner, role: ACCOUNT_ROLE_SIGNER },\n { address: authority, role: ACCOUNT_ROLE_READONLY },\n { address: vault0, role: ACCOUNT_ROLE_WRITABLE },\n { address: vault1, role: ACCOUNT_ROLE_WRITABLE },\n { address: token0Mint, role: ACCOUNT_ROLE_READONLY },\n { address: token1Mint, role: ACCOUNT_ROLE_READONLY },\n { address: user0, role: ACCOUNT_ROLE_WRITABLE },\n { address: user1, role: ACCOUNT_ROLE_WRITABLE },\n { address: tokenProgram, role: ACCOUNT_ROLE_READONLY },\n ];\n\n // Add oracle if provided (always writable due to Anchor #[account(mut)] constraint)\n if (oracle) {\n keys.push({ address: oracle, role: ACCOUNT_ROLE_WRITABLE });\n }\n for (const account of remainingAccounts) {\n keys.push({ address: account, role: ACCOUNT_ROLE_READONLY });\n }\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.removeLiquidity,\n removeLiquidityArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n TOKEN_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_SIGNER,\n} from '../core/constants.js';\nimport type { CollectProtocolFeesArgs } from '../core/types.js';\nimport {\n collectProtocolFeesArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/**\n * Accounts required for collect_protocol_fees instruction\n */\nexport interface CollectProtocolFeesAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (writable) */\n pool: Address;\n /** Protocol position account (writable) */\n protocolPosition: Address;\n /** Admin authority (signer) */\n admin: Address;\n /** Pool authority PDA (read-only) */\n authority: Address;\n /** Pool vault for token0 (writable) */\n vault0: Address;\n /** Pool vault for token1 (writable) */\n vault1: Address;\n /** Token0 mint (read-only) */\n token0Mint: Address;\n /** Token1 mint (read-only) */\n token1Mint: Address;\n /** Recipient token0 account (writable) */\n recipient0: Address;\n /** Recipient token1 account (writable) */\n recipient1: Address;\n /** SPL Token program */\n tokenProgram?: Address;\n}\n\n/**\n * Create a collect_protocol_fees instruction\n *\n * Collects accrued protocol fees from the protocol position and transfers them\n * to the configured recipients.\n *\n * @param accounts - Required accounts for collecting protocol fees\n * @param args - Instruction arguments (max0, max1)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to collect protocol fees\n *\n * @example\n * ```ts\n * const ix = createCollectProtocolFeesInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * protocolPosition: protocolPositionAddress,\n * admin: adminPublicKey,\n * authority: authorityPda,\n * vault0: vault0Address,\n * vault1: vault1Address,\n * token0Mint: mint0,\n * token1Mint: mint1,\n * recipient0: adminToken0Account,\n * recipient1: adminToken1Account,\n * },\n * {\n * max0: BigInt('18446744073709551615'),\n * max1: BigInt('18446744073709551615'),\n * }\n * );\n * ```\n */\nexport function createCollectProtocolFeesInstruction(\n accounts: CollectProtocolFeesAccounts,\n args: CollectProtocolFeesArgs,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const {\n config,\n pool,\n protocolPosition,\n admin,\n authority,\n vault0,\n vault1,\n token0Mint,\n token1Mint,\n recipient0,\n recipient1,\n tokenProgram = TOKEN_PROGRAM_ID,\n } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: ACCOUNT_ROLE_READONLY },\n { address: pool, role: ACCOUNT_ROLE_WRITABLE },\n { address: protocolPosition, role: ACCOUNT_ROLE_WRITABLE },\n { address: admin, role: ACCOUNT_ROLE_SIGNER },\n { address: authority, role: ACCOUNT_ROLE_READONLY },\n { address: vault0, role: ACCOUNT_ROLE_WRITABLE },\n { address: vault1, role: ACCOUNT_ROLE_WRITABLE },\n { address: token0Mint, role: ACCOUNT_ROLE_READONLY },\n { address: token1Mint, role: ACCOUNT_ROLE_READONLY },\n { address: recipient0, role: ACCOUNT_ROLE_WRITABLE },\n { address: recipient1, role: ACCOUNT_ROLE_WRITABLE },\n { address: tokenProgram, role: ACCOUNT_ROLE_READONLY },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.collectProtocolFees,\n collectProtocolFeesArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n} from '../core/constants.js';\n\n/**\n * Accounts required for oracle_update instruction\n */\nexport interface OracleUpdateAccounts {\n /** Pool account (read-only) */\n pool: Address;\n /** Oracle PDA to update (writable) */\n oracle: Address;\n}\n\n/**\n * Create an oracle_update instruction\n *\n * Updates the oracle with the current pool prices. This samples the current\n * spot price, clamps it according to maxPriceChangeRatioQ64, and records\n * a new observation if the observation interval has elapsed.\n *\n * This instruction is permissionless - anyone can call it to update the oracle.\n *\n * @param accounts - Required accounts for the instruction\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to update the oracle\n *\n * @example\n * ```ts\n * const ix = createOracleUpdateInstruction({\n * pool: poolAddress,\n * oracle: oracleAddress,\n * });\n * ```\n */\nexport function createOracleUpdateInstruction(\n accounts: OracleUpdateAccounts,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const { pool, oracle } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: pool, role: ACCOUNT_ROLE_READONLY },\n { address: oracle, role: ACCOUNT_ROLE_WRITABLE },\n ];\n\n // oracle_update has no args, just the discriminator\n const data = INSTRUCTION_DISCRIMINATORS.oracleUpdate;\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n} from '../core/constants.js';\nimport type { OracleConsultArgs } from '../core/types.js';\nimport {\n oracleConsultArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\nimport { getStructCodec, getU128Codec, type Codec } from '@solana/kit';\nimport type { ReadonlyUint8Array } from '@solana/kit';\n\n/**\n * Accounts required for oracle_consult instruction\n */\nexport interface OracleConsultAccounts {\n /** Pool account (read-only) */\n pool: Address;\n /** Oracle PDA to query (read-only) */\n oracle: Address;\n}\n\n/**\n * Result returned from oracle_consult via return data\n */\nexport interface OracleConsultResult {\n /** TWAP price of token0 in token1 (Q64.64 fixed-point) */\n price0Q64: bigint;\n /** TWAP price of token1 in token0 (Q64.64 fixed-point) */\n price1Q64: bigint;\n}\n\nconst oracleConsultResultCodec: Codec<OracleConsultResult> = getStructCodec([\n ['price0Q64', getU128Codec()],\n ['price1Q64', getU128Codec()],\n]);\n\n/**\n * Decode oracle_consult return data\n */\nexport function decodeOracleConsultResult(\n data: ReadonlyUint8Array,\n): OracleConsultResult {\n return oracleConsultResultCodec.decode(data);\n}\n\n/**\n * Create an oracle_consult instruction\n *\n * Queries the TWAP price from the oracle over the specified time window.\n * The result is returned via Solana's return data mechanism.\n *\n * Note: To read the result, you must invoke this instruction via CPI or\n * simulate the transaction and parse the return data.\n *\n * @param accounts - Required accounts for the instruction\n * @param args - Instruction arguments (windowSeconds)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to consult the oracle\n *\n * @example\n * ```ts\n * const ix = createOracleConsultInstruction(\n * {\n * pool: poolAddress,\n * oracle: oracleAddress,\n * },\n * {\n * windowSeconds: 300, // 5-minute TWAP\n * }\n * );\n * ```\n */\nexport function createOracleConsultInstruction(\n accounts: OracleConsultAccounts,\n args: OracleConsultArgs,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const { pool, oracle } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: pool, role: ACCOUNT_ROLE_READONLY },\n { address: oracle, role: ACCOUNT_ROLE_READONLY },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.oracleConsult,\n oracleConsultArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import { getAddressCodec, type Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport {\n PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n ACCOUNT_ROLE_READONLY,\n} from '../core/constants.js';\nimport type { QuoteToNumeraireArgs } from '../core/types.js';\nimport {\n quoteToNumeraireArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\nimport {\n getStructCodec,\n getU128Codec,\n getU8Codec,\n type Codec,\n} from '@solana/kit';\nimport type { ReadonlyUint8Array } from '@solana/kit';\n\n/**\n * Accounts required for quote_to_numeraire instruction\n */\nexport interface QuoteToNumeraireAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Starting pool for the route (read-only) */\n startPool: Address;\n /**\n * Remaining accounts for routing:\n * - [pool1?, pool2?, ...]\n *\n * Each hop requires the next pool in the route chain.\n */\n remainingAccounts?: Address[];\n}\n\n/**\n * Result returned from quote_to_numeraire via return data\n */\nexport interface QuoteToNumeraireResult {\n /** Amount converted to numeraire (u128) */\n amountInNumeraire: bigint;\n /** Final mint reached (should be numeraire) */\n endMint: Address;\n /** Number of hops used in the route */\n hopsUsed: number;\n}\n\nconst quoteToNumeraireResultCodec: Codec<QuoteToNumeraireResult> =\n getStructCodec([\n ['amountInNumeraire', getU128Codec()],\n ['endMint', getAddressCodec()],\n ['hopsUsed', getU8Codec()],\n ]);\n\n/**\n * Decode quote_to_numeraire return data\n */\nexport function decodeQuoteToNumeraireResult(\n data: ReadonlyUint8Array,\n): QuoteToNumeraireResult {\n return quoteToNumeraireResultCodec.decode(data);\n}\n\n/**\n * Create a quote_to_numeraire instruction\n *\n * Converts an amount of one token to its value in the pool's numeraire\n * via the routing chain using spot pricing. (TWAP is not supported in v0.1.)\n *\n * The result is returned via Solana's return data mechanism.\n *\n * @param accounts - Required accounts for the instruction\n * @param args - Instruction arguments (amount, side, maxHops, useTwap, windowSeconds)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to quote amount in numeraire\n *\n * @example\n * ```ts\n * // Quote using spot prices (no TWAP)\n * const ix = createQuoteToNumeraireInstruction(\n * {\n * config: configAddress,\n * startPool: poolAddress,\n * },\n * {\n * amount: 1000000n,\n * side: 0, // token0\n * maxHops: 3,\n * useTwap: false,\n * windowSeconds: 0,\n * }\n * );\n * ```\n */\nexport function createQuoteToNumeraireInstruction(\n accounts: QuoteToNumeraireAccounts,\n args: QuoteToNumeraireArgs,\n programId: Address = PROGRAM_ID,\n): Instruction {\n const { config, startPool, remainingAccounts = [] } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: ACCOUNT_ROLE_READONLY },\n { address: startPool, role: ACCOUNT_ROLE_READONLY },\n ];\n\n // Add remaining accounts (pools and oracles for multi-hop routing)\n for (const account of remainingAccounts) {\n keys.push({ address: account, role: ACCOUNT_ROLE_READONLY });\n }\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.quoteToNumeraire,\n quoteToNumeraireArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","/**\n * Config fetching and utilities for the CPMM SDK\n */\n\nimport type { Address } from '@solana/kit';\nimport type { Rpc, GetAccountInfoApi } from '@solana/kit';\nimport type { AmmConfig } from '../core/types.js';\nimport { decodeAmmConfig } from '../core/codecs.js';\nimport { PROGRAM_ID } from '../core/constants.js';\nimport { getConfigAddress } from '../core/pda.js';\n\n// Browser-compatible base64 decoding\nfunction base64ToBytes(base64: string): Uint8Array {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n\n/**\n * Fetch and decode the AmmConfig account\n *\n * @param rpc - Solana RPC client\n * @param programId - Program ID (defaults to CPMM program)\n * @param commitment - Optional commitment level\n * @returns Decoded config data or null if not found\n */\nexport async function fetchConfig(\n rpc: Rpc<GetAccountInfoApi>,\n programId: Address = PROGRAM_ID,\n commitment?: 'processed' | 'confirmed' | 'finalized',\n): Promise<AmmConfig | null> {\n const [configAddress] = await getConfigAddress(programId);\n const response = await rpc\n .getAccountInfo(configAddress, {\n encoding: 'base64',\n commitment,\n })\n .send();\n\n if (!response.value) {\n return null;\n }\n\n return decodeAmmConfig(base64ToBytes(response.value.data[0]));\n}\n\n/**\n * Fetch config with its PDA address\n */\nexport async function fetchConfigWithAddress(\n rpc: Rpc<GetAccountInfoApi>,\n programId: Address = PROGRAM_ID,\n commitment?: 'processed' | 'confirmed' | 'finalized',\n): Promise<{ address: Address; account: AmmConfig } | null> {\n const [configAddress] = await getConfigAddress(programId);\n const account = await fetchConfig(rpc, programId, commitment);\n if (!account) {\n return null;\n }\n return { address: configAddress, account };\n}\n","// Constants\nexport {\n INITIALIZER_PROGRAM_ID,\n BPF_LOADER_UPGRADEABLE_PROGRAM_ID,\n SEED_CONFIG,\n SEED_LAUNCH,\n SEED_LAUNCH_AUTHORITY,\n MAX_MIGRATOR_ALLOWLIST,\n MAX_SENTINEL_ALLOWLIST,\n MAX_CALLDATA,\n EMPTY_REMAINING_ACCOUNTS_HASH,\n PHASE_TRADING,\n PHASE_MIGRATED,\n PHASE_ABORTED,\n DIRECTION_BUY,\n DIRECTION_SELL,\n CURVE_KIND_XYK,\n CURVE_PARAMS_FORMAT_XYK_V0,\n SF_BEFORE_SWAP,\n SF_AFTER_SWAP,\n SENTINEL_NO_CHANGE,\n INITIALIZER_INSTRUCTION_DISCRIMINATORS,\n INITIALIZER_ACCOUNT_DISCRIMINATORS,\n DOPPLER_DEVNET_ALT,\n} from './constants.js';\n\n// Generated types and codec factories\nexport type {\n InitConfig,\n InitConfigArgs,\n Launch,\n LaunchArgs,\n InitializeConfigArgs,\n InitializeConfigArgsArgs,\n InitializeLaunchArgs,\n InitializeLaunchArgsArgs,\n CalldataBuf,\n} from '../generated/initializer/index.js';\n\nexport {\n getInitConfigDecoder,\n getInitConfigEncoder,\n getInitConfigCodec,\n getLaunchDecoder,\n getLaunchEncoder,\n getLaunchCodec,\n getInitializeConfigArgsEncoder,\n getInitializeConfigArgsDecoder,\n getInitializeConfigArgsCodec,\n getInitializeLaunchArgsEncoder,\n getInitializeLaunchArgsDecoder,\n getInitializeLaunchArgsCodec,\n} from '../generated/initializer/index.js';\n\n// PDA helpers\nexport {\n getConfigAddress,\n getProgramDataAddress,\n getLaunchAddress,\n getLaunchAuthorityAddress,\n encodeU64LE,\n launchIdFromU64,\n} from './pda.js';\n\n// Instruction builders\nexport {\n createInitializeConfigInstruction,\n type InitializeConfigAccounts,\n createSetMigratorAllowlistInstruction,\n type SetMigratorAllowlistAccounts,\n createSetSentinelAllowlistInstruction,\n type SetSentinelAllowlistAccounts,\n createInitializeLaunchInstruction,\n getTokenMetadataAddress,\n type InitializeLaunchAccounts,\n createCurveSwapExactInInstruction,\n type CurveSwapExactInAccounts,\n createMigrateLaunchInstruction,\n type MigrateLaunchAccounts,\n createAbortLaunchInstruction,\n type AbortLaunchAccounts,\n createPreviewSwapExactInInstruction,\n decodePreviewSwapExactInResult,\n type PreviewSwapExactInAccounts,\n type PreviewSwapExactInResult,\n createPreviewMigrationInstruction,\n decodePreviewMigrationResult,\n type PreviewMigrationAccounts,\n type PreviewMigrationResult,\n} from './instructions/index.js';\n\n// Client helpers\nexport {\n fetchLaunch,\n fetchAllLaunches,\n fetchLaunchesByAuthority,\n launchExists,\n type FetchLaunchesConfig,\n type LaunchWithAddress,\n} from './client/index.js';\n","import { address, type Address } from '@solana/kit';\n\n/**\n * Program ID for the Initializer program.\n *\n * Source of truth: programs/initializer/src/lib.rs\n */\nexport const INITIALIZER_PROGRAM_ID: Address = address(\n '4h3Dqyo5qmteJoMxXt3tdtfXELDB6pdRTPU9mWruiKp1',\n);\n\nexport const BPF_LOADER_UPGRADEABLE_PROGRAM_ID: Address = address(\n 'BPFLoaderUpgradeab1e11111111111111111111111',\n);\n\n// ============================================================================\n// PDA Seeds (must match programs/initializer/src/constants.rs)\n// ============================================================================\n\nexport const SEED_CONFIG = 'config_v3';\nexport const SEED_LAUNCH = 'launch_v3';\nexport const SEED_LAUNCH_AUTHORITY = 'launch_authority_v3';\n\n// ============================================================================\n// Remaining Accounts Hash\n// ============================================================================\n\n/**\n * Commitment hash for an empty remaining-accounts list — SHA256 of [0,0,0,0].\n * Pass this for sentinelRemainingAccountsHash and migratorRemainingAccountsHash\n * when no extra accounts are needed.\n */\nexport const EMPTY_REMAINING_ACCOUNTS_HASH = new Uint8Array([\n 223, 63, 97, 152, 4, 169, 47, 219, 64, 87, 25, 45, 196, 61, 215, 72, 234, 119,\n 138, 220, 82, 188, 73, 140, 232, 5, 36, 192, 20, 184, 17, 25,\n]);\n\n// ============================================================================\n// Address Lookup Tables\n// ============================================================================\n\n/**\n * Devnet ALT containing static accounts shared by every initializeLaunch tx.\n * Indices: 0=TOKEN_PROGRAM, 1=SYSTEM_PROGRAM, 2=SYSVAR_RENT,\n * 3=INITIALIZER_PROGRAM, 4=TOKEN_METADATA_PROGRAM,\n * 5=CPMM_MIGRATOR_PROGRAM, 6=WSOL_MINT, 7=config PDA\n */\nexport const DOPPLER_DEVNET_ALT: Address = address(\n '7r5rdLkGMzTq5Q2kBhkePw4ZTeZEooHgTXktYoamNmVq',\n);\n\n// ============================================================================\n// Limits\n// ============================================================================\n\nexport const MAX_MIGRATOR_ALLOWLIST = 32;\nexport const MAX_SENTINEL_ALLOWLIST = 32;\nexport const MAX_CALLDATA = 256;\n\n// ============================================================================\n// Phases / Directions / Flags (must match programs/initializer/src/constants.rs)\n// ============================================================================\n\nexport const PHASE_TRADING = 0;\nexport const PHASE_MIGRATED = 1;\nexport const PHASE_ABORTED = 2;\n\nexport const DIRECTION_BUY = 0;\nexport const DIRECTION_SELL = 1;\n\nexport const CURVE_KIND_XYK = 0;\n\nexport const CURVE_PARAMS_FORMAT_XYK_V0 = 0x00;\n\nexport const SF_BEFORE_SWAP = 1 << 0;\nexport const SF_AFTER_SWAP = 1 << 1;\n\nexport const SENTINEL_NO_CHANGE = 0xffff;\n\n// ============================================================================\n// Instruction Discriminators (Anchor 8-byte hashes)\n// ============================================================================\n\nexport const INITIALIZER_INSTRUCTION_DISCRIMINATORS = {\n // SHA256(\"global:initialize_config\")[0:8]\n initializeConfig: new Uint8Array([\n 0xd0, 0x7f, 0x15, 0x01, 0xc2, 0xbe, 0xc4, 0x46,\n ]),\n // SHA256(\"global:set_migrator_allowlist\")[0:8]\n setMigratorAllowlist: new Uint8Array([\n 0xd1, 0x5a, 0xb5, 0x68, 0x63, 0x6c, 0xe9, 0xa8,\n ]),\n // SHA256(\"global:set_sentinel_allowlist\")[0:8]\n setSentinelAllowlist: new Uint8Array([\n 0xe9, 0x48, 0xb4, 0xf6, 0xab, 0x75, 0x15, 0x32,\n ]),\n // SHA256(\"global:initialize_launch\")[0:8]\n initializeLaunch: new Uint8Array([\n 0x5a, 0xc9, 0xdc, 0x8e, 0x70, 0xfd, 0x64, 0x0d,\n ]),\n // SHA256(\"global:curve_swap_exact_in\")[0:8]\n curveSwapExactIn: new Uint8Array([\n 0xc4, 0xf7, 0xc3, 0x7e, 0xe3, 0x1b, 0xa6, 0x5d,\n ]),\n // SHA256(\"global:migrate_launch\")[0:8]\n migrateLaunch: new Uint8Array([\n 0x13, 0xc7, 0x77, 0x67, 0x0d, 0x1e, 0x0c, 0xcd,\n ]),\n // SHA256(\"global:abort_launch\")[0:8]\n abortLaunch: new Uint8Array([0x2c, 0x70, 0xc0, 0xeb, 0xe3, 0x3d, 0xb3, 0x07]),\n // SHA256(\"global:preview_swap_exact_in\")[0:8]\n previewSwapExactIn: new Uint8Array([\n 0x32, 0x82, 0x1f, 0x45, 0x93, 0x3a, 0xde, 0xb2,\n ]),\n // SHA256(\"global:preview_migration\")[0:8]\n previewMigration: new Uint8Array([\n 0xd8, 0xb4, 0xd1, 0x70, 0x3e, 0x10, 0x0f, 0x3f,\n ]),\n} as const;\n\n// ============================================================================\n// Account Discriminators (Anchor 8-byte hashes)\n// ============================================================================\n\nexport const INITIALIZER_ACCOUNT_DISCRIMINATORS = {\n // SHA256(\"account:InitConfig\")[0:8]\n InitConfig: new Uint8Array([0x61, 0xa6, 0x23, 0x07, 0x14, 0x02, 0xa4, 0x7e]),\n // SHA256(\"account:Launch\")[0:8]\n Launch: new Uint8Array([0x90, 0x33, 0x33, 0xa3, 0xce, 0x55, 0xd5, 0x26]),\n} as const;\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport const INIT_CONFIG_DISCRIMINATOR = new Uint8Array([\n 97, 166, 35, 7, 20, 2, 164, 126,\n]);\n\nexport function getInitConfigDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(INIT_CONFIG_DISCRIMINATOR);\n}\n\nexport type InitConfig = {\n discriminator: ReadonlyUint8Array;\n admin: Address;\n migratorAllowlistLen: number;\n migratorAllowlist: Array<Address>;\n sentinelAllowlistLen: number;\n sentinelAllowlist: Array<Address>;\n bump: number;\n version: number;\n reserved: ReadonlyUint8Array;\n};\n\nexport type InitConfigArgs = {\n admin: Address;\n migratorAllowlistLen: number;\n migratorAllowlist: Array<Address>;\n sentinelAllowlistLen: number;\n sentinelAllowlist: Array<Address>;\n bump: number;\n version: number;\n reserved: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link InitConfigArgs} account data. */\nexport function getInitConfigEncoder(): FixedSizeEncoder<InitConfigArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['admin', getAddressEncoder()],\n ['migratorAllowlistLen', getU8Encoder()],\n ['migratorAllowlist', getArrayEncoder(getAddressEncoder(), { size: 32 })],\n ['sentinelAllowlistLen', getU8Encoder()],\n ['sentinelAllowlist', getArrayEncoder(getAddressEncoder(), { size: 32 })],\n ['bump', getU8Encoder()],\n ['version', getU8Encoder()],\n ['reserved', fixEncoderSize(getBytesEncoder(), 31)],\n ]),\n (value) => ({ ...value, discriminator: INIT_CONFIG_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link InitConfig} account data. */\nexport function getInitConfigDecoder(): FixedSizeDecoder<InitConfig> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['admin', getAddressDecoder()],\n ['migratorAllowlistLen', getU8Decoder()],\n ['migratorAllowlist', getArrayDecoder(getAddressDecoder(), { size: 32 })],\n ['sentinelAllowlistLen', getU8Decoder()],\n ['sentinelAllowlist', getArrayDecoder(getAddressDecoder(), { size: 32 })],\n ['bump', getU8Decoder()],\n ['version', getU8Decoder()],\n ['reserved', fixDecoderSize(getBytesDecoder(), 31)],\n ]);\n}\n\n/** Gets the codec for {@link InitConfig} account data. */\nexport function getInitConfigCodec(): FixedSizeCodec<\n InitConfigArgs,\n InitConfig\n> {\n return combineCodec(getInitConfigEncoder(), getInitConfigDecoder());\n}\n\nexport function decodeInitConfig<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<InitConfig, TAddress>;\nexport function decodeInitConfig<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<InitConfig, TAddress>;\nexport function decodeInitConfig<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<InitConfig, TAddress> | MaybeAccount<InitConfig, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getInitConfigDecoder(),\n );\n}\n\nexport async function fetchInitConfig<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<InitConfig, TAddress>> {\n const maybeAccount = await fetchMaybeInitConfig(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeInitConfig<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<InitConfig, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeInitConfig(maybeAccount);\n}\n\nexport async function fetchAllInitConfig(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<InitConfig>[]> {\n const maybeAccounts = await fetchAllMaybeInitConfig(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeInitConfig(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<InitConfig>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeInitConfig(maybeAccount));\n}\n\nexport function getInitConfigSize(): number {\n return 2123;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport type CalldataBuf = { len: number; bytes: ReadonlyUint8Array };\n\nexport type CalldataBufArgs = CalldataBuf;\n\nexport function getCalldataBufEncoder(): FixedSizeEncoder<CalldataBufArgs> {\n return getStructEncoder([\n ['len', getU16Encoder()],\n ['bytes', fixEncoderSize(getBytesEncoder(), 256)],\n ]);\n}\n\nexport function getCalldataBufDecoder(): FixedSizeDecoder<CalldataBuf> {\n return getStructDecoder([\n ['len', getU16Decoder()],\n ['bytes', fixDecoderSize(getBytesDecoder(), 256)],\n ]);\n}\n\nexport function getCalldataBufCodec(): FixedSizeCodec<\n CalldataBufArgs,\n CalldataBuf\n> {\n return combineCodec(getCalldataBufEncoder(), getCalldataBufDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getStructDecoder,\n getStructEncoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n} from '@solana/kit';\n\nexport type InitializeConfigArgs = {\n migratorAllowlist: Array<Address>;\n sentinelAllowlist: Array<Address>;\n};\n\nexport type InitializeConfigArgsArgs = InitializeConfigArgs;\n\nexport function getInitializeConfigArgsEncoder(): Encoder<InitializeConfigArgsArgs> {\n return getStructEncoder([\n ['migratorAllowlist', getArrayEncoder(getAddressEncoder())],\n ['sentinelAllowlist', getArrayEncoder(getAddressEncoder())],\n ]);\n}\n\nexport function getInitializeConfigArgsDecoder(): Decoder<InitializeConfigArgs> {\n return getStructDecoder([\n ['migratorAllowlist', getArrayDecoder(getAddressDecoder())],\n ['sentinelAllowlist', getArrayDecoder(getAddressDecoder())],\n ]);\n}\n\nexport function getInitializeConfigArgsCodec(): Codec<\n InitializeConfigArgsArgs,\n InitializeConfigArgs\n> {\n return combineCodec(\n getInitializeConfigArgsEncoder(),\n getInitializeConfigArgsDecoder(),\n );\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport type InitializeLaunchArgs = {\n namespace: Address;\n launchId: ReadonlyUint8Array;\n baseDecimals: number;\n baseTotalSupply: bigint;\n baseForDistribution: bigint;\n baseForLiquidity: bigint;\n curveVirtualBase: bigint;\n curveVirtualQuote: bigint;\n curveFeeBps: number;\n curveKind: number;\n curveParams: ReadonlyUint8Array;\n allowBuy: number;\n allowSell: number;\n sentinelProgram: Address;\n sentinelFlags: number;\n sentinelCalldata: ReadonlyUint8Array;\n migratorProgram: Address;\n migratorInitCalldata: ReadonlyUint8Array;\n migratorMigrateCalldata: ReadonlyUint8Array;\n /**\n * Commitment hash for swap/preview sentinel remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n sentinelRemainingAccountsHash: ReadonlyUint8Array;\n /**\n * Commitment hash for migrate remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n migratorRemainingAccountsHash: ReadonlyUint8Array;\n /** Token name for on-chain metadata. If empty, metadata creation is skipped. */\n metadataName: string;\n /** Token symbol for on-chain metadata. */\n metadataSymbol: string;\n /** Metadata JSON URI for on-chain metadata. */\n metadataUri: string;\n};\n\nexport type InitializeLaunchArgsArgs = {\n namespace: Address;\n launchId: ReadonlyUint8Array;\n baseDecimals: number;\n baseTotalSupply: number | bigint;\n baseForDistribution: number | bigint;\n baseForLiquidity: number | bigint;\n curveVirtualBase: number | bigint;\n curveVirtualQuote: number | bigint;\n curveFeeBps: number;\n curveKind: number;\n curveParams: ReadonlyUint8Array;\n allowBuy: number;\n allowSell: number;\n sentinelProgram: Address;\n sentinelFlags: number;\n sentinelCalldata: ReadonlyUint8Array;\n migratorProgram: Address;\n migratorInitCalldata: ReadonlyUint8Array;\n migratorMigrateCalldata: ReadonlyUint8Array;\n /**\n * Commitment hash for swap/preview sentinel remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n sentinelRemainingAccountsHash: ReadonlyUint8Array;\n /**\n * Commitment hash for migrate remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n migratorRemainingAccountsHash: ReadonlyUint8Array;\n /** Token name for on-chain metadata. If empty, metadata creation is skipped. */\n metadataName: string;\n /** Token symbol for on-chain metadata. */\n metadataSymbol: string;\n /** Metadata JSON URI for on-chain metadata. */\n metadataUri: string;\n};\n\nexport function getInitializeLaunchArgsEncoder(): Encoder<InitializeLaunchArgsArgs> {\n return getStructEncoder([\n ['namespace', getAddressEncoder()],\n ['launchId', fixEncoderSize(getBytesEncoder(), 32)],\n ['baseDecimals', getU8Encoder()],\n ['baseTotalSupply', getU64Encoder()],\n ['baseForDistribution', getU64Encoder()],\n ['baseForLiquidity', getU64Encoder()],\n ['curveVirtualBase', getU64Encoder()],\n ['curveVirtualQuote', getU64Encoder()],\n ['curveFeeBps', getU16Encoder()],\n ['curveKind', getU8Encoder()],\n ['curveParams', addEncoderSizePrefix(getBytesEncoder(), getU32Encoder())],\n ['allowBuy', getU8Encoder()],\n ['allowSell', getU8Encoder()],\n ['sentinelProgram', getAddressEncoder()],\n ['sentinelFlags', getU32Encoder()],\n [\n 'sentinelCalldata',\n addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),\n ],\n ['migratorProgram', getAddressEncoder()],\n [\n 'migratorInitCalldata',\n addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),\n ],\n [\n 'migratorMigrateCalldata',\n addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),\n ],\n ['sentinelRemainingAccountsHash', fixEncoderSize(getBytesEncoder(), 32)],\n ['migratorRemainingAccountsHash', fixEncoderSize(getBytesEncoder(), 32)],\n ['metadataName', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['metadataSymbol', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['metadataUri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ]);\n}\n\nexport function getInitializeLaunchArgsDecoder(): Decoder<InitializeLaunchArgs> {\n return getStructDecoder([\n ['namespace', getAddressDecoder()],\n ['launchId', fixDecoderSize(getBytesDecoder(), 32)],\n ['baseDecimals', getU8Decoder()],\n ['baseTotalSupply', getU64Decoder()],\n ['baseForDistribution', getU64Decoder()],\n ['baseForLiquidity', getU64Decoder()],\n ['curveVirtualBase', getU64Decoder()],\n ['curveVirtualQuote', getU64Decoder()],\n ['curveFeeBps', getU16Decoder()],\n ['curveKind', getU8Decoder()],\n ['curveParams', addDecoderSizePrefix(getBytesDecoder(), getU32Decoder())],\n ['allowBuy', getU8Decoder()],\n ['allowSell', getU8Decoder()],\n ['sentinelProgram', getAddressDecoder()],\n ['sentinelFlags', getU32Decoder()],\n [\n 'sentinelCalldata',\n addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),\n ],\n ['migratorProgram', getAddressDecoder()],\n [\n 'migratorInitCalldata',\n addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),\n ],\n [\n 'migratorMigrateCalldata',\n addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),\n ],\n ['sentinelRemainingAccountsHash', fixDecoderSize(getBytesDecoder(), 32)],\n ['migratorRemainingAccountsHash', fixDecoderSize(getBytesDecoder(), 32)],\n ['metadataName', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['metadataSymbol', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['metadataUri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ]);\n}\n\nexport function getInitializeLaunchArgsCodec(): Codec<\n InitializeLaunchArgsArgs,\n InitializeLaunchArgs\n> {\n return combineCodec(\n getInitializeLaunchArgsEncoder(),\n getInitializeLaunchArgsDecoder(),\n );\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n getCalldataBufDecoder,\n getCalldataBufEncoder,\n type CalldataBuf,\n type CalldataBufArgs,\n} from '../types';\n\nexport const LAUNCH_DISCRIMINATOR = new Uint8Array([\n 144, 51, 51, 163, 206, 85, 213, 38,\n]);\n\nexport function getLaunchDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(LAUNCH_DISCRIMINATOR);\n}\n\nexport type Launch = {\n discriminator: ReadonlyUint8Array;\n authority: Address;\n namespace: Address;\n launchId: ReadonlyUint8Array;\n phase: number;\n bump: number;\n launchAuthorityBump: number;\n pad0: ReadonlyUint8Array;\n baseMint: Address;\n quoteMint: Address;\n baseVault: Address;\n quoteVault: Address;\n baseTotalSupply: bigint;\n baseForDistribution: bigint;\n baseForLiquidity: bigint;\n baseForCurve: bigint;\n curveVirtualBase: bigint;\n curveVirtualQuote: bigint;\n curveFeeBps: number;\n pad1: ReadonlyUint8Array;\n allowBuy: number;\n allowSell: number;\n pad2: ReadonlyUint8Array;\n sentinelProgram: Address;\n sentinelFlags: number;\n pad3: ReadonlyUint8Array;\n sentinelCalldata: CalldataBuf;\n migratorProgram: Address;\n migratorInitCalldata: CalldataBuf;\n migratorMigrateCalldata: CalldataBuf;\n curveKind: number;\n swapLock: number;\n pad4: ReadonlyUint8Array;\n curveParams: CalldataBuf;\n quoteDeposited: bigint;\n reserved: ReadonlyUint8Array;\n};\n\nexport type LaunchArgs = {\n authority: Address;\n namespace: Address;\n launchId: ReadonlyUint8Array;\n phase: number;\n bump: number;\n launchAuthorityBump: number;\n pad0: ReadonlyUint8Array;\n baseMint: Address;\n quoteMint: Address;\n baseVault: Address;\n quoteVault: Address;\n baseTotalSupply: number | bigint;\n baseForDistribution: number | bigint;\n baseForLiquidity: number | bigint;\n baseForCurve: number | bigint;\n curveVirtualBase: number | bigint;\n curveVirtualQuote: number | bigint;\n curveFeeBps: number;\n pad1: ReadonlyUint8Array;\n allowBuy: number;\n allowSell: number;\n pad2: ReadonlyUint8Array;\n sentinelProgram: Address;\n sentinelFlags: number;\n pad3: ReadonlyUint8Array;\n sentinelCalldata: CalldataBufArgs;\n migratorProgram: Address;\n migratorInitCalldata: CalldataBufArgs;\n migratorMigrateCalldata: CalldataBufArgs;\n curveKind: number;\n swapLock: number;\n pad4: ReadonlyUint8Array;\n curveParams: CalldataBufArgs;\n quoteDeposited: number | bigint;\n reserved: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link LaunchArgs} account data. */\nexport function getLaunchEncoder(): FixedSizeEncoder<LaunchArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['authority', getAddressEncoder()],\n ['namespace', getAddressEncoder()],\n ['launchId', fixEncoderSize(getBytesEncoder(), 32)],\n ['phase', getU8Encoder()],\n ['bump', getU8Encoder()],\n ['launchAuthorityBump', getU8Encoder()],\n ['pad0', fixEncoderSize(getBytesEncoder(), 5)],\n ['baseMint', getAddressEncoder()],\n ['quoteMint', getAddressEncoder()],\n ['baseVault', getAddressEncoder()],\n ['quoteVault', getAddressEncoder()],\n ['baseTotalSupply', getU64Encoder()],\n ['baseForDistribution', getU64Encoder()],\n ['baseForLiquidity', getU64Encoder()],\n ['baseForCurve', getU64Encoder()],\n ['curveVirtualBase', getU64Encoder()],\n ['curveVirtualQuote', getU64Encoder()],\n ['curveFeeBps', getU16Encoder()],\n ['pad1', fixEncoderSize(getBytesEncoder(), 6)],\n ['allowBuy', getU8Encoder()],\n ['allowSell', getU8Encoder()],\n ['pad2', fixEncoderSize(getBytesEncoder(), 6)],\n ['sentinelProgram', getAddressEncoder()],\n ['sentinelFlags', getU32Encoder()],\n ['pad3', fixEncoderSize(getBytesEncoder(), 4)],\n ['sentinelCalldata', getCalldataBufEncoder()],\n ['migratorProgram', getAddressEncoder()],\n ['migratorInitCalldata', getCalldataBufEncoder()],\n ['migratorMigrateCalldata', getCalldataBufEncoder()],\n ['curveKind', getU8Encoder()],\n ['swapLock', getU8Encoder()],\n ['pad4', fixEncoderSize(getBytesEncoder(), 6)],\n ['curveParams', getCalldataBufEncoder()],\n ['quoteDeposited', getU64Encoder()],\n ['reserved', fixEncoderSize(getBytesEncoder(), 64)],\n ]),\n (value) => ({ ...value, discriminator: LAUNCH_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link Launch} account data. */\nexport function getLaunchDecoder(): FixedSizeDecoder<Launch> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['authority', getAddressDecoder()],\n ['namespace', getAddressDecoder()],\n ['launchId', fixDecoderSize(getBytesDecoder(), 32)],\n ['phase', getU8Decoder()],\n ['bump', getU8Decoder()],\n ['launchAuthorityBump', getU8Decoder()],\n ['pad0', fixDecoderSize(getBytesDecoder(), 5)],\n ['baseMint', getAddressDecoder()],\n ['quoteMint', getAddressDecoder()],\n ['baseVault', getAddressDecoder()],\n ['quoteVault', getAddressDecoder()],\n ['baseTotalSupply', getU64Decoder()],\n ['baseForDistribution', getU64Decoder()],\n ['baseForLiquidity', getU64Decoder()],\n ['baseForCurve', getU64Decoder()],\n ['curveVirtualBase', getU64Decoder()],\n ['curveVirtualQuote', getU64Decoder()],\n ['curveFeeBps', getU16Decoder()],\n ['pad1', fixDecoderSize(getBytesDecoder(), 6)],\n ['allowBuy', getU8Decoder()],\n ['allowSell', getU8Decoder()],\n ['pad2', fixDecoderSize(getBytesDecoder(), 6)],\n ['sentinelProgram', getAddressDecoder()],\n ['sentinelFlags', getU32Decoder()],\n ['pad3', fixDecoderSize(getBytesDecoder(), 4)],\n ['sentinelCalldata', getCalldataBufDecoder()],\n ['migratorProgram', getAddressDecoder()],\n ['migratorInitCalldata', getCalldataBufDecoder()],\n ['migratorMigrateCalldata', getCalldataBufDecoder()],\n ['curveKind', getU8Decoder()],\n ['swapLock', getU8Decoder()],\n ['pad4', fixDecoderSize(getBytesDecoder(), 6)],\n ['curveParams', getCalldataBufDecoder()],\n ['quoteDeposited', getU64Decoder()],\n ['reserved', fixDecoderSize(getBytesDecoder(), 64)],\n ]);\n}\n\n/** Gets the codec for {@link Launch} account data. */\nexport function getLaunchCodec(): FixedSizeCodec<LaunchArgs, Launch> {\n return combineCodec(getLaunchEncoder(), getLaunchDecoder());\n}\n\nexport function decodeLaunch<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<Launch, TAddress>;\nexport function decodeLaunch<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<Launch, TAddress>;\nexport function decodeLaunch<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<Launch, TAddress> | MaybeAccount<Launch, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getLaunchDecoder(),\n );\n}\n\nexport async function fetchLaunch<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<Launch, TAddress>> {\n const maybeAccount = await fetchMaybeLaunch(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeLaunch<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<Launch, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeLaunch(maybeAccount);\n}\n\nexport async function fetchAllLaunch(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<Launch>[]> {\n const maybeAccounts = await fetchAllMaybeLaunch(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeLaunch(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<Launch>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeLaunch(maybeAccount));\n}\n\nexport function getLaunchSize(): number {\n return 1488;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { INITIALIZER_PROGRAM_ADDRESS } from '../programs';\n\nexport const CURVE_SWAP_EXACT_IN_DISCRIMINATOR = new Uint8Array([\n 196, 247, 195, 126, 227, 27, 166, 93,\n]);\n\nexport function getCurveSwapExactInDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CURVE_SWAP_EXACT_IN_DISCRIMINATOR,\n );\n}\n\nexport type CurveSwapExactInInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountConfig extends string | AccountMeta<string> = string,\n TAccountLaunch extends string | AccountMeta<string> = string,\n TAccountLaunchAuthority extends string | AccountMeta<string> = string,\n TAccountBaseVault extends string | AccountMeta<string> = string,\n TAccountQuoteVault extends string | AccountMeta<string> = string,\n TAccountUserBaseAccount extends string | AccountMeta<string> = string,\n TAccountUserQuoteAccount extends string | AccountMeta<string> = string,\n TAccountBaseMint extends string | AccountMeta<string> = string,\n TAccountQuoteMint extends string | AccountMeta<string> = string,\n TAccountUser extends string | AccountMeta<string> = string,\n TAccountSentinelProgram extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountConfig extends string\n ? ReadonlyAccount<TAccountConfig>\n : TAccountConfig,\n TAccountLaunch extends string\n ? WritableAccount<TAccountLaunch>\n : TAccountLaunch,\n TAccountLaunchAuthority extends string\n ? ReadonlyAccount<TAccountLaunchAuthority>\n : TAccountLaunchAuthority,\n TAccountBaseVault extends string\n ? WritableAccount<TAccountBaseVault>\n : TAccountBaseVault,\n TAccountQuoteVault extends string\n ? WritableAccount<TAccountQuoteVault>\n : TAccountQuoteVault,\n TAccountUserBaseAccount extends string\n ? WritableAccount<TAccountUserBaseAccount>\n : TAccountUserBaseAccount,\n TAccountUserQuoteAccount extends string\n ? WritableAccount<TAccountUserQuoteAccount>\n : TAccountUserQuoteAccount,\n TAccountBaseMint extends string\n ? ReadonlyAccount<TAccountBaseMint>\n : TAccountBaseMint,\n TAccountQuoteMint extends string\n ? ReadonlyAccount<TAccountQuoteMint>\n : TAccountQuoteMint,\n TAccountUser extends string\n ? ReadonlySignerAccount<TAccountUser> & AccountSignerMeta<TAccountUser>\n : TAccountUser,\n TAccountSentinelProgram extends string\n ? ReadonlyAccount<TAccountSentinelProgram>\n : TAccountSentinelProgram,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CurveSwapExactInInstructionData = {\n discriminator: ReadonlyUint8Array;\n amountIn: bigint;\n minAmountOut: bigint;\n direction: number;\n};\n\nexport type CurveSwapExactInInstructionDataArgs = {\n amountIn: number | bigint;\n minAmountOut: number | bigint;\n direction: number;\n};\n\nexport function getCurveSwapExactInInstructionDataEncoder(): FixedSizeEncoder<CurveSwapExactInInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['amountIn', getU64Encoder()],\n ['minAmountOut', getU64Encoder()],\n ['direction', getU8Encoder()],\n ]),\n (value) => ({ ...value, discriminator: CURVE_SWAP_EXACT_IN_DISCRIMINATOR }),\n );\n}\n\nexport function getCurveSwapExactInInstructionDataDecoder(): FixedSizeDecoder<CurveSwapExactInInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['amountIn', getU64Decoder()],\n ['minAmountOut', getU64Decoder()],\n ['direction', getU8Decoder()],\n ]);\n}\n\nexport function getCurveSwapExactInInstructionDataCodec(): FixedSizeCodec<\n CurveSwapExactInInstructionDataArgs,\n CurveSwapExactInInstructionData\n> {\n return combineCodec(\n getCurveSwapExactInInstructionDataEncoder(),\n getCurveSwapExactInInstructionDataDecoder(),\n );\n}\n\nexport type CurveSwapExactInAsyncInput<\n TAccountConfig extends string = string,\n TAccountLaunch extends string = string,\n TAccountLaunchAuthority extends string = string,\n TAccountBaseVault extends string = string,\n TAccountQuoteVault extends string = string,\n TAccountUserBaseAccount extends string = string,\n TAccountUserQuoteAccount extends string = string,\n TAccountBaseMint extends string = string,\n TAccountQuoteMint extends string = string,\n TAccountUser extends string = string,\n TAccountSentinelProgram extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n config?: Address<TAccountConfig>;\n launch: Address<TAccountLaunch>;\n launchAuthority: Address<TAccountLaunchAuthority>;\n baseVault: Address<TAccountBaseVault>;\n quoteVault: Address<TAccountQuoteVault>;\n userBaseAccount: Address<TAccountUserBaseAccount>;\n userQuoteAccount: Address<TAccountUserQuoteAccount>;\n baseMint: Address<TAccountBaseMint>;\n quoteMint: Address<TAccountQuoteMint>;\n user: TransactionSigner<TAccountUser>;\n /** Optional sentinel program (must match launch.sentinel_program if set) */\n sentinelProgram?: Address<TAccountSentinelProgram>;\n tokenProgram?: Address<TAccountTokenProgram>;\n amountIn: CurveSwapExactInInstructionDataArgs['amountIn'];\n minAmountOut: CurveSwapExactInInstructionDataArgs['minAmountOut'];\n direction: CurveSwapExactInInstructionDataArgs['direction'];\n};\n\nexport async function getCurveSwapExactInInstructionAsync<\n TAccountConfig extends string,\n TAccountLaunch extends string,\n TAccountLaunchAuthority extends string,\n TAccountBaseVault extends string,\n TAccountQuoteVault extends string,\n TAccountUserBaseAccount extends string,\n TAccountUserQuoteAccount extends string,\n TAccountBaseMint extends string,\n TAccountQuoteMint extends string,\n TAccountUser extends string,\n TAccountSentinelProgram extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: CurveSwapExactInAsyncInput<\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountUserBaseAccount,\n TAccountUserQuoteAccount,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountUser,\n TAccountSentinelProgram,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CurveSwapExactInInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountUserBaseAccount,\n TAccountUserQuoteAccount,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountUser,\n TAccountSentinelProgram,\n TAccountTokenProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n config: { value: input.config ?? null, isWritable: false },\n launch: { value: input.launch ?? null, isWritable: true },\n launchAuthority: {\n value: input.launchAuthority ?? null,\n isWritable: false,\n },\n baseVault: { value: input.baseVault ?? null, isWritable: true },\n quoteVault: { value: input.quoteVault ?? null, isWritable: true },\n userBaseAccount: { value: input.userBaseAccount ?? null, isWritable: true },\n userQuoteAccount: {\n value: input.userQuoteAccount ?? null,\n isWritable: true,\n },\n baseMint: { value: input.baseMint ?? null, isWritable: false },\n quoteMint: { value: input.quoteMint ?? null, isWritable: false },\n user: { value: input.user ?? null, isWritable: false },\n sentinelProgram: {\n value: input.sentinelProgram ?? null,\n isWritable: false,\n },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.config.value) {\n accounts.config.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([99, 111, 110, 102, 105, 103, 95, 118, 51]),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('config', accounts.config),\n getAccountMeta('launch', accounts.launch),\n getAccountMeta('launchAuthority', accounts.launchAuthority),\n getAccountMeta('baseVault', accounts.baseVault),\n getAccountMeta('quoteVault', accounts.quoteVault),\n getAccountMeta('userBaseAccount', accounts.userBaseAccount),\n getAccountMeta('userQuoteAccount', accounts.userQuoteAccount),\n getAccountMeta('baseMint', accounts.baseMint),\n getAccountMeta('quoteMint', accounts.quoteMint),\n getAccountMeta('user', accounts.user),\n getAccountMeta('sentinelProgram', accounts.sentinelProgram),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n ],\n data: getCurveSwapExactInInstructionDataEncoder().encode(\n args as CurveSwapExactInInstructionDataArgs,\n ),\n programAddress,\n } as CurveSwapExactInInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountUserBaseAccount,\n TAccountUserQuoteAccount,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountUser,\n TAccountSentinelProgram,\n TAccountTokenProgram\n >);\n}\n\nexport type CurveSwapExactInInput<\n TAccountConfig extends string = string,\n TAccountLaunch extends string = string,\n TAccountLaunchAuthority extends string = string,\n TAccountBaseVault extends string = string,\n TAccountQuoteVault extends string = string,\n TAccountUserBaseAccount extends string = string,\n TAccountUserQuoteAccount extends string = string,\n TAccountBaseMint extends string = string,\n TAccountQuoteMint extends string = string,\n TAccountUser extends string = string,\n TAccountSentinelProgram extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n config: Address<TAccountConfig>;\n launch: Address<TAccountLaunch>;\n launchAuthority: Address<TAccountLaunchAuthority>;\n baseVault: Address<TAccountBaseVault>;\n quoteVault: Address<TAccountQuoteVault>;\n userBaseAccount: Address<TAccountUserBaseAccount>;\n userQuoteAccount: Address<TAccountUserQuoteAccount>;\n baseMint: Address<TAccountBaseMint>;\n quoteMint: Address<TAccountQuoteMint>;\n user: TransactionSigner<TAccountUser>;\n /** Optional sentinel program (must match launch.sentinel_program if set) */\n sentinelProgram?: Address<TAccountSentinelProgram>;\n tokenProgram?: Address<TAccountTokenProgram>;\n amountIn: CurveSwapExactInInstructionDataArgs['amountIn'];\n minAmountOut: CurveSwapExactInInstructionDataArgs['minAmountOut'];\n direction: CurveSwapExactInInstructionDataArgs['direction'];\n};\n\nexport function getCurveSwapExactInInstruction<\n TAccountConfig extends string,\n TAccountLaunch extends string,\n TAccountLaunchAuthority extends string,\n TAccountBaseVault extends string,\n TAccountQuoteVault extends string,\n TAccountUserBaseAccount extends string,\n TAccountUserQuoteAccount extends string,\n TAccountBaseMint extends string,\n TAccountQuoteMint extends string,\n TAccountUser extends string,\n TAccountSentinelProgram extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: CurveSwapExactInInput<\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountUserBaseAccount,\n TAccountUserQuoteAccount,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountUser,\n TAccountSentinelProgram,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CurveSwapExactInInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountUserBaseAccount,\n TAccountUserQuoteAccount,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountUser,\n TAccountSentinelProgram,\n TAccountTokenProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n config: { value: input.config ?? null, isWritable: false },\n launch: { value: input.launch ?? null, isWritable: true },\n launchAuthority: {\n value: input.launchAuthority ?? null,\n isWritable: false,\n },\n baseVault: { value: input.baseVault ?? null, isWritable: true },\n quoteVault: { value: input.quoteVault ?? null, isWritable: true },\n userBaseAccount: { value: input.userBaseAccount ?? null, isWritable: true },\n userQuoteAccount: {\n value: input.userQuoteAccount ?? null,\n isWritable: true,\n },\n baseMint: { value: input.baseMint ?? null, isWritable: false },\n quoteMint: { value: input.quoteMint ?? null, isWritable: false },\n user: { value: input.user ?? null, isWritable: false },\n sentinelProgram: {\n value: input.sentinelProgram ?? null,\n isWritable: false,\n },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('config', accounts.config),\n getAccountMeta('launch', accounts.launch),\n getAccountMeta('launchAuthority', accounts.launchAuthority),\n getAccountMeta('baseVault', accounts.baseVault),\n getAccountMeta('quoteVault', accounts.quoteVault),\n getAccountMeta('userBaseAccount', accounts.userBaseAccount),\n getAccountMeta('userQuoteAccount', accounts.userQuoteAccount),\n getAccountMeta('baseMint', accounts.baseMint),\n getAccountMeta('quoteMint', accounts.quoteMint),\n getAccountMeta('user', accounts.user),\n getAccountMeta('sentinelProgram', accounts.sentinelProgram),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n ],\n data: getCurveSwapExactInInstructionDataEncoder().encode(\n args as CurveSwapExactInInstructionDataArgs,\n ),\n programAddress,\n } as CurveSwapExactInInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountUserBaseAccount,\n TAccountUserQuoteAccount,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountUser,\n TAccountSentinelProgram,\n TAccountTokenProgram\n >);\n}\n\nexport type ParsedCurveSwapExactInInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n config: TAccountMetas[0];\n launch: TAccountMetas[1];\n launchAuthority: TAccountMetas[2];\n baseVault: TAccountMetas[3];\n quoteVault: TAccountMetas[4];\n userBaseAccount: TAccountMetas[5];\n userQuoteAccount: TAccountMetas[6];\n baseMint: TAccountMetas[7];\n quoteMint: TAccountMetas[8];\n user: TAccountMetas[9];\n /** Optional sentinel program (must match launch.sentinel_program if set) */\n sentinelProgram?: TAccountMetas[10] | undefined;\n tokenProgram: TAccountMetas[11];\n };\n data: CurveSwapExactInInstructionData;\n};\n\nexport function parseCurveSwapExactInInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCurveSwapExactInInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 12) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 12,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n const getNextOptionalAccount = () => {\n const accountMeta = getNextAccount();\n return accountMeta.address === INITIALIZER_PROGRAM_ADDRESS\n ? undefined\n : accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n config: getNextAccount(),\n launch: getNextAccount(),\n launchAuthority: getNextAccount(),\n baseVault: getNextAccount(),\n quoteVault: getNextAccount(),\n userBaseAccount: getNextAccount(),\n userQuoteAccount: getNextAccount(),\n baseMint: getNextAccount(),\n quoteMint: getNextAccount(),\n user: getNextAccount(),\n sentinelProgram: getNextOptionalAccount(),\n tokenProgram: getNextAccount(),\n },\n data: getCurveSwapExactInInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { INITIALIZER_PROGRAM_ADDRESS } from '../programs';\n\nexport const INITIALIZE_CONFIG_DISCRIMINATOR = new Uint8Array([\n 208, 127, 21, 1, 194, 190, 196, 70,\n]);\n\nexport function getInitializeConfigDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n INITIALIZE_CONFIG_DISCRIMINATOR,\n );\n}\n\nexport type InitializeConfigInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountAdmin extends string | AccountMeta<string> = string,\n TAccountConfig extends string | AccountMeta<string> = string,\n TAccountProgramData extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n '11111111111111111111111111111111',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAdmin extends string\n ? WritableSignerAccount<TAccountAdmin> &\n AccountSignerMeta<TAccountAdmin>\n : TAccountAdmin,\n TAccountConfig extends string\n ? WritableAccount<TAccountConfig>\n : TAccountConfig,\n TAccountProgramData extends string\n ? ReadonlyAccount<TAccountProgramData>\n : TAccountProgramData,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializeConfigInstructionData = {\n discriminator: ReadonlyUint8Array;\n migratorAllowlist: Array<Address>;\n sentinelAllowlist: Array<Address>;\n};\n\nexport type InitializeConfigInstructionDataArgs = {\n migratorAllowlist: Array<Address>;\n sentinelAllowlist: Array<Address>;\n};\n\nexport function getInitializeConfigInstructionDataEncoder(): Encoder<InitializeConfigInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['migratorAllowlist', getArrayEncoder(getAddressEncoder())],\n ['sentinelAllowlist', getArrayEncoder(getAddressEncoder())],\n ]),\n (value) => ({ ...value, discriminator: INITIALIZE_CONFIG_DISCRIMINATOR }),\n );\n}\n\nexport function getInitializeConfigInstructionDataDecoder(): Decoder<InitializeConfigInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['migratorAllowlist', getArrayDecoder(getAddressDecoder())],\n ['sentinelAllowlist', getArrayDecoder(getAddressDecoder())],\n ]);\n}\n\nexport function getInitializeConfigInstructionDataCodec(): Codec<\n InitializeConfigInstructionDataArgs,\n InitializeConfigInstructionData\n> {\n return combineCodec(\n getInitializeConfigInstructionDataEncoder(),\n getInitializeConfigInstructionDataDecoder(),\n );\n}\n\nexport type InitializeConfigAsyncInput<\n TAccountAdmin extends string = string,\n TAccountConfig extends string = string,\n TAccountProgramData extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n admin: TransactionSigner<TAccountAdmin>;\n config?: Address<TAccountConfig>;\n programData: Address<TAccountProgramData>;\n systemProgram?: Address<TAccountSystemProgram>;\n migratorAllowlist: InitializeConfigInstructionDataArgs['migratorAllowlist'];\n sentinelAllowlist: InitializeConfigInstructionDataArgs['sentinelAllowlist'];\n};\n\nexport async function getInitializeConfigInstructionAsync<\n TAccountAdmin extends string,\n TAccountConfig extends string,\n TAccountProgramData extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: InitializeConfigAsyncInput<\n TAccountAdmin,\n TAccountConfig,\n TAccountProgramData,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n InitializeConfigInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig,\n TAccountProgramData,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n admin: { value: input.admin ?? null, isWritable: true },\n config: { value: input.config ?? null, isWritable: true },\n programData: { value: input.programData ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.config.value) {\n accounts.config.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([99, 111, 110, 102, 105, 103, 95, 118, 51]),\n ),\n ],\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('admin', accounts.admin),\n getAccountMeta('config', accounts.config),\n getAccountMeta('programData', accounts.programData),\n getAccountMeta('systemProgram', accounts.systemProgram),\n ],\n data: getInitializeConfigInstructionDataEncoder().encode(\n args as InitializeConfigInstructionDataArgs,\n ),\n programAddress,\n } as InitializeConfigInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig,\n TAccountProgramData,\n TAccountSystemProgram\n >);\n}\n\nexport type InitializeConfigInput<\n TAccountAdmin extends string = string,\n TAccountConfig extends string = string,\n TAccountProgramData extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n admin: TransactionSigner<TAccountAdmin>;\n config: Address<TAccountConfig>;\n programData: Address<TAccountProgramData>;\n systemProgram?: Address<TAccountSystemProgram>;\n migratorAllowlist: InitializeConfigInstructionDataArgs['migratorAllowlist'];\n sentinelAllowlist: InitializeConfigInstructionDataArgs['sentinelAllowlist'];\n};\n\nexport function getInitializeConfigInstruction<\n TAccountAdmin extends string,\n TAccountConfig extends string,\n TAccountProgramData extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: InitializeConfigInput<\n TAccountAdmin,\n TAccountConfig,\n TAccountProgramData,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): InitializeConfigInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig,\n TAccountProgramData,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n admin: { value: input.admin ?? null, isWritable: true },\n config: { value: input.config ?? null, isWritable: true },\n programData: { value: input.programData ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('admin', accounts.admin),\n getAccountMeta('config', accounts.config),\n getAccountMeta('programData', accounts.programData),\n getAccountMeta('systemProgram', accounts.systemProgram),\n ],\n data: getInitializeConfigInstructionDataEncoder().encode(\n args as InitializeConfigInstructionDataArgs,\n ),\n programAddress,\n } as InitializeConfigInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig,\n TAccountProgramData,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedInitializeConfigInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n admin: TAccountMetas[0];\n config: TAccountMetas[1];\n programData: TAccountMetas[2];\n systemProgram: TAccountMetas[3];\n };\n data: InitializeConfigInstructionData;\n};\n\nexport function parseInitializeConfigInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedInitializeConfigInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 4,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n admin: getNextAccount(),\n config: getNextAccount(),\n programData: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getInitializeConfigInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { INITIALIZER_PROGRAM_ADDRESS } from '../programs';\n\nexport const INITIALIZE_LAUNCH_DISCRIMINATOR = new Uint8Array([\n 90, 201, 220, 142, 112, 253, 100, 13,\n]);\n\nexport function getInitializeLaunchDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n INITIALIZE_LAUNCH_DISCRIMINATOR,\n );\n}\n\nexport type InitializeLaunchInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountConfig extends string | AccountMeta<string> = string,\n TAccountLaunch extends string | AccountMeta<string> = string,\n TAccountLaunchAuthority extends string | AccountMeta<string> = string,\n TAccountBaseMint extends string | AccountMeta<string> = string,\n TAccountQuoteMint extends string | AccountMeta<string> = string,\n TAccountBaseVault extends string | AccountMeta<string> = string,\n TAccountQuoteVault extends string | AccountMeta<string> = string,\n TAccountPayer extends string | AccountMeta<string> = string,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountMigratorProgram extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',\n TAccountSystemProgram extends string | AccountMeta<string> =\n '11111111111111111111111111111111',\n TAccountRent extends string | AccountMeta<string> =\n 'SysvarRent111111111111111111111111111111111',\n TAccountMetadataAccount extends string | AccountMeta<string> = string,\n TAccountMetadataProgram extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountConfig extends string\n ? ReadonlyAccount<TAccountConfig>\n : TAccountConfig,\n TAccountLaunch extends string\n ? WritableAccount<TAccountLaunch>\n : TAccountLaunch,\n TAccountLaunchAuthority extends string\n ? ReadonlyAccount<TAccountLaunchAuthority>\n : TAccountLaunchAuthority,\n TAccountBaseMint extends string\n ? WritableSignerAccount<TAccountBaseMint> &\n AccountSignerMeta<TAccountBaseMint>\n : TAccountBaseMint,\n TAccountQuoteMint extends string\n ? ReadonlyAccount<TAccountQuoteMint>\n : TAccountQuoteMint,\n TAccountBaseVault extends string\n ? WritableSignerAccount<TAccountBaseVault> &\n AccountSignerMeta<TAccountBaseVault>\n : TAccountBaseVault,\n TAccountQuoteVault extends string\n ? WritableSignerAccount<TAccountQuoteVault> &\n AccountSignerMeta<TAccountQuoteVault>\n : TAccountQuoteVault,\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> &\n AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n TAccountAuthority extends string\n ? ReadonlySignerAccount<TAccountAuthority> &\n AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountMigratorProgram extends string\n ? ReadonlyAccount<TAccountMigratorProgram>\n : TAccountMigratorProgram,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n TAccountRent extends string\n ? ReadonlyAccount<TAccountRent>\n : TAccountRent,\n TAccountMetadataAccount extends string\n ? WritableAccount<TAccountMetadataAccount>\n : TAccountMetadataAccount,\n TAccountMetadataProgram extends string\n ? ReadonlyAccount<TAccountMetadataProgram>\n : TAccountMetadataProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializeLaunchInstructionData = {\n discriminator: ReadonlyUint8Array;\n namespace: Address;\n launchId: ReadonlyUint8Array;\n baseDecimals: number;\n baseTotalSupply: bigint;\n baseForDistribution: bigint;\n baseForLiquidity: bigint;\n curveVirtualBase: bigint;\n curveVirtualQuote: bigint;\n curveFeeBps: number;\n curveKind: number;\n curveParams: ReadonlyUint8Array;\n allowBuy: number;\n allowSell: number;\n sentinelProgram: Address;\n sentinelFlags: number;\n sentinelCalldata: ReadonlyUint8Array;\n migratorProgram: Address;\n migratorInitCalldata: ReadonlyUint8Array;\n migratorMigrateCalldata: ReadonlyUint8Array;\n /**\n * Commitment hash for swap/preview sentinel remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n sentinelRemainingAccountsHash: ReadonlyUint8Array;\n /**\n * Commitment hash for migrate remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n migratorRemainingAccountsHash: ReadonlyUint8Array;\n /** Token name for on-chain metadata. If empty, metadata creation is skipped. */\n metadataName: string;\n /** Token symbol for on-chain metadata. */\n metadataSymbol: string;\n /** Metadata JSON URI for on-chain metadata. */\n metadataUri: string;\n};\n\nexport type InitializeLaunchInstructionDataArgs = {\n namespace: Address;\n launchId: ReadonlyUint8Array;\n baseDecimals: number;\n baseTotalSupply: number | bigint;\n baseForDistribution: number | bigint;\n baseForLiquidity: number | bigint;\n curveVirtualBase: number | bigint;\n curveVirtualQuote: number | bigint;\n curveFeeBps: number;\n curveKind: number;\n curveParams: ReadonlyUint8Array;\n allowBuy: number;\n allowSell: number;\n sentinelProgram: Address;\n sentinelFlags: number;\n sentinelCalldata: ReadonlyUint8Array;\n migratorProgram: Address;\n migratorInitCalldata: ReadonlyUint8Array;\n migratorMigrateCalldata: ReadonlyUint8Array;\n /**\n * Commitment hash for swap/preview sentinel remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n sentinelRemainingAccountsHash: ReadonlyUint8Array;\n /**\n * Commitment hash for migrate remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n migratorRemainingAccountsHash: ReadonlyUint8Array;\n /** Token name for on-chain metadata. If empty, metadata creation is skipped. */\n metadataName: string;\n /** Token symbol for on-chain metadata. */\n metadataSymbol: string;\n /** Metadata JSON URI for on-chain metadata. */\n metadataUri: string;\n};\n\nexport function getInitializeLaunchInstructionDataEncoder(): Encoder<InitializeLaunchInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['namespace', getAddressEncoder()],\n ['launchId', fixEncoderSize(getBytesEncoder(), 32)],\n ['baseDecimals', getU8Encoder()],\n ['baseTotalSupply', getU64Encoder()],\n ['baseForDistribution', getU64Encoder()],\n ['baseForLiquidity', getU64Encoder()],\n ['curveVirtualBase', getU64Encoder()],\n ['curveVirtualQuote', getU64Encoder()],\n ['curveFeeBps', getU16Encoder()],\n ['curveKind', getU8Encoder()],\n ['curveParams', addEncoderSizePrefix(getBytesEncoder(), getU32Encoder())],\n ['allowBuy', getU8Encoder()],\n ['allowSell', getU8Encoder()],\n ['sentinelProgram', getAddressEncoder()],\n ['sentinelFlags', getU32Encoder()],\n [\n 'sentinelCalldata',\n addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),\n ],\n ['migratorProgram', getAddressEncoder()],\n [\n 'migratorInitCalldata',\n addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),\n ],\n [\n 'migratorMigrateCalldata',\n addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),\n ],\n ['sentinelRemainingAccountsHash', fixEncoderSize(getBytesEncoder(), 32)],\n ['migratorRemainingAccountsHash', fixEncoderSize(getBytesEncoder(), 32)],\n ['metadataName', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n [\n 'metadataSymbol',\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n ],\n ['metadataUri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ]),\n (value) => ({ ...value, discriminator: INITIALIZE_LAUNCH_DISCRIMINATOR }),\n );\n}\n\nexport function getInitializeLaunchInstructionDataDecoder(): Decoder<InitializeLaunchInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['namespace', getAddressDecoder()],\n ['launchId', fixDecoderSize(getBytesDecoder(), 32)],\n ['baseDecimals', getU8Decoder()],\n ['baseTotalSupply', getU64Decoder()],\n ['baseForDistribution', getU64Decoder()],\n ['baseForLiquidity', getU64Decoder()],\n ['curveVirtualBase', getU64Decoder()],\n ['curveVirtualQuote', getU64Decoder()],\n ['curveFeeBps', getU16Decoder()],\n ['curveKind', getU8Decoder()],\n ['curveParams', addDecoderSizePrefix(getBytesDecoder(), getU32Decoder())],\n ['allowBuy', getU8Decoder()],\n ['allowSell', getU8Decoder()],\n ['sentinelProgram', getAddressDecoder()],\n ['sentinelFlags', getU32Decoder()],\n [\n 'sentinelCalldata',\n addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),\n ],\n ['migratorProgram', getAddressDecoder()],\n [\n 'migratorInitCalldata',\n addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),\n ],\n [\n 'migratorMigrateCalldata',\n addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),\n ],\n ['sentinelRemainingAccountsHash', fixDecoderSize(getBytesDecoder(), 32)],\n ['migratorRemainingAccountsHash', fixDecoderSize(getBytesDecoder(), 32)],\n ['metadataName', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['metadataSymbol', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['metadataUri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ]);\n}\n\nexport function getInitializeLaunchInstructionDataCodec(): Codec<\n InitializeLaunchInstructionDataArgs,\n InitializeLaunchInstructionData\n> {\n return combineCodec(\n getInitializeLaunchInstructionDataEncoder(),\n getInitializeLaunchInstructionDataDecoder(),\n );\n}\n\nexport type InitializeLaunchAsyncInput<\n TAccountConfig extends string = string,\n TAccountLaunch extends string = string,\n TAccountLaunchAuthority extends string = string,\n TAccountBaseMint extends string = string,\n TAccountQuoteMint extends string = string,\n TAccountBaseVault extends string = string,\n TAccountQuoteVault extends string = string,\n TAccountPayer extends string = string,\n TAccountAuthority extends string = string,\n TAccountMigratorProgram extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountRent extends string = string,\n TAccountMetadataAccount extends string = string,\n TAccountMetadataProgram extends string = string,\n> = {\n config?: Address<TAccountConfig>;\n launch: Address<TAccountLaunch>;\n launchAuthority?: Address<TAccountLaunchAuthority>;\n baseMint: TransactionSigner<TAccountBaseMint>;\n quoteMint: Address<TAccountQuoteMint>;\n baseVault: TransactionSigner<TAccountBaseVault>;\n quoteVault: TransactionSigner<TAccountQuoteVault>;\n payer: TransactionSigner<TAccountPayer>;\n /** Optional authority (creator/admin). If not provided, launch is permissionless. */\n authority?: TransactionSigner<TAccountAuthority>;\n /** Optional migrator program for init hook */\n migratorProgram?: Address<TAccountMigratorProgram>;\n tokenProgram?: Address<TAccountTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n rent?: Address<TAccountRent>;\n /** Metadata account (PDA derived from base_mint via Metaplex Token Metadata). */\n metadataAccount?: Address<TAccountMetadataAccount>;\n /** Metaplex Token Metadata program. */\n metadataProgram?: Address<TAccountMetadataProgram>;\n namespace: InitializeLaunchInstructionDataArgs['namespace'];\n launchId: InitializeLaunchInstructionDataArgs['launchId'];\n baseDecimals: InitializeLaunchInstructionDataArgs['baseDecimals'];\n baseTotalSupply: InitializeLaunchInstructionDataArgs['baseTotalSupply'];\n baseForDistribution: InitializeLaunchInstructionDataArgs['baseForDistribution'];\n baseForLiquidity: InitializeLaunchInstructionDataArgs['baseForLiquidity'];\n curveVirtualBase: InitializeLaunchInstructionDataArgs['curveVirtualBase'];\n curveVirtualQuote: InitializeLaunchInstructionDataArgs['curveVirtualQuote'];\n curveFeeBps: InitializeLaunchInstructionDataArgs['curveFeeBps'];\n curveKind: InitializeLaunchInstructionDataArgs['curveKind'];\n curveParams: InitializeLaunchInstructionDataArgs['curveParams'];\n allowBuy: InitializeLaunchInstructionDataArgs['allowBuy'];\n allowSell: InitializeLaunchInstructionDataArgs['allowSell'];\n sentinelProgram: InitializeLaunchInstructionDataArgs['sentinelProgram'];\n sentinelFlags: InitializeLaunchInstructionDataArgs['sentinelFlags'];\n sentinelCalldata: InitializeLaunchInstructionDataArgs['sentinelCalldata'];\n migratorProgramArg: InitializeLaunchInstructionDataArgs['migratorProgram'];\n migratorInitCalldata: InitializeLaunchInstructionDataArgs['migratorInitCalldata'];\n migratorMigrateCalldata: InitializeLaunchInstructionDataArgs['migratorMigrateCalldata'];\n sentinelRemainingAccountsHash: InitializeLaunchInstructionDataArgs['sentinelRemainingAccountsHash'];\n migratorRemainingAccountsHash: InitializeLaunchInstructionDataArgs['migratorRemainingAccountsHash'];\n metadataName: InitializeLaunchInstructionDataArgs['metadataName'];\n metadataSymbol: InitializeLaunchInstructionDataArgs['metadataSymbol'];\n metadataUri: InitializeLaunchInstructionDataArgs['metadataUri'];\n};\n\nexport async function getInitializeLaunchInstructionAsync<\n TAccountConfig extends string,\n TAccountLaunch extends string,\n TAccountLaunchAuthority extends string,\n TAccountBaseMint extends string,\n TAccountQuoteMint extends string,\n TAccountBaseVault extends string,\n TAccountQuoteVault extends string,\n TAccountPayer extends string,\n TAccountAuthority extends string,\n TAccountMigratorProgram extends string,\n TAccountTokenProgram extends string,\n TAccountSystemProgram extends string,\n TAccountRent extends string,\n TAccountMetadataAccount extends string,\n TAccountMetadataProgram extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: InitializeLaunchAsyncInput<\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountAuthority,\n TAccountMigratorProgram,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountMetadataAccount,\n TAccountMetadataProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n InitializeLaunchInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountAuthority,\n TAccountMigratorProgram,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountMetadataAccount,\n TAccountMetadataProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n config: { value: input.config ?? null, isWritable: false },\n launch: { value: input.launch ?? null, isWritable: true },\n launchAuthority: {\n value: input.launchAuthority ?? null,\n isWritable: false,\n },\n baseMint: { value: input.baseMint ?? null, isWritable: true },\n quoteMint: { value: input.quoteMint ?? null, isWritable: false },\n baseVault: { value: input.baseVault ?? null, isWritable: true },\n quoteVault: { value: input.quoteVault ?? null, isWritable: true },\n payer: { value: input.payer ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: false },\n migratorProgram: {\n value: input.migratorProgram ?? null,\n isWritable: false,\n },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n rent: { value: input.rent ?? null, isWritable: false },\n metadataAccount: { value: input.metadataAccount ?? null, isWritable: true },\n metadataProgram: {\n value: input.metadataProgram ?? null,\n isWritable: false,\n },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input, migratorProgram: input.migratorProgramArg };\n\n // Resolve default values.\n if (!accounts.config.value) {\n accounts.config.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([99, 111, 110, 102, 105, 103, 95, 118, 51]),\n ),\n ],\n });\n }\n if (!accounts.launchAuthority.value) {\n accounts.launchAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([\n 108, 97, 117, 110, 99, 104, 95, 97, 117, 116, 104, 111, 114, 105,\n 116, 121, 95, 118, 51,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n 'launch',\n accounts.launch.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.rent.value) {\n accounts.rent.value =\n 'SysvarRent111111111111111111111111111111111' as Address<'SysvarRent111111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('config', accounts.config),\n getAccountMeta('launch', accounts.launch),\n getAccountMeta('launchAuthority', accounts.launchAuthority),\n getAccountMeta('baseMint', accounts.baseMint),\n getAccountMeta('quoteMint', accounts.quoteMint),\n getAccountMeta('baseVault', accounts.baseVault),\n getAccountMeta('quoteVault', accounts.quoteVault),\n getAccountMeta('payer', accounts.payer),\n getAccountMeta('authority', accounts.authority),\n getAccountMeta('migratorProgram', accounts.migratorProgram),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('rent', accounts.rent),\n getAccountMeta('metadataAccount', accounts.metadataAccount),\n getAccountMeta('metadataProgram', accounts.metadataProgram),\n ],\n data: getInitializeLaunchInstructionDataEncoder().encode(\n args as InitializeLaunchInstructionDataArgs,\n ),\n programAddress,\n } as InitializeLaunchInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountAuthority,\n TAccountMigratorProgram,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountMetadataAccount,\n TAccountMetadataProgram\n >);\n}\n\nexport type InitializeLaunchInput<\n TAccountConfig extends string = string,\n TAccountLaunch extends string = string,\n TAccountLaunchAuthority extends string = string,\n TAccountBaseMint extends string = string,\n TAccountQuoteMint extends string = string,\n TAccountBaseVault extends string = string,\n TAccountQuoteVault extends string = string,\n TAccountPayer extends string = string,\n TAccountAuthority extends string = string,\n TAccountMigratorProgram extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountRent extends string = string,\n TAccountMetadataAccount extends string = string,\n TAccountMetadataProgram extends string = string,\n> = {\n config: Address<TAccountConfig>;\n launch: Address<TAccountLaunch>;\n launchAuthority: Address<TAccountLaunchAuthority>;\n baseMint: TransactionSigner<TAccountBaseMint>;\n quoteMint: Address<TAccountQuoteMint>;\n baseVault: TransactionSigner<TAccountBaseVault>;\n quoteVault: TransactionSigner<TAccountQuoteVault>;\n payer: TransactionSigner<TAccountPayer>;\n /** Optional authority (creator/admin). If not provided, launch is permissionless. */\n authority?: TransactionSigner<TAccountAuthority>;\n /** Optional migrator program for init hook */\n migratorProgram?: Address<TAccountMigratorProgram>;\n tokenProgram?: Address<TAccountTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n rent?: Address<TAccountRent>;\n /** Metadata account (PDA derived from base_mint via Metaplex Token Metadata). */\n metadataAccount?: Address<TAccountMetadataAccount>;\n /** Metaplex Token Metadata program. */\n metadataProgram?: Address<TAccountMetadataProgram>;\n namespace: InitializeLaunchInstructionDataArgs['namespace'];\n launchId: InitializeLaunchInstructionDataArgs['launchId'];\n baseDecimals: InitializeLaunchInstructionDataArgs['baseDecimals'];\n baseTotalSupply: InitializeLaunchInstructionDataArgs['baseTotalSupply'];\n baseForDistribution: InitializeLaunchInstructionDataArgs['baseForDistribution'];\n baseForLiquidity: InitializeLaunchInstructionDataArgs['baseForLiquidity'];\n curveVirtualBase: InitializeLaunchInstructionDataArgs['curveVirtualBase'];\n curveVirtualQuote: InitializeLaunchInstructionDataArgs['curveVirtualQuote'];\n curveFeeBps: InitializeLaunchInstructionDataArgs['curveFeeBps'];\n curveKind: InitializeLaunchInstructionDataArgs['curveKind'];\n curveParams: InitializeLaunchInstructionDataArgs['curveParams'];\n allowBuy: InitializeLaunchInstructionDataArgs['allowBuy'];\n allowSell: InitializeLaunchInstructionDataArgs['allowSell'];\n sentinelProgram: InitializeLaunchInstructionDataArgs['sentinelProgram'];\n sentinelFlags: InitializeLaunchInstructionDataArgs['sentinelFlags'];\n sentinelCalldata: InitializeLaunchInstructionDataArgs['sentinelCalldata'];\n migratorProgramArg: InitializeLaunchInstructionDataArgs['migratorProgram'];\n migratorInitCalldata: InitializeLaunchInstructionDataArgs['migratorInitCalldata'];\n migratorMigrateCalldata: InitializeLaunchInstructionDataArgs['migratorMigrateCalldata'];\n sentinelRemainingAccountsHash: InitializeLaunchInstructionDataArgs['sentinelRemainingAccountsHash'];\n migratorRemainingAccountsHash: InitializeLaunchInstructionDataArgs['migratorRemainingAccountsHash'];\n metadataName: InitializeLaunchInstructionDataArgs['metadataName'];\n metadataSymbol: InitializeLaunchInstructionDataArgs['metadataSymbol'];\n metadataUri: InitializeLaunchInstructionDataArgs['metadataUri'];\n};\n\nexport function getInitializeLaunchInstruction<\n TAccountConfig extends string,\n TAccountLaunch extends string,\n TAccountLaunchAuthority extends string,\n TAccountBaseMint extends string,\n TAccountQuoteMint extends string,\n TAccountBaseVault extends string,\n TAccountQuoteVault extends string,\n TAccountPayer extends string,\n TAccountAuthority extends string,\n TAccountMigratorProgram extends string,\n TAccountTokenProgram extends string,\n TAccountSystemProgram extends string,\n TAccountRent extends string,\n TAccountMetadataAccount extends string,\n TAccountMetadataProgram extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: InitializeLaunchInput<\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountAuthority,\n TAccountMigratorProgram,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountMetadataAccount,\n TAccountMetadataProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): InitializeLaunchInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountAuthority,\n TAccountMigratorProgram,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountMetadataAccount,\n TAccountMetadataProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n config: { value: input.config ?? null, isWritable: false },\n launch: { value: input.launch ?? null, isWritable: true },\n launchAuthority: {\n value: input.launchAuthority ?? null,\n isWritable: false,\n },\n baseMint: { value: input.baseMint ?? null, isWritable: true },\n quoteMint: { value: input.quoteMint ?? null, isWritable: false },\n baseVault: { value: input.baseVault ?? null, isWritable: true },\n quoteVault: { value: input.quoteVault ?? null, isWritable: true },\n payer: { value: input.payer ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: false },\n migratorProgram: {\n value: input.migratorProgram ?? null,\n isWritable: false,\n },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n rent: { value: input.rent ?? null, isWritable: false },\n metadataAccount: { value: input.metadataAccount ?? null, isWritable: true },\n metadataProgram: {\n value: input.metadataProgram ?? null,\n isWritable: false,\n },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input, migratorProgram: input.migratorProgramArg };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.rent.value) {\n accounts.rent.value =\n 'SysvarRent111111111111111111111111111111111' as Address<'SysvarRent111111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('config', accounts.config),\n getAccountMeta('launch', accounts.launch),\n getAccountMeta('launchAuthority', accounts.launchAuthority),\n getAccountMeta('baseMint', accounts.baseMint),\n getAccountMeta('quoteMint', accounts.quoteMint),\n getAccountMeta('baseVault', accounts.baseVault),\n getAccountMeta('quoteVault', accounts.quoteVault),\n getAccountMeta('payer', accounts.payer),\n getAccountMeta('authority', accounts.authority),\n getAccountMeta('migratorProgram', accounts.migratorProgram),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('rent', accounts.rent),\n getAccountMeta('metadataAccount', accounts.metadataAccount),\n getAccountMeta('metadataProgram', accounts.metadataProgram),\n ],\n data: getInitializeLaunchInstructionDataEncoder().encode(\n args as InitializeLaunchInstructionDataArgs,\n ),\n programAddress,\n } as InitializeLaunchInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountAuthority,\n TAccountMigratorProgram,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountMetadataAccount,\n TAccountMetadataProgram\n >);\n}\n\nexport type ParsedInitializeLaunchInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n config: TAccountMetas[0];\n launch: TAccountMetas[1];\n launchAuthority: TAccountMetas[2];\n baseMint: TAccountMetas[3];\n quoteMint: TAccountMetas[4];\n baseVault: TAccountMetas[5];\n quoteVault: TAccountMetas[6];\n payer: TAccountMetas[7];\n /** Optional authority (creator/admin). If not provided, launch is permissionless. */\n authority?: TAccountMetas[8] | undefined;\n /** Optional migrator program for init hook */\n migratorProgram?: TAccountMetas[9] | undefined;\n tokenProgram: TAccountMetas[10];\n systemProgram: TAccountMetas[11];\n rent: TAccountMetas[12];\n /** Metadata account (PDA derived from base_mint via Metaplex Token Metadata). */\n metadataAccount?: TAccountMetas[13] | undefined;\n /** Metaplex Token Metadata program. */\n metadataProgram?: TAccountMetas[14] | undefined;\n };\n data: InitializeLaunchInstructionData;\n};\n\nexport function parseInitializeLaunchInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedInitializeLaunchInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 15) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 15,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n const getNextOptionalAccount = () => {\n const accountMeta = getNextAccount();\n return accountMeta.address === INITIALIZER_PROGRAM_ADDRESS\n ? undefined\n : accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n config: getNextAccount(),\n launch: getNextAccount(),\n launchAuthority: getNextAccount(),\n baseMint: getNextAccount(),\n quoteMint: getNextAccount(),\n baseVault: getNextAccount(),\n quoteVault: getNextAccount(),\n payer: getNextAccount(),\n authority: getNextOptionalAccount(),\n migratorProgram: getNextOptionalAccount(),\n tokenProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n rent: getNextAccount(),\n metadataAccount: getNextOptionalAccount(),\n metadataProgram: getNextOptionalAccount(),\n },\n data: getInitializeLaunchInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { INITIALIZER_PROGRAM_ADDRESS } from '../programs';\n\nexport const PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR = new Uint8Array([\n 50, 130, 31, 69, 147, 58, 222, 178,\n]);\n\nexport function getPreviewSwapExactInDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR,\n );\n}\n\nexport type PreviewSwapExactInInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountLaunch extends string | AccountMeta<string> = string,\n TAccountBaseVault extends string | AccountMeta<string> = string,\n TAccountQuoteVault extends string | AccountMeta<string> = string,\n TAccountSentinelProgram extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountLaunch extends string\n ? ReadonlyAccount<TAccountLaunch>\n : TAccountLaunch,\n TAccountBaseVault extends string\n ? ReadonlyAccount<TAccountBaseVault>\n : TAccountBaseVault,\n TAccountQuoteVault extends string\n ? ReadonlyAccount<TAccountQuoteVault>\n : TAccountQuoteVault,\n TAccountSentinelProgram extends string\n ? ReadonlyAccount<TAccountSentinelProgram>\n : TAccountSentinelProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type PreviewSwapExactInInstructionData = {\n discriminator: ReadonlyUint8Array;\n amountIn: bigint;\n direction: number;\n};\n\nexport type PreviewSwapExactInInstructionDataArgs = {\n amountIn: number | bigint;\n direction: number;\n};\n\nexport function getPreviewSwapExactInInstructionDataEncoder(): FixedSizeEncoder<PreviewSwapExactInInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['amountIn', getU64Encoder()],\n ['direction', getU8Encoder()],\n ]),\n (value) => ({\n ...value,\n discriminator: PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getPreviewSwapExactInInstructionDataDecoder(): FixedSizeDecoder<PreviewSwapExactInInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['amountIn', getU64Decoder()],\n ['direction', getU8Decoder()],\n ]);\n}\n\nexport function getPreviewSwapExactInInstructionDataCodec(): FixedSizeCodec<\n PreviewSwapExactInInstructionDataArgs,\n PreviewSwapExactInInstructionData\n> {\n return combineCodec(\n getPreviewSwapExactInInstructionDataEncoder(),\n getPreviewSwapExactInInstructionDataDecoder(),\n );\n}\n\nexport type PreviewSwapExactInInput<\n TAccountLaunch extends string = string,\n TAccountBaseVault extends string = string,\n TAccountQuoteVault extends string = string,\n TAccountSentinelProgram extends string = string,\n> = {\n launch: Address<TAccountLaunch>;\n baseVault: Address<TAccountBaseVault>;\n quoteVault: Address<TAccountQuoteVault>;\n /** Optional sentinel program (must match launch.sentinel_program if set) */\n sentinelProgram?: Address<TAccountSentinelProgram>;\n amountIn: PreviewSwapExactInInstructionDataArgs['amountIn'];\n direction: PreviewSwapExactInInstructionDataArgs['direction'];\n};\n\nexport function getPreviewSwapExactInInstruction<\n TAccountLaunch extends string,\n TAccountBaseVault extends string,\n TAccountQuoteVault extends string,\n TAccountSentinelProgram extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: PreviewSwapExactInInput<\n TAccountLaunch,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountSentinelProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): PreviewSwapExactInInstruction<\n TProgramAddress,\n TAccountLaunch,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountSentinelProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n launch: { value: input.launch ?? null, isWritable: false },\n baseVault: { value: input.baseVault ?? null, isWritable: false },\n quoteVault: { value: input.quoteVault ?? null, isWritable: false },\n sentinelProgram: {\n value: input.sentinelProgram ?? null,\n isWritable: false,\n },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('launch', accounts.launch),\n getAccountMeta('baseVault', accounts.baseVault),\n getAccountMeta('quoteVault', accounts.quoteVault),\n getAccountMeta('sentinelProgram', accounts.sentinelProgram),\n ],\n data: getPreviewSwapExactInInstructionDataEncoder().encode(\n args as PreviewSwapExactInInstructionDataArgs,\n ),\n programAddress,\n } as PreviewSwapExactInInstruction<\n TProgramAddress,\n TAccountLaunch,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountSentinelProgram\n >);\n}\n\nexport type ParsedPreviewSwapExactInInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n launch: TAccountMetas[0];\n baseVault: TAccountMetas[1];\n quoteVault: TAccountMetas[2];\n /** Optional sentinel program (must match launch.sentinel_program if set) */\n sentinelProgram?: TAccountMetas[3] | undefined;\n };\n data: PreviewSwapExactInInstructionData;\n};\n\nexport function parsePreviewSwapExactInInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedPreviewSwapExactInInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 4,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n const getNextOptionalAccount = () => {\n const accountMeta = getNextAccount();\n return accountMeta.address === INITIALIZER_PROGRAM_ADDRESS\n ? undefined\n : accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n launch: getNextAccount(),\n baseVault: getNextAccount(),\n quoteVault: getNextAccount(),\n sentinelProgram: getNextOptionalAccount(),\n },\n data: getPreviewSwapExactInInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { INITIALIZER_PROGRAM_ADDRESS } from '../programs';\n\nexport const SET_MIGRATOR_ALLOWLIST_DISCRIMINATOR = new Uint8Array([\n 209, 90, 181, 104, 99, 108, 233, 168,\n]);\n\nexport function getSetMigratorAllowlistDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n SET_MIGRATOR_ALLOWLIST_DISCRIMINATOR,\n );\n}\n\nexport type SetMigratorAllowlistInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountAdmin extends string | AccountMeta<string> = string,\n TAccountConfig extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAdmin extends string\n ? ReadonlySignerAccount<TAccountAdmin> &\n AccountSignerMeta<TAccountAdmin>\n : TAccountAdmin,\n TAccountConfig extends string\n ? WritableAccount<TAccountConfig>\n : TAccountConfig,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type SetMigratorAllowlistInstructionData = {\n discriminator: ReadonlyUint8Array;\n allowlist: Array<Address>;\n};\n\nexport type SetMigratorAllowlistInstructionDataArgs = {\n allowlist: Array<Address>;\n};\n\nexport function getSetMigratorAllowlistInstructionDataEncoder(): Encoder<SetMigratorAllowlistInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['allowlist', getArrayEncoder(getAddressEncoder())],\n ]),\n (value) => ({\n ...value,\n discriminator: SET_MIGRATOR_ALLOWLIST_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getSetMigratorAllowlistInstructionDataDecoder(): Decoder<SetMigratorAllowlistInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['allowlist', getArrayDecoder(getAddressDecoder())],\n ]);\n}\n\nexport function getSetMigratorAllowlistInstructionDataCodec(): Codec<\n SetMigratorAllowlistInstructionDataArgs,\n SetMigratorAllowlistInstructionData\n> {\n return combineCodec(\n getSetMigratorAllowlistInstructionDataEncoder(),\n getSetMigratorAllowlistInstructionDataDecoder(),\n );\n}\n\nexport type SetMigratorAllowlistAsyncInput<\n TAccountAdmin extends string = string,\n TAccountConfig extends string = string,\n> = {\n admin: TransactionSigner<TAccountAdmin>;\n config?: Address<TAccountConfig>;\n allowlist: SetMigratorAllowlistInstructionDataArgs['allowlist'];\n};\n\nexport async function getSetMigratorAllowlistInstructionAsync<\n TAccountAdmin extends string,\n TAccountConfig extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: SetMigratorAllowlistAsyncInput<TAccountAdmin, TAccountConfig>,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n SetMigratorAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n admin: { value: input.admin ?? null, isWritable: false },\n config: { value: input.config ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.config.value) {\n accounts.config.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([99, 111, 110, 102, 105, 103, 95, 118, 51]),\n ),\n ],\n });\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('admin', accounts.admin),\n getAccountMeta('config', accounts.config),\n ],\n data: getSetMigratorAllowlistInstructionDataEncoder().encode(\n args as SetMigratorAllowlistInstructionDataArgs,\n ),\n programAddress,\n } as SetMigratorAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n >);\n}\n\nexport type SetMigratorAllowlistInput<\n TAccountAdmin extends string = string,\n TAccountConfig extends string = string,\n> = {\n admin: TransactionSigner<TAccountAdmin>;\n config: Address<TAccountConfig>;\n allowlist: SetMigratorAllowlistInstructionDataArgs['allowlist'];\n};\n\nexport function getSetMigratorAllowlistInstruction<\n TAccountAdmin extends string,\n TAccountConfig extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: SetMigratorAllowlistInput<TAccountAdmin, TAccountConfig>,\n config?: { programAddress?: TProgramAddress },\n): SetMigratorAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n admin: { value: input.admin ?? null, isWritable: false },\n config: { value: input.config ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('admin', accounts.admin),\n getAccountMeta('config', accounts.config),\n ],\n data: getSetMigratorAllowlistInstructionDataEncoder().encode(\n args as SetMigratorAllowlistInstructionDataArgs,\n ),\n programAddress,\n } as SetMigratorAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n >);\n}\n\nexport type ParsedSetMigratorAllowlistInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n admin: TAccountMetas[0];\n config: TAccountMetas[1];\n };\n data: SetMigratorAllowlistInstructionData;\n};\n\nexport function parseSetMigratorAllowlistInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedSetMigratorAllowlistInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { admin: getNextAccount(), config: getNextAccount() },\n data: getSetMigratorAllowlistInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { INITIALIZER_PROGRAM_ADDRESS } from '../programs';\n\nexport const SET_SENTINEL_ALLOWLIST_DISCRIMINATOR = new Uint8Array([\n 233, 72, 180, 246, 171, 117, 21, 50,\n]);\n\nexport function getSetSentinelAllowlistDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n SET_SENTINEL_ALLOWLIST_DISCRIMINATOR,\n );\n}\n\nexport type SetSentinelAllowlistInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountAdmin extends string | AccountMeta<string> = string,\n TAccountConfig extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAdmin extends string\n ? ReadonlySignerAccount<TAccountAdmin> &\n AccountSignerMeta<TAccountAdmin>\n : TAccountAdmin,\n TAccountConfig extends string\n ? WritableAccount<TAccountConfig>\n : TAccountConfig,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type SetSentinelAllowlistInstructionData = {\n discriminator: ReadonlyUint8Array;\n allowlist: Array<Address>;\n};\n\nexport type SetSentinelAllowlistInstructionDataArgs = {\n allowlist: Array<Address>;\n};\n\nexport function getSetSentinelAllowlistInstructionDataEncoder(): Encoder<SetSentinelAllowlistInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['allowlist', getArrayEncoder(getAddressEncoder())],\n ]),\n (value) => ({\n ...value,\n discriminator: SET_SENTINEL_ALLOWLIST_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getSetSentinelAllowlistInstructionDataDecoder(): Decoder<SetSentinelAllowlistInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['allowlist', getArrayDecoder(getAddressDecoder())],\n ]);\n}\n\nexport function getSetSentinelAllowlistInstructionDataCodec(): Codec<\n SetSentinelAllowlistInstructionDataArgs,\n SetSentinelAllowlistInstructionData\n> {\n return combineCodec(\n getSetSentinelAllowlistInstructionDataEncoder(),\n getSetSentinelAllowlistInstructionDataDecoder(),\n );\n}\n\nexport type SetSentinelAllowlistAsyncInput<\n TAccountAdmin extends string = string,\n TAccountConfig extends string = string,\n> = {\n admin: TransactionSigner<TAccountAdmin>;\n config?: Address<TAccountConfig>;\n allowlist: SetSentinelAllowlistInstructionDataArgs['allowlist'];\n};\n\nexport async function getSetSentinelAllowlistInstructionAsync<\n TAccountAdmin extends string,\n TAccountConfig extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: SetSentinelAllowlistAsyncInput<TAccountAdmin, TAccountConfig>,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n SetSentinelAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n admin: { value: input.admin ?? null, isWritable: false },\n config: { value: input.config ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.config.value) {\n accounts.config.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([99, 111, 110, 102, 105, 103, 95, 118, 51]),\n ),\n ],\n });\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('admin', accounts.admin),\n getAccountMeta('config', accounts.config),\n ],\n data: getSetSentinelAllowlistInstructionDataEncoder().encode(\n args as SetSentinelAllowlistInstructionDataArgs,\n ),\n programAddress,\n } as SetSentinelAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n >);\n}\n\nexport type SetSentinelAllowlistInput<\n TAccountAdmin extends string = string,\n TAccountConfig extends string = string,\n> = {\n admin: TransactionSigner<TAccountAdmin>;\n config: Address<TAccountConfig>;\n allowlist: SetSentinelAllowlistInstructionDataArgs['allowlist'];\n};\n\nexport function getSetSentinelAllowlistInstruction<\n TAccountAdmin extends string,\n TAccountConfig extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: SetSentinelAllowlistInput<TAccountAdmin, TAccountConfig>,\n config?: { programAddress?: TProgramAddress },\n): SetSentinelAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n admin: { value: input.admin ?? null, isWritable: false },\n config: { value: input.config ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('admin', accounts.admin),\n getAccountMeta('config', accounts.config),\n ],\n data: getSetSentinelAllowlistInstructionDataEncoder().encode(\n args as SetSentinelAllowlistInstructionDataArgs,\n ),\n programAddress,\n } as SetSentinelAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n >);\n}\n\nexport type ParsedSetSentinelAllowlistInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n admin: TAccountMetas[0];\n config: TAccountMetas[1];\n };\n data: SetSentinelAllowlistInstructionData;\n};\n\nexport function parseSetSentinelAllowlistInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedSetSentinelAllowlistInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { admin: getNextAccount(), config: getNextAccount() },\n data: getSetSentinelAllowlistInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n isProgramError,\n type Address,\n type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM,\n type SolanaError,\n} from '@solana/kit';\nimport { INITIALIZER_PROGRAM_ADDRESS } from '../programs';\n\n/** Unauthorized: Unauthorized */\nexport const INITIALIZER_ERROR__UNAUTHORIZED = 0x1770; // 6000\n/** InvalidPhase: Invalid phase */\nexport const INITIALIZER_ERROR__INVALID_PHASE = 0x1771; // 6001\n/** InvalidAmount: Invalid amount */\nexport const INITIALIZER_ERROR__INVALID_AMOUNT = 0x1772; // 6002\n/** InvalidVault: Invalid vault */\nexport const INITIALIZER_ERROR__INVALID_VAULT = 0x1773; // 6003\n/** InvalidMint: Invalid mint */\nexport const INITIALIZER_ERROR__INVALID_MINT = 0x1774; // 6004\n/** MathOverflow: Math overflow */\nexport const INITIALIZER_ERROR__MATH_OVERFLOW = 0x1775; // 6005\n/** InvalidCurveParams: Invalid curve params */\nexport const INITIALIZER_ERROR__INVALID_CURVE_PARAMS = 0x1776; // 6006\n/** SlippageExceeded: Slippage exceeded */\nexport const INITIALIZER_ERROR__SLIPPAGE_EXCEEDED = 0x1777; // 6007\n/** CurveLiquidityInsufficient: Curve liquidity insufficient */\nexport const INITIALIZER_ERROR__CURVE_LIQUIDITY_INSUFFICIENT = 0x1778; // 6008\n/** CalldataTooLarge: Calldata too large */\nexport const INITIALIZER_ERROR__CALLDATA_TOO_LARGE = 0x1779; // 6009\n/** MigratorNotAllowlisted: Migrator not allowlisted */\nexport const INITIALIZER_ERROR__MIGRATOR_NOT_ALLOWLISTED = 0x177a; // 6010\n/** SentinelNotAllowlisted: Sentinel not allowlisted */\nexport const INITIALIZER_ERROR__SENTINEL_NOT_ALLOWLISTED = 0x177b; // 6011\n/** WrongMigrator: Wrong migrator program */\nexport const INITIALIZER_ERROR__WRONG_MIGRATOR = 0x177c; // 6012\n/** WrongSentinel: Wrong sentinel program */\nexport const INITIALIZER_ERROR__WRONG_SENTINEL = 0x177d; // 6013\n/** MigratorCpiFailed: Migrator CPI failed */\nexport const INITIALIZER_ERROR__MIGRATOR_CPI_FAILED = 0x177e; // 6014\n/** SentinelCpiFailed: Sentinel CPI failed */\nexport const INITIALIZER_ERROR__SENTINEL_CPI_FAILED = 0x177f; // 6015\n/** SentinelRejected: Sentinel rejected */\nexport const INITIALIZER_ERROR__SENTINEL_REJECTED = 0x1780; // 6016\n/** BuyNotAllowed: Buy not allowed */\nexport const INITIALIZER_ERROR__BUY_NOT_ALLOWED = 0x1781; // 6017\n/** SellNotAllowed: Sell not allowed */\nexport const INITIALIZER_ERROR__SELL_NOT_ALLOWED = 0x1782; // 6018\n/** InvalidDirection: Invalid direction */\nexport const INITIALIZER_ERROR__INVALID_DIRECTION = 0x1783; // 6019\n/** AllowlistFull: Allowlist full */\nexport const INITIALIZER_ERROR__ALLOWLIST_FULL = 0x1784; // 6020\n/** InvalidInput: Invalid input */\nexport const INITIALIZER_ERROR__INVALID_INPUT = 0x1785; // 6021\n/** AlreadyMigrated: Already migrated */\nexport const INITIALIZER_ERROR__ALREADY_MIGRATED = 0x1786; // 6022\n/** QuoteVaultNotEmpty: Quote vault not empty */\nexport const INITIALIZER_ERROR__QUOTE_VAULT_NOT_EMPTY = 0x1787; // 6023\n/** LaunchLocked: Launch locked */\nexport const INITIALIZER_ERROR__LAUNCH_LOCKED = 0x1788; // 6024\n/** InvalidCurveKind: Invalid curve kind */\nexport const INITIALIZER_ERROR__INVALID_CURVE_KIND = 0x1789; // 6025\n/** CurveParamsInvalid: Curve params invalid */\nexport const INITIALIZER_ERROR__CURVE_PARAMS_INVALID = 0x178a; // 6026\n/** RemainingAccountOverlap: Remaining account overlaps with protocol account */\nexport const INITIALIZER_ERROR__REMAINING_ACCOUNT_OVERLAP = 0x178b; // 6027\n/** MissingRemainingAccountsCommitment: Missing remaining accounts commitment */\nexport const INITIALIZER_ERROR__MISSING_REMAINING_ACCOUNTS_COMMITMENT = 0x178c; // 6028\n/** RemainingAccountsCommitmentMismatch: Remaining accounts commitment mismatch */\nexport const INITIALIZER_ERROR__REMAINING_ACCOUNTS_COMMITMENT_MISMATCH = 0x178d; // 6029\n/** InvalidOracle: Invalid oracle account */\nexport const INITIALIZER_ERROR__INVALID_ORACLE = 0x178e; // 6030\n/** MissingMetadataAccounts: Missing metadata accounts */\nexport const INITIALIZER_ERROR__MISSING_METADATA_ACCOUNTS = 0x178f; // 6031\n/** InvalidMetadataProgram: Invalid metadata program */\nexport const INITIALIZER_ERROR__INVALID_METADATA_PROGRAM = 0x1790; // 6032\n/** InvalidMetadataAccount: Invalid metadata account */\nexport const INITIALIZER_ERROR__INVALID_METADATA_ACCOUNT = 0x1791; // 6033\n/** MetadataCpiFailed: Metadata CPI failed */\nexport const INITIALIZER_ERROR__METADATA_CPI_FAILED = 0x1792; // 6034\n\nexport type InitializerError =\n | typeof INITIALIZER_ERROR__ALLOWLIST_FULL\n | typeof INITIALIZER_ERROR__ALREADY_MIGRATED\n | typeof INITIALIZER_ERROR__BUY_NOT_ALLOWED\n | typeof INITIALIZER_ERROR__CALLDATA_TOO_LARGE\n | typeof INITIALIZER_ERROR__CURVE_LIQUIDITY_INSUFFICIENT\n | typeof INITIALIZER_ERROR__CURVE_PARAMS_INVALID\n | typeof INITIALIZER_ERROR__INVALID_AMOUNT\n | typeof INITIALIZER_ERROR__INVALID_CURVE_KIND\n | typeof INITIALIZER_ERROR__INVALID_CURVE_PARAMS\n | typeof INITIALIZER_ERROR__INVALID_DIRECTION\n | typeof INITIALIZER_ERROR__INVALID_INPUT\n | typeof INITIALIZER_ERROR__INVALID_METADATA_ACCOUNT\n | typeof INITIALIZER_ERROR__INVALID_METADATA_PROGRAM\n | typeof INITIALIZER_ERROR__INVALID_MINT\n | typeof INITIALIZER_ERROR__INVALID_ORACLE\n | typeof INITIALIZER_ERROR__INVALID_PHASE\n | typeof INITIALIZER_ERROR__INVALID_VAULT\n | typeof INITIALIZER_ERROR__LAUNCH_LOCKED\n | typeof INITIALIZER_ERROR__MATH_OVERFLOW\n | typeof INITIALIZER_ERROR__METADATA_CPI_FAILED\n | typeof INITIALIZER_ERROR__MIGRATOR_CPI_FAILED\n | typeof INITIALIZER_ERROR__MIGRATOR_NOT_ALLOWLISTED\n | typeof INITIALIZER_ERROR__MISSING_METADATA_ACCOUNTS\n | typeof INITIALIZER_ERROR__MISSING_REMAINING_ACCOUNTS_COMMITMENT\n | typeof INITIALIZER_ERROR__QUOTE_VAULT_NOT_EMPTY\n | typeof INITIALIZER_ERROR__REMAINING_ACCOUNT_OVERLAP\n | typeof INITIALIZER_ERROR__REMAINING_ACCOUNTS_COMMITMENT_MISMATCH\n | typeof INITIALIZER_ERROR__SELL_NOT_ALLOWED\n | typeof INITIALIZER_ERROR__SENTINEL_CPI_FAILED\n | typeof INITIALIZER_ERROR__SENTINEL_NOT_ALLOWLISTED\n | typeof INITIALIZER_ERROR__SENTINEL_REJECTED\n | typeof INITIALIZER_ERROR__SLIPPAGE_EXCEEDED\n | typeof INITIALIZER_ERROR__UNAUTHORIZED\n | typeof INITIALIZER_ERROR__WRONG_MIGRATOR\n | typeof INITIALIZER_ERROR__WRONG_SENTINEL;\n\nlet initializerErrorMessages: Record<InitializerError, string> | undefined;\nif (process.env.NODE_ENV !== 'production') {\n initializerErrorMessages = {\n [INITIALIZER_ERROR__ALLOWLIST_FULL]: `Allowlist full`,\n [INITIALIZER_ERROR__ALREADY_MIGRATED]: `Already migrated`,\n [INITIALIZER_ERROR__BUY_NOT_ALLOWED]: `Buy not allowed`,\n [INITIALIZER_ERROR__CALLDATA_TOO_LARGE]: `Calldata too large`,\n [INITIALIZER_ERROR__CURVE_LIQUIDITY_INSUFFICIENT]: `Curve liquidity insufficient`,\n [INITIALIZER_ERROR__CURVE_PARAMS_INVALID]: `Curve params invalid`,\n [INITIALIZER_ERROR__INVALID_AMOUNT]: `Invalid amount`,\n [INITIALIZER_ERROR__INVALID_CURVE_KIND]: `Invalid curve kind`,\n [INITIALIZER_ERROR__INVALID_CURVE_PARAMS]: `Invalid curve params`,\n [INITIALIZER_ERROR__INVALID_DIRECTION]: `Invalid direction`,\n [INITIALIZER_ERROR__INVALID_INPUT]: `Invalid input`,\n [INITIALIZER_ERROR__INVALID_METADATA_ACCOUNT]: `Invalid metadata account`,\n [INITIALIZER_ERROR__INVALID_METADATA_PROGRAM]: `Invalid metadata program`,\n [INITIALIZER_ERROR__INVALID_MINT]: `Invalid mint`,\n [INITIALIZER_ERROR__INVALID_ORACLE]: `Invalid oracle account`,\n [INITIALIZER_ERROR__INVALID_PHASE]: `Invalid phase`,\n [INITIALIZER_ERROR__INVALID_VAULT]: `Invalid vault`,\n [INITIALIZER_ERROR__LAUNCH_LOCKED]: `Launch locked`,\n [INITIALIZER_ERROR__MATH_OVERFLOW]: `Math overflow`,\n [INITIALIZER_ERROR__METADATA_CPI_FAILED]: `Metadata CPI failed`,\n [INITIALIZER_ERROR__MIGRATOR_CPI_FAILED]: `Migrator CPI failed`,\n [INITIALIZER_ERROR__MIGRATOR_NOT_ALLOWLISTED]: `Migrator not allowlisted`,\n [INITIALIZER_ERROR__MISSING_METADATA_ACCOUNTS]: `Missing metadata accounts`,\n [INITIALIZER_ERROR__MISSING_REMAINING_ACCOUNTS_COMMITMENT]: `Missing remaining accounts commitment`,\n [INITIALIZER_ERROR__QUOTE_VAULT_NOT_EMPTY]: `Quote vault not empty`,\n [INITIALIZER_ERROR__REMAINING_ACCOUNT_OVERLAP]: `Remaining account overlaps with protocol account`,\n [INITIALIZER_ERROR__REMAINING_ACCOUNTS_COMMITMENT_MISMATCH]: `Remaining accounts commitment mismatch`,\n [INITIALIZER_ERROR__SELL_NOT_ALLOWED]: `Sell not allowed`,\n [INITIALIZER_ERROR__SENTINEL_CPI_FAILED]: `Sentinel CPI failed`,\n [INITIALIZER_ERROR__SENTINEL_NOT_ALLOWLISTED]: `Sentinel not allowlisted`,\n [INITIALIZER_ERROR__SENTINEL_REJECTED]: `Sentinel rejected`,\n [INITIALIZER_ERROR__SLIPPAGE_EXCEEDED]: `Slippage exceeded`,\n [INITIALIZER_ERROR__UNAUTHORIZED]: `Unauthorized`,\n [INITIALIZER_ERROR__WRONG_MIGRATOR]: `Wrong migrator program`,\n [INITIALIZER_ERROR__WRONG_SENTINEL]: `Wrong sentinel program`,\n };\n}\n\nexport function getInitializerErrorMessage(code: InitializerError): string {\n if (process.env.NODE_ENV !== 'production') {\n return (initializerErrorMessages as Record<InitializerError, string>)[code];\n }\n\n return 'Error message not available in production bundles.';\n}\n\nexport function isInitializerError<TProgramErrorCode extends InitializerError>(\n error: unknown,\n transactionMessage: {\n instructions: Record<number, { programAddress: Address }>;\n },\n code?: TProgramErrorCode,\n): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> &\n Readonly<{ context: Readonly<{ code: TProgramErrorCode }> }> {\n return isProgramError<TProgramErrorCode>(\n error,\n transactionMessage,\n INITIALIZER_PROGRAM_ADDRESS,\n code,\n );\n}\n","import {\n type Address,\n type ProgramDerivedAddress,\n getAddressCodec,\n getProgramDerivedAddress,\n} from '@solana/kit';\nimport {\n BPF_LOADER_UPGRADEABLE_PROGRAM_ID,\n INITIALIZER_PROGRAM_ID,\n SEED_CONFIG,\n SEED_LAUNCH,\n SEED_LAUNCH_AUTHORITY,\n} from './constants.js';\n\nconst addressCodec = getAddressCodec();\nconst textEncoder = new TextEncoder();\n\nexport function encodeU64LE(value: bigint): Uint8Array {\n const bytes = new Uint8Array(8);\n const view = new DataView(bytes.buffer);\n view.setBigUint64(0, value, true);\n return bytes;\n}\n\n/**\n * Derive the InitConfig PDA address.\n * Seeds: ['config_v3']\n */\nexport async function getConfigAddress(\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: programId,\n seeds: [textEncoder.encode(SEED_CONFIG)],\n });\n}\n\n/**\n * Derive the ProgramData PDA for an upgradeable program.\n * Seeds: [initializer_program_id] with program = BPFLoaderUpgradeable.\n */\nexport async function getProgramDataAddress(\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: BPF_LOADER_UPGRADEABLE_PROGRAM_ID,\n seeds: [addressCodec.encode(programId)],\n });\n}\n\n/**\n * Derive the Launch PDA address.\n * Seeds: ['launch_v3', namespace, launch_id_bytes_32]\n */\nexport async function getLaunchAddress(\n namespace: Address,\n launchId: Uint8Array,\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Promise<ProgramDerivedAddress> {\n if (launchId.length !== 32) {\n throw new Error('launchId must be 32 bytes');\n }\n return getProgramDerivedAddress({\n programAddress: programId,\n seeds: [\n textEncoder.encode(SEED_LAUNCH),\n addressCodec.encode(namespace),\n launchId,\n ],\n });\n}\n\n/**\n * Derive the Launch authority PDA address.\n * Seeds: ['launch_authority_v3', launch]\n */\nexport async function getLaunchAuthorityAddress(\n launch: Address,\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: programId,\n seeds: [\n textEncoder.encode(SEED_LAUNCH_AUTHORITY),\n addressCodec.encode(launch),\n ],\n });\n}\n\n/**\n * Convenience helper for the common pattern: embed a u64 into a 32-byte launch_id.\n */\nexport function launchIdFromU64(launchId: bigint): Uint8Array {\n const out = new Uint8Array(32);\n out.set(encodeU64LE(launchId), 0);\n return out;\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport type { TransactionSigner, AccountSignerMeta } from '@solana/kit';\nimport {\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_WRITABLE_SIGNER,\n SYSTEM_PROGRAM_ID,\n} from '../../core/constants.js';\nimport { INITIALIZER_PROGRAM_ID } from '../constants.js';\nimport type { InitializeConfigArgsArgs } from '../../generated/initializer/index.js';\nimport { getInitializeConfigInstructionDataEncoder } from '../../generated/initializer/index.js';\n\ntype AddressOrSigner = Address | TransactionSigner;\n\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\nfunction createSignerAccountMeta(\n value: AddressOrSigner,\n role: typeof ACCOUNT_ROLE_WRITABLE_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return { address: value.address, role, signer: value };\n }\n return { address: value, role };\n}\n\nexport interface InitializeConfigAccounts {\n admin: AddressOrSigner;\n config: Address;\n programData: Address;\n systemProgram?: Address;\n}\n\nexport function createInitializeConfigInstruction(\n accounts: InitializeConfigAccounts,\n args: InitializeConfigArgsArgs,\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const {\n admin,\n config,\n programData,\n systemProgram = SYSTEM_PROGRAM_ID,\n } = accounts;\n\n const keys: (AccountMeta | AccountSignerMeta)[] = [\n createSignerAccountMeta(admin, ACCOUNT_ROLE_WRITABLE_SIGNER),\n { address: config, role: ACCOUNT_ROLE_WRITABLE },\n { address: programData, role: ACCOUNT_ROLE_READONLY },\n { address: systemProgram, role: ACCOUNT_ROLE_READONLY },\n ];\n\n const data = new Uint8Array(\n getInitializeConfigInstructionDataEncoder().encode(args),\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport type { TransactionSigner, AccountSignerMeta } from '@solana/kit';\nimport {\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_WRITABLE_SIGNER,\n} from '../../core/constants.js';\nimport { INITIALIZER_PROGRAM_ID } from '../constants.js';\nimport { getSetMigratorAllowlistInstructionDataEncoder } from '../../generated/initializer/index.js';\n\ntype AddressOrSigner = Address | TransactionSigner;\n\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\nfunction createSignerAccountMeta(\n value: AddressOrSigner,\n role: typeof ACCOUNT_ROLE_WRITABLE_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return { address: value.address, role, signer: value };\n }\n return { address: value, role };\n}\n\nexport interface SetMigratorAllowlistAccounts {\n admin: AddressOrSigner;\n config: Address;\n}\n\nexport function createSetMigratorAllowlistInstruction(\n accounts: SetMigratorAllowlistAccounts,\n allowlist: Address[],\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const { admin, config } = accounts;\n\n const keys: (AccountMeta | AccountSignerMeta)[] = [\n createSignerAccountMeta(admin, ACCOUNT_ROLE_WRITABLE_SIGNER),\n { address: config, role: ACCOUNT_ROLE_WRITABLE },\n ];\n\n const data = new Uint8Array(\n getSetMigratorAllowlistInstructionDataEncoder().encode({ allowlist }),\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport type { TransactionSigner, AccountSignerMeta } from '@solana/kit';\nimport {\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_WRITABLE_SIGNER,\n} from '../../core/constants.js';\nimport { INITIALIZER_PROGRAM_ID } from '../constants.js';\nimport { getSetSentinelAllowlistInstructionDataEncoder } from '../../generated/initializer/index.js';\n\ntype AddressOrSigner = Address | TransactionSigner;\n\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\nfunction createSignerAccountMeta(\n value: AddressOrSigner,\n role: typeof ACCOUNT_ROLE_WRITABLE_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return { address: value.address, role, signer: value };\n }\n return { address: value, role };\n}\n\nexport interface SetSentinelAllowlistAccounts {\n admin: AddressOrSigner;\n config: Address;\n}\n\nexport function createSetSentinelAllowlistInstruction(\n accounts: SetSentinelAllowlistAccounts,\n allowlist: Address[],\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const { admin, config } = accounts;\n\n const keys: (AccountMeta | AccountSignerMeta)[] = [\n createSignerAccountMeta(admin, ACCOUNT_ROLE_WRITABLE_SIGNER),\n { address: config, role: ACCOUNT_ROLE_WRITABLE },\n ];\n\n const data = new Uint8Array(\n getSetSentinelAllowlistInstructionDataEncoder().encode({ allowlist }),\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n","import { address, type Address } from '@solana/kit';\n\n// Source of truth: programs/cpmm_migrator/src/lib.rs\nexport const CPMM_MIGRATOR_PROGRAM_ID: Address = address(\n '7WMUTNC41eMCo6eGH5Sy2xbgE3AycvLbFPo95AU9CSUd',\n);\n\nexport const SEED_STATE = 'state';\n\n// Source of truth: programs/cpmm_migrator/src/constants.rs\nexport const MAX_RECIPIENTS = 2;\n\nexport const CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS = {\n // SHA256(\"global:register_launch\")[0:8]\n registerLaunch: new Uint8Array([\n 0x72, 0x72, 0x43, 0x17, 0x29, 0x46, 0x00, 0xe1,\n ]),\n // SHA256(\"global:migrate\")[0:8]\n migrate: new Uint8Array([0x9b, 0xea, 0xe7, 0x92, 0xec, 0x9e, 0xa2, 0x1e]),\n} as const;\n\nexport const CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS = {\n // SHA256(\"account:CpmmMigratorState\")[0:8]\n CpmmMigratorState: new Uint8Array([\n 0xa9, 0x56, 0xff, 0xbb, 0x25, 0xf8, 0x0b, 0xb0,\n ]),\n} as const;\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertIsInstructionWithAccounts,\n containsBytes,\n fixEncoderSize,\n getBytesEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,\n SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,\n SolanaError,\n type Address,\n type ClientWithPayer,\n type ClientWithRpc,\n type ClientWithTransactionPlanning,\n type ClientWithTransactionSending,\n type GetAccountInfoApi,\n type GetMultipleAccountsApi,\n type Instruction,\n type InstructionWithData,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n addSelfFetchFunctions,\n addSelfPlanAndSendFunctions,\n type SelfFetchFunctions,\n type SelfPlanAndSendFunctions,\n} from '@solana/program-client-core';\nimport {\n getClaimReceiptCodec,\n getEntryByMintCodec,\n getEntryCodec,\n getLaunchCodec,\n getMarketCodec,\n getOracleStateCodec,\n type ClaimReceipt,\n type ClaimReceiptArgs,\n type Entry,\n type EntryArgs,\n type EntryByMint,\n type EntryByMintArgs,\n type Launch,\n type LaunchArgs,\n type Market,\n type MarketArgs,\n type OracleState,\n type OracleStateArgs,\n} from '../accounts';\nimport {\n getClaimInstructionAsync,\n getMigrateEntryInstructionAsync,\n getPreviewPayoutIfWinnerInstruction,\n getRegisterEntryInstructionAsync,\n parseClaimInstruction,\n parseMigrateEntryInstruction,\n parsePreviewPayoutIfWinnerInstruction,\n parseRegisterEntryInstruction,\n type ClaimAsyncInput,\n type MigrateEntryAsyncInput,\n type ParsedClaimInstruction,\n type ParsedMigrateEntryInstruction,\n type ParsedPreviewPayoutIfWinnerInstruction,\n type ParsedRegisterEntryInstruction,\n type PreviewPayoutIfWinnerInput,\n type RegisterEntryAsyncInput,\n} from '../instructions';\n\nexport const PREDICTION_MIGRATOR_PROGRAM_ADDRESS =\n 'HYHdyy7QZg8Ucky9Z97xNtSCvrZxVNkeoney8xEPXjiZ' as Address<'HYHdyy7QZg8Ucky9Z97xNtSCvrZxVNkeoney8xEPXjiZ'>;\n\nexport enum PredictionMigratorAccount {\n ClaimReceipt,\n Entry,\n EntryByMint,\n Launch,\n Market,\n OracleState,\n}\n\nexport function identifyPredictionMigratorAccount(\n account: { data: ReadonlyUint8Array } | ReadonlyUint8Array,\n): PredictionMigratorAccount {\n const data = 'data' in account ? account.data : account;\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([223, 233, 11, 229, 124, 165, 207, 28]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorAccount.ClaimReceipt;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([63, 18, 152, 113, 215, 246, 221, 250]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorAccount.Entry;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([188, 191, 157, 194, 68, 82, 181, 126]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorAccount.EntryByMint;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([144, 51, 51, 163, 206, 85, 213, 38]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorAccount.Launch;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([219, 190, 213, 55, 0, 227, 198, 154]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorAccount.Market;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([97, 156, 157, 189, 194, 73, 8, 15]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorAccount.OracleState;\n }\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,\n { accountData: data, programName: 'predictionMigrator' },\n );\n}\n\nexport enum PredictionMigratorInstruction {\n Claim,\n MigrateEntry,\n PreviewPayoutIfWinner,\n RegisterEntry,\n}\n\nexport function identifyPredictionMigratorInstruction(\n instruction: { data: ReadonlyUint8Array } | ReadonlyUint8Array,\n): PredictionMigratorInstruction {\n const data = 'data' in instruction ? instruction.data : instruction;\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([62, 198, 214, 193, 213, 159, 108, 210]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorInstruction.Claim;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([239, 154, 55, 173, 110, 36, 188, 214]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorInstruction.MigrateEntry;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([228, 144, 72, 185, 234, 186, 183, 143]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorInstruction.PreviewPayoutIfWinner;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([198, 25, 1, 183, 73, 219, 215, 14]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorInstruction.RegisterEntry;\n }\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,\n { instructionData: data, programName: 'predictionMigrator' },\n );\n}\n\nexport type ParsedPredictionMigratorInstruction<\n TProgram extends string = 'HYHdyy7QZg8Ucky9Z97xNtSCvrZxVNkeoney8xEPXjiZ',\n> =\n | ({\n instructionType: PredictionMigratorInstruction.Claim;\n } & ParsedClaimInstruction<TProgram>)\n | ({\n instructionType: PredictionMigratorInstruction.MigrateEntry;\n } & ParsedMigrateEntryInstruction<TProgram>)\n | ({\n instructionType: PredictionMigratorInstruction.PreviewPayoutIfWinner;\n } & ParsedPreviewPayoutIfWinnerInstruction<TProgram>)\n | ({\n instructionType: PredictionMigratorInstruction.RegisterEntry;\n } & ParsedRegisterEntryInstruction<TProgram>);\n\nexport function parsePredictionMigratorInstruction<TProgram extends string>(\n instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>,\n): ParsedPredictionMigratorInstruction<TProgram> {\n const instructionType = identifyPredictionMigratorInstruction(instruction);\n switch (instructionType) {\n case PredictionMigratorInstruction.Claim: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: PredictionMigratorInstruction.Claim,\n ...parseClaimInstruction(instruction),\n };\n }\n case PredictionMigratorInstruction.MigrateEntry: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: PredictionMigratorInstruction.MigrateEntry,\n ...parseMigrateEntryInstruction(instruction),\n };\n }\n case PredictionMigratorInstruction.PreviewPayoutIfWinner: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: PredictionMigratorInstruction.PreviewPayoutIfWinner,\n ...parsePreviewPayoutIfWinnerInstruction(instruction),\n };\n }\n case PredictionMigratorInstruction.RegisterEntry: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: PredictionMigratorInstruction.RegisterEntry,\n ...parseRegisterEntryInstruction(instruction),\n };\n }\n default:\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,\n {\n instructionType: instructionType as string,\n programName: 'predictionMigrator',\n },\n );\n }\n}\n\nexport type PredictionMigratorPlugin = {\n accounts: PredictionMigratorPluginAccounts;\n instructions: PredictionMigratorPluginInstructions;\n};\n\nexport type PredictionMigratorPluginAccounts = {\n claimReceipt: ReturnType<typeof getClaimReceiptCodec> &\n SelfFetchFunctions<ClaimReceiptArgs, ClaimReceipt>;\n entry: ReturnType<typeof getEntryCodec> &\n SelfFetchFunctions<EntryArgs, Entry>;\n entryByMint: ReturnType<typeof getEntryByMintCodec> &\n SelfFetchFunctions<EntryByMintArgs, EntryByMint>;\n launch: ReturnType<typeof getLaunchCodec> &\n SelfFetchFunctions<LaunchArgs, Launch>;\n market: ReturnType<typeof getMarketCodec> &\n SelfFetchFunctions<MarketArgs, Market>;\n oracleState: ReturnType<typeof getOracleStateCodec> &\n SelfFetchFunctions<OracleStateArgs, OracleState>;\n};\n\nexport type PredictionMigratorPluginInstructions = {\n claim: (\n input: MakeOptional<ClaimAsyncInput, 'payer'>,\n ) => ReturnType<typeof getClaimInstructionAsync> & SelfPlanAndSendFunctions;\n migrateEntry: (\n input: MakeOptional<MigrateEntryAsyncInput, 'payer'>,\n ) => ReturnType<typeof getMigrateEntryInstructionAsync> &\n SelfPlanAndSendFunctions;\n previewPayoutIfWinner: (\n input: PreviewPayoutIfWinnerInput,\n ) => ReturnType<typeof getPreviewPayoutIfWinnerInstruction> &\n SelfPlanAndSendFunctions;\n registerEntry: (\n input: MakeOptional<RegisterEntryAsyncInput, 'payer'>,\n ) => ReturnType<typeof getRegisterEntryInstructionAsync> &\n SelfPlanAndSendFunctions;\n};\n\nexport type PredictionMigratorPluginRequirements = ClientWithRpc<\n GetAccountInfoApi & GetMultipleAccountsApi\n> &\n ClientWithPayer &\n ClientWithTransactionPlanning &\n ClientWithTransactionSending;\n\nexport function predictionMigratorProgram() {\n return <T extends PredictionMigratorPluginRequirements>(client: T) => {\n return {\n ...client,\n predictionMigrator: <PredictionMigratorPlugin>{\n accounts: {\n claimReceipt: addSelfFetchFunctions(client, getClaimReceiptCodec()),\n entry: addSelfFetchFunctions(client, getEntryCodec()),\n entryByMint: addSelfFetchFunctions(client, getEntryByMintCodec()),\n launch: addSelfFetchFunctions(client, getLaunchCodec()),\n market: addSelfFetchFunctions(client, getMarketCodec()),\n oracleState: addSelfFetchFunctions(client, getOracleStateCodec()),\n },\n instructions: {\n claim: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getClaimInstructionAsync({\n ...input,\n payer: input.payer ?? client.payer,\n }),\n ),\n migrateEntry: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getMigrateEntryInstructionAsync({\n ...input,\n payer: input.payer ?? client.payer,\n }),\n ),\n previewPayoutIfWinner: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getPreviewPayoutIfWinnerInstruction(input),\n ),\n registerEntry: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getRegisterEntryInstructionAsync({\n ...input,\n payer: input.payer ?? client.payer,\n }),\n ),\n },\n },\n };\n };\n}\n\ntype MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta, AccountLookupMeta } from '@solana/kit';\nimport type { TransactionSigner, AccountSignerMeta } from '@solana/kit';\nimport {\n AccountRole,\n getProgramDerivedAddress,\n getAddressEncoder,\n} from '@solana/kit';\nimport {\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_SIGNER,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_WRITABLE_SIGNER,\n SYSTEM_PROGRAM_ID,\n TOKEN_PROGRAM_ID,\n TOKEN_METADATA_PROGRAM_ID,\n} from '../../core/constants.js';\nimport {\n CURVE_KIND_XYK,\n CURVE_PARAMS_FORMAT_XYK_V0,\n INITIALIZER_PROGRAM_ID,\n} from '../constants.js';\nimport { CPMM_MIGRATOR_PROGRAM_ID } from '../../migrators/cpmmMigrator/constants.js';\nimport { PREDICTION_MIGRATOR_PROGRAM_ADDRESS } from '../../generated/predictionMigrator/programs/predictionMigrator.js';\nimport type { InitializeLaunchArgsArgs } from '../../generated/initializer/index.js';\nimport { getInitializeLaunchInstructionDataEncoder } from '../../generated/initializer/index.js';\n\ntype AddressOrSigner = Address | TransactionSigner;\n\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\nfunction createAccountMeta(\n value: AddressOrSigner,\n role:\n | typeof ACCOUNT_ROLE_READONLY\n | typeof ACCOUNT_ROLE_WRITABLE\n | typeof ACCOUNT_ROLE_SIGNER\n | typeof ACCOUNT_ROLE_WRITABLE_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return { address: value.address, role, signer: value };\n }\n return { address: value, role };\n}\n\n/**\n * Derive the Metaplex token metadata PDA for a given mint.\n * Seeds: [\"metadata\", TOKEN_METADATA_PROGRAM_ID, mint]\n *\n * Pass the result as `metadataAccount` in InitializeLaunchAccounts\n * whenever `metadataName` is non-empty.\n */\nexport async function getTokenMetadataAddress(mint: Address): Promise<Address> {\n const encoder = getAddressEncoder();\n const [metadataAddress] = await getProgramDerivedAddress({\n programAddress: TOKEN_METADATA_PROGRAM_ID,\n seeds: [\n new TextEncoder().encode('metadata'),\n encoder.encode(TOKEN_METADATA_PROGRAM_ID),\n encoder.encode(mint),\n ],\n });\n return metadataAddress;\n}\n\n/**\n * Known index of each static account in the Doppler devnet ALT\n * (7r5rdLkGMzTq5Q2kBhkePw4ZTeZEooHgTXktYoamNmVq).\n */\nconst ALT_INDEX: Record<string, number> = {\n [TOKEN_PROGRAM_ID]: 0,\n [SYSTEM_PROGRAM_ID]: 1,\n SysvarRent111111111111111111111111111111111: 2,\n [INITIALIZER_PROGRAM_ID]: 3,\n [TOKEN_METADATA_PROGRAM_ID]: 4,\n [CPMM_MIGRATOR_PROGRAM_ID]: 5,\n So11111111111111111111111111111111111111112: 6,\n // index 7 = config PDA — resolved at call time from accounts.config\n [PREDICTION_MIGRATOR_PROGRAM_ADDRESS]: 8,\n};\n\nexport interface InitializeLaunchAccounts {\n config: Address;\n launch: Address;\n launchAuthority: Address;\n baseMint: AddressOrSigner;\n quoteMint: Address;\n baseVault: AddressOrSigner;\n quoteVault: AddressOrSigner;\n payer: AddressOrSigner;\n authority?: AddressOrSigner;\n migratorProgram?: Address;\n tokenProgram?: Address;\n systemProgram?: Address;\n rent: Address;\n /** Required when args.metadataName is non-empty. Derive with getTokenMetadataAddress(baseMint). */\n metadataAccount?: Address;\n /**\n * Optional Address Lookup Table to reference for static accounts.\n * When provided, constant non-signer accounts (tokenProgram, systemProgram,\n * rent, migratorProgram, quoteMint when WSOL, metadataProgram, config) are\n * encoded as ALT lookup metas instead of 32-byte static keys, reducing\n * transaction size by ~200+ bytes and enabling V4 metadata within the\n * 1232-byte Solana transaction limit.\n *\n * Use DOPPLER_DEVNET_ALT for devnet.\n */\n addressLookupTable?: Address;\n}\n\nfunction validateInitializeLaunchCurveParams(\n args: InitializeLaunchArgsArgs,\n): void {\n if (args.curveKind !== CURVE_KIND_XYK) {\n throw new Error(\n `unsupported curve kind: ${args.curveKind}; only CURVE_KIND_XYK is currently enabled`,\n );\n }\n if (\n args.curveParams.length !== 1 ||\n args.curveParams[0] !== CURVE_PARAMS_FORMAT_XYK_V0\n ) {\n throw new Error('xyk curve params must be [CURVE_PARAMS_FORMAT_XYK_V0]');\n }\n}\n\nexport function createInitializeLaunchInstruction(\n accounts: InitializeLaunchAccounts,\n args: InitializeLaunchArgsArgs,\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n validateInitializeLaunchCurveParams(args);\n\n const {\n config,\n launch,\n launchAuthority,\n baseMint,\n quoteMint,\n baseVault,\n quoteVault,\n payer,\n authority,\n migratorProgram,\n tokenProgram = TOKEN_PROGRAM_ID,\n systemProgram = SYSTEM_PROGRAM_ID,\n rent,\n metadataAccount,\n addressLookupTable: alt,\n } = accounts;\n\n const withMetadata = Boolean(\n args.metadataName && args.metadataName.length > 0,\n );\n\n if (withMetadata && !metadataAccount) {\n throw new Error(\n 'metadataName is set but metadataAccount was not provided. ' +\n 'Derive it with await initializer.getTokenMetadataAddress(baseMintAddress).',\n );\n }\n\n // Build an ALT index map that also includes the config PDA at index 7.\n const altIndexMap: Record<string, number> = alt\n ? { ...ALT_INDEX, [config]: 7 }\n : {};\n\n function staticOrLookup(\n addr: Address,\n role: AccountRole.READONLY | AccountRole.WRITABLE,\n ): AccountMeta | AccountLookupMeta {\n if (alt && altIndexMap[addr] !== undefined) {\n return {\n address: addr,\n role,\n lookupTableAddress: alt,\n addressIndex: altIndexMap[addr]!,\n };\n }\n return { address: addr, role };\n }\n\n const keys: (AccountMeta | AccountSignerMeta | AccountLookupMeta)[] = [\n staticOrLookup(config, AccountRole.READONLY),\n { address: launch, role: ACCOUNT_ROLE_WRITABLE },\n { address: launchAuthority, role: ACCOUNT_ROLE_READONLY },\n createAccountMeta(baseMint, ACCOUNT_ROLE_WRITABLE_SIGNER),\n staticOrLookup(quoteMint, AccountRole.READONLY),\n createAccountMeta(baseVault, ACCOUNT_ROLE_WRITABLE_SIGNER),\n createAccountMeta(quoteVault, ACCOUNT_ROLE_WRITABLE_SIGNER),\n createAccountMeta(payer, ACCOUNT_ROLE_WRITABLE_SIGNER),\n ];\n\n if (authority) {\n keys.push(createAccountMeta(authority, ACCOUNT_ROLE_SIGNER));\n }\n if (migratorProgram) {\n keys.push(staticOrLookup(migratorProgram, AccountRole.READONLY));\n }\n\n keys.push(staticOrLookup(tokenProgram, AccountRole.READONLY));\n keys.push(staticOrLookup(systemProgram, AccountRole.READONLY));\n keys.push(staticOrLookup(rent, AccountRole.READONLY));\n\n if (withMetadata) {\n keys.push({ address: metadataAccount!, role: ACCOUNT_ROLE_WRITABLE });\n keys.push(staticOrLookup(TOKEN_METADATA_PROGRAM_ID, AccountRole.READONLY));\n }\n\n const data = new Uint8Array(\n getInitializeLaunchInstructionDataEncoder().encode(args),\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport type { TransactionSigner, AccountSignerMeta } from '@solana/kit';\nimport {\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_SIGNER,\n ACCOUNT_ROLE_WRITABLE,\n SYSTEM_PROGRAM_ID,\n TOKEN_PROGRAM_ID,\n} from '../../core/constants.js';\nimport { INITIALIZER_PROGRAM_ID } from '../constants.js';\nimport { getCurveSwapExactInInstructionDataEncoder } from '../../generated/initializer/index.js';\n\ntype AddressOrSigner = Address | TransactionSigner;\n\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\nfunction createAccountMeta(\n value: AddressOrSigner,\n role:\n | typeof ACCOUNT_ROLE_READONLY\n | typeof ACCOUNT_ROLE_WRITABLE\n | typeof ACCOUNT_ROLE_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return { address: value.address, role, signer: value };\n }\n return { address: value, role };\n}\n\nexport interface CurveSwapExactInAccounts {\n config: Address;\n launch: Address;\n launchAuthority: Address;\n baseVault: Address;\n quoteVault: Address;\n userBaseAccount: Address;\n userQuoteAccount: Address;\n baseMint: Address;\n quoteMint: Address;\n user: AddressOrSigner;\n /** Pass the actual sentinel program address, or omit to use System Program as a no-op placeholder. */\n sentinelProgram?: Address;\n tokenProgram?: Address;\n}\n\nexport function createCurveSwapExactInInstruction(\n accounts: CurveSwapExactInAccounts,\n args: { amountIn: bigint; minAmountOut: bigint; direction: number },\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const {\n config,\n launch,\n launchAuthority,\n baseVault,\n quoteVault,\n userBaseAccount,\n userQuoteAccount,\n baseMint,\n quoteMint,\n user,\n sentinelProgram = SYSTEM_PROGRAM_ID,\n tokenProgram = TOKEN_PROGRAM_ID,\n } = accounts;\n\n const keys: (AccountMeta | AccountSignerMeta)[] = [\n { address: config, role: ACCOUNT_ROLE_READONLY },\n { address: launch, role: ACCOUNT_ROLE_WRITABLE },\n { address: launchAuthority, role: ACCOUNT_ROLE_READONLY },\n { address: baseVault, role: ACCOUNT_ROLE_WRITABLE },\n { address: quoteVault, role: ACCOUNT_ROLE_WRITABLE },\n { address: userBaseAccount, role: ACCOUNT_ROLE_WRITABLE },\n { address: userQuoteAccount, role: ACCOUNT_ROLE_WRITABLE },\n { address: baseMint, role: ACCOUNT_ROLE_READONLY },\n { address: quoteMint, role: ACCOUNT_ROLE_READONLY },\n createAccountMeta(user, ACCOUNT_ROLE_SIGNER),\n // sentinel_program is Optional in the on-chain struct but still occupies a fixed\n // slot (token_program follows it). Always emit it — use SYSTEM_PROGRAM_ID as the\n // no-op placeholder when no real sentinel is configured.\n { address: sentinelProgram, role: ACCOUNT_ROLE_READONLY },\n { address: tokenProgram, role: ACCOUNT_ROLE_READONLY },\n ];\n\n const data = new Uint8Array(\n getCurveSwapExactInInstructionDataEncoder().encode(args),\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport type { TransactionSigner, AccountSignerMeta } from '@solana/kit';\nimport {\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_WRITABLE,\n ACCOUNT_ROLE_WRITABLE_SIGNER,\n SYSTEM_PROGRAM_ID,\n TOKEN_PROGRAM_ID,\n} from '../../core/constants.js';\nimport {\n INITIALIZER_INSTRUCTION_DISCRIMINATORS,\n INITIALIZER_PROGRAM_ID,\n} from '../constants.js';\nimport { encodeInstructionData } from '../../core/codecs.js';\n\ntype AddressOrSigner = Address | TransactionSigner;\n\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\nfunction createSignerAccountMeta(\n value: AddressOrSigner,\n role: typeof ACCOUNT_ROLE_WRITABLE_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return { address: value.address, role, signer: value };\n }\n return { address: value, role };\n}\n\nexport interface MigrateLaunchAccounts {\n config: Address;\n launch: Address;\n launchAuthority: Address;\n baseMint: Address;\n quoteMint: Address;\n baseVault: Address;\n quoteVault: Address;\n migratorProgram: Address;\n payer: AddressOrSigner;\n tokenProgram?: Address;\n systemProgram?: Address;\n rent: Address;\n}\n\nexport function createMigrateLaunchInstruction(\n accounts: MigrateLaunchAccounts,\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const {\n config,\n launch,\n launchAuthority,\n baseMint,\n quoteMint,\n baseVault,\n quoteVault,\n migratorProgram,\n payer,\n tokenProgram = TOKEN_PROGRAM_ID,\n systemProgram = SYSTEM_PROGRAM_ID,\n rent,\n } = accounts;\n\n const keys: (AccountMeta | AccountSignerMeta)[] = [\n { address: config, role: ACCOUNT_ROLE_READONLY },\n { address: launch, role: ACCOUNT_ROLE_WRITABLE },\n { address: launchAuthority, role: ACCOUNT_ROLE_READONLY },\n { address: baseMint, role: ACCOUNT_ROLE_READONLY },\n { address: quoteMint, role: ACCOUNT_ROLE_READONLY },\n { address: baseVault, role: ACCOUNT_ROLE_WRITABLE },\n { address: quoteVault, role: ACCOUNT_ROLE_WRITABLE },\n { address: migratorProgram, role: ACCOUNT_ROLE_READONLY },\n createSignerAccountMeta(payer, ACCOUNT_ROLE_WRITABLE_SIGNER),\n { address: tokenProgram, role: ACCOUNT_ROLE_READONLY },\n { address: systemProgram, role: ACCOUNT_ROLE_READONLY },\n { address: rent, role: ACCOUNT_ROLE_READONLY },\n ];\n\n const data = encodeInstructionData(\n INITIALIZER_INSTRUCTION_DISCRIMINATORS.migrateLaunch,\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction, AccountMeta } from '@solana/kit';\nimport type { TransactionSigner, AccountSignerMeta } from '@solana/kit';\nimport {\n ACCOUNT_ROLE_READONLY,\n ACCOUNT_ROLE_SIGNER,\n ACCOUNT_ROLE_WRITABLE,\n TOKEN_PROGRAM_ID,\n} from '../../core/constants.js';\nimport {\n INITIALIZER_INSTRUCTION_DISCRIMINATORS,\n INITIALIZER_PROGRAM_ID,\n} from '../constants.js';\nimport { encodeInstructionData } from '../../core/codecs.js';\n\ntype AddressOrSigner = Address | TransactionSigner;\n\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\nfunction createAccountMeta(\n value: AddressOrSigner,\n role:\n | typeof ACCOUNT_ROLE_READONLY\n | typeof ACCOUNT_ROLE_WRITABLE\n | typeof ACCOUNT_ROLE_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return { address: value.address, role, signer: value };\n }\n return { address: value, role };\n}\n\nexport interface AbortLaunchAccounts {\n config: Address;\n launch: Address;\n launchAuthority: Address;\n baseVault: Address;\n quoteVault: Address;\n authority: AddressOrSigner;\n authorityBaseAccount: Address;\n baseMint: Address;\n tokenProgram?: Address;\n}\n\nexport function createAbortLaunchInstruction(\n accounts: AbortLaunchAccounts,\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const {\n config,\n launch,\n launchAuthority,\n baseVault,\n quoteVault,\n authority,\n authorityBaseAccount,\n baseMint,\n tokenProgram = TOKEN_PROGRAM_ID,\n } = accounts;\n\n const keys: (AccountMeta | AccountSignerMeta)[] = [\n { address: config, role: ACCOUNT_ROLE_READONLY },\n { address: launch, role: ACCOUNT_ROLE_WRITABLE },\n { address: launchAuthority, role: ACCOUNT_ROLE_READONLY },\n { address: baseVault, role: ACCOUNT_ROLE_WRITABLE },\n { address: quoteVault, role: ACCOUNT_ROLE_READONLY },\n createAccountMeta(authority, ACCOUNT_ROLE_SIGNER),\n { address: authorityBaseAccount, role: ACCOUNT_ROLE_WRITABLE },\n { address: baseMint, role: ACCOUNT_ROLE_READONLY },\n { address: tokenProgram, role: ACCOUNT_ROLE_READONLY },\n ];\n\n const data = encodeInstructionData(\n INITIALIZER_INSTRUCTION_DISCRIMINATORS.abortLaunch,\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction } from '@solana/kit';\nimport { getStructCodec, getU64Codec } from '@solana/kit';\nimport { ACCOUNT_ROLE_READONLY } from '../../core/constants.js';\nimport { INITIALIZER_PROGRAM_ID } from '../constants.js';\nimport { getPreviewSwapExactInInstructionDataEncoder } from '../../generated/initializer/index.js';\n\nexport interface PreviewSwapExactInResult {\n amountOut: bigint;\n feePaid: bigint;\n}\n\nconst previewSwapExactInResultCodec = getStructCodec([\n ['amountOut', getU64Codec()],\n ['feePaid', getU64Codec()],\n]);\n\nexport interface PreviewSwapExactInAccounts {\n launch: Address;\n baseVault: Address;\n quoteVault: Address;\n sentinelProgram?: Address;\n}\n\nexport function createPreviewSwapExactInInstruction(\n accounts: PreviewSwapExactInAccounts,\n args: { amountIn: bigint; direction: number },\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const { launch, baseVault, quoteVault, sentinelProgram } = accounts;\n\n const keys = [\n { address: launch, role: ACCOUNT_ROLE_READONLY },\n { address: baseVault, role: ACCOUNT_ROLE_READONLY },\n { address: quoteVault, role: ACCOUNT_ROLE_READONLY },\n ] as const;\n\n const accountsList = sentinelProgram\n ? [...keys, { address: sentinelProgram, role: ACCOUNT_ROLE_READONLY }]\n : keys;\n\n const data = new Uint8Array(\n getPreviewSwapExactInInstructionDataEncoder().encode(args),\n );\n\n return { programAddress: programId, accounts: accountsList, data };\n}\n\nexport function decodePreviewSwapExactInResult(\n data: Uint8Array,\n): PreviewSwapExactInResult {\n return previewSwapExactInResultCodec.decode(data);\n}\n","import type { Address } from '@solana/kit';\nimport type { Instruction } from '@solana/kit';\nimport { getStructCodec, getU64Codec } from '@solana/kit';\nimport { ACCOUNT_ROLE_READONLY } from '../../core/constants.js';\nimport {\n INITIALIZER_INSTRUCTION_DISCRIMINATORS,\n INITIALIZER_PROGRAM_ID,\n} from '../constants.js';\nimport { encodeInstructionData } from '../../core/codecs.js';\n\nexport interface PreviewMigrationResult {\n baseVaultAmount: bigint;\n quoteVaultAmount: bigint;\n baseMintSupply: bigint;\n}\n\nconst previewMigrationResultCodec = getStructCodec([\n ['baseVaultAmount', getU64Codec()],\n ['quoteVaultAmount', getU64Codec()],\n ['baseMintSupply', getU64Codec()],\n]);\n\nexport interface PreviewMigrationAccounts {\n launch: Address;\n baseMint: Address;\n baseVault: Address;\n quoteVault: Address;\n}\n\nexport function createPreviewMigrationInstruction(\n accounts: PreviewMigrationAccounts,\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const { launch, baseMint, baseVault, quoteVault } = accounts;\n\n const keys = [\n { address: launch, role: ACCOUNT_ROLE_READONLY },\n { address: baseMint, role: ACCOUNT_ROLE_READONLY },\n { address: baseVault, role: ACCOUNT_ROLE_READONLY },\n { address: quoteVault, role: ACCOUNT_ROLE_READONLY },\n ];\n\n const data = encodeInstructionData(\n INITIALIZER_INSTRUCTION_DISCRIMINATORS.previewMigration,\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n\nexport function decodePreviewMigrationResult(\n data: Uint8Array,\n): PreviewMigrationResult {\n return previewMigrationResultCodec.decode(data);\n}\n","/**\n * Launch fetching functions for the Initializer SDK\n */\n\nimport { getAddressCodec, type Address } from '@solana/kit';\nimport type { ReadonlyUint8Array } from '@solana/kit';\nimport type { Rpc, GetAccountInfoApi } from '@solana/kit';\nimport type { GetProgramAccountsRpc } from '../../core/rpc.js';\nimport type { Base64EncodedBytes } from '@solana/kit';\nimport {\n getLaunchDecoder,\n type Launch,\n} from '../../generated/initializer/index.js';\nimport {\n INITIALIZER_PROGRAM_ID,\n INITIALIZER_ACCOUNT_DISCRIMINATORS,\n} from '../constants.js';\nimport { getLaunchAddress } from '../pda.js';\n\nconst addressCodec = getAddressCodec();\n\nfunction bytesToBase64(bytes: ReadonlyUint8Array): string {\n let binary = '';\n for (let i = 0; i < bytes.length; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\n\nfunction base64ToBytes(base64: string): Uint8Array {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n\nexport interface FetchLaunchesConfig {\n programId?: Address;\n commitment?: 'processed' | 'confirmed' | 'finalized';\n}\n\nexport interface LaunchWithAddress {\n address: Address;\n account: Launch;\n}\n\ntype ProgramAccount = Readonly<{\n pubkey: Address;\n account: Readonly<{ data: [string, 'base64'] }>;\n}>;\n\nexport async function fetchLaunch(\n rpc: Rpc<GetAccountInfoApi>,\n address: Address,\n config?: FetchLaunchesConfig,\n): Promise<Launch | null> {\n const response = await rpc\n .getAccountInfo(address, {\n encoding: 'base64',\n commitment: config?.commitment,\n })\n .send();\n\n if (!response.value) {\n return null;\n }\n\n return getLaunchDecoder().decode(base64ToBytes(response.value.data[0]));\n}\n\nexport async function fetchAllLaunches(\n rpc: GetProgramAccountsRpc,\n config?: FetchLaunchesConfig,\n): Promise<LaunchWithAddress[]> {\n const programId = config?.programId ?? INITIALIZER_PROGRAM_ID;\n\n const discriminatorFilter = {\n memcmp: {\n offset: 0n,\n bytes: bytesToBase64(\n INITIALIZER_ACCOUNT_DISCRIMINATORS.Launch,\n ) as Base64EncodedBytes,\n encoding: 'base64' as const,\n },\n };\n\n const response = (await rpc\n .getProgramAccounts(programId, {\n encoding: 'base64',\n commitment: config?.commitment,\n filters: [discriminatorFilter],\n })\n .send()) as unknown;\n\n const accounts = (\n Array.isArray(response)\n ? response\n : (response as { value: ProgramAccount[] }).value\n ) as ProgramAccount[];\n\n const launches: LaunchWithAddress[] = [];\n const decoder = getLaunchDecoder();\n\n for (const account of accounts) {\n try {\n const launch = decoder.decode(base64ToBytes(account.account.data[0]));\n launches.push({ address: account.pubkey, account: launch });\n } catch {\n console.warn(`Failed to decode launch account: ${account.pubkey}`);\n }\n }\n\n return launches;\n}\n\n/**\n * Fetch launches filtered by Launch.authority (offset 8).\n * Note: Permissionless launches have authority == Pubkey::default().\n */\nexport async function fetchLaunchesByAuthority(\n rpc: GetProgramAccountsRpc,\n authority: Address,\n config?: FetchLaunchesConfig,\n): Promise<LaunchWithAddress[]> {\n const programId = config?.programId ?? INITIALIZER_PROGRAM_ID;\n\n const discriminatorFilter = {\n memcmp: {\n offset: 0n,\n bytes: bytesToBase64(\n INITIALIZER_ACCOUNT_DISCRIMINATORS.Launch,\n ) as Base64EncodedBytes,\n encoding: 'base64' as const,\n },\n };\n\n const authorityFilter = {\n memcmp: {\n offset: 8n,\n bytes: bytesToBase64(\n addressCodec.encode(authority),\n ) as Base64EncodedBytes,\n encoding: 'base64' as const,\n },\n };\n\n const response = (await rpc\n .getProgramAccounts(programId, {\n encoding: 'base64',\n commitment: config?.commitment,\n filters: [discriminatorFilter, authorityFilter],\n })\n .send()) as unknown;\n\n const accounts = (\n Array.isArray(response)\n ? response\n : (response as { value: ProgramAccount[] }).value\n ) as ProgramAccount[];\n\n const launches: LaunchWithAddress[] = [];\n const decoder = getLaunchDecoder();\n\n for (const account of accounts) {\n try {\n const launch = decoder.decode(base64ToBytes(account.account.data[0]));\n launches.push({ address: account.pubkey, account: launch });\n } catch {\n console.warn(`Failed to decode launch account: ${account.pubkey}`);\n }\n }\n\n return launches;\n}\n\nexport async function launchExists(\n rpc: Rpc<GetAccountInfoApi>,\n namespace: Address,\n launchId: Uint8Array,\n config?: FetchLaunchesConfig,\n): Promise<boolean> {\n const programId = config?.programId ?? INITIALIZER_PROGRAM_ID;\n const [launchAddress] = await getLaunchAddress(\n namespace,\n launchId,\n programId,\n );\n const launch = await fetchLaunch(rpc, launchAddress, config);\n return launch !== null;\n}\n","import { mergeBytes } from '@solana/kit';\nimport {\n getRegisterLaunchArgsEncoder,\n getMigrateArgsEncoder,\n type RegisterLaunchArgsArgs,\n type MigrateArgsArgs,\n} from '../../generated/cpmmMigrator/index.js';\nimport { CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS } from './constants.js';\n\nexport {\n CPMM_MIGRATOR_PROGRAM_ID,\n SEED_STATE,\n MAX_RECIPIENTS,\n CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS,\n CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS,\n} from './constants.js';\n\nexport type {\n Recipient,\n RecipientArgs,\n RegisterLaunchArgs,\n RegisterLaunchArgsArgs,\n MigrateArgs,\n MigrateArgsArgs,\n CpmmMigratorState,\n CpmmMigratorStateArgs,\n} from '../../generated/cpmmMigrator/index.js';\n\nexport {\n getRecipientEncoder,\n getRecipientDecoder,\n getRecipientCodec,\n getRegisterLaunchArgsEncoder,\n getRegisterLaunchArgsDecoder,\n getRegisterLaunchArgsCodec,\n getMigrateArgsEncoder,\n getMigrateArgsDecoder,\n getMigrateArgsCodec,\n getCpmmMigratorStateEncoder,\n getCpmmMigratorStateDecoder,\n getCpmmMigratorStateCodec,\n} from '../../generated/cpmmMigrator/index.js';\n\nexport { getCpmmMigratorStateAddress } from './pda.js';\n\nexport { fetchCpmmMigratorState } from './client.js';\n\nexport function encodeRegisterLaunchCalldata(\n args: RegisterLaunchArgsArgs,\n): Uint8Array {\n const encoded = new Uint8Array(getRegisterLaunchArgsEncoder().encode(args));\n return mergeBytes([\n CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS.registerLaunch,\n encoded,\n ]);\n}\n\nexport function encodeMigrateCalldata(args: MigrateArgsArgs): Uint8Array {\n const encoded = new Uint8Array(getMigrateArgsEncoder().encode(args));\n return mergeBytes([\n CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS.migrate,\n encoded,\n ]);\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\n/**\n * Arguments for migrate instruction.\n * These are deserialized from the migrator_migrate_calldata passed by initializer.\n */\nexport type MigrateArgs = {\n /** Base tokens reserved for distribution to recipients */\n baseForDistribution: bigint;\n /** Base tokens reserved for CPMM liquidity */\n baseForLiquidity: bigint;\n};\n\nexport type MigrateArgsArgs = {\n /** Base tokens reserved for distribution to recipients */\n baseForDistribution: number | bigint;\n /** Base tokens reserved for CPMM liquidity */\n baseForLiquidity: number | bigint;\n};\n\nexport function getMigrateArgsEncoder(): FixedSizeEncoder<MigrateArgsArgs> {\n return getStructEncoder([\n ['baseForDistribution', getU64Encoder()],\n ['baseForLiquidity', getU64Encoder()],\n ]);\n}\n\nexport function getMigrateArgsDecoder(): FixedSizeDecoder<MigrateArgs> {\n return getStructDecoder([\n ['baseForDistribution', getU64Decoder()],\n ['baseForLiquidity', getU64Decoder()],\n ]);\n}\n\nexport function getMigrateArgsCodec(): FixedSizeCodec<\n MigrateArgsArgs,\n MigrateArgs\n> {\n return combineCodec(getMigrateArgsEncoder(), getMigrateArgsDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type Recipient = { wallet: Address; amount: bigint };\n\nexport type RecipientArgs = { wallet: Address; amount: number | bigint };\n\nexport function getRecipientEncoder(): FixedSizeEncoder<RecipientArgs> {\n return getStructEncoder([\n ['wallet', getAddressEncoder()],\n ['amount', getU64Encoder()],\n ]);\n}\n\nexport function getRecipientDecoder(): FixedSizeDecoder<Recipient> {\n return getStructDecoder([\n ['wallet', getAddressDecoder()],\n ['amount', getU64Decoder()],\n ]);\n}\n\nexport function getRecipientCodec(): FixedSizeCodec<RecipientArgs, Recipient> {\n return combineCodec(getRecipientEncoder(), getRecipientDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getOptionDecoder,\n getOptionEncoder,\n getStructDecoder,\n getStructEncoder,\n getU128Decoder,\n getU128Encoder,\n getU16Decoder,\n getU16Encoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Option,\n type OptionOrNullable,\n} from '@solana/kit';\nimport {\n getRecipientDecoder,\n getRecipientEncoder,\n type Recipient,\n type RecipientArgs,\n} from '.';\n\n/**\n * Arguments for register_launch instruction.\n * These are deserialized from the migrator_init_calldata passed by initializer.\n */\nexport type RegisterLaunchArgs = {\n cpmmConfig: Address;\n initialSwapFeeBps: number;\n initialFeeSplitBps: number;\n recipients: Array<Recipient>;\n minRaiseQuote: bigint;\n minMigrationPriceQ64Opt: Option<bigint>;\n};\n\nexport type RegisterLaunchArgsArgs = {\n cpmmConfig: Address;\n initialSwapFeeBps: number;\n initialFeeSplitBps: number;\n recipients: Array<RecipientArgs>;\n minRaiseQuote: number | bigint;\n minMigrationPriceQ64Opt: OptionOrNullable<number | bigint>;\n};\n\nexport function getRegisterLaunchArgsEncoder(): Encoder<RegisterLaunchArgsArgs> {\n return getStructEncoder([\n ['cpmmConfig', getAddressEncoder()],\n ['initialSwapFeeBps', getU16Encoder()],\n ['initialFeeSplitBps', getU16Encoder()],\n ['recipients', getArrayEncoder(getRecipientEncoder())],\n ['minRaiseQuote', getU64Encoder()],\n ['minMigrationPriceQ64Opt', getOptionEncoder(getU128Encoder())],\n ]);\n}\n\nexport function getRegisterLaunchArgsDecoder(): Decoder<RegisterLaunchArgs> {\n return getStructDecoder([\n ['cpmmConfig', getAddressDecoder()],\n ['initialSwapFeeBps', getU16Decoder()],\n ['initialFeeSplitBps', getU16Decoder()],\n ['recipients', getArrayDecoder(getRecipientDecoder())],\n ['minRaiseQuote', getU64Decoder()],\n ['minMigrationPriceQ64Opt', getOptionDecoder(getU128Decoder())],\n ]);\n}\n\nexport function getRegisterLaunchArgsCodec(): Codec<\n RegisterLaunchArgsArgs,\n RegisterLaunchArgs\n> {\n return combineCodec(\n getRegisterLaunchArgsEncoder(),\n getRegisterLaunchArgsDecoder(),\n );\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBooleanDecoder,\n getBooleanEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getOptionDecoder,\n getOptionEncoder,\n getStructDecoder,\n getStructEncoder,\n getU128Decoder,\n getU128Encoder,\n getU16Decoder,\n getU16Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type Codec,\n type Decoder,\n type EncodedAccount,\n type Encoder,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type Option,\n type OptionOrNullable,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n getRecipientDecoder,\n getRecipientEncoder,\n type Recipient,\n type RecipientArgs,\n} from '../types';\n\nexport const CPMM_MIGRATOR_STATE_DISCRIMINATOR = new Uint8Array([\n 169, 86, 255, 187, 37, 248, 11, 176,\n]);\n\nexport function getCpmmMigratorStateDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CPMM_MIGRATOR_STATE_DISCRIMINATOR,\n );\n}\n\nexport type CpmmMigratorState = {\n discriminator: ReadonlyUint8Array;\n /** The launch this state is associated with */\n launch: Address;\n /** Admin who registered this launch (receives unsold curve base tokens) */\n admin: Address;\n /** CPMM config to use for pool initialization */\n cpmmConfig: Address;\n /** Initial swap fee for the CPMM pool (basis points) */\n initialSwapFeeBps: number;\n /** Initial fee split for the CPMM pool (basis points) */\n initialFeeSplitBps: number;\n /** Padding for alignment */\n pad0: ReadonlyUint8Array;\n /** Recipients for base token distribution at migration */\n recipients: Array<Recipient>;\n /** Minimum quote tokens required to migrate */\n minRaiseQuote: bigint;\n /** Optional minimum price floor (Q64 fixed point) */\n minMigrationPriceQ64Opt: Option<bigint>;\n /** Whether this launch has been migrated */\n isMigrated: boolean;\n /** Bump seed for this PDA */\n bump: number;\n /** Reserved for future use */\n reserved: ReadonlyUint8Array;\n};\n\nexport type CpmmMigratorStateArgs = {\n /** The launch this state is associated with */\n launch: Address;\n /** Admin who registered this launch (receives unsold curve base tokens) */\n admin: Address;\n /** CPMM config to use for pool initialization */\n cpmmConfig: Address;\n /** Initial swap fee for the CPMM pool (basis points) */\n initialSwapFeeBps: number;\n /** Initial fee split for the CPMM pool (basis points) */\n initialFeeSplitBps: number;\n /** Padding for alignment */\n pad0: ReadonlyUint8Array;\n /** Recipients for base token distribution at migration */\n recipients: Array<RecipientArgs>;\n /** Minimum quote tokens required to migrate */\n minRaiseQuote: number | bigint;\n /** Optional minimum price floor (Q64 fixed point) */\n minMigrationPriceQ64Opt: OptionOrNullable<number | bigint>;\n /** Whether this launch has been migrated */\n isMigrated: boolean;\n /** Bump seed for this PDA */\n bump: number;\n /** Reserved for future use */\n reserved: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link CpmmMigratorStateArgs} account data. */\nexport function getCpmmMigratorStateEncoder(): Encoder<CpmmMigratorStateArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['launch', getAddressEncoder()],\n ['admin', getAddressEncoder()],\n ['cpmmConfig', getAddressEncoder()],\n ['initialSwapFeeBps', getU16Encoder()],\n ['initialFeeSplitBps', getU16Encoder()],\n ['pad0', fixEncoderSize(getBytesEncoder(), 4)],\n ['recipients', getArrayEncoder(getRecipientEncoder(), { size: 2 })],\n ['minRaiseQuote', getU64Encoder()],\n ['minMigrationPriceQ64Opt', getOptionEncoder(getU128Encoder())],\n ['isMigrated', getBooleanEncoder()],\n ['bump', getU8Encoder()],\n ['reserved', fixEncoderSize(getBytesEncoder(), 14)],\n ]),\n (value) => ({ ...value, discriminator: CPMM_MIGRATOR_STATE_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link CpmmMigratorState} account data. */\nexport function getCpmmMigratorStateDecoder(): Decoder<CpmmMigratorState> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['launch', getAddressDecoder()],\n ['admin', getAddressDecoder()],\n ['cpmmConfig', getAddressDecoder()],\n ['initialSwapFeeBps', getU16Decoder()],\n ['initialFeeSplitBps', getU16Decoder()],\n ['pad0', fixDecoderSize(getBytesDecoder(), 4)],\n ['recipients', getArrayDecoder(getRecipientDecoder(), { size: 2 })],\n ['minRaiseQuote', getU64Decoder()],\n ['minMigrationPriceQ64Opt', getOptionDecoder(getU128Decoder())],\n ['isMigrated', getBooleanDecoder()],\n ['bump', getU8Decoder()],\n ['reserved', fixDecoderSize(getBytesDecoder(), 14)],\n ]);\n}\n\n/** Gets the codec for {@link CpmmMigratorState} account data. */\nexport function getCpmmMigratorStateCodec(): Codec<\n CpmmMigratorStateArgs,\n CpmmMigratorState\n> {\n return combineCodec(\n getCpmmMigratorStateEncoder(),\n getCpmmMigratorStateDecoder(),\n );\n}\n\nexport function decodeCpmmMigratorState<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<CpmmMigratorState, TAddress>;\nexport function decodeCpmmMigratorState<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<CpmmMigratorState, TAddress>;\nexport function decodeCpmmMigratorState<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n):\n | Account<CpmmMigratorState, TAddress>\n | MaybeAccount<CpmmMigratorState, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getCpmmMigratorStateDecoder(),\n );\n}\n\nexport async function fetchCpmmMigratorState<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<CpmmMigratorState, TAddress>> {\n const maybeAccount = await fetchMaybeCpmmMigratorState(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeCpmmMigratorState<\n TAddress extends string = string,\n>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<CpmmMigratorState, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeCpmmMigratorState(maybeAccount);\n}\n\nexport async function fetchAllCpmmMigratorState(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<CpmmMigratorState>[]> {\n const maybeAccounts = await fetchAllMaybeCpmmMigratorState(\n rpc,\n addresses,\n config,\n );\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeCpmmMigratorState(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<CpmmMigratorState>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) =>\n decodeCpmmMigratorState(maybeAccount),\n );\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n isProgramError,\n type Address,\n type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM,\n type SolanaError,\n} from '@solana/kit';\nimport { CPMM_MIGRATOR_PROGRAM_ADDRESS } from '../programs';\n\n/** Unauthorized: Unauthorized */\nexport const CPMM_MIGRATOR_ERROR__UNAUTHORIZED = 0x1770; // 6000\n/** InvalidPhase: Invalid phase */\nexport const CPMM_MIGRATOR_ERROR__INVALID_PHASE = 0x1771; // 6001\n/** InvalidAmount: Invalid amount */\nexport const CPMM_MIGRATOR_ERROR__INVALID_AMOUNT = 0x1772; // 6002\n/** InvalidVault: Invalid vault */\nexport const CPMM_MIGRATOR_ERROR__INVALID_VAULT = 0x1773; // 6003\n/** InvalidMint: Invalid mint */\nexport const CPMM_MIGRATOR_ERROR__INVALID_MINT = 0x1774; // 6004\n/** MathOverflow: Math overflow */\nexport const CPMM_MIGRATOR_ERROR__MATH_OVERFLOW = 0x1775; // 6005\n/** InvalidConfig: Invalid config */\nexport const CPMM_MIGRATOR_ERROR__INVALID_CONFIG = 0x1776; // 6006\n/** MinRaiseNotMet: Minimum raise not met */\nexport const CPMM_MIGRATOR_ERROR__MIN_RAISE_NOT_MET = 0x1777; // 6007\n/** PriceFloorNotMet: Price floor not met */\nexport const CPMM_MIGRATOR_ERROR__PRICE_FLOOR_NOT_MET = 0x1778; // 6008\n/** MissingRecipientAccount: Missing recipient account */\nexport const CPMM_MIGRATOR_ERROR__MISSING_RECIPIENT_ACCOUNT = 0x1779; // 6009\n/** InvalidRecipientAccount: Invalid recipient account */\nexport const CPMM_MIGRATOR_ERROR__INVALID_RECIPIENT_ACCOUNT = 0x177a; // 6010\n/** ExtraRecipientAccounts: Extra recipient accounts */\nexport const CPMM_MIGRATOR_ERROR__EXTRA_RECIPIENT_ACCOUNTS = 0x177b; // 6011\n/** PoolAlreadyInitialized: Pool already initialized */\nexport const CPMM_MIGRATOR_ERROR__POOL_ALREADY_INITIALIZED = 0x177c; // 6012\n/** PositionAlreadyInitialized: Position already initialized */\nexport const CPMM_MIGRATOR_ERROR__POSITION_ALREADY_INITIALIZED = 0x177d; // 6013\n/** AlreadyMigrated: Already migrated */\nexport const CPMM_MIGRATOR_ERROR__ALREADY_MIGRATED = 0x177e; // 6014\n/** TooManyRecipients: Too many recipients */\nexport const CPMM_MIGRATOR_ERROR__TOO_MANY_RECIPIENTS = 0x177f; // 6015\n/** InvalidRecipient: Invalid recipient */\nexport const CPMM_MIGRATOR_ERROR__INVALID_RECIPIENT = 0x1780; // 6016\n/** InvalidLaunch: Invalid launch */\nexport const CPMM_MIGRATOR_ERROR__INVALID_LAUNCH = 0x1781; // 6017\n/** LaunchConfigMismatch: Launch configuration mismatch */\nexport const CPMM_MIGRATOR_ERROR__LAUNCH_CONFIG_MISMATCH = 0x1782; // 6018\n\nexport type CpmmMigratorError =\n | typeof CPMM_MIGRATOR_ERROR__ALREADY_MIGRATED\n | typeof CPMM_MIGRATOR_ERROR__EXTRA_RECIPIENT_ACCOUNTS\n | typeof CPMM_MIGRATOR_ERROR__INVALID_AMOUNT\n | typeof CPMM_MIGRATOR_ERROR__INVALID_CONFIG\n | typeof CPMM_MIGRATOR_ERROR__INVALID_LAUNCH\n | typeof CPMM_MIGRATOR_ERROR__INVALID_MINT\n | typeof CPMM_MIGRATOR_ERROR__INVALID_PHASE\n | typeof CPMM_MIGRATOR_ERROR__INVALID_RECIPIENT\n | typeof CPMM_MIGRATOR_ERROR__INVALID_RECIPIENT_ACCOUNT\n | typeof CPMM_MIGRATOR_ERROR__INVALID_VAULT\n | typeof CPMM_MIGRATOR_ERROR__LAUNCH_CONFIG_MISMATCH\n | typeof CPMM_MIGRATOR_ERROR__MATH_OVERFLOW\n | typeof CPMM_MIGRATOR_ERROR__MIN_RAISE_NOT_MET\n | typeof CPMM_MIGRATOR_ERROR__MISSING_RECIPIENT_ACCOUNT\n | typeof CPMM_MIGRATOR_ERROR__POOL_ALREADY_INITIALIZED\n | typeof CPMM_MIGRATOR_ERROR__POSITION_ALREADY_INITIALIZED\n | typeof CPMM_MIGRATOR_ERROR__PRICE_FLOOR_NOT_MET\n | typeof CPMM_MIGRATOR_ERROR__TOO_MANY_RECIPIENTS\n | typeof CPMM_MIGRATOR_ERROR__UNAUTHORIZED;\n\nlet cpmmMigratorErrorMessages: Record<CpmmMigratorError, string> | undefined;\nif (process.env.NODE_ENV !== 'production') {\n cpmmMigratorErrorMessages = {\n [CPMM_MIGRATOR_ERROR__ALREADY_MIGRATED]: `Already migrated`,\n [CPMM_MIGRATOR_ERROR__EXTRA_RECIPIENT_ACCOUNTS]: `Extra recipient accounts`,\n [CPMM_MIGRATOR_ERROR__INVALID_AMOUNT]: `Invalid amount`,\n [CPMM_MIGRATOR_ERROR__INVALID_CONFIG]: `Invalid config`,\n [CPMM_MIGRATOR_ERROR__INVALID_LAUNCH]: `Invalid launch`,\n [CPMM_MIGRATOR_ERROR__INVALID_MINT]: `Invalid mint`,\n [CPMM_MIGRATOR_ERROR__INVALID_PHASE]: `Invalid phase`,\n [CPMM_MIGRATOR_ERROR__INVALID_RECIPIENT]: `Invalid recipient`,\n [CPMM_MIGRATOR_ERROR__INVALID_RECIPIENT_ACCOUNT]: `Invalid recipient account`,\n [CPMM_MIGRATOR_ERROR__INVALID_VAULT]: `Invalid vault`,\n [CPMM_MIGRATOR_ERROR__LAUNCH_CONFIG_MISMATCH]: `Launch configuration mismatch`,\n [CPMM_MIGRATOR_ERROR__MATH_OVERFLOW]: `Math overflow`,\n [CPMM_MIGRATOR_ERROR__MIN_RAISE_NOT_MET]: `Minimum raise not met`,\n [CPMM_MIGRATOR_ERROR__MISSING_RECIPIENT_ACCOUNT]: `Missing recipient account`,\n [CPMM_MIGRATOR_ERROR__POOL_ALREADY_INITIALIZED]: `Pool already initialized`,\n [CPMM_MIGRATOR_ERROR__POSITION_ALREADY_INITIALIZED]: `Position already initialized`,\n [CPMM_MIGRATOR_ERROR__PRICE_FLOOR_NOT_MET]: `Price floor not met`,\n [CPMM_MIGRATOR_ERROR__TOO_MANY_RECIPIENTS]: `Too many recipients`,\n [CPMM_MIGRATOR_ERROR__UNAUTHORIZED]: `Unauthorized`,\n };\n}\n\nexport function getCpmmMigratorErrorMessage(code: CpmmMigratorError): string {\n if (process.env.NODE_ENV !== 'production') {\n return (cpmmMigratorErrorMessages as Record<CpmmMigratorError, string>)[\n code\n ];\n }\n\n return 'Error message not available in production bundles.';\n}\n\nexport function isCpmmMigratorError<\n TProgramErrorCode extends CpmmMigratorError,\n>(\n error: unknown,\n transactionMessage: {\n instructions: Record<number, { programAddress: Address }>;\n },\n code?: TProgramErrorCode,\n): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> &\n Readonly<{ context: Readonly<{ code: TProgramErrorCode }> }> {\n return isProgramError<TProgramErrorCode>(\n error,\n transactionMessage,\n CPMM_MIGRATOR_PROGRAM_ADDRESS,\n code,\n );\n}\n","import {\n type Address,\n type ProgramDerivedAddress,\n getAddressCodec,\n getProgramDerivedAddress,\n} from '@solana/kit';\nimport { CPMM_MIGRATOR_PROGRAM_ID, SEED_STATE } from './constants.js';\n\nconst addressCodec = getAddressCodec();\nconst textEncoder = new TextEncoder();\n\nexport async function getCpmmMigratorStateAddress(\n launch: Address,\n programId: Address = CPMM_MIGRATOR_PROGRAM_ID,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: programId,\n seeds: [textEncoder.encode(SEED_STATE), addressCodec.encode(launch)],\n });\n}\n","import type { Address } from '@solana/kit';\nimport type { Rpc, GetAccountInfoApi } from '@solana/kit';\nimport {\n getCpmmMigratorStateDecoder,\n type CpmmMigratorState,\n} from '../../generated/cpmmMigrator/index.js';\n\nfunction base64ToBytes(base64: string): Uint8Array {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n\nexport async function fetchCpmmMigratorState(\n rpc: Rpc<GetAccountInfoApi>,\n address: Address,\n): Promise<CpmmMigratorState | null> {\n const response = await rpc\n .getAccountInfo(address, { encoding: 'base64' })\n .send();\n if (!response.value) return null;\n return getCpmmMigratorStateDecoder().decode(\n base64ToBytes(response.value.data[0]),\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/solana/cpmm/index.ts","../../src/solana/core/tokenMetadata.ts","../../src/solana/core/marketCapHelpers.ts","../../src/solana/core/errors.ts","../../src/solana/instructions/initializeConfig.ts","../../src/solana/instructions/initializePool.ts","../../src/solana/instructions/initializeOracle.ts","../../src/solana/instructions/setFees.ts","../../src/solana/instructions/setSentinel.ts","../../src/solana/instructions/setRoute.ts","../../src/solana/instructions/pause.ts","../../src/solana/instructions/unpause.ts","../../src/solana/instructions/transferAdmin.ts","../../src/solana/instructions/skim.ts","../../src/solana/instructions/swapExactIn.ts","../../src/solana/instructions/createPosition.ts","../../src/solana/instructions/closePosition.ts","../../src/solana/instructions/addLiquidity.ts","../../src/solana/instructions/removeLiquidity.ts","../../src/solana/instructions/collectProtocolFees.ts","../../src/solana/instructions/oracleUpdate.ts","../../src/solana/instructions/oracleConsult.ts","../../src/solana/instructions/quoteToNumeraire.ts","../../src/solana/client/config.ts","../../src/solana/initializer/index.ts","../../src/solana/initializer/constants.ts","../../src/solana/generated/initializer/accounts/initConfig.ts","../../src/solana/generated/initializer/types/calldataBuf.ts","../../src/solana/generated/initializer/types/initializeConfigArgs.ts","../../src/solana/generated/initializer/types/initializeLaunchArgs.ts","../../src/solana/generated/initializer/accounts/launch.ts","../../src/solana/generated/initializer/instructions/curveSwapExactIn.ts","../../src/solana/generated/initializer/instructions/initializeConfig.ts","../../src/solana/generated/initializer/instructions/initializeLaunch.ts","../../src/solana/generated/initializer/instructions/previewSwapExactIn.ts","../../src/solana/generated/initializer/instructions/setMigratorAllowlist.ts","../../src/solana/generated/initializer/instructions/setSentinelAllowlist.ts","../../src/solana/generated/initializer/errors/initializer.ts","../../src/solana/initializer/pda.ts","../../src/solana/initializer/instructions/initializeConfig.ts","../../src/solana/initializer/instructions/setMigratorAllowlist.ts","../../src/solana/initializer/instructions/setSentinelAllowlist.ts","../../src/solana/migrators/cpmmMigrator/constants.ts","../../src/solana/migrators/cpmmMigrator/pda.ts","../../src/solana/generated/predictionMigrator/accounts/claimReceipt.ts","../../src/solana/generated/predictionMigrator/accounts/entry.ts","../../src/solana/generated/predictionMigrator/accounts/entryByMint.ts","../../src/solana/generated/predictionMigrator/types/accumulatorUpdated.ts","../../src/solana/generated/predictionMigrator/types/calldataBuf.ts","../../src/solana/generated/predictionMigrator/types/entryMigrated.ts","../../src/solana/generated/predictionMigrator/types/entryRegistered.ts","../../src/solana/generated/predictionMigrator/types/marketCreated.ts","../../src/solana/generated/predictionMigrator/types/marketResolved.ts","../../src/solana/generated/predictionMigrator/types/migrateEntryArgs.ts","../../src/solana/generated/predictionMigrator/types/previewPayoutIfWinnerArgs.ts","../../src/solana/generated/predictionMigrator/types/registerEntryArgs.ts","../../src/solana/generated/predictionMigrator/types/rewardsClaimed.ts","../../src/solana/generated/predictionMigrator/accounts/launch.ts","../../src/solana/generated/predictionMigrator/accounts/market.ts","../../src/solana/generated/predictionMigrator/accounts/oracleState.ts","../../src/solana/generated/predictionMigrator/instructions/claim.ts","../../src/solana/generated/predictionMigrator/instructions/migrateEntry.ts","../../src/solana/generated/predictionMigrator/instructions/previewPayoutIfWinner.ts","../../src/solana/generated/predictionMigrator/instructions/registerEntry.ts","../../src/solana/generated/predictionMigrator/programs/predictionMigrator.ts","../../src/solana/migrators/predictionMigrator/pda.ts","../../src/solana/initializer/instructions/initializeLaunch.ts","../../src/solana/initializer/instructions/curveSwapExactIn.ts","../../src/solana/initializer/instructions/migrateLaunch.ts","../../src/solana/initializer/instructions/abortLaunch.ts","../../src/solana/initializer/instructions/previewSwapExactIn.ts","../../src/solana/initializer/instructions/previewMigration.ts","../../src/solana/initializer/helpers.ts","../../src/solana/initializer/client/launch.ts","../../src/solana/migrators/cpmmMigrator/index.ts","../../src/solana/generated/cpmmMigrator/types/migrateArgs.ts","../../src/solana/generated/cpmmMigrator/types/recipient.ts","../../src/solana/generated/cpmmMigrator/types/registerLaunchArgs.ts","../../src/solana/generated/cpmmMigrator/accounts/cpmmMigratorState.ts","../../src/solana/generated/cpmmMigrator/errors/cpmmMigrator.ts","../../src/solana/migrators/cpmmMigrator/client.ts","../../src/solana/migrators/predictionMigrator/index.ts","../../src/solana/generated/predictionMigrator/errors/predictionMigrator.ts","../../src/solana/trustedOracle/index.ts","../../src/solana/generated/trustedOracle/accounts/oracleState.ts","../../src/solana/generated/trustedOracle/instructions/finalize.ts","../../src/solana/generated/trustedOracle/instructions/initializeOracle.ts","../../src/solana/generated/trustedOracle/programs/trustedOracle.ts","../../src/solana/generated/trustedOracle/errors/trustedOracle.ts","../../src/solana/generated/trustedOracle/types/initializeOracleArgs.ts","../../src/solana/trustedOracle/pda.ts"],"names":["CpmmErrorCode","AccountRole","getStructCodec","getU128Codec","getAddressCodec","MAX_SENTINEL_ALLOWLIST","SEED_CONFIG","SENTINEL_NO_CHANGE","SF_AFTER_SWAP","SF_BEFORE_SWAP","createInitializeConfigInstruction","fetchLaunch","getConfigAddress","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getArrayEncoder","getAddressEncoder","getArrayDecoder","getAddressDecoder","combineCodec","getU8Encoder","getU64Encoder","getU16Encoder","getU8Decoder","getU64Decoder","getU16Decoder","transformEncoder","getU32Encoder","getU32Decoder","addEncoderSizePrefix","getUtf8Encoder","addressCodec","textEncoder","getProgramDerivedAddress","isTransactionSigner","createSignerAccountMeta","address","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountsExist","fetchEncodedAccounts","getU128Encoder","getU128Decoder","getCalldataBufEncoder","getCalldataBufDecoder","getBooleanEncoder","getBooleanDecoder","LAUNCH_DISCRIMINATOR","getLaunchEncoder","getLaunchDecoder","getLaunchCodec","decodeOracleState","getAddressFromResolvedInstructionAccount","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","PredictionMigratorAccount","containsBytes","SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT","PredictionMigratorInstruction","SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION","assertIsInstructionWithAccounts","SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE","addSelfFetchFunctions","addSelfPlanAndSendFunctions","createAccountMeta","getU64Codec","base64ToBytes","getOptionEncoder","getOptionDecoder","isProgramError","ORACLE_STATE_DISCRIMINATOR","fetchAllMaybeOracleState","fetchAllOracleState","fetchMaybeOracleState","fetchOracleState","getOracleStateCodec","getOracleStateDecoder","getOracleStateDiscriminatorBytes","getOracleStateEncoder","getOracleStateSize","TrustedOracleAccount","TrustedOracleInstruction"],"mappings":";;;;;;;;AAAA,IAAA,YAAA,GAAA;AAAA,QAAA,CAAA,YAAA,EAAA;AAAA,EAAA,sBAAA,EAAA,MAAA,sBAAA;AAAA,EAAA,eAAA,EAAA,MAAA,eAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,mBAAA,EAAA,MAAA,mBAAA;AAAA,EAAA,eAAA,EAAA,MAAA,eAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,0BAAA,EAAA,MAAA,0BAAA;AAAA,EAAA,cAAA,EAAA,MAAA,cAAA;AAAA,EAAA,uBAAA,EAAA,MAAA,uBAAA;AAAA,EAAA,sBAAA,EAAA,MAAA,sBAAA;AAAA,EAAA,OAAA,EAAA,MAAA,OAAA;AAAA,EAAA,cAAA,EAAA,MAAA,cAAA;AAAA,EAAA,WAAA,EAAA,MAAA,WAAA;AAAA,EAAA,WAAA,EAAA,MAAA,WAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,sBAAA,EAAA,MAAA,sBAAA;AAAA,EAAA,kBAAA,EAA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,GAGd;AACA,EAAA,OAAOC,YAAAA;AAAA,IACL,8BAAA,EAA+B;AAAA,IAC/B,8BAAA;AAA+B,GACjC;AACF;AC3CA,eAAsB,qBAAA,CACpB,iBACA,KAAA,EACgC;AAChC,EAAA,MAAM,UAAA,GAAa,IAAI,UAAA,CAAW,CAAC,CAAA;AACnC,EAAA,IAAI,SAAS,UAAA,CAAW,MAAM,EAAE,YAAA,CAAa,CAAA,EAAG,OAAO,IAAI,CAAA;AAE3D,EAAA,OAAOc,wBAAAA,CAAyB;AAAA,IAC9B,cAAA,EAAgB,8BAAA;AAAA,IAChB,KAAA,EAAO;AAAA,MACL,IAAI,WAAA,EAAY,CAAE,MAAA,CAAO,QAAQ,CAAA;AAAA,MACjCjB,iBAAAA,EAAkB,CAAE,MAAA,CAAO,eAAe,CAAA;AAAA,MAC1C;AAAA;AACF,GACD,CAAA;AACH","file":"index.js","sourcesContent":["export * from '../core/index.js';\nexport * from '../instructions/index.js';\nexport * from '../client/index.js';\n","import {\n getAddressCodec,\n getProgramDerivedAddress,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/kit';\nimport { TOKEN_METADATA_PROGRAM_ID } from './constants.js';\n\nconst addressCodec = getAddressCodec();\nconst textEncoder = new TextEncoder();\n\n/**\n * Derive Metaplex Token Metadata PDA for a given mint.\n *\n * Seeds: ['metadata', token_metadata_program_id, mint]\n */\nexport async function getMetadataAddress(\n mint: Address,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: TOKEN_METADATA_PROGRAM_ID,\n seeds: [\n textEncoder.encode('metadata'),\n addressCodec.encode(TOKEN_METADATA_PROGRAM_ID),\n addressCodec.encode(mint),\n ],\n });\n}\n","/**\n * Market cap conversion utilities for Solana token launches.\n *\n * Converts between human-readable market cap values (USD) and the raw\n * curve parameters used by the initializer program.\n *\n * For an XYK bonding curve the marginal spot price at any point is:\n *\n * spotPrice (quote/base, raw units) = (quoteReserve + curveVirtualQuote)\n * / (baseReserve + curveVirtualBase)\n *\n * At launch open (quoteReserve = 0, baseReserve = baseForCurve):\n *\n * spotPrice = curveVirtualQuote / (baseForCurve + curveVirtualBase)\n *\n * Adjusted for decimals and numeraire price:\n *\n * spotPriceUSD = spotPrice * 10^(baseDecimals - quoteDecimals) * numerairePriceUSD\n *\n * Market cap (FDV) is then:\n *\n * marketCap = spotPriceUSD * (baseTotalSupply / 10^baseDecimals)\n */\n\nimport type {\n MarketCapValidationResult,\n CurveParams,\n MarketCapToCurveParamsInput,\n CurveParamsToMarketCapInput,\n} from './types.js';\n\nexport type {\n MarketCapValidationResult,\n CurveParams,\n MarketCapToCurveParamsInput,\n CurveParamsToMarketCapInput,\n};\n\n// ============================================================================\n// Primitive helpers\n// ============================================================================\n\n/**\n * Convert a market cap (USD) and total supply to a per-token price (USD).\n *\n * @example\n * // $1M market cap, 1B tokens with 6 decimals\n * marketCapToTokenPrice(1_000_000, 1_000_000_000n * 10n**6n, 6)\n * // => 0.001\n */\nexport function marketCapToTokenPrice(\n marketCapUSD: number,\n baseTotalSupply: bigint,\n baseDecimals: number,\n): number {\n if (marketCapUSD <= 0) {\n throw new Error('Market cap must be positive');\n }\n if (baseTotalSupply <= 0n) {\n throw new Error('Token supply must be positive');\n }\n\n const supplyNum = Number(baseTotalSupply) / 10 ** baseDecimals;\n return marketCapUSD / supplyNum;\n}\n\n/**\n * Validate market cap parameters and return warnings for unusual values.\n * Does not throw — callers can decide whether to surface warnings to users.\n *\n * @example\n * const { valid, warnings } = validateMarketCapParameters(500, supply, 6);\n * if (!valid) console.warn(warnings);\n */\nexport function validateMarketCapParameters(\n marketCapUSD: number,\n baseTotalSupply: bigint,\n baseDecimals: number,\n): MarketCapValidationResult {\n const warnings: string[] = [];\n\n if (marketCapUSD < 1_000) {\n warnings.push(\n `Market cap $${marketCapUSD.toLocaleString()} is very small. Verify this is intentional.`,\n );\n }\n\n if (marketCapUSD > 1_000_000_000_000) {\n warnings.push(\n `Market cap $${marketCapUSD.toLocaleString()} exceeds $1T. Verify this is correct.`,\n );\n }\n\n const tokenPriceUSD = marketCapToTokenPrice(\n marketCapUSD,\n baseTotalSupply,\n baseDecimals,\n );\n\n if (tokenPriceUSD < 0.000_001) {\n warnings.push(\n `Implied token price $${tokenPriceUSD.toExponential(2)} is very small. This may cause precision issues.`,\n );\n }\n\n if (tokenPriceUSD > 1_000_000) {\n warnings.push(\n `Implied token price $${tokenPriceUSD.toLocaleString()} is very large. Verify token supply and market cap.`,\n );\n }\n\n return { valid: warnings.length === 0, warnings };\n}\n\n// ============================================================================\n// Market cap ↔ curve virtual reserves\n// ============================================================================\n\n/**\n * Convert a market cap range (USD) to XYK curve virtual reserve parameters.\n *\n * Returns `{ curveVirtualBase, curveVirtualQuote }` for both the start (open)\n * and end (graduation) prices, ready to pass into `InitializeLaunchArgs`.\n *\n * `baseForCurve` is the number of base tokens allocated to the curve vault\n * (baseTotalSupply - baseForDistribution - baseForLiquidity). It determines\n * the correct initial spot price alongside the virtual reserves.\n *\n * `virtualBase` defaults to `baseForCurve`. A larger value gives finer price\n * granularity at the cost of a proportionally larger `curveVirtualQuote`.\n *\n * @example\n * const totalSupply = 1_000_000_000n * 10n ** 6n;\n * const { start, end } = marketCapToCurveParams({\n * startMarketCapUSD: 100_000,\n * endMarketCapUSD: 5_000_000,\n * baseTotalSupply: totalSupply,\n * baseForCurve: totalSupply, // no distribution or liquidity allocation\n * baseDecimals: 6,\n * quoteDecimals: 9, // SOL\n * numerairePriceUSD: 150,\n * });\n * // Use start.curveVirtualBase / start.curveVirtualQuote in InitializeLaunchArgs\n */\nexport function marketCapToCurveParams(input: MarketCapToCurveParamsInput): {\n start: CurveParams;\n end: CurveParams;\n} {\n const {\n startMarketCapUSD,\n endMarketCapUSD,\n baseTotalSupply,\n baseForCurve,\n baseDecimals,\n quoteDecimals,\n numerairePriceUSD,\n virtualBase,\n } = input;\n\n if (startMarketCapUSD <= 0)\n throw new Error('startMarketCapUSD must be positive');\n if (endMarketCapUSD <= 0) throw new Error('endMarketCapUSD must be positive');\n if (startMarketCapUSD >= endMarketCapUSD) {\n throw new Error('startMarketCapUSD must be less than endMarketCapUSD');\n }\n if (baseForCurve <= 0n) throw new Error('baseForCurve must be positive');\n if (baseForCurve > baseTotalSupply)\n throw new Error('baseForCurve cannot exceed baseTotalSupply');\n if (numerairePriceUSD <= 0)\n throw new Error('numerairePriceUSD must be positive');\n\n const canonicalVirtualBase =\n virtualBase !== undefined && virtualBase > 0n ? virtualBase : baseForCurve;\n\n return {\n start: _marketCapToCurveParams(\n startMarketCapUSD,\n baseTotalSupply,\n baseForCurve,\n baseDecimals,\n quoteDecimals,\n numerairePriceUSD,\n canonicalVirtualBase,\n ),\n end: _marketCapToCurveParams(\n endMarketCapUSD,\n baseTotalSupply,\n baseForCurve,\n baseDecimals,\n quoteDecimals,\n numerairePriceUSD,\n canonicalVirtualBase,\n ),\n };\n}\n\n/**\n * Convert a single market cap (USD) to XYK curve virtual reserve parameters.\n * Use `marketCapToCurveParams` for a full start/end range.\n */\nexport function marketCapToSingleCurveParams(\n marketCapUSD: number,\n baseTotalSupply: bigint,\n baseForCurve: bigint,\n baseDecimals: number,\n quoteDecimals: number,\n numerairePriceUSD: number,\n virtualBase?: bigint,\n): CurveParams {\n if (marketCapUSD <= 0) throw new Error('marketCapUSD must be positive');\n if (baseForCurve <= 0n) throw new Error('baseForCurve must be positive');\n if (baseForCurve > baseTotalSupply)\n throw new Error('baseForCurve cannot exceed baseTotalSupply');\n if (numerairePriceUSD <= 0)\n throw new Error('numerairePriceUSD must be positive');\n\n const canonicalVirtualBase =\n virtualBase !== undefined && virtualBase > 0n ? virtualBase : baseForCurve;\n\n return _marketCapToCurveParams(\n marketCapUSD,\n baseTotalSupply,\n baseForCurve,\n baseDecimals,\n quoteDecimals,\n numerairePriceUSD,\n canonicalVirtualBase,\n );\n}\n\n/**\n * Derive the current market cap (USD) from live XYK curve state.\n *\n * Pass the virtual reserves from the `Launch` account and the current token\n * vault balances (`baseReserve`, `quoteReserve`) to get the live spot price.\n *\n * @example\n * const launch = await fetchLaunch(connection, launchAddress);\n * const [baseVaultBalance, quoteVaultBalance] = await Promise.all([\n * getTokenAccountBalance(connection, launch.baseVault),\n * getTokenAccountBalance(connection, launch.quoteVault),\n * ]);\n * // baseReserve is the curve-available portion, excluding reserved allocations\n * const baseReserve = baseVaultBalance - launch.baseForDistribution - launch.baseForLiquidity;\n * const mcap = curveParamsToMarketCap({\n * curveVirtualBase: launch.curveVirtualBase,\n * curveVirtualQuote: launch.curveVirtualQuote,\n * baseReserve,\n * quoteReserve: quoteVaultBalance,\n * baseTotalSupply: launch.baseTotalSupply,\n * baseDecimals: 6,\n * quoteDecimals: 9,\n * numerairePriceUSD: 150,\n * });\n */\nexport function curveParamsToMarketCap(\n input: CurveParamsToMarketCapInput,\n): number {\n const {\n curveVirtualBase,\n curveVirtualQuote,\n baseReserve,\n quoteReserve,\n baseTotalSupply,\n baseDecimals,\n quoteDecimals,\n numerairePriceUSD,\n } = input;\n\n if (curveVirtualBase <= 0n)\n throw new Error('curveVirtualBase must be positive');\n if (curveVirtualQuote <= 0n)\n throw new Error('curveVirtualQuote must be positive');\n if (baseReserve < 0n) throw new Error('baseReserve must be non-negative');\n if (quoteReserve < 0n) throw new Error('quoteReserve must be non-negative');\n\n const spotPriceUSD = _spotPriceUSD(\n curveVirtualBase,\n curveVirtualQuote,\n baseReserve,\n quoteReserve,\n baseDecimals,\n quoteDecimals,\n numerairePriceUSD,\n );\n\n const supplyHuman = Number(baseTotalSupply) / 10 ** baseDecimals;\n return spotPriceUSD * supplyHuman;\n}\n\n// ============================================================================\n// Internal\n// ============================================================================\n\nfunction _marketCapToCurveParams(\n marketCapUSD: number,\n baseTotalSupply: bigint,\n baseForCurve: bigint,\n baseDecimals: number,\n quoteDecimals: number,\n numerairePriceUSD: number,\n curveVirtualBase: bigint,\n): CurveParams {\n const tokenPriceUSD = marketCapToTokenPrice(\n marketCapUSD,\n baseTotalSupply,\n baseDecimals,\n );\n const priceInNumeraire = tokenPriceUSD / numerairePriceUSD;\n\n // Convert to raw units: quote_units / base_units\n const decimalScale = 10 ** (quoteDecimals - baseDecimals);\n const rawPriceQuotePerBase = priceInNumeraire * decimalScale;\n\n // spot price = virtual_quote / (baseForCurve + virtual_base)\n // => virtual_quote = rawPrice * (baseForCurve + virtual_base)\n const effectiveDenominator = baseForCurve + curveVirtualBase;\n\n const PRECISION = 1_000_000_000n;\n const rawPriceScaled = BigInt(\n Math.round(rawPriceQuotePerBase * Number(PRECISION)),\n );\n const curveVirtualQuote = (effectiveDenominator * rawPriceScaled) / PRECISION;\n\n if (curveVirtualQuote <= 0n) {\n throw new Error(\n `Computed curveVirtualQuote is zero or negative for marketCap=$${marketCapUSD.toLocaleString()}. ` +\n `Try a higher market cap or larger virtualBase.`,\n );\n }\n\n return { curveVirtualBase, curveVirtualQuote };\n}\n\nfunction _spotPriceUSD(\n curveVirtualBase: bigint,\n curveVirtualQuote: bigint,\n baseReserve: bigint,\n quoteReserve: bigint,\n baseDecimals: number,\n quoteDecimals: number,\n numerairePriceUSD: number,\n): number {\n // spot price (quote/base) = (quoteReserve + virtualQuote) / (baseReserve + virtualBase)\n const effBase = Number(baseReserve + curveVirtualBase);\n const effQuote = Number(quoteReserve + curveVirtualQuote);\n const rawRatio = effQuote / effBase;\n\n // adjust for decimals → numeraire per token (human units)\n const decimalScale = 10 ** (baseDecimals - quoteDecimals);\n return rawRatio * decimalScale * numerairePriceUSD;\n}\n","/**\n * CPMM program error codes\n *\n * These correspond to the CpmmError enum in the on-chain program.\n * Anchor errors start at 6000 (0x1770).\n */\nexport enum CpmmErrorCode {\n /** Unauthorized - caller lacks required authority */\n Unauthorized = 6000,\n /** Pool is currently locked (reentrancy protection) */\n PoolLocked = 6001,\n /** Invalid fee value (exceeds max or invalid range) */\n InvalidFee = 6002,\n /** Invalid fee split value (exceeds max or invalid range) */\n InvalidFeeSplit = 6003,\n /** Invalid swap direction (must be 0 or 1) */\n InvalidDirection = 6004,\n /** Insufficient liquidity for operation */\n InsufficientLiquidity = 6005,\n /** Output amount less than minimum (slippage exceeded) */\n SlippageExceeded = 6006,\n /** Math operation overflowed */\n MathOverflow = 6007,\n /** Mints not in canonical order */\n InvalidMintOrder = 6008,\n /** Cannot create pool with identical tokens */\n SameMintPair = 6009,\n /** Vault account invalid or mismatch */\n InvalidVault = 6010,\n /** Position account invalid or mismatch */\n InvalidPosition = 6011,\n /** Cannot close position with non-zero shares or fees */\n PositionNotEmpty = 6012,\n /** Invalid route configuration */\n InvalidRoute = 6013,\n /** Not supported in v0.1 */\n NotSupportedInV0_1 = 6014,\n /** Oracle not initialized for this pool */\n OracleNotInitialized = 6015,\n /** Zero shares out */\n ZeroSharesOut = 6016,\n /** Sentinel program rejected the operation */\n SentinelRejected = 6017,\n /** Sentinel CPI call failed */\n SentinelCpiFailed = 6018,\n /** Sentinel program account not provided */\n SentinelProgramNotProvided = 6019,\n /** Sentinel program account is not executable */\n SentinelProgramNotExecutable = 6020,\n /** Sentinel return data missing or wrong program id */\n SentinelReturnDataMissing = 6021,\n /** Sentinel return data invalid length or could not deserialize */\n SentinelReturnDataInvalid = 6022,\n /** Sentinel program not in allowlist */\n SentinelNotAllowlisted = 6023,\n /** Pool has zero shares (no liquidity) */\n TotalSharesZero = 6024,\n /** Amount cannot be zero */\n AmountZero = 6025,\n /** Pool is paused by admin */\n Paused = 6026,\n /** Internal invariant violation */\n InvariantViolation = 6027,\n /** Invalid mint address */\n InvalidMint = 6028,\n /** Invalid input parameter */\n InvalidInput = 6029,\n /** Reentrancy detected */\n Reentrancy = 6030,\n}\n\n/**\n * Human-readable error messages\n */\nexport const CPMM_ERROR_MESSAGES: Record<CpmmErrorCode, string> = {\n [CpmmErrorCode.Unauthorized]: 'Unauthorized: Caller lacks required authority',\n [CpmmErrorCode.PoolLocked]:\n 'Pool is currently locked (reentrancy protection)',\n [CpmmErrorCode.InvalidFee]:\n 'Invalid fee value (exceeds max or invalid range)',\n [CpmmErrorCode.InvalidFeeSplit]:\n 'Invalid fee split value (exceeds max or invalid range)',\n [CpmmErrorCode.InvalidDirection]: 'Invalid swap direction (must be 0 or 1)',\n [CpmmErrorCode.InsufficientLiquidity]:\n 'Insufficient liquidity for this operation',\n [CpmmErrorCode.SlippageExceeded]:\n 'Slippage exceeded: Output amount less than minimum',\n [CpmmErrorCode.MathOverflow]: 'Math operation overflowed',\n [CpmmErrorCode.InvalidMintOrder]: 'Token mints not in canonical order',\n [CpmmErrorCode.SameMintPair]: 'Cannot create pool with identical tokens',\n [CpmmErrorCode.InvalidVault]: 'Vault account is invalid or does not match',\n [CpmmErrorCode.InvalidPosition]:\n 'Position account is invalid or does not match',\n [CpmmErrorCode.PositionNotEmpty]:\n 'Cannot close position with non-zero shares or fees',\n [CpmmErrorCode.InvalidRoute]: 'Invalid route configuration',\n [CpmmErrorCode.NotSupportedInV0_1]: 'Not supported in v0.1',\n [CpmmErrorCode.OracleNotInitialized]: 'Oracle not initialized for this pool',\n [CpmmErrorCode.ZeroSharesOut]: 'Zero shares out',\n [CpmmErrorCode.SentinelRejected]: 'Sentinel program rejected the operation',\n [CpmmErrorCode.SentinelCpiFailed]: 'Sentinel CPI call failed',\n [CpmmErrorCode.SentinelProgramNotProvided]:\n 'Sentinel program account not provided',\n [CpmmErrorCode.SentinelProgramNotExecutable]:\n 'Sentinel program account is not executable',\n [CpmmErrorCode.SentinelReturnDataMissing]:\n 'Sentinel return data missing or wrong program id',\n [CpmmErrorCode.SentinelReturnDataInvalid]:\n 'Sentinel return data invalid length or could not deserialize',\n [CpmmErrorCode.SentinelNotAllowlisted]: 'Sentinel program not in allowlist',\n [CpmmErrorCode.TotalSharesZero]: 'Pool has zero shares (no liquidity)',\n [CpmmErrorCode.AmountZero]: 'Amount cannot be zero',\n [CpmmErrorCode.Paused]: 'Pool is paused by admin',\n [CpmmErrorCode.InvariantViolation]: 'Internal invariant violation',\n [CpmmErrorCode.InvalidMint]: 'Invalid mint address',\n [CpmmErrorCode.InvalidInput]: 'Invalid input parameter',\n [CpmmErrorCode.Reentrancy]: 'Reentrancy detected',\n};\n\n/**\n * Custom error class for CPMM program errors\n */\nexport class CpmmError extends Error {\n constructor(\n public readonly code: CpmmErrorCode,\n public readonly logs?: string[],\n ) {\n super(CPMM_ERROR_MESSAGES[code] || `Unknown CPMM error: ${code}`);\n this.name = 'CpmmError';\n }\n\n /**\n * Get the error code name\n */\n get codeName(): string {\n return CpmmErrorCode[this.code] || 'Unknown';\n }\n}\n\n/**\n * Parse error code from transaction logs\n */\nexport function parseErrorFromLogs(logs: string[]): CpmmError | null {\n // Look for Anchor error pattern: \"Program log: AnchorError ...\"\n // or custom error pattern: \"Program log: Error Code: ...\"\n for (const log of logs) {\n // Pattern 1: Anchor error with code\n const anchorMatch = log.match(\n /AnchorError.*Error Code:\\s*(\\w+)\\.\\s*Error Number:\\s*(\\d+)/,\n );\n if (anchorMatch) {\n const errorNumber = parseInt(anchorMatch[2], 10);\n if (errorNumber >= 6000 && errorNumber <= 6030) {\n return new CpmmError(errorNumber as CpmmErrorCode, logs);\n }\n }\n\n // Pattern 2: Error number in hex\n const hexMatch = log.match(/Error Number:\\s*0x([0-9a-fA-F]+)/);\n if (hexMatch) {\n const errorNumber = parseInt(hexMatch[1], 16);\n if (errorNumber >= 6000 && errorNumber <= 6030) {\n return new CpmmError(errorNumber as CpmmErrorCode, logs);\n }\n }\n\n // Pattern 3: Custom error message\n const customMatch = log.match(/Error Message:\\s*(.+)/);\n if (customMatch) {\n const message = customMatch[1].toLowerCase();\n // Try to match message to error code\n for (const [code, msg] of Object.entries(CPMM_ERROR_MESSAGES)) {\n if (\n msg.toLowerCase().includes(message) ||\n message.includes(msg.toLowerCase())\n ) {\n return new CpmmError(parseInt(code) as CpmmErrorCode, logs);\n }\n }\n }\n }\n\n return null;\n}\n\n/**\n * Check if an error code is a CPMM error\n */\nexport function isCpmmError(code: number): code is CpmmErrorCode {\n return code >= 6000 && code <= 6030;\n}\n\n/**\n * Get error message from code\n */\nexport function getErrorMessage(code: number): string {\n if (isCpmmError(code)) {\n return CPMM_ERROR_MESSAGES[code];\n }\n return `Unknown error code: ${code}`;\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n SYSTEM_PROGRAM_ADDRESS,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\nimport type { InitializeConfigArgs } from '../core/types.js';\nimport {\n initializeConfigArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/**\n * Accounts required for initialize_config instruction\n */\nexport interface InitializeConfigAccounts {\n /** AmmConfig account to initialize (writable, PDA: ['config']) */\n config: Address;\n /** Payer for account creation (writable, signer) */\n payer: Address;\n /** System program */\n systemProgram?: Address;\n}\n\n/**\n * Create an initialize_config instruction\n *\n * Initializes the global AMM configuration singleton. This should only be called once\n * per deployment to set up the admin, fees, and allowlist.\n *\n * @param accounts - Required accounts for initialization\n * @param args - Instruction arguments (admin, numeraireMint, fees, allowlist)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to initialize the config\n *\n * @example\n * ```ts\n * const [configAddress] = await getConfigAddress();\n * const ix = createInitializeConfigInstruction(\n * {\n * config: configAddress,\n * payer: payerPublicKey,\n * },\n * {\n * admin: adminPublicKey,\n * numeraireMint: usdcMint,\n * maxSwapFeeBps: 100,\n * maxFeeSplitBps: 5000,\n * maxRouteHops: 3,\n * protocolFeeEnabled: true,\n * protocolFeeBps: 500,\n * sentinelAllowlist: [],\n * }\n * );\n * ```\n */\nexport function createInitializeConfigInstruction(\n accounts: InitializeConfigAccounts,\n args: InitializeConfigArgs,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const { config, payer, systemProgram = SYSTEM_PROGRAM_ADDRESS } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: AccountRole.WRITABLE },\n { address: payer, role: AccountRole.WRITABLE_SIGNER },\n { address: systemProgram, role: AccountRole.READONLY },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.initializeConfig,\n initializeConfigArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type {\n Address,\n Instruction,\n AccountMeta,\n TransactionSigner,\n AccountSignerMeta,\n} from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n SYSTEM_PROGRAM_ADDRESS,\n TOKEN_PROGRAM_ADDRESS,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\nimport type { InitializePoolArgs } from '../core/types.js';\nimport {\n initializePoolArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/** Type that can be either an Address or a TransactionSigner */\ntype AddressOrSigner = Address | TransactionSigner;\n\n/** Check if value is a TransactionSigner (duck typing) */\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\n/** Create an account meta, embedding signer if provided */\nfunction createSignerAccountMeta(\n value: AddressOrSigner,\n role: typeof AccountRole.WRITABLE_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return {\n address: value.address,\n role,\n signer: value,\n };\n }\n return { address: value, role };\n}\n\n/**\n * Accounts required for initialize_pool instruction\n */\nexport interface InitializePoolAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account to initialize (writable, PDA: ['pool', token0_mint, token1_mint]) */\n pool: Address;\n /** Protocol position account (writable, PDA: ['protocol_position', pool]) */\n protocolPosition: Address;\n /** Pool authority PDA (read-only, PDA: ['authority', pool]) */\n authority: Address;\n /** Vault for token0 (writable signer - pass TransactionSigner to include signer in instruction) */\n vault0: Address | TransactionSigner;\n /** Vault for token1 (writable signer - pass TransactionSigner to include signer in instruction) */\n vault1: Address | TransactionSigner;\n /** Token0 mint (read-only, must be lexicographically smaller) */\n token0Mint: Address;\n /** Token1 mint (read-only, must be lexicographically larger) */\n token1Mint: Address;\n /** Payer for account creation (writable signer - pass TransactionSigner to include signer in instruction) */\n payer: Address | TransactionSigner;\n /** SPL Token program */\n tokenProgram?: Address;\n /** System program */\n systemProgram?: Address;\n /** Rent sysvar */\n rent: Address;\n}\n\n/**\n * Create an initialize_pool instruction\n *\n * Initializes a new trading pool for a token pair. The mints must be in canonical order\n * (token0 < token1 by bytes). Use sortMints() to ensure proper ordering.\n *\n * @param accounts - Required accounts for pool initialization\n * @param args - Instruction arguments (mintA, mintB, fees, liquidityMeasureSide, numeraire override)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to initialize the pool\n *\n * @example\n * ```ts\n * const addresses = await getPoolInitAddresses(mintA, mintB);\n * const ix = createInitializePoolInstruction(\n * {\n * config: addresses.config[0],\n * pool: addresses.pool[0],\n * protocolPosition: addresses.protocolPosition[0],\n * authority: addresses.authority[0],\n * vault0: vault0Keypair.publicKey,\n * vault1: vault1Keypair.publicKey,\n * token0Mint: addresses.token0,\n * token1Mint: addresses.token1,\n * payer: payerPublicKey,\n * rent: SYSVAR_RENT_PUBKEY,\n * },\n * {\n * mintA: mintA,\n * mintB: mintB,\n * initialSwapFeeBps: 30,\n * initialFeeSplitBps: 5000,\n * liquidityMeasureSide: 0,\n * numeraireMintOverride: null,\n * }\n * );\n * ```\n */\nexport function createInitializePoolInstruction(\n accounts: InitializePoolAccounts,\n args: InitializePoolArgs,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const {\n config,\n pool,\n protocolPosition,\n authority,\n vault0,\n vault1,\n token0Mint,\n token1Mint,\n payer,\n tokenProgram = TOKEN_PROGRAM_ADDRESS,\n systemProgram = SYSTEM_PROGRAM_ADDRESS,\n rent,\n } = accounts;\n\n // Build account metas in order expected by the program\n // For signer accounts (vault0, vault1, payer), embed the signer if provided\n const keys: (AccountMeta | AccountSignerMeta)[] = [\n { address: config, role: AccountRole.READONLY },\n { address: pool, role: AccountRole.WRITABLE },\n { address: protocolPosition, role: AccountRole.WRITABLE },\n { address: authority, role: AccountRole.READONLY },\n createSignerAccountMeta(vault0, AccountRole.WRITABLE_SIGNER),\n createSignerAccountMeta(vault1, AccountRole.WRITABLE_SIGNER),\n { address: token0Mint, role: AccountRole.READONLY },\n { address: token1Mint, role: AccountRole.READONLY },\n createSignerAccountMeta(payer, AccountRole.WRITABLE_SIGNER),\n { address: tokenProgram, role: AccountRole.READONLY },\n { address: systemProgram, role: AccountRole.READONLY },\n { address: rent, role: AccountRole.READONLY },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.initializePool,\n initializePoolArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n SYSTEM_PROGRAM_ADDRESS,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\nimport type { InitializeOracleArgs } from '../core/types.js';\nimport {\n initializeOracleArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/**\n * Accounts required for initialize_oracle instruction\n */\nexport interface InitializeOracleAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (read-only) */\n pool: Address;\n /** Oracle PDA to initialize (writable, will be created) */\n oracle: Address;\n /** Admin authority (signer, must match config.admin) */\n admin: Address;\n /** Payer for account creation (signer, writable) */\n payer: Address;\n /** System program */\n systemProgram?: Address;\n}\n\n/**\n * Create an initialize_oracle instruction\n *\n * Initializes a TWAP oracle for a pool. The oracle tracks price movements\n * and stores observations for time-weighted average price calculations.\n *\n * @param accounts - Required accounts for the instruction\n * @param args - Instruction arguments (maxPriceChangeRatioQ64, observationIntervalSec, numObservations)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to initialize the oracle\n *\n * @example\n * ```ts\n * const ix = createInitializeOracleInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * oracle: oracleAddress,\n * admin: adminPublicKey,\n * payer: payerPublicKey,\n * },\n * {\n * maxPriceChangeRatioQ64: 1n << 64n, // 100% max change per slot\n * observationIntervalSec: 60, // 1 minute between observations\n * numObservations: 64, // Must be MAX_ORACLE_OBSERVATIONS\n * }\n * );\n * ```\n */\nexport function createInitializeOracleInstruction(\n accounts: InitializeOracleAccounts,\n args: InitializeOracleArgs,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const {\n config,\n pool,\n oracle,\n admin,\n payer,\n systemProgram = SYSTEM_PROGRAM_ADDRESS,\n } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: AccountRole.READONLY },\n { address: pool, role: AccountRole.READONLY },\n { address: oracle, role: AccountRole.WRITABLE },\n { address: admin, role: AccountRole.READONLY_SIGNER },\n { address: payer, role: AccountRole.WRITABLE_SIGNER },\n { address: systemProgram, role: AccountRole.READONLY },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.initializeOracle,\n initializeOracleArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\nimport type { SetFeesArgs } from '../core/types.js';\nimport { setFeesArgsCodec, encodeInstructionData } from '../core/codecs.js';\n\n/**\n * Accounts required for set_fees instruction\n */\nexport interface SetFeesAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (writable) */\n pool: Address;\n /** Admin authority (signer, must match config.admin) */\n admin: Address;\n}\n\n/**\n * Create a set_fees instruction\n *\n * Admin instruction to update the swap fee and fee split on a pool.\n * Fees will be clamped to the config's max values.\n *\n * @param accounts - Required accounts for setting fees\n * @param args - Instruction arguments (swapFeeBps, feeSplitBps)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to set fees\n *\n * @example\n * ```ts\n * const ix = createSetFeesInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * admin: adminPublicKey,\n * },\n * {\n * swapFeeBps: 30, // 0.30% swap fee\n * feeSplitBps: 5000, // 50% of fees go to LPs (distributable)\n * }\n * );\n * ```\n */\nexport function createSetFeesInstruction(\n accounts: SetFeesAccounts,\n args: SetFeesArgs,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const { config, pool, admin } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: AccountRole.READONLY },\n { address: pool, role: AccountRole.WRITABLE },\n { address: admin, role: AccountRole.READONLY_SIGNER },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.setFees,\n setFeesArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\nimport type { SetSentinelArgs } from '../core/types.js';\nimport { setSentinelArgsCodec, encodeInstructionData } from '../core/codecs.js';\n\n/**\n * Accounts required for set_sentinel instruction\n */\nexport interface SetSentinelAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (writable) */\n pool: Address;\n /** Admin authority (signer, must match config.admin) */\n admin: Address;\n}\n\n/**\n * Create a set_sentinel instruction\n *\n * Admin instruction to configure a sentinel (hook) program on a pool.\n * The sentinel program must be in the config's allowlist (if the allowlist is non-empty).\n * Use Pubkey::default() to disable the sentinel.\n *\n * @param accounts - Required accounts for setting sentinel\n * @param args - Instruction arguments (sentinelProgram, sentinelFlags)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to set sentinel\n *\n * @example\n * ```ts\n * import { SF_BEFORE_SWAP, SF_AFTER_SWAP } from '@cpmm/sdk';\n *\n * const ix = createSetSentinelInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * admin: adminPublicKey,\n * },\n * {\n * sentinelProgram: sentinelProgramId,\n * sentinelFlags: SF_BEFORE_SWAP | SF_AFTER_SWAP, // Enable both hooks\n * }\n * );\n * ```\n */\nexport function createSetSentinelInstruction(\n accounts: SetSentinelAccounts,\n args: SetSentinelArgs,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const { config, pool, admin } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: AccountRole.READONLY },\n { address: pool, role: AccountRole.WRITABLE },\n { address: admin, role: AccountRole.READONLY_SIGNER },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.setSentinel,\n setSentinelArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\nimport type { SetRouteArgs } from '../core/types.js';\nimport { setRouteArgsCodec, encodeInstructionData } from '../core/codecs.js';\n\n/**\n * Accounts required for set_route instruction\n */\nexport interface SetRouteAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (writable) */\n pool: Address;\n /** Next pool in routing chain (optional, required if setting a route) */\n nextPool?: Address;\n /** Admin authority (signer, must match config.admin) */\n admin: Address;\n}\n\n/**\n * Create a set_route instruction\n *\n * Admin instruction to configure routing for a pool. This allows multi-hop swaps\n * through a chain of pools. The bridge mint must exist in both the current pool\n * and the next pool.\n *\n * To clear routing, pass Pubkey::default() for both routeNextPool and routeBridgeMint.\n *\n * @param accounts - Required accounts for setting route\n * @param args - Instruction arguments (routeNextPool, routeBridgeMint)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to set route\n *\n * @example\n * ```ts\n * // Set up routing: Pool A -> Pool B via USDC\n * const ix = createSetRouteInstruction(\n * {\n * config: configAddress,\n * pool: poolAAddress,\n * nextPool: poolBAddress,\n * admin: adminPublicKey,\n * },\n * {\n * routeNextPool: poolBAddress,\n * routeBridgeMint: usdcMint, // Must be in both pools\n * }\n * );\n *\n * // Clear routing\n * const clearIx = createSetRouteInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * admin: adminPublicKey,\n * },\n * {\n * routeNextPool: address('11111111111111111111111111111111'),\n * routeBridgeMint: address('11111111111111111111111111111111'),\n * }\n * );\n * ```\n */\nexport function createSetRouteInstruction(\n accounts: SetRouteAccounts,\n args: SetRouteArgs,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const { config, pool, nextPool, admin } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: AccountRole.READONLY },\n { address: pool, role: AccountRole.WRITABLE },\n ];\n\n // Add next_pool if provided (optional account)\n if (nextPool) {\n keys.push({ address: nextPool, role: AccountRole.READONLY });\n }\n\n keys.push({ address: admin, role: AccountRole.READONLY_SIGNER });\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.setRoute,\n setRouteArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\n\n/**\n * Accounts required for pause instruction\n */\nexport interface PauseAccounts {\n /** AmmConfig account (writable) */\n config: Address;\n /** Admin authority (signer, must match config.admin) */\n admin: Address;\n}\n\n/**\n * Create a pause instruction\n *\n * Admin instruction to pause all pool operations globally. When paused,\n * swaps, liquidity additions, and liquidity removals will fail.\n *\n * @param accounts - Required accounts for pausing\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to pause the AMM\n *\n * @example\n * ```ts\n * const ix = createPauseInstruction({\n * config: configAddress,\n * admin: adminPublicKey,\n * });\n * ```\n */\nexport function createPauseInstruction(\n accounts: PauseAccounts,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const { config, admin } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: AccountRole.WRITABLE },\n { address: admin, role: AccountRole.READONLY_SIGNER },\n ];\n\n // No args for pause instruction, just the discriminator\n const data = INSTRUCTION_DISCRIMINATORS.pause;\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\n\n/**\n * Accounts required for unpause instruction\n */\nexport interface UnpauseAccounts {\n /** AmmConfig account (writable) */\n config: Address;\n /** Admin authority (signer, must match config.admin) */\n admin: Address;\n}\n\n/**\n * Create an unpause instruction\n *\n * Admin instruction to unpause all pool operations. This re-enables\n * swaps, liquidity additions, and liquidity removals after a pause.\n *\n * @param accounts - Required accounts for unpausing\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to unpause the AMM\n *\n * @example\n * ```ts\n * const ix = createUnpauseInstruction({\n * config: configAddress,\n * admin: adminPublicKey,\n * });\n * ```\n */\nexport function createUnpauseInstruction(\n accounts: UnpauseAccounts,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const { config, admin } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: AccountRole.WRITABLE },\n { address: admin, role: AccountRole.READONLY_SIGNER },\n ];\n\n // No args for unpause instruction, just the discriminator\n const data = INSTRUCTION_DISCRIMINATORS.unpause;\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\nimport type { TransferAdminArgs } from '../core/types.js';\nimport {\n transferAdminArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/**\n * Accounts required for transfer_admin instruction\n */\nexport interface TransferAdminAccounts {\n /** AmmConfig account (writable) */\n config: Address;\n /** Current admin authority (signer, must match config.admin) */\n admin: Address;\n}\n\n/**\n * Create a transfer_admin instruction\n *\n * Admin instruction to transfer administrative authority to a new address.\n * The new admin will have full control over the AMM configuration and all pools.\n *\n * CAUTION: This action is irreversible. Ensure the new admin address is correct\n * and that you have access to it before executing.\n *\n * @param accounts - Required accounts for transferring admin\n * @param args - Instruction arguments (newAdmin)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to transfer admin\n *\n * @example\n * ```ts\n * const ix = createTransferAdminInstruction(\n * {\n * config: configAddress,\n * admin: currentAdminPublicKey,\n * },\n * {\n * newAdmin: newAdminPublicKey,\n * }\n * );\n * ```\n */\nexport function createTransferAdminInstruction(\n accounts: TransferAdminAccounts,\n args: TransferAdminArgs,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const { config, admin } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: AccountRole.WRITABLE },\n { address: admin, role: AccountRole.READONLY_SIGNER },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.transferAdmin,\n transferAdminArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n TOKEN_PROGRAM_ADDRESS,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\n\n/**\n * Accounts required for skim instruction\n */\nexport interface SkimAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (read-only) */\n pool: Address;\n /** Admin authority (signer, must match config.admin) */\n admin: Address;\n /** Pool authority PDA (read-only, PDA: ['authority', pool]) */\n authority: Address;\n /** Token0 vault (writable) */\n vault0: Address;\n /** Token1 vault (writable) */\n vault1: Address;\n /** Token0 mint (read-only) */\n token0Mint: Address;\n /** Token1 mint (read-only) */\n token1Mint: Address;\n /** Admin's token0 ATA to receive excess (writable) */\n adminAta0: Address;\n /** Admin's token1 ATA to receive excess (writable) */\n adminAta1: Address;\n /** SPL Token program */\n tokenProgram?: Address;\n}\n\n/**\n * Create a skim instruction\n *\n * Admin instruction to withdraw excess tokens from pool vaults. This recovers any\n * tokens that were accidentally sent directly to the vault accounts (outside of\n * normal pool operations).\n *\n * Only withdraws tokens in excess of (reserve + unclaimed_fees). Normal pool\n * reserves and LP fees are not affected.\n *\n * @param accounts - Required accounts for skimming\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to skim excess tokens\n *\n * @example\n * ```ts\n * const ix = createSkimInstruction({\n * config: configAddress,\n * pool: poolAddress,\n * admin: adminPublicKey,\n * authority: authorityAddress,\n * vault0: vault0Address,\n * vault1: vault1Address,\n * token0Mint: mint0,\n * token1Mint: mint1,\n * adminAta0: adminToken0Account,\n * adminAta1: adminToken1Account,\n * });\n * ```\n */\nexport function createSkimInstruction(\n accounts: SkimAccounts,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const {\n config,\n pool,\n admin,\n authority,\n vault0,\n vault1,\n token0Mint,\n token1Mint,\n adminAta0,\n adminAta1,\n tokenProgram = TOKEN_PROGRAM_ADDRESS,\n } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: AccountRole.READONLY },\n { address: pool, role: AccountRole.READONLY },\n { address: admin, role: AccountRole.READONLY_SIGNER },\n { address: authority, role: AccountRole.READONLY },\n { address: vault0, role: AccountRole.WRITABLE },\n { address: vault1, role: AccountRole.WRITABLE },\n { address: token0Mint, role: AccountRole.READONLY },\n { address: token1Mint, role: AccountRole.READONLY },\n { address: adminAta0, role: AccountRole.WRITABLE },\n { address: adminAta1, role: AccountRole.WRITABLE },\n { address: tokenProgram, role: AccountRole.READONLY },\n ];\n\n // No args for skim instruction, just the discriminator\n const data = INSTRUCTION_DISCRIMINATORS.skim;\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n TOKEN_PROGRAM_ADDRESS,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\nimport type { SwapExactInArgs, SwapDirection } from '../core/types.js';\nimport { encodeInstructionData, swapExactInArgsCodec } from '../core/codecs.js';\n\n/**\n * Accounts required for swap_exact_in instruction\n */\nexport interface SwapExactInAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (writable) */\n pool: Address;\n /** Pool authority PDA (read-only) */\n authority: Address;\n /** Input token vault (writable) */\n vaultIn: Address;\n /** Output token vault (writable) */\n vaultOut: Address;\n /** Token0 mint (read-only, for transfer_checked) */\n token0Mint: Address;\n /** Token1 mint (read-only, for transfer_checked) */\n token1Mint: Address;\n /** User's input token account (writable) */\n userIn: Address;\n /** User's output token account (writable) */\n userOut: Address;\n /** User authority (signer) */\n user: Address;\n /** SPL Token program */\n tokenProgram?: Address;\n /** Oracle account (optional, required if updateOracle is true) */\n oracle?: Address;\n /** Optional remaining accounts (sentinel program/state, route/oracle data) */\n remainingAccounts?: Address[];\n}\n\n/**\n * Create a swap_exact_in instruction\n *\n * Swaps an exact input amount for a minimum output amount using the CPMM formula.\n *\n * @param accounts - Required accounts for the swap\n * @param args - Instruction arguments (amountIn, minAmountOut, direction, updateOracle)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to execute the swap\n *\n * @example\n * ```ts\n * const ix = createSwapExactInInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * authority: authorityAddress,\n * vaultIn: vault0Address,\n * vaultOut: vault1Address,\n * token0Mint: mint0,\n * token1Mint: mint1,\n * userIn: userToken0Account,\n * userOut: userToken1Account,\n * user: userPublicKey,\n * },\n * {\n * amountIn: 1000000n,\n * minAmountOut: 990000n,\n * direction: 0, // token0 -> token1\n * updateOracle: false,\n * }\n * );\n * ```\n */\nexport function createSwapExactInInstruction(\n accounts: SwapExactInAccounts,\n args: SwapExactInArgs,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const {\n config,\n pool,\n authority,\n vaultIn,\n vaultOut,\n token0Mint,\n token1Mint,\n userIn,\n userOut,\n user,\n tokenProgram = TOKEN_PROGRAM_ADDRESS,\n oracle,\n remainingAccounts = [],\n } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: AccountRole.READONLY },\n { address: pool, role: AccountRole.WRITABLE },\n { address: authority, role: AccountRole.READONLY },\n { address: vaultIn, role: AccountRole.WRITABLE },\n { address: vaultOut, role: AccountRole.WRITABLE },\n { address: token0Mint, role: AccountRole.READONLY },\n { address: token1Mint, role: AccountRole.READONLY },\n { address: userIn, role: AccountRole.WRITABLE },\n { address: userOut, role: AccountRole.WRITABLE },\n { address: user, role: AccountRole.READONLY_SIGNER },\n { address: tokenProgram, role: AccountRole.READONLY },\n ];\n\n // Add oracle if provided (always writable due to Anchor #[account(mut)] constraint)\n if (oracle) {\n keys.push({ address: oracle, role: AccountRole.WRITABLE });\n }\n for (const account of remainingAccounts) {\n keys.push({ address: account, role: AccountRole.READONLY });\n }\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.swapExactIn,\n swapExactInArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n\n/**\n * Helper to create swap instruction with simplified parameters\n */\nexport function createSwapInstruction(params: {\n config: Address;\n pool: Address;\n authority: Address;\n vault0: Address;\n vault1: Address;\n token0Mint: Address;\n token1Mint: Address;\n userToken0: Address;\n userToken1: Address;\n user: Address;\n amountIn: bigint;\n minAmountOut: bigint;\n direction: SwapDirection;\n oracle?: Address;\n remainingAccounts?: Address[];\n updateOracle?: boolean;\n programId?: Address;\n}): Instruction {\n const {\n config,\n pool,\n authority,\n vault0,\n vault1,\n token0Mint,\n token1Mint,\n userToken0,\n userToken1,\n user,\n amountIn,\n minAmountOut,\n direction,\n oracle,\n remainingAccounts,\n updateOracle = false,\n programId = CPMM_PROGRAM_ID,\n } = params;\n\n // Determine vaults and user accounts based on direction\n const [vaultIn, vaultOut] =\n direction === 0 ? [vault0, vault1] : [vault1, vault0];\n const [userIn, userOut] =\n direction === 0 ? [userToken0, userToken1] : [userToken1, userToken0];\n\n return createSwapExactInInstruction(\n {\n config,\n pool,\n authority,\n vaultIn,\n vaultOut,\n token0Mint,\n token1Mint,\n userIn,\n userOut,\n user,\n oracle,\n remainingAccounts,\n },\n {\n amountIn,\n minAmountOut,\n direction,\n updateOracle,\n },\n programId,\n );\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n SYSTEM_PROGRAM_ADDRESS,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\nimport type { CreatePositionArgs } from '../core/types.js';\nimport {\n createPositionArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/**\n * Accounts required for create_position instruction\n */\nexport interface CreatePositionAccounts {\n /** Pool account (read-only) */\n pool: Address;\n /** Position PDA to be created (writable, derived from ['position', pool, owner, position_id]) */\n position: Address;\n /** Owner of the position (signer) */\n owner: Address;\n /** Payer for rent (signer, writable) */\n payer: Address;\n /** System program */\n systemProgram?: Address;\n}\n\n/**\n * Create a create_position instruction\n *\n * Creates a new liquidity position for a pool. The position is a PDA derived from\n * the pool, owner, and position ID. Users can have multiple positions per pool\n * by using different position IDs.\n *\n * @param accounts - Required accounts for creating the position\n * @param args - Instruction arguments (positionId)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to create a new position\n *\n * @example\n * ```ts\n * const ix = createCreatePositionInstruction(\n * {\n * pool: poolAddress,\n * position: positionPda,\n * owner: userPublicKey,\n * payer: userPublicKey,\n * },\n * {\n * positionId: 0n,\n * }\n * );\n * ```\n */\nexport function createCreatePositionInstruction(\n accounts: CreatePositionAccounts,\n args: CreatePositionArgs,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const {\n pool,\n position,\n owner,\n payer,\n systemProgram = SYSTEM_PROGRAM_ADDRESS,\n } = accounts;\n\n // Build account metas in order expected by the program\n // Order: pool, position, owner, payer, system_program\n const keys: AccountMeta[] = [\n { address: pool, role: AccountRole.READONLY },\n { address: position, role: AccountRole.WRITABLE },\n { address: owner, role: AccountRole.READONLY_SIGNER },\n { address: payer, role: AccountRole.WRITABLE_SIGNER },\n { address: systemProgram, role: AccountRole.READONLY },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.createPosition,\n createPositionArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\n\n/**\n * Accounts required for close_position instruction\n */\nexport interface ClosePositionAccounts {\n /** Pool account (read-only) */\n pool: Address;\n /** Position account to close (writable) */\n position: Address;\n /** Position owner (signer) */\n owner: Address;\n /** Recipient for rent lamports (writable) */\n rentRecipient: Address;\n}\n\n/**\n * Create a close_position instruction\n *\n * Closes an empty position account, returning the rent lamports to the recipient.\n * The position must have zero shares and zero accrued fees to be closed.\n *\n * @param accounts - Required accounts for closing the position\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to close a position\n *\n * @example\n * ```ts\n * const ix = createClosePositionInstruction({\n * pool: poolAddress,\n * position: positionAddress,\n * owner: userPublicKey,\n * rentRecipient: userPublicKey,\n * });\n * ```\n */\nexport function createClosePositionInstruction(\n accounts: ClosePositionAccounts,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const { pool, position, owner, rentRecipient } = accounts;\n\n // Build account metas in order expected by the program\n // Order: pool, position, owner, rent_recipient\n const keys: AccountMeta[] = [\n { address: pool, role: AccountRole.READONLY },\n { address: position, role: AccountRole.WRITABLE },\n { address: owner, role: AccountRole.READONLY_SIGNER },\n { address: rentRecipient, role: AccountRole.WRITABLE },\n ];\n\n // closePosition has no args, just the discriminator\n const data = INSTRUCTION_DISCRIMINATORS.closePosition;\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address, Instruction, AccountMeta, Codec } from '@solana/kit';\nimport {\n getStructCodec,\n getU64Codec,\n getU128Codec,\n getBooleanCodec,\n AccountRole,\n} from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n TOKEN_PROGRAM_ADDRESS,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\nimport type { AddLiquidityArgs } from '../core/types.js';\nimport { encodeInstructionData } from '../core/codecs.js';\n\n/**\n * Extended AddLiquidity args that include updateOracle flag\n * (matches the on-chain program's actual args)\n */\nexport interface AddLiquidityArgsWithOracle extends AddLiquidityArgs {\n /** Whether to update the oracle (requires oracle account) */\n updateOracle: boolean;\n}\n\n/**\n * Codec for AddLiquidity args including updateOracle\n */\nconst addLiquidityArgsWithOracleCodec: Codec<AddLiquidityArgsWithOracle> =\n getStructCodec([\n ['amount0Max', getU64Codec()],\n ['amount1Max', getU64Codec()],\n ['minSharesOut', getU128Codec()],\n ['updateOracle', getBooleanCodec()],\n ]);\n\n/**\n * Accounts required for add_liquidity instruction\n */\nexport interface AddLiquidityAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (writable) */\n pool: Address;\n /** User's position account (writable) */\n position: Address;\n /** Protocol position for protocol fees (writable) */\n protocolPosition: Address;\n /** Position owner (signer) */\n owner: Address;\n /** Pool authority PDA (read-only) */\n authority: Address;\n /** Pool vault for token0 (writable) */\n vault0: Address;\n /** Pool vault for token1 (writable) */\n vault1: Address;\n /** Token0 mint (read-only) */\n token0Mint: Address;\n /** Token1 mint (read-only) */\n token1Mint: Address;\n /** User's token0 account (writable) */\n user0: Address;\n /** User's token1 account (writable) */\n user1: Address;\n /** SPL Token program */\n tokenProgram?: Address;\n /** Oracle account (optional, required if updateOracle is true) */\n oracle?: Address;\n /** Optional remaining accounts (sentinel program/state, route/oracle data) */\n remainingAccounts?: Address[];\n}\n\n/**\n * Create an add_liquidity instruction\n *\n * Adds liquidity to a pool by depositing tokens and receiving LP shares.\n * For an empty pool (first deposit), the amount of shares is sqrt(amount0 * amount1).\n * For subsequent deposits, shares are proportional to the smaller ratio of deposit to reserves.\n *\n * @param accounts - Required accounts for adding liquidity\n * @param args - Instruction arguments (amount0Max, amount1Max, minSharesOut, updateOracle)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to add liquidity\n *\n * @example\n * ```ts\n * const ix = createAddLiquidityInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * position: positionAddress,\n * protocolPosition: protocolPositionAddress,\n * owner: userPublicKey,\n * authority: authorityPda,\n * vault0: vault0Address,\n * vault1: vault1Address,\n * token0Mint: mint0,\n * token1Mint: mint1,\n * user0: userToken0Account,\n * user1: userToken1Account,\n * },\n * {\n * amount0Max: 1000000n,\n * amount1Max: 1000000n,\n * minSharesOut: 0n,\n * updateOracle: false,\n * }\n * );\n * ```\n */\nexport function createAddLiquidityInstruction(\n accounts: AddLiquidityAccounts,\n args: AddLiquidityArgsWithOracle,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const {\n config,\n pool,\n position,\n protocolPosition,\n owner,\n authority,\n vault0,\n vault1,\n token0Mint,\n token1Mint,\n user0,\n user1,\n tokenProgram = TOKEN_PROGRAM_ADDRESS,\n oracle,\n remainingAccounts = [],\n } = accounts;\n\n // Build account metas in order expected by the program\n // Order: config, pool, position, protocol_position, owner, authority,\n // vault0, vault1, token0_mint, token1_mint, user0, user1, token_program, [oracle]\n const keys: AccountMeta[] = [\n { address: config, role: AccountRole.READONLY },\n { address: pool, role: AccountRole.WRITABLE },\n { address: position, role: AccountRole.WRITABLE },\n { address: protocolPosition, role: AccountRole.WRITABLE },\n { address: owner, role: AccountRole.READONLY_SIGNER },\n { address: authority, role: AccountRole.READONLY },\n { address: vault0, role: AccountRole.WRITABLE },\n { address: vault1, role: AccountRole.WRITABLE },\n { address: token0Mint, role: AccountRole.READONLY },\n { address: token1Mint, role: AccountRole.READONLY },\n { address: user0, role: AccountRole.WRITABLE },\n { address: user1, role: AccountRole.WRITABLE },\n { address: tokenProgram, role: AccountRole.READONLY },\n ];\n\n // Add oracle if provided (always writable due to Anchor #[account(mut)] constraint)\n if (oracle) {\n keys.push({ address: oracle, role: AccountRole.WRITABLE });\n }\n for (const account of remainingAccounts) {\n keys.push({ address: account, role: AccountRole.READONLY });\n }\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.addLiquidity,\n addLiquidityArgsWithOracleCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n TOKEN_PROGRAM_ADDRESS,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\nimport type { RemoveLiquidityArgs } from '../core/types.js';\nimport {\n removeLiquidityArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/**\n * Accounts required for remove_liquidity instruction\n */\nexport interface RemoveLiquidityAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (writable) */\n pool: Address;\n /** User's position account (writable) */\n position: Address;\n /** Protocol position for protocol fees (writable) */\n protocolPosition: Address;\n /** Position owner (signer) */\n owner: Address;\n /** Pool authority PDA (read-only) */\n authority: Address;\n /** Pool vault for token0 (writable) */\n vault0: Address;\n /** Pool vault for token1 (writable) */\n vault1: Address;\n /** Token0 mint (read-only) */\n token0Mint: Address;\n /** Token1 mint (read-only) */\n token1Mint: Address;\n /** User's token0 account (writable) */\n user0: Address;\n /** User's token1 account (writable) */\n user1: Address;\n /** SPL Token program */\n tokenProgram?: Address;\n /** Oracle account (optional, required if updateOracle is true) */\n oracle?: Address;\n /** Optional remaining accounts (sentinel program/state, route/oracle data) */\n remainingAccounts?: Address[];\n}\n\n/**\n * Create a remove_liquidity instruction\n *\n * Removes liquidity from a pool by burning LP shares and receiving tokens back.\n * The amount of tokens received is proportional to the share of the pool being withdrawn.\n * Also accrues any pending fees to the position before withdrawal.\n *\n * @param accounts - Required accounts for removing liquidity\n * @param args - Instruction arguments (sharesIn, minAmount0Out, minAmount1Out, updateOracle)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to remove liquidity\n *\n * @example\n * ```ts\n * const ix = createRemoveLiquidityInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * position: positionAddress,\n * protocolPosition: protocolPositionAddress,\n * owner: userPublicKey,\n * authority: authorityPda,\n * vault0: vault0Address,\n * vault1: vault1Address,\n * token0Mint: mint0,\n * token1Mint: mint1,\n * user0: userToken0Account,\n * user1: userToken1Account,\n * },\n * {\n * sharesIn: 500000n,\n * minAmount0Out: 450000n,\n * minAmount1Out: 450000n,\n * updateOracle: false,\n * }\n * );\n * ```\n */\nexport function createRemoveLiquidityInstruction(\n accounts: RemoveLiquidityAccounts,\n args: RemoveLiquidityArgs,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const {\n config,\n pool,\n position,\n protocolPosition,\n owner,\n authority,\n vault0,\n vault1,\n token0Mint,\n token1Mint,\n user0,\n user1,\n tokenProgram = TOKEN_PROGRAM_ADDRESS,\n oracle,\n remainingAccounts = [],\n } = accounts;\n\n // Build account metas in order expected by the program\n // Order: config, pool, position, protocol_position, owner, authority,\n // vault0, vault1, token0_mint, token1_mint, user0, user1, token_program, [oracle]\n const keys: AccountMeta[] = [\n { address: config, role: AccountRole.READONLY },\n { address: pool, role: AccountRole.WRITABLE },\n { address: position, role: AccountRole.WRITABLE },\n { address: protocolPosition, role: AccountRole.WRITABLE },\n { address: owner, role: AccountRole.READONLY_SIGNER },\n { address: authority, role: AccountRole.READONLY },\n { address: vault0, role: AccountRole.WRITABLE },\n { address: vault1, role: AccountRole.WRITABLE },\n { address: token0Mint, role: AccountRole.READONLY },\n { address: token1Mint, role: AccountRole.READONLY },\n { address: user0, role: AccountRole.WRITABLE },\n { address: user1, role: AccountRole.WRITABLE },\n { address: tokenProgram, role: AccountRole.READONLY },\n ];\n\n // Add oracle if provided (always writable due to Anchor #[account(mut)] constraint)\n if (oracle) {\n keys.push({ address: oracle, role: AccountRole.WRITABLE });\n }\n for (const account of remainingAccounts) {\n keys.push({ address: account, role: AccountRole.READONLY });\n }\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.removeLiquidity,\n removeLiquidityArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n TOKEN_PROGRAM_ADDRESS,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\nimport type { CollectProtocolFeesArgs } from '../core/types.js';\nimport {\n collectProtocolFeesArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/**\n * Accounts required for collect_protocol_fees instruction\n */\nexport interface CollectProtocolFeesAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Pool account (writable) */\n pool: Address;\n /** Protocol position account (writable) */\n protocolPosition: Address;\n /** Admin authority (signer) */\n admin: Address;\n /** Pool authority PDA (read-only) */\n authority: Address;\n /** Pool vault for token0 (writable) */\n vault0: Address;\n /** Pool vault for token1 (writable) */\n vault1: Address;\n /** Token0 mint (read-only) */\n token0Mint: Address;\n /** Token1 mint (read-only) */\n token1Mint: Address;\n /** Recipient token0 account (writable) */\n recipient0: Address;\n /** Recipient token1 account (writable) */\n recipient1: Address;\n /** SPL Token program */\n tokenProgram?: Address;\n}\n\n/**\n * Create a collect_protocol_fees instruction\n *\n * Collects accrued protocol fees from the protocol position and transfers them\n * to the configured recipients.\n *\n * @param accounts - Required accounts for collecting protocol fees\n * @param args - Instruction arguments (max0, max1)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to collect protocol fees\n *\n * @example\n * ```ts\n * const ix = createCollectProtocolFeesInstruction(\n * {\n * config: configAddress,\n * pool: poolAddress,\n * protocolPosition: protocolPositionAddress,\n * admin: adminPublicKey,\n * authority: authorityPda,\n * vault0: vault0Address,\n * vault1: vault1Address,\n * token0Mint: mint0,\n * token1Mint: mint1,\n * recipient0: adminToken0Account,\n * recipient1: adminToken1Account,\n * },\n * {\n * max0: BigInt('18446744073709551615'),\n * max1: BigInt('18446744073709551615'),\n * }\n * );\n * ```\n */\nexport function createCollectProtocolFeesInstruction(\n accounts: CollectProtocolFeesAccounts,\n args: CollectProtocolFeesArgs,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const {\n config,\n pool,\n protocolPosition,\n admin,\n authority,\n vault0,\n vault1,\n token0Mint,\n token1Mint,\n recipient0,\n recipient1,\n tokenProgram = TOKEN_PROGRAM_ADDRESS,\n } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: AccountRole.READONLY },\n { address: pool, role: AccountRole.WRITABLE },\n { address: protocolPosition, role: AccountRole.WRITABLE },\n { address: admin, role: AccountRole.READONLY_SIGNER },\n { address: authority, role: AccountRole.READONLY },\n { address: vault0, role: AccountRole.WRITABLE },\n { address: vault1, role: AccountRole.WRITABLE },\n { address: token0Mint, role: AccountRole.READONLY },\n { address: token1Mint, role: AccountRole.READONLY },\n { address: recipient0, role: AccountRole.WRITABLE },\n { address: recipient1, role: AccountRole.WRITABLE },\n { address: tokenProgram, role: AccountRole.READONLY },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.collectProtocolFees,\n collectProtocolFeesArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type { Address, Instruction, AccountMeta } from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\n\n/**\n * Accounts required for oracle_update instruction\n */\nexport interface OracleUpdateAccounts {\n /** Pool account (read-only) */\n pool: Address;\n /** Oracle PDA to update (writable) */\n oracle: Address;\n}\n\n/**\n * Create an oracle_update instruction\n *\n * Updates the oracle with the current pool prices. This samples the current\n * spot price, clamps it according to maxPriceChangeRatioQ64, and records\n * a new observation if the observation interval has elapsed.\n *\n * This instruction is permissionless - anyone can call it to update the oracle.\n *\n * @param accounts - Required accounts for the instruction\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to update the oracle\n *\n * @example\n * ```ts\n * const ix = createOracleUpdateInstruction({\n * pool: poolAddress,\n * oracle: oracleAddress,\n * });\n * ```\n */\nexport function createOracleUpdateInstruction(\n accounts: OracleUpdateAccounts,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const { pool, oracle } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: pool, role: AccountRole.READONLY },\n { address: oracle, role: AccountRole.WRITABLE },\n ];\n\n // oracle_update has no args, just the discriminator\n const data = INSTRUCTION_DISCRIMINATORS.oracleUpdate;\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type {\n Address,\n Instruction,\n AccountMeta,\n ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n getStructCodec,\n getU128Codec,\n type Codec,\n AccountRole,\n} from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\nimport type { OracleConsultArgs } from '../core/types.js';\nimport {\n oracleConsultArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/**\n * Accounts required for oracle_consult instruction\n */\nexport interface OracleConsultAccounts {\n /** Pool account (read-only) */\n pool: Address;\n /** Oracle PDA to query (read-only) */\n oracle: Address;\n}\n\n/**\n * Result returned from oracle_consult via return data\n */\nexport interface OracleConsultResult {\n /** TWAP price of token0 in token1 (Q64.64 fixed-point) */\n price0Q64: bigint;\n /** TWAP price of token1 in token0 (Q64.64 fixed-point) */\n price1Q64: bigint;\n}\n\nconst oracleConsultResultCodec: Codec<OracleConsultResult> = getStructCodec([\n ['price0Q64', getU128Codec()],\n ['price1Q64', getU128Codec()],\n]);\n\n/**\n * Decode oracle_consult return data\n */\nexport function decodeOracleConsultResult(\n data: ReadonlyUint8Array,\n): OracleConsultResult {\n return oracleConsultResultCodec.decode(data);\n}\n\n/**\n * Create an oracle_consult instruction\n *\n * Queries the TWAP price from the oracle over the specified time window.\n * The result is returned via Solana's return data mechanism.\n *\n * Note: To read the result, you must invoke this instruction via CPI or\n * simulate the transaction and parse the return data.\n *\n * @param accounts - Required accounts for the instruction\n * @param args - Instruction arguments (windowSeconds)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to consult the oracle\n *\n * @example\n * ```ts\n * const ix = createOracleConsultInstruction(\n * {\n * pool: poolAddress,\n * oracle: oracleAddress,\n * },\n * {\n * windowSeconds: 300, // 5-minute TWAP\n * }\n * );\n * ```\n */\nexport function createOracleConsultInstruction(\n accounts: OracleConsultAccounts,\n args: OracleConsultArgs,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const { pool, oracle } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: pool, role: AccountRole.READONLY },\n { address: oracle, role: AccountRole.READONLY },\n ];\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.oracleConsult,\n oracleConsultArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","import type {\n Address,\n Instruction,\n AccountMeta,\n ReadonlyUint8Array,\n Codec,\n} from '@solana/kit';\nimport {\n getAddressCodec,\n getStructCodec,\n getU128Codec,\n getU8Codec,\n AccountRole,\n} from '@solana/kit';\nimport {\n CPMM_PROGRAM_ID,\n INSTRUCTION_DISCRIMINATORS,\n} from '../core/constants.js';\nimport type { QuoteToNumeraireArgs } from '../core/types.js';\nimport {\n quoteToNumeraireArgsCodec,\n encodeInstructionData,\n} from '../core/codecs.js';\n\n/**\n * Accounts required for quote_to_numeraire instruction\n */\nexport interface QuoteToNumeraireAccounts {\n /** AmmConfig account (read-only) */\n config: Address;\n /** Starting pool for the route (read-only) */\n startPool: Address;\n /**\n * Remaining accounts for routing:\n * - [pool1?, pool2?, ...]\n *\n * Each hop requires the next pool in the route chain.\n */\n remainingAccounts?: Address[];\n}\n\n/**\n * Result returned from quote_to_numeraire via return data\n */\nexport interface QuoteToNumeraireResult {\n /** Amount converted to numeraire (u128) */\n amountInNumeraire: bigint;\n /** Final mint reached (should be numeraire) */\n endMint: Address;\n /** Number of hops used in the route */\n hopsUsed: number;\n}\n\nconst quoteToNumeraireResultCodec: Codec<QuoteToNumeraireResult> =\n getStructCodec([\n ['amountInNumeraire', getU128Codec()],\n ['endMint', getAddressCodec()],\n ['hopsUsed', getU8Codec()],\n ]);\n\n/**\n * Decode quote_to_numeraire return data\n */\nexport function decodeQuoteToNumeraireResult(\n data: ReadonlyUint8Array,\n): QuoteToNumeraireResult {\n return quoteToNumeraireResultCodec.decode(data);\n}\n\n/**\n * Create a quote_to_numeraire instruction\n *\n * Converts an amount of one token to its value in the pool's numeraire\n * via the routing chain using spot pricing. (TWAP is not supported in v0.1.)\n *\n * The result is returned via Solana's return data mechanism.\n *\n * @param accounts - Required accounts for the instruction\n * @param args - Instruction arguments (amount, side, maxHops, useTwap, windowSeconds)\n * @param programId - Program ID (defaults to CPMM program)\n * @returns Instruction to quote amount in numeraire\n *\n * @example\n * ```ts\n * // Quote using spot prices (no TWAP)\n * const ix = createQuoteToNumeraireInstruction(\n * {\n * config: configAddress,\n * startPool: poolAddress,\n * },\n * {\n * amount: 1000000n,\n * side: 0, // token0\n * maxHops: 3,\n * useTwap: false,\n * windowSeconds: 0,\n * }\n * );\n * ```\n */\nexport function createQuoteToNumeraireInstruction(\n accounts: QuoteToNumeraireAccounts,\n args: QuoteToNumeraireArgs,\n programId: Address = CPMM_PROGRAM_ID,\n): Instruction {\n const { config, startPool, remainingAccounts = [] } = accounts;\n\n // Build account metas in order expected by the program\n const keys: AccountMeta[] = [\n { address: config, role: AccountRole.READONLY },\n { address: startPool, role: AccountRole.READONLY },\n ];\n\n // Add remaining accounts (pools and oracles for multi-hop routing)\n for (const account of remainingAccounts) {\n keys.push({ address: account, role: AccountRole.READONLY });\n }\n\n const data = encodeInstructionData(\n INSTRUCTION_DISCRIMINATORS.quoteToNumeraire,\n quoteToNumeraireArgsCodec,\n args,\n );\n\n return {\n programAddress: programId,\n accounts: keys,\n data,\n };\n}\n","/**\n * Config fetching and utilities for the CPMM SDK\n */\n\nimport type { Address } from '@solana/kit';\nimport type { Rpc, GetAccountInfoApi } from '@solana/kit';\nimport type { AmmConfig } from '../core/types.js';\nimport { decodeAmmConfig } from '../core/codecs.js';\nimport { CPMM_PROGRAM_ID } from '../core/constants.js';\nimport { getConfigAddress } from '../core/pda.js';\n\n// Browser-compatible base64 decoding\nfunction base64ToBytes(base64: string): Uint8Array {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n\n/**\n * Fetch and decode the AmmConfig account\n *\n * @param rpc - Solana RPC client\n * @param programId - Program ID (defaults to CPMM program)\n * @param commitment - Optional commitment level\n * @returns Decoded config data or null if not found\n */\nexport async function fetchConfig(\n rpc: Rpc<GetAccountInfoApi>,\n programId: Address = CPMM_PROGRAM_ID,\n commitment?: 'processed' | 'confirmed' | 'finalized',\n): Promise<AmmConfig | null> {\n const [configAddress] = await getConfigAddress(programId);\n const response = await rpc\n .getAccountInfo(configAddress, {\n encoding: 'base64',\n commitment,\n })\n .send();\n\n if (!response.value) {\n return null;\n }\n\n return decodeAmmConfig(base64ToBytes(response.value.data[0]));\n}\n\n/**\n * Fetch config with its PDA address\n */\nexport async function fetchConfigWithAddress(\n rpc: Rpc<GetAccountInfoApi>,\n programId: Address = CPMM_PROGRAM_ID,\n commitment?: 'processed' | 'confirmed' | 'finalized',\n): Promise<{ address: Address; account: AmmConfig } | null> {\n const [configAddress] = await getConfigAddress(programId);\n const account = await fetchConfig(rpc, programId, commitment);\n if (!account) {\n return null;\n }\n return { address: configAddress, account };\n}\n","// Constants\nexport {\n INITIALIZER_PROGRAM_ID,\n BPF_LOADER_UPGRADEABLE_PROGRAM_ID,\n CPMM_SENTINEL_PROGRAM_ID,\n PREDICTION_SENTINEL_PROGRAM_ID,\n SEED_CONFIG,\n SEED_LAUNCH,\n SEED_LAUNCH_AUTHORITY,\n MAX_MIGRATOR_ALLOWLIST,\n MAX_SENTINEL_ALLOWLIST,\n MAX_CALLDATA,\n EMPTY_REMAINING_ACCOUNTS_HASH,\n PHASE_TRADING,\n PHASE_MIGRATED,\n PHASE_ABORTED,\n DIRECTION_BUY,\n DIRECTION_SELL,\n CURVE_KIND_XYK,\n CURVE_PARAMS_FORMAT_XYK_V0,\n SF_BEFORE_SWAP,\n SF_AFTER_SWAP,\n SENTINEL_NO_CHANGE,\n INITIALIZER_INSTRUCTION_DISCRIMINATORS,\n INITIALIZER_ACCOUNT_DISCRIMINATORS,\n DOPPLER_DEVNET_ALT,\n} from './constants.js';\n\n// Generated types and codec factories\nexport type {\n InitConfig,\n InitConfigArgs,\n Launch,\n LaunchArgs,\n InitializeConfigArgs,\n InitializeConfigArgsArgs,\n InitializeLaunchArgs,\n InitializeLaunchArgsArgs,\n CalldataBuf,\n} from '../generated/initializer/index.js';\n\nexport {\n getInitConfigDecoder,\n getInitConfigEncoder,\n getInitConfigCodec,\n getLaunchDecoder,\n getLaunchEncoder,\n getLaunchCodec,\n getInitializeConfigArgsEncoder,\n getInitializeConfigArgsDecoder,\n getInitializeConfigArgsCodec,\n getInitializeLaunchArgsEncoder,\n getInitializeLaunchArgsDecoder,\n getInitializeLaunchArgsCodec,\n} from '../generated/initializer/index.js';\n\n// PDA helpers\nexport {\n getConfigAddress,\n getProgramDataAddress,\n getLaunchAddress,\n getLaunchAuthorityAddress,\n encodeU64LE,\n launchIdFromU64,\n} from './pda.js';\n\n// Instruction builders\nexport {\n createInitializeConfigInstruction,\n type InitializeConfigAccounts,\n createSetMigratorAllowlistInstruction,\n type SetMigratorAllowlistAccounts,\n createSetSentinelAllowlistInstruction,\n type SetSentinelAllowlistAccounts,\n createInitializeLaunchInstruction,\n getTokenMetadataAddress,\n type InitializeLaunchAccounts,\n createCurveSwapExactInInstruction,\n type CurveSwapExactInAccounts,\n createMigrateLaunchInstruction,\n type MigrateLaunchAccounts,\n createAbortLaunchInstruction,\n type AbortLaunchAccounts,\n createPreviewSwapExactInInstruction,\n decodePreviewSwapExactInResult,\n type PreviewSwapExactInAccounts,\n type PreviewSwapExactInResult,\n createPreviewMigrationInstruction,\n decodePreviewMigrationResult,\n type PreviewMigrationAccounts,\n type PreviewMigrationResult,\n} from './instructions/index.js';\n\n// Helpers\nexport { computeRemainingAccountsHash, phaseLabel } from './helpers.js';\n\n// Client helpers\nexport {\n fetchLaunch,\n fetchAllLaunches,\n fetchLaunchesByAuthority,\n launchExists,\n type FetchLaunchesConfig,\n type LaunchWithAddress,\n} from './client/index.js';\n","import { address, type Address } from '@solana/kit';\n\n/**\n * Program ID for the Initializer program.\n *\n * Source of truth: programs/initializer/src/lib.rs\n */\nexport const INITIALIZER_PROGRAM_ID: Address = address(\n '4h3Dqyo5qmteJoMxXt3tdtfXELDB6pdRTPU9mWruiKp1',\n);\n\nexport const BPF_LOADER_UPGRADEABLE_PROGRAM_ID: Address = address(\n 'BPFLoaderUpgradeab1e11111111111111111111111',\n);\n\n/**\n * Sentinel program for CPMM-migrated launches.\n * Invoked during bonding curve swaps and previews as a pre/post-swap hook.\n *\n * Source of truth: programs/cpmm_sentinel/src/lib.rs\n */\nexport const CPMM_SENTINEL_PROGRAM_ID: Address = address(\n '2vJ1c62knEwZbxp3XdHB4RSmCfz55pA6tRkCho63gW7u',\n);\n\n/**\n * Sentinel program for prediction market launches.\n * Invoked during bonding curve swaps and previews as a pre/post-swap hook.\n *\n * Source of truth: programs/prediction_sentinel/src/lib.rs\n */\nexport const PREDICTION_SENTINEL_PROGRAM_ID: Address = address(\n '7QcQDANJVC17Jgc6KjjeagSkm2zAphgHVPK5agJzyihB',\n);\n\n// ============================================================================\n// PDA Seeds (must match programs/initializer/src/constants.rs)\n// ============================================================================\n\nexport const SEED_CONFIG = 'config_v3';\nexport const SEED_LAUNCH = 'launch_v3';\nexport const SEED_LAUNCH_AUTHORITY = 'launch_authority_v3';\n\n// ============================================================================\n// Remaining Accounts Hash\n// ============================================================================\n\n/**\n * Commitment hash for an empty remaining-accounts list — keccak256 of [0,0,0,0].\n * Pass this for sentinelRemainingAccountsHash and migratorRemainingAccountsHash\n * when no extra accounts are needed at that hook's invocation time.\n */\nexport const EMPTY_REMAINING_ACCOUNTS_HASH = new Uint8Array([\n 232, 231, 118, 38, 88, 111, 115, 185, 85, 54, 76, 123, 75, 191, 11, 183, 247,\n 104, 94, 189, 64, 232, 82, 177, 100, 99, 58, 74, 203, 211, 36, 76,\n]);\n\n// ============================================================================\n// Address Lookup Tables\n// ============================================================================\n\n/**\n * Devnet ALT containing static accounts shared by every initializeLaunch tx.\n * Indices: 0=TOKEN_PROGRAM, 1=SYSTEM_PROGRAM, 2=SYSVAR_RENT,\n * 3=INITIALIZER_PROGRAM, 4=TOKEN_METADATA_PROGRAM,\n * 5=CPMM_MIGRATOR_PROGRAM, 6=WSOL_MINT, 7=config PDA\n */\nexport const DOPPLER_DEVNET_ALT: Address = address(\n '7r5rdLkGMzTq5Q2kBhkePw4ZTeZEooHgTXktYoamNmVq',\n);\n\n// ============================================================================\n// Limits\n// ============================================================================\n\nexport const MAX_MIGRATOR_ALLOWLIST = 32;\nexport const MAX_SENTINEL_ALLOWLIST = 32;\nexport const MAX_CALLDATA = 256;\n\n// ============================================================================\n// Phases / Directions / Flags (must match programs/initializer/src/constants.rs)\n// ============================================================================\n\nexport const PHASE_TRADING = 0;\nexport const PHASE_MIGRATED = 1;\nexport const PHASE_ABORTED = 2;\n\nexport const DIRECTION_BUY = 0;\nexport const DIRECTION_SELL = 1;\n\nexport const CURVE_KIND_XYK = 0;\n\nexport const CURVE_PARAMS_FORMAT_XYK_V0 = 0x00;\n\nexport const SF_BEFORE_SWAP = 1 << 0;\nexport const SF_AFTER_SWAP = 1 << 1;\n\nexport const SENTINEL_NO_CHANGE = 0xffff;\n\n// ============================================================================\n// Instruction Discriminators (Anchor 8-byte hashes)\n// ============================================================================\n\nexport const INITIALIZER_INSTRUCTION_DISCRIMINATORS = {\n // SHA256(\"global:initialize_config\")[0:8]\n initializeConfig: new Uint8Array([\n 0xd0, 0x7f, 0x15, 0x01, 0xc2, 0xbe, 0xc4, 0x46,\n ]),\n // SHA256(\"global:set_migrator_allowlist\")[0:8]\n setMigratorAllowlist: new Uint8Array([\n 0xd1, 0x5a, 0xb5, 0x68, 0x63, 0x6c, 0xe9, 0xa8,\n ]),\n // SHA256(\"global:set_sentinel_allowlist\")[0:8]\n setSentinelAllowlist: new Uint8Array([\n 0xe9, 0x48, 0xb4, 0xf6, 0xab, 0x75, 0x15, 0x32,\n ]),\n // SHA256(\"global:initialize_launch\")[0:8]\n initializeLaunch: new Uint8Array([\n 0x5a, 0xc9, 0xdc, 0x8e, 0x70, 0xfd, 0x64, 0x0d,\n ]),\n // SHA256(\"global:curve_swap_exact_in\")[0:8]\n curveSwapExactIn: new Uint8Array([\n 0xc4, 0xf7, 0xc3, 0x7e, 0xe3, 0x1b, 0xa6, 0x5d,\n ]),\n // SHA256(\"global:migrate_launch\")[0:8]\n migrateLaunch: new Uint8Array([\n 0x13, 0xc7, 0x77, 0x67, 0x0d, 0x1e, 0x0c, 0xcd,\n ]),\n // SHA256(\"global:abort_launch\")[0:8]\n abortLaunch: new Uint8Array([0x2c, 0x70, 0xc0, 0xeb, 0xe3, 0x3d, 0xb3, 0x07]),\n // SHA256(\"global:preview_swap_exact_in\")[0:8]\n previewSwapExactIn: new Uint8Array([\n 0x32, 0x82, 0x1f, 0x45, 0x93, 0x3a, 0xde, 0xb2,\n ]),\n // SHA256(\"global:preview_migration\")[0:8]\n previewMigration: new Uint8Array([\n 0xd8, 0xb4, 0xd1, 0x70, 0x3e, 0x10, 0x0f, 0x3f,\n ]),\n} as const;\n\n// ============================================================================\n// Account Discriminators (Anchor 8-byte hashes)\n// ============================================================================\n\nexport const INITIALIZER_ACCOUNT_DISCRIMINATORS = {\n // SHA256(\"account:InitConfig\")[0:8]\n InitConfig: new Uint8Array([0x61, 0xa6, 0x23, 0x07, 0x14, 0x02, 0xa4, 0x7e]),\n // SHA256(\"account:Launch\")[0:8]\n Launch: new Uint8Array([0x90, 0x33, 0x33, 0xa3, 0xce, 0x55, 0xd5, 0x26]),\n} as const;\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport const INIT_CONFIG_DISCRIMINATOR = new Uint8Array([\n 97, 166, 35, 7, 20, 2, 164, 126,\n]);\n\nexport function getInitConfigDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(INIT_CONFIG_DISCRIMINATOR);\n}\n\nexport type InitConfig = {\n discriminator: ReadonlyUint8Array;\n admin: Address;\n migratorAllowlistLen: number;\n migratorAllowlist: Array<Address>;\n sentinelAllowlistLen: number;\n sentinelAllowlist: Array<Address>;\n bump: number;\n version: number;\n reserved: ReadonlyUint8Array;\n};\n\nexport type InitConfigArgs = {\n admin: Address;\n migratorAllowlistLen: number;\n migratorAllowlist: Array<Address>;\n sentinelAllowlistLen: number;\n sentinelAllowlist: Array<Address>;\n bump: number;\n version: number;\n reserved: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link InitConfigArgs} account data. */\nexport function getInitConfigEncoder(): FixedSizeEncoder<InitConfigArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['admin', getAddressEncoder()],\n ['migratorAllowlistLen', getU8Encoder()],\n ['migratorAllowlist', getArrayEncoder(getAddressEncoder(), { size: 32 })],\n ['sentinelAllowlistLen', getU8Encoder()],\n ['sentinelAllowlist', getArrayEncoder(getAddressEncoder(), { size: 32 })],\n ['bump', getU8Encoder()],\n ['version', getU8Encoder()],\n ['reserved', fixEncoderSize(getBytesEncoder(), 31)],\n ]),\n (value) => ({ ...value, discriminator: INIT_CONFIG_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link InitConfig} account data. */\nexport function getInitConfigDecoder(): FixedSizeDecoder<InitConfig> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['admin', getAddressDecoder()],\n ['migratorAllowlistLen', getU8Decoder()],\n ['migratorAllowlist', getArrayDecoder(getAddressDecoder(), { size: 32 })],\n ['sentinelAllowlistLen', getU8Decoder()],\n ['sentinelAllowlist', getArrayDecoder(getAddressDecoder(), { size: 32 })],\n ['bump', getU8Decoder()],\n ['version', getU8Decoder()],\n ['reserved', fixDecoderSize(getBytesDecoder(), 31)],\n ]);\n}\n\n/** Gets the codec for {@link InitConfig} account data. */\nexport function getInitConfigCodec(): FixedSizeCodec<\n InitConfigArgs,\n InitConfig\n> {\n return combineCodec(getInitConfigEncoder(), getInitConfigDecoder());\n}\n\nexport function decodeInitConfig<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<InitConfig, TAddress>;\nexport function decodeInitConfig<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<InitConfig, TAddress>;\nexport function decodeInitConfig<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<InitConfig, TAddress> | MaybeAccount<InitConfig, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getInitConfigDecoder(),\n );\n}\n\nexport async function fetchInitConfig<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<InitConfig, TAddress>> {\n const maybeAccount = await fetchMaybeInitConfig(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeInitConfig<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<InitConfig, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeInitConfig(maybeAccount);\n}\n\nexport async function fetchAllInitConfig(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<InitConfig>[]> {\n const maybeAccounts = await fetchAllMaybeInitConfig(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeInitConfig(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<InitConfig>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeInitConfig(maybeAccount));\n}\n\nexport function getInitConfigSize(): number {\n return 2123;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport type CalldataBuf = { len: number; bytes: ReadonlyUint8Array };\n\nexport type CalldataBufArgs = CalldataBuf;\n\nexport function getCalldataBufEncoder(): FixedSizeEncoder<CalldataBufArgs> {\n return getStructEncoder([\n ['len', getU16Encoder()],\n ['bytes', fixEncoderSize(getBytesEncoder(), 256)],\n ]);\n}\n\nexport function getCalldataBufDecoder(): FixedSizeDecoder<CalldataBuf> {\n return getStructDecoder([\n ['len', getU16Decoder()],\n ['bytes', fixDecoderSize(getBytesDecoder(), 256)],\n ]);\n}\n\nexport function getCalldataBufCodec(): FixedSizeCodec<\n CalldataBufArgs,\n CalldataBuf\n> {\n return combineCodec(getCalldataBufEncoder(), getCalldataBufDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getStructDecoder,\n getStructEncoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n} from '@solana/kit';\n\nexport type InitializeConfigArgs = {\n migratorAllowlist: Array<Address>;\n sentinelAllowlist: Array<Address>;\n};\n\nexport type InitializeConfigArgsArgs = InitializeConfigArgs;\n\nexport function getInitializeConfigArgsEncoder(): Encoder<InitializeConfigArgsArgs> {\n return getStructEncoder([\n ['migratorAllowlist', getArrayEncoder(getAddressEncoder())],\n ['sentinelAllowlist', getArrayEncoder(getAddressEncoder())],\n ]);\n}\n\nexport function getInitializeConfigArgsDecoder(): Decoder<InitializeConfigArgs> {\n return getStructDecoder([\n ['migratorAllowlist', getArrayDecoder(getAddressDecoder())],\n ['sentinelAllowlist', getArrayDecoder(getAddressDecoder())],\n ]);\n}\n\nexport function getInitializeConfigArgsCodec(): Codec<\n InitializeConfigArgsArgs,\n InitializeConfigArgs\n> {\n return combineCodec(\n getInitializeConfigArgsEncoder(),\n getInitializeConfigArgsDecoder(),\n );\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport type InitializeLaunchArgs = {\n namespace: Address;\n launchId: ReadonlyUint8Array;\n baseDecimals: number;\n baseTotalSupply: bigint;\n baseForDistribution: bigint;\n baseForLiquidity: bigint;\n curveVirtualBase: bigint;\n curveVirtualQuote: bigint;\n curveFeeBps: number;\n curveKind: number;\n curveParams: ReadonlyUint8Array;\n allowBuy: number;\n allowSell: number;\n sentinelProgram: Address;\n sentinelFlags: number;\n sentinelCalldata: ReadonlyUint8Array;\n migratorProgram: Address;\n migratorInitCalldata: ReadonlyUint8Array;\n migratorMigrateCalldata: ReadonlyUint8Array;\n /**\n * Commitment hash for swap/preview sentinel remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n sentinelRemainingAccountsHash: ReadonlyUint8Array;\n /**\n * Commitment hash for migrate remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n migratorRemainingAccountsHash: ReadonlyUint8Array;\n /** Token name for on-chain metadata. If empty, metadata creation is skipped. */\n metadataName: string;\n /** Token symbol for on-chain metadata. */\n metadataSymbol: string;\n /** Metadata JSON URI for on-chain metadata. */\n metadataUri: string;\n};\n\nexport type InitializeLaunchArgsArgs = {\n namespace: Address;\n launchId: ReadonlyUint8Array;\n baseDecimals: number;\n baseTotalSupply: number | bigint;\n baseForDistribution: number | bigint;\n baseForLiquidity: number | bigint;\n curveVirtualBase: number | bigint;\n curveVirtualQuote: number | bigint;\n curveFeeBps: number;\n curveKind: number;\n curveParams: ReadonlyUint8Array;\n allowBuy: number;\n allowSell: number;\n sentinelProgram: Address;\n sentinelFlags: number;\n sentinelCalldata: ReadonlyUint8Array;\n migratorProgram: Address;\n migratorInitCalldata: ReadonlyUint8Array;\n migratorMigrateCalldata: ReadonlyUint8Array;\n /**\n * Commitment hash for swap/preview sentinel remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n sentinelRemainingAccountsHash: ReadonlyUint8Array;\n /**\n * Commitment hash for migrate remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n migratorRemainingAccountsHash: ReadonlyUint8Array;\n /** Token name for on-chain metadata. If empty, metadata creation is skipped. */\n metadataName: string;\n /** Token symbol for on-chain metadata. */\n metadataSymbol: string;\n /** Metadata JSON URI for on-chain metadata. */\n metadataUri: string;\n};\n\nexport function getInitializeLaunchArgsEncoder(): Encoder<InitializeLaunchArgsArgs> {\n return getStructEncoder([\n ['namespace', getAddressEncoder()],\n ['launchId', fixEncoderSize(getBytesEncoder(), 32)],\n ['baseDecimals', getU8Encoder()],\n ['baseTotalSupply', getU64Encoder()],\n ['baseForDistribution', getU64Encoder()],\n ['baseForLiquidity', getU64Encoder()],\n ['curveVirtualBase', getU64Encoder()],\n ['curveVirtualQuote', getU64Encoder()],\n ['curveFeeBps', getU16Encoder()],\n ['curveKind', getU8Encoder()],\n ['curveParams', addEncoderSizePrefix(getBytesEncoder(), getU32Encoder())],\n ['allowBuy', getU8Encoder()],\n ['allowSell', getU8Encoder()],\n ['sentinelProgram', getAddressEncoder()],\n ['sentinelFlags', getU32Encoder()],\n [\n 'sentinelCalldata',\n addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),\n ],\n ['migratorProgram', getAddressEncoder()],\n [\n 'migratorInitCalldata',\n addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),\n ],\n [\n 'migratorMigrateCalldata',\n addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),\n ],\n ['sentinelRemainingAccountsHash', fixEncoderSize(getBytesEncoder(), 32)],\n ['migratorRemainingAccountsHash', fixEncoderSize(getBytesEncoder(), 32)],\n ['metadataName', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['metadataSymbol', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ['metadataUri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ]);\n}\n\nexport function getInitializeLaunchArgsDecoder(): Decoder<InitializeLaunchArgs> {\n return getStructDecoder([\n ['namespace', getAddressDecoder()],\n ['launchId', fixDecoderSize(getBytesDecoder(), 32)],\n ['baseDecimals', getU8Decoder()],\n ['baseTotalSupply', getU64Decoder()],\n ['baseForDistribution', getU64Decoder()],\n ['baseForLiquidity', getU64Decoder()],\n ['curveVirtualBase', getU64Decoder()],\n ['curveVirtualQuote', getU64Decoder()],\n ['curveFeeBps', getU16Decoder()],\n ['curveKind', getU8Decoder()],\n ['curveParams', addDecoderSizePrefix(getBytesDecoder(), getU32Decoder())],\n ['allowBuy', getU8Decoder()],\n ['allowSell', getU8Decoder()],\n ['sentinelProgram', getAddressDecoder()],\n ['sentinelFlags', getU32Decoder()],\n [\n 'sentinelCalldata',\n addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),\n ],\n ['migratorProgram', getAddressDecoder()],\n [\n 'migratorInitCalldata',\n addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),\n ],\n [\n 'migratorMigrateCalldata',\n addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),\n ],\n ['sentinelRemainingAccountsHash', fixDecoderSize(getBytesDecoder(), 32)],\n ['migratorRemainingAccountsHash', fixDecoderSize(getBytesDecoder(), 32)],\n ['metadataName', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['metadataSymbol', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['metadataUri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ]);\n}\n\nexport function getInitializeLaunchArgsCodec(): Codec<\n InitializeLaunchArgsArgs,\n InitializeLaunchArgs\n> {\n return combineCodec(\n getInitializeLaunchArgsEncoder(),\n getInitializeLaunchArgsDecoder(),\n );\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n getCalldataBufDecoder,\n getCalldataBufEncoder,\n type CalldataBuf,\n type CalldataBufArgs,\n} from '../types';\n\nexport const LAUNCH_DISCRIMINATOR = new Uint8Array([\n 144, 51, 51, 163, 206, 85, 213, 38,\n]);\n\nexport function getLaunchDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(LAUNCH_DISCRIMINATOR);\n}\n\nexport type Launch = {\n discriminator: ReadonlyUint8Array;\n authority: Address;\n namespace: Address;\n launchId: ReadonlyUint8Array;\n phase: number;\n bump: number;\n launchAuthorityBump: number;\n pad0: ReadonlyUint8Array;\n baseMint: Address;\n quoteMint: Address;\n baseVault: Address;\n quoteVault: Address;\n baseTotalSupply: bigint;\n baseForDistribution: bigint;\n baseForLiquidity: bigint;\n baseForCurve: bigint;\n curveVirtualBase: bigint;\n curveVirtualQuote: bigint;\n curveFeeBps: number;\n pad1: ReadonlyUint8Array;\n allowBuy: number;\n allowSell: number;\n pad2: ReadonlyUint8Array;\n sentinelProgram: Address;\n sentinelFlags: number;\n pad3: ReadonlyUint8Array;\n sentinelCalldata: CalldataBuf;\n migratorProgram: Address;\n migratorInitCalldata: CalldataBuf;\n migratorMigrateCalldata: CalldataBuf;\n curveKind: number;\n swapLock: number;\n pad4: ReadonlyUint8Array;\n curveParams: CalldataBuf;\n quoteDeposited: bigint;\n reserved: ReadonlyUint8Array;\n};\n\nexport type LaunchArgs = {\n authority: Address;\n namespace: Address;\n launchId: ReadonlyUint8Array;\n phase: number;\n bump: number;\n launchAuthorityBump: number;\n pad0: ReadonlyUint8Array;\n baseMint: Address;\n quoteMint: Address;\n baseVault: Address;\n quoteVault: Address;\n baseTotalSupply: number | bigint;\n baseForDistribution: number | bigint;\n baseForLiquidity: number | bigint;\n baseForCurve: number | bigint;\n curveVirtualBase: number | bigint;\n curveVirtualQuote: number | bigint;\n curveFeeBps: number;\n pad1: ReadonlyUint8Array;\n allowBuy: number;\n allowSell: number;\n pad2: ReadonlyUint8Array;\n sentinelProgram: Address;\n sentinelFlags: number;\n pad3: ReadonlyUint8Array;\n sentinelCalldata: CalldataBufArgs;\n migratorProgram: Address;\n migratorInitCalldata: CalldataBufArgs;\n migratorMigrateCalldata: CalldataBufArgs;\n curveKind: number;\n swapLock: number;\n pad4: ReadonlyUint8Array;\n curveParams: CalldataBufArgs;\n quoteDeposited: number | bigint;\n reserved: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link LaunchArgs} account data. */\nexport function getLaunchEncoder(): FixedSizeEncoder<LaunchArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['authority', getAddressEncoder()],\n ['namespace', getAddressEncoder()],\n ['launchId', fixEncoderSize(getBytesEncoder(), 32)],\n ['phase', getU8Encoder()],\n ['bump', getU8Encoder()],\n ['launchAuthorityBump', getU8Encoder()],\n ['pad0', fixEncoderSize(getBytesEncoder(), 5)],\n ['baseMint', getAddressEncoder()],\n ['quoteMint', getAddressEncoder()],\n ['baseVault', getAddressEncoder()],\n ['quoteVault', getAddressEncoder()],\n ['baseTotalSupply', getU64Encoder()],\n ['baseForDistribution', getU64Encoder()],\n ['baseForLiquidity', getU64Encoder()],\n ['baseForCurve', getU64Encoder()],\n ['curveVirtualBase', getU64Encoder()],\n ['curveVirtualQuote', getU64Encoder()],\n ['curveFeeBps', getU16Encoder()],\n ['pad1', fixEncoderSize(getBytesEncoder(), 6)],\n ['allowBuy', getU8Encoder()],\n ['allowSell', getU8Encoder()],\n ['pad2', fixEncoderSize(getBytesEncoder(), 6)],\n ['sentinelProgram', getAddressEncoder()],\n ['sentinelFlags', getU32Encoder()],\n ['pad3', fixEncoderSize(getBytesEncoder(), 4)],\n ['sentinelCalldata', getCalldataBufEncoder()],\n ['migratorProgram', getAddressEncoder()],\n ['migratorInitCalldata', getCalldataBufEncoder()],\n ['migratorMigrateCalldata', getCalldataBufEncoder()],\n ['curveKind', getU8Encoder()],\n ['swapLock', getU8Encoder()],\n ['pad4', fixEncoderSize(getBytesEncoder(), 6)],\n ['curveParams', getCalldataBufEncoder()],\n ['quoteDeposited', getU64Encoder()],\n ['reserved', fixEncoderSize(getBytesEncoder(), 64)],\n ]),\n (value) => ({ ...value, discriminator: LAUNCH_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link Launch} account data. */\nexport function getLaunchDecoder(): FixedSizeDecoder<Launch> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['authority', getAddressDecoder()],\n ['namespace', getAddressDecoder()],\n ['launchId', fixDecoderSize(getBytesDecoder(), 32)],\n ['phase', getU8Decoder()],\n ['bump', getU8Decoder()],\n ['launchAuthorityBump', getU8Decoder()],\n ['pad0', fixDecoderSize(getBytesDecoder(), 5)],\n ['baseMint', getAddressDecoder()],\n ['quoteMint', getAddressDecoder()],\n ['baseVault', getAddressDecoder()],\n ['quoteVault', getAddressDecoder()],\n ['baseTotalSupply', getU64Decoder()],\n ['baseForDistribution', getU64Decoder()],\n ['baseForLiquidity', getU64Decoder()],\n ['baseForCurve', getU64Decoder()],\n ['curveVirtualBase', getU64Decoder()],\n ['curveVirtualQuote', getU64Decoder()],\n ['curveFeeBps', getU16Decoder()],\n ['pad1', fixDecoderSize(getBytesDecoder(), 6)],\n ['allowBuy', getU8Decoder()],\n ['allowSell', getU8Decoder()],\n ['pad2', fixDecoderSize(getBytesDecoder(), 6)],\n ['sentinelProgram', getAddressDecoder()],\n ['sentinelFlags', getU32Decoder()],\n ['pad3', fixDecoderSize(getBytesDecoder(), 4)],\n ['sentinelCalldata', getCalldataBufDecoder()],\n ['migratorProgram', getAddressDecoder()],\n ['migratorInitCalldata', getCalldataBufDecoder()],\n ['migratorMigrateCalldata', getCalldataBufDecoder()],\n ['curveKind', getU8Decoder()],\n ['swapLock', getU8Decoder()],\n ['pad4', fixDecoderSize(getBytesDecoder(), 6)],\n ['curveParams', getCalldataBufDecoder()],\n ['quoteDeposited', getU64Decoder()],\n ['reserved', fixDecoderSize(getBytesDecoder(), 64)],\n ]);\n}\n\n/** Gets the codec for {@link Launch} account data. */\nexport function getLaunchCodec(): FixedSizeCodec<LaunchArgs, Launch> {\n return combineCodec(getLaunchEncoder(), getLaunchDecoder());\n}\n\nexport function decodeLaunch<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<Launch, TAddress>;\nexport function decodeLaunch<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<Launch, TAddress>;\nexport function decodeLaunch<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<Launch, TAddress> | MaybeAccount<Launch, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getLaunchDecoder(),\n );\n}\n\nexport async function fetchLaunch<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<Launch, TAddress>> {\n const maybeAccount = await fetchMaybeLaunch(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeLaunch<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<Launch, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeLaunch(maybeAccount);\n}\n\nexport async function fetchAllLaunch(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<Launch>[]> {\n const maybeAccounts = await fetchAllMaybeLaunch(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeLaunch(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<Launch>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeLaunch(maybeAccount));\n}\n\nexport function getLaunchSize(): number {\n return 1488;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { INITIALIZER_PROGRAM_ADDRESS } from '../programs';\n\nexport const CURVE_SWAP_EXACT_IN_DISCRIMINATOR = new Uint8Array([\n 196, 247, 195, 126, 227, 27, 166, 93,\n]);\n\nexport function getCurveSwapExactInDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CURVE_SWAP_EXACT_IN_DISCRIMINATOR,\n );\n}\n\nexport type CurveSwapExactInInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountConfig extends string | AccountMeta<string> = string,\n TAccountLaunch extends string | AccountMeta<string> = string,\n TAccountLaunchAuthority extends string | AccountMeta<string> = string,\n TAccountBaseVault extends string | AccountMeta<string> = string,\n TAccountQuoteVault extends string | AccountMeta<string> = string,\n TAccountUserBaseAccount extends string | AccountMeta<string> = string,\n TAccountUserQuoteAccount extends string | AccountMeta<string> = string,\n TAccountBaseMint extends string | AccountMeta<string> = string,\n TAccountQuoteMint extends string | AccountMeta<string> = string,\n TAccountUser extends string | AccountMeta<string> = string,\n TAccountSentinelProgram extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountConfig extends string\n ? ReadonlyAccount<TAccountConfig>\n : TAccountConfig,\n TAccountLaunch extends string\n ? WritableAccount<TAccountLaunch>\n : TAccountLaunch,\n TAccountLaunchAuthority extends string\n ? ReadonlyAccount<TAccountLaunchAuthority>\n : TAccountLaunchAuthority,\n TAccountBaseVault extends string\n ? WritableAccount<TAccountBaseVault>\n : TAccountBaseVault,\n TAccountQuoteVault extends string\n ? WritableAccount<TAccountQuoteVault>\n : TAccountQuoteVault,\n TAccountUserBaseAccount extends string\n ? WritableAccount<TAccountUserBaseAccount>\n : TAccountUserBaseAccount,\n TAccountUserQuoteAccount extends string\n ? WritableAccount<TAccountUserQuoteAccount>\n : TAccountUserQuoteAccount,\n TAccountBaseMint extends string\n ? ReadonlyAccount<TAccountBaseMint>\n : TAccountBaseMint,\n TAccountQuoteMint extends string\n ? ReadonlyAccount<TAccountQuoteMint>\n : TAccountQuoteMint,\n TAccountUser extends string\n ? ReadonlySignerAccount<TAccountUser> & AccountSignerMeta<TAccountUser>\n : TAccountUser,\n TAccountSentinelProgram extends string\n ? ReadonlyAccount<TAccountSentinelProgram>\n : TAccountSentinelProgram,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CurveSwapExactInInstructionData = {\n discriminator: ReadonlyUint8Array;\n amountIn: bigint;\n minAmountOut: bigint;\n direction: number;\n};\n\nexport type CurveSwapExactInInstructionDataArgs = {\n amountIn: number | bigint;\n minAmountOut: number | bigint;\n direction: number;\n};\n\nexport function getCurveSwapExactInInstructionDataEncoder(): FixedSizeEncoder<CurveSwapExactInInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['amountIn', getU64Encoder()],\n ['minAmountOut', getU64Encoder()],\n ['direction', getU8Encoder()],\n ]),\n (value) => ({ ...value, discriminator: CURVE_SWAP_EXACT_IN_DISCRIMINATOR }),\n );\n}\n\nexport function getCurveSwapExactInInstructionDataDecoder(): FixedSizeDecoder<CurveSwapExactInInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['amountIn', getU64Decoder()],\n ['minAmountOut', getU64Decoder()],\n ['direction', getU8Decoder()],\n ]);\n}\n\nexport function getCurveSwapExactInInstructionDataCodec(): FixedSizeCodec<\n CurveSwapExactInInstructionDataArgs,\n CurveSwapExactInInstructionData\n> {\n return combineCodec(\n getCurveSwapExactInInstructionDataEncoder(),\n getCurveSwapExactInInstructionDataDecoder(),\n );\n}\n\nexport type CurveSwapExactInAsyncInput<\n TAccountConfig extends string = string,\n TAccountLaunch extends string = string,\n TAccountLaunchAuthority extends string = string,\n TAccountBaseVault extends string = string,\n TAccountQuoteVault extends string = string,\n TAccountUserBaseAccount extends string = string,\n TAccountUserQuoteAccount extends string = string,\n TAccountBaseMint extends string = string,\n TAccountQuoteMint extends string = string,\n TAccountUser extends string = string,\n TAccountSentinelProgram extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n config?: Address<TAccountConfig>;\n launch: Address<TAccountLaunch>;\n launchAuthority: Address<TAccountLaunchAuthority>;\n baseVault: Address<TAccountBaseVault>;\n quoteVault: Address<TAccountQuoteVault>;\n userBaseAccount: Address<TAccountUserBaseAccount>;\n userQuoteAccount: Address<TAccountUserQuoteAccount>;\n baseMint: Address<TAccountBaseMint>;\n quoteMint: Address<TAccountQuoteMint>;\n user: TransactionSigner<TAccountUser>;\n /** Optional sentinel program (must match launch.sentinel_program if set) */\n sentinelProgram?: Address<TAccountSentinelProgram>;\n tokenProgram?: Address<TAccountTokenProgram>;\n amountIn: CurveSwapExactInInstructionDataArgs['amountIn'];\n minAmountOut: CurveSwapExactInInstructionDataArgs['minAmountOut'];\n direction: CurveSwapExactInInstructionDataArgs['direction'];\n};\n\nexport async function getCurveSwapExactInInstructionAsync<\n TAccountConfig extends string,\n TAccountLaunch extends string,\n TAccountLaunchAuthority extends string,\n TAccountBaseVault extends string,\n TAccountQuoteVault extends string,\n TAccountUserBaseAccount extends string,\n TAccountUserQuoteAccount extends string,\n TAccountBaseMint extends string,\n TAccountQuoteMint extends string,\n TAccountUser extends string,\n TAccountSentinelProgram extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: CurveSwapExactInAsyncInput<\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountUserBaseAccount,\n TAccountUserQuoteAccount,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountUser,\n TAccountSentinelProgram,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CurveSwapExactInInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountUserBaseAccount,\n TAccountUserQuoteAccount,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountUser,\n TAccountSentinelProgram,\n TAccountTokenProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n config: { value: input.config ?? null, isWritable: false },\n launch: { value: input.launch ?? null, isWritable: true },\n launchAuthority: {\n value: input.launchAuthority ?? null,\n isWritable: false,\n },\n baseVault: { value: input.baseVault ?? null, isWritable: true },\n quoteVault: { value: input.quoteVault ?? null, isWritable: true },\n userBaseAccount: { value: input.userBaseAccount ?? null, isWritable: true },\n userQuoteAccount: {\n value: input.userQuoteAccount ?? null,\n isWritable: true,\n },\n baseMint: { value: input.baseMint ?? null, isWritable: false },\n quoteMint: { value: input.quoteMint ?? null, isWritable: false },\n user: { value: input.user ?? null, isWritable: false },\n sentinelProgram: {\n value: input.sentinelProgram ?? null,\n isWritable: false,\n },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.config.value) {\n accounts.config.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([99, 111, 110, 102, 105, 103, 95, 118, 51]),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('config', accounts.config),\n getAccountMeta('launch', accounts.launch),\n getAccountMeta('launchAuthority', accounts.launchAuthority),\n getAccountMeta('baseVault', accounts.baseVault),\n getAccountMeta('quoteVault', accounts.quoteVault),\n getAccountMeta('userBaseAccount', accounts.userBaseAccount),\n getAccountMeta('userQuoteAccount', accounts.userQuoteAccount),\n getAccountMeta('baseMint', accounts.baseMint),\n getAccountMeta('quoteMint', accounts.quoteMint),\n getAccountMeta('user', accounts.user),\n getAccountMeta('sentinelProgram', accounts.sentinelProgram),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n ],\n data: getCurveSwapExactInInstructionDataEncoder().encode(\n args as CurveSwapExactInInstructionDataArgs,\n ),\n programAddress,\n } as CurveSwapExactInInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountUserBaseAccount,\n TAccountUserQuoteAccount,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountUser,\n TAccountSentinelProgram,\n TAccountTokenProgram\n >);\n}\n\nexport type CurveSwapExactInInput<\n TAccountConfig extends string = string,\n TAccountLaunch extends string = string,\n TAccountLaunchAuthority extends string = string,\n TAccountBaseVault extends string = string,\n TAccountQuoteVault extends string = string,\n TAccountUserBaseAccount extends string = string,\n TAccountUserQuoteAccount extends string = string,\n TAccountBaseMint extends string = string,\n TAccountQuoteMint extends string = string,\n TAccountUser extends string = string,\n TAccountSentinelProgram extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n config: Address<TAccountConfig>;\n launch: Address<TAccountLaunch>;\n launchAuthority: Address<TAccountLaunchAuthority>;\n baseVault: Address<TAccountBaseVault>;\n quoteVault: Address<TAccountQuoteVault>;\n userBaseAccount: Address<TAccountUserBaseAccount>;\n userQuoteAccount: Address<TAccountUserQuoteAccount>;\n baseMint: Address<TAccountBaseMint>;\n quoteMint: Address<TAccountQuoteMint>;\n user: TransactionSigner<TAccountUser>;\n /** Optional sentinel program (must match launch.sentinel_program if set) */\n sentinelProgram?: Address<TAccountSentinelProgram>;\n tokenProgram?: Address<TAccountTokenProgram>;\n amountIn: CurveSwapExactInInstructionDataArgs['amountIn'];\n minAmountOut: CurveSwapExactInInstructionDataArgs['minAmountOut'];\n direction: CurveSwapExactInInstructionDataArgs['direction'];\n};\n\nexport function getCurveSwapExactInInstruction<\n TAccountConfig extends string,\n TAccountLaunch extends string,\n TAccountLaunchAuthority extends string,\n TAccountBaseVault extends string,\n TAccountQuoteVault extends string,\n TAccountUserBaseAccount extends string,\n TAccountUserQuoteAccount extends string,\n TAccountBaseMint extends string,\n TAccountQuoteMint extends string,\n TAccountUser extends string,\n TAccountSentinelProgram extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: CurveSwapExactInInput<\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountUserBaseAccount,\n TAccountUserQuoteAccount,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountUser,\n TAccountSentinelProgram,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CurveSwapExactInInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountUserBaseAccount,\n TAccountUserQuoteAccount,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountUser,\n TAccountSentinelProgram,\n TAccountTokenProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n config: { value: input.config ?? null, isWritable: false },\n launch: { value: input.launch ?? null, isWritable: true },\n launchAuthority: {\n value: input.launchAuthority ?? null,\n isWritable: false,\n },\n baseVault: { value: input.baseVault ?? null, isWritable: true },\n quoteVault: { value: input.quoteVault ?? null, isWritable: true },\n userBaseAccount: { value: input.userBaseAccount ?? null, isWritable: true },\n userQuoteAccount: {\n value: input.userQuoteAccount ?? null,\n isWritable: true,\n },\n baseMint: { value: input.baseMint ?? null, isWritable: false },\n quoteMint: { value: input.quoteMint ?? null, isWritable: false },\n user: { value: input.user ?? null, isWritable: false },\n sentinelProgram: {\n value: input.sentinelProgram ?? null,\n isWritable: false,\n },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('config', accounts.config),\n getAccountMeta('launch', accounts.launch),\n getAccountMeta('launchAuthority', accounts.launchAuthority),\n getAccountMeta('baseVault', accounts.baseVault),\n getAccountMeta('quoteVault', accounts.quoteVault),\n getAccountMeta('userBaseAccount', accounts.userBaseAccount),\n getAccountMeta('userQuoteAccount', accounts.userQuoteAccount),\n getAccountMeta('baseMint', accounts.baseMint),\n getAccountMeta('quoteMint', accounts.quoteMint),\n getAccountMeta('user', accounts.user),\n getAccountMeta('sentinelProgram', accounts.sentinelProgram),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n ],\n data: getCurveSwapExactInInstructionDataEncoder().encode(\n args as CurveSwapExactInInstructionDataArgs,\n ),\n programAddress,\n } as CurveSwapExactInInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountUserBaseAccount,\n TAccountUserQuoteAccount,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountUser,\n TAccountSentinelProgram,\n TAccountTokenProgram\n >);\n}\n\nexport type ParsedCurveSwapExactInInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n config: TAccountMetas[0];\n launch: TAccountMetas[1];\n launchAuthority: TAccountMetas[2];\n baseVault: TAccountMetas[3];\n quoteVault: TAccountMetas[4];\n userBaseAccount: TAccountMetas[5];\n userQuoteAccount: TAccountMetas[6];\n baseMint: TAccountMetas[7];\n quoteMint: TAccountMetas[8];\n user: TAccountMetas[9];\n /** Optional sentinel program (must match launch.sentinel_program if set) */\n sentinelProgram?: TAccountMetas[10] | undefined;\n tokenProgram: TAccountMetas[11];\n };\n data: CurveSwapExactInInstructionData;\n};\n\nexport function parseCurveSwapExactInInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCurveSwapExactInInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 12) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 12,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n const getNextOptionalAccount = () => {\n const accountMeta = getNextAccount();\n return accountMeta.address === INITIALIZER_PROGRAM_ADDRESS\n ? undefined\n : accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n config: getNextAccount(),\n launch: getNextAccount(),\n launchAuthority: getNextAccount(),\n baseVault: getNextAccount(),\n quoteVault: getNextAccount(),\n userBaseAccount: getNextAccount(),\n userQuoteAccount: getNextAccount(),\n baseMint: getNextAccount(),\n quoteMint: getNextAccount(),\n user: getNextAccount(),\n sentinelProgram: getNextOptionalAccount(),\n tokenProgram: getNextAccount(),\n },\n data: getCurveSwapExactInInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { INITIALIZER_PROGRAM_ADDRESS } from '../programs';\n\nexport const INITIALIZE_CONFIG_DISCRIMINATOR = new Uint8Array([\n 208, 127, 21, 1, 194, 190, 196, 70,\n]);\n\nexport function getInitializeConfigDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n INITIALIZE_CONFIG_DISCRIMINATOR,\n );\n}\n\nexport type InitializeConfigInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountAdmin extends string | AccountMeta<string> = string,\n TAccountConfig extends string | AccountMeta<string> = string,\n TAccountProgramData extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n '11111111111111111111111111111111',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAdmin extends string\n ? WritableSignerAccount<TAccountAdmin> &\n AccountSignerMeta<TAccountAdmin>\n : TAccountAdmin,\n TAccountConfig extends string\n ? WritableAccount<TAccountConfig>\n : TAccountConfig,\n TAccountProgramData extends string\n ? ReadonlyAccount<TAccountProgramData>\n : TAccountProgramData,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializeConfigInstructionData = {\n discriminator: ReadonlyUint8Array;\n migratorAllowlist: Array<Address>;\n sentinelAllowlist: Array<Address>;\n};\n\nexport type InitializeConfigInstructionDataArgs = {\n migratorAllowlist: Array<Address>;\n sentinelAllowlist: Array<Address>;\n};\n\nexport function getInitializeConfigInstructionDataEncoder(): Encoder<InitializeConfigInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['migratorAllowlist', getArrayEncoder(getAddressEncoder())],\n ['sentinelAllowlist', getArrayEncoder(getAddressEncoder())],\n ]),\n (value) => ({ ...value, discriminator: INITIALIZE_CONFIG_DISCRIMINATOR }),\n );\n}\n\nexport function getInitializeConfigInstructionDataDecoder(): Decoder<InitializeConfigInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['migratorAllowlist', getArrayDecoder(getAddressDecoder())],\n ['sentinelAllowlist', getArrayDecoder(getAddressDecoder())],\n ]);\n}\n\nexport function getInitializeConfigInstructionDataCodec(): Codec<\n InitializeConfigInstructionDataArgs,\n InitializeConfigInstructionData\n> {\n return combineCodec(\n getInitializeConfigInstructionDataEncoder(),\n getInitializeConfigInstructionDataDecoder(),\n );\n}\n\nexport type InitializeConfigAsyncInput<\n TAccountAdmin extends string = string,\n TAccountConfig extends string = string,\n TAccountProgramData extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n admin: TransactionSigner<TAccountAdmin>;\n config?: Address<TAccountConfig>;\n programData: Address<TAccountProgramData>;\n systemProgram?: Address<TAccountSystemProgram>;\n migratorAllowlist: InitializeConfigInstructionDataArgs['migratorAllowlist'];\n sentinelAllowlist: InitializeConfigInstructionDataArgs['sentinelAllowlist'];\n};\n\nexport async function getInitializeConfigInstructionAsync<\n TAccountAdmin extends string,\n TAccountConfig extends string,\n TAccountProgramData extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: InitializeConfigAsyncInput<\n TAccountAdmin,\n TAccountConfig,\n TAccountProgramData,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n InitializeConfigInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig,\n TAccountProgramData,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n admin: { value: input.admin ?? null, isWritable: true },\n config: { value: input.config ?? null, isWritable: true },\n programData: { value: input.programData ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.config.value) {\n accounts.config.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([99, 111, 110, 102, 105, 103, 95, 118, 51]),\n ),\n ],\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('admin', accounts.admin),\n getAccountMeta('config', accounts.config),\n getAccountMeta('programData', accounts.programData),\n getAccountMeta('systemProgram', accounts.systemProgram),\n ],\n data: getInitializeConfigInstructionDataEncoder().encode(\n args as InitializeConfigInstructionDataArgs,\n ),\n programAddress,\n } as InitializeConfigInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig,\n TAccountProgramData,\n TAccountSystemProgram\n >);\n}\n\nexport type InitializeConfigInput<\n TAccountAdmin extends string = string,\n TAccountConfig extends string = string,\n TAccountProgramData extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n admin: TransactionSigner<TAccountAdmin>;\n config: Address<TAccountConfig>;\n programData: Address<TAccountProgramData>;\n systemProgram?: Address<TAccountSystemProgram>;\n migratorAllowlist: InitializeConfigInstructionDataArgs['migratorAllowlist'];\n sentinelAllowlist: InitializeConfigInstructionDataArgs['sentinelAllowlist'];\n};\n\nexport function getInitializeConfigInstruction<\n TAccountAdmin extends string,\n TAccountConfig extends string,\n TAccountProgramData extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: InitializeConfigInput<\n TAccountAdmin,\n TAccountConfig,\n TAccountProgramData,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): InitializeConfigInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig,\n TAccountProgramData,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n admin: { value: input.admin ?? null, isWritable: true },\n config: { value: input.config ?? null, isWritable: true },\n programData: { value: input.programData ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('admin', accounts.admin),\n getAccountMeta('config', accounts.config),\n getAccountMeta('programData', accounts.programData),\n getAccountMeta('systemProgram', accounts.systemProgram),\n ],\n data: getInitializeConfigInstructionDataEncoder().encode(\n args as InitializeConfigInstructionDataArgs,\n ),\n programAddress,\n } as InitializeConfigInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig,\n TAccountProgramData,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedInitializeConfigInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n admin: TAccountMetas[0];\n config: TAccountMetas[1];\n programData: TAccountMetas[2];\n systemProgram: TAccountMetas[3];\n };\n data: InitializeConfigInstructionData;\n};\n\nexport function parseInitializeConfigInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedInitializeConfigInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 4,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n admin: getNextAccount(),\n config: getNextAccount(),\n programData: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getInitializeConfigInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n addDecoderSizePrefix,\n addEncoderSizePrefix,\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n getUtf8Decoder,\n getUtf8Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { INITIALIZER_PROGRAM_ADDRESS } from '../programs';\n\nexport const INITIALIZE_LAUNCH_DISCRIMINATOR = new Uint8Array([\n 90, 201, 220, 142, 112, 253, 100, 13,\n]);\n\nexport function getInitializeLaunchDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n INITIALIZE_LAUNCH_DISCRIMINATOR,\n );\n}\n\nexport type InitializeLaunchInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountConfig extends string | AccountMeta<string> = string,\n TAccountLaunch extends string | AccountMeta<string> = string,\n TAccountLaunchAuthority extends string | AccountMeta<string> = string,\n TAccountBaseMint extends string | AccountMeta<string> = string,\n TAccountQuoteMint extends string | AccountMeta<string> = string,\n TAccountBaseVault extends string | AccountMeta<string> = string,\n TAccountQuoteVault extends string | AccountMeta<string> = string,\n TAccountPayer extends string | AccountMeta<string> = string,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountMigratorProgram extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',\n TAccountSystemProgram extends string | AccountMeta<string> =\n '11111111111111111111111111111111',\n TAccountRent extends string | AccountMeta<string> =\n 'SysvarRent111111111111111111111111111111111',\n TAccountMetadataAccount extends string | AccountMeta<string> = string,\n TAccountMetadataProgram extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountConfig extends string\n ? ReadonlyAccount<TAccountConfig>\n : TAccountConfig,\n TAccountLaunch extends string\n ? WritableAccount<TAccountLaunch>\n : TAccountLaunch,\n TAccountLaunchAuthority extends string\n ? ReadonlyAccount<TAccountLaunchAuthority>\n : TAccountLaunchAuthority,\n TAccountBaseMint extends string\n ? WritableSignerAccount<TAccountBaseMint> &\n AccountSignerMeta<TAccountBaseMint>\n : TAccountBaseMint,\n TAccountQuoteMint extends string\n ? ReadonlyAccount<TAccountQuoteMint>\n : TAccountQuoteMint,\n TAccountBaseVault extends string\n ? WritableSignerAccount<TAccountBaseVault> &\n AccountSignerMeta<TAccountBaseVault>\n : TAccountBaseVault,\n TAccountQuoteVault extends string\n ? WritableSignerAccount<TAccountQuoteVault> &\n AccountSignerMeta<TAccountQuoteVault>\n : TAccountQuoteVault,\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> &\n AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n TAccountAuthority extends string\n ? ReadonlySignerAccount<TAccountAuthority> &\n AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountMigratorProgram extends string\n ? ReadonlyAccount<TAccountMigratorProgram>\n : TAccountMigratorProgram,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n TAccountRent extends string\n ? ReadonlyAccount<TAccountRent>\n : TAccountRent,\n TAccountMetadataAccount extends string\n ? WritableAccount<TAccountMetadataAccount>\n : TAccountMetadataAccount,\n TAccountMetadataProgram extends string\n ? ReadonlyAccount<TAccountMetadataProgram>\n : TAccountMetadataProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializeLaunchInstructionData = {\n discriminator: ReadonlyUint8Array;\n namespace: Address;\n launchId: ReadonlyUint8Array;\n baseDecimals: number;\n baseTotalSupply: bigint;\n baseForDistribution: bigint;\n baseForLiquidity: bigint;\n curveVirtualBase: bigint;\n curveVirtualQuote: bigint;\n curveFeeBps: number;\n curveKind: number;\n curveParams: ReadonlyUint8Array;\n allowBuy: number;\n allowSell: number;\n sentinelProgram: Address;\n sentinelFlags: number;\n sentinelCalldata: ReadonlyUint8Array;\n migratorProgram: Address;\n migratorInitCalldata: ReadonlyUint8Array;\n migratorMigrateCalldata: ReadonlyUint8Array;\n /**\n * Commitment hash for swap/preview sentinel remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n sentinelRemainingAccountsHash: ReadonlyUint8Array;\n /**\n * Commitment hash for migrate remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n migratorRemainingAccountsHash: ReadonlyUint8Array;\n /** Token name for on-chain metadata. If empty, metadata creation is skipped. */\n metadataName: string;\n /** Token symbol for on-chain metadata. */\n metadataSymbol: string;\n /** Metadata JSON URI for on-chain metadata. */\n metadataUri: string;\n};\n\nexport type InitializeLaunchInstructionDataArgs = {\n namespace: Address;\n launchId: ReadonlyUint8Array;\n baseDecimals: number;\n baseTotalSupply: number | bigint;\n baseForDistribution: number | bigint;\n baseForLiquidity: number | bigint;\n curveVirtualBase: number | bigint;\n curveVirtualQuote: number | bigint;\n curveFeeBps: number;\n curveKind: number;\n curveParams: ReadonlyUint8Array;\n allowBuy: number;\n allowSell: number;\n sentinelProgram: Address;\n sentinelFlags: number;\n sentinelCalldata: ReadonlyUint8Array;\n migratorProgram: Address;\n migratorInitCalldata: ReadonlyUint8Array;\n migratorMigrateCalldata: ReadonlyUint8Array;\n /**\n * Commitment hash for swap/preview sentinel remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n sentinelRemainingAccountsHash: ReadonlyUint8Array;\n /**\n * Commitment hash for migrate remaining accounts.\n * Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).\n */\n migratorRemainingAccountsHash: ReadonlyUint8Array;\n /** Token name for on-chain metadata. If empty, metadata creation is skipped. */\n metadataName: string;\n /** Token symbol for on-chain metadata. */\n metadataSymbol: string;\n /** Metadata JSON URI for on-chain metadata. */\n metadataUri: string;\n};\n\nexport function getInitializeLaunchInstructionDataEncoder(): Encoder<InitializeLaunchInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['namespace', getAddressEncoder()],\n ['launchId', fixEncoderSize(getBytesEncoder(), 32)],\n ['baseDecimals', getU8Encoder()],\n ['baseTotalSupply', getU64Encoder()],\n ['baseForDistribution', getU64Encoder()],\n ['baseForLiquidity', getU64Encoder()],\n ['curveVirtualBase', getU64Encoder()],\n ['curveVirtualQuote', getU64Encoder()],\n ['curveFeeBps', getU16Encoder()],\n ['curveKind', getU8Encoder()],\n ['curveParams', addEncoderSizePrefix(getBytesEncoder(), getU32Encoder())],\n ['allowBuy', getU8Encoder()],\n ['allowSell', getU8Encoder()],\n ['sentinelProgram', getAddressEncoder()],\n ['sentinelFlags', getU32Encoder()],\n [\n 'sentinelCalldata',\n addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),\n ],\n ['migratorProgram', getAddressEncoder()],\n [\n 'migratorInitCalldata',\n addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),\n ],\n [\n 'migratorMigrateCalldata',\n addEncoderSizePrefix(getBytesEncoder(), getU32Encoder()),\n ],\n ['sentinelRemainingAccountsHash', fixEncoderSize(getBytesEncoder(), 32)],\n ['migratorRemainingAccountsHash', fixEncoderSize(getBytesEncoder(), 32)],\n ['metadataName', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n [\n 'metadataSymbol',\n addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder()),\n ],\n ['metadataUri', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],\n ]),\n (value) => ({ ...value, discriminator: INITIALIZE_LAUNCH_DISCRIMINATOR }),\n );\n}\n\nexport function getInitializeLaunchInstructionDataDecoder(): Decoder<InitializeLaunchInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['namespace', getAddressDecoder()],\n ['launchId', fixDecoderSize(getBytesDecoder(), 32)],\n ['baseDecimals', getU8Decoder()],\n ['baseTotalSupply', getU64Decoder()],\n ['baseForDistribution', getU64Decoder()],\n ['baseForLiquidity', getU64Decoder()],\n ['curveVirtualBase', getU64Decoder()],\n ['curveVirtualQuote', getU64Decoder()],\n ['curveFeeBps', getU16Decoder()],\n ['curveKind', getU8Decoder()],\n ['curveParams', addDecoderSizePrefix(getBytesDecoder(), getU32Decoder())],\n ['allowBuy', getU8Decoder()],\n ['allowSell', getU8Decoder()],\n ['sentinelProgram', getAddressDecoder()],\n ['sentinelFlags', getU32Decoder()],\n [\n 'sentinelCalldata',\n addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),\n ],\n ['migratorProgram', getAddressDecoder()],\n [\n 'migratorInitCalldata',\n addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),\n ],\n [\n 'migratorMigrateCalldata',\n addDecoderSizePrefix(getBytesDecoder(), getU32Decoder()),\n ],\n ['sentinelRemainingAccountsHash', fixDecoderSize(getBytesDecoder(), 32)],\n ['migratorRemainingAccountsHash', fixDecoderSize(getBytesDecoder(), 32)],\n ['metadataName', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['metadataSymbol', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ['metadataUri', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],\n ]);\n}\n\nexport function getInitializeLaunchInstructionDataCodec(): Codec<\n InitializeLaunchInstructionDataArgs,\n InitializeLaunchInstructionData\n> {\n return combineCodec(\n getInitializeLaunchInstructionDataEncoder(),\n getInitializeLaunchInstructionDataDecoder(),\n );\n}\n\nexport type InitializeLaunchAsyncInput<\n TAccountConfig extends string = string,\n TAccountLaunch extends string = string,\n TAccountLaunchAuthority extends string = string,\n TAccountBaseMint extends string = string,\n TAccountQuoteMint extends string = string,\n TAccountBaseVault extends string = string,\n TAccountQuoteVault extends string = string,\n TAccountPayer extends string = string,\n TAccountAuthority extends string = string,\n TAccountMigratorProgram extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountRent extends string = string,\n TAccountMetadataAccount extends string = string,\n TAccountMetadataProgram extends string = string,\n> = {\n config?: Address<TAccountConfig>;\n launch: Address<TAccountLaunch>;\n launchAuthority?: Address<TAccountLaunchAuthority>;\n baseMint: TransactionSigner<TAccountBaseMint>;\n quoteMint: Address<TAccountQuoteMint>;\n baseVault: TransactionSigner<TAccountBaseVault>;\n quoteVault: TransactionSigner<TAccountQuoteVault>;\n payer: TransactionSigner<TAccountPayer>;\n /** Optional authority (creator/admin). If not provided, launch is permissionless. */\n authority?: TransactionSigner<TAccountAuthority>;\n /** Optional migrator program for init hook */\n migratorProgram?: Address<TAccountMigratorProgram>;\n tokenProgram?: Address<TAccountTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n rent?: Address<TAccountRent>;\n /** Metadata account (PDA derived from base_mint via Metaplex Token Metadata). */\n metadataAccount?: Address<TAccountMetadataAccount>;\n /** Metaplex Token Metadata program. */\n metadataProgram?: Address<TAccountMetadataProgram>;\n namespace: InitializeLaunchInstructionDataArgs['namespace'];\n launchId: InitializeLaunchInstructionDataArgs['launchId'];\n baseDecimals: InitializeLaunchInstructionDataArgs['baseDecimals'];\n baseTotalSupply: InitializeLaunchInstructionDataArgs['baseTotalSupply'];\n baseForDistribution: InitializeLaunchInstructionDataArgs['baseForDistribution'];\n baseForLiquidity: InitializeLaunchInstructionDataArgs['baseForLiquidity'];\n curveVirtualBase: InitializeLaunchInstructionDataArgs['curveVirtualBase'];\n curveVirtualQuote: InitializeLaunchInstructionDataArgs['curveVirtualQuote'];\n curveFeeBps: InitializeLaunchInstructionDataArgs['curveFeeBps'];\n curveKind: InitializeLaunchInstructionDataArgs['curveKind'];\n curveParams: InitializeLaunchInstructionDataArgs['curveParams'];\n allowBuy: InitializeLaunchInstructionDataArgs['allowBuy'];\n allowSell: InitializeLaunchInstructionDataArgs['allowSell'];\n sentinelProgram: InitializeLaunchInstructionDataArgs['sentinelProgram'];\n sentinelFlags: InitializeLaunchInstructionDataArgs['sentinelFlags'];\n sentinelCalldata: InitializeLaunchInstructionDataArgs['sentinelCalldata'];\n migratorProgramArg: InitializeLaunchInstructionDataArgs['migratorProgram'];\n migratorInitCalldata: InitializeLaunchInstructionDataArgs['migratorInitCalldata'];\n migratorMigrateCalldata: InitializeLaunchInstructionDataArgs['migratorMigrateCalldata'];\n sentinelRemainingAccountsHash: InitializeLaunchInstructionDataArgs['sentinelRemainingAccountsHash'];\n migratorRemainingAccountsHash: InitializeLaunchInstructionDataArgs['migratorRemainingAccountsHash'];\n metadataName: InitializeLaunchInstructionDataArgs['metadataName'];\n metadataSymbol: InitializeLaunchInstructionDataArgs['metadataSymbol'];\n metadataUri: InitializeLaunchInstructionDataArgs['metadataUri'];\n};\n\nexport async function getInitializeLaunchInstructionAsync<\n TAccountConfig extends string,\n TAccountLaunch extends string,\n TAccountLaunchAuthority extends string,\n TAccountBaseMint extends string,\n TAccountQuoteMint extends string,\n TAccountBaseVault extends string,\n TAccountQuoteVault extends string,\n TAccountPayer extends string,\n TAccountAuthority extends string,\n TAccountMigratorProgram extends string,\n TAccountTokenProgram extends string,\n TAccountSystemProgram extends string,\n TAccountRent extends string,\n TAccountMetadataAccount extends string,\n TAccountMetadataProgram extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: InitializeLaunchAsyncInput<\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountAuthority,\n TAccountMigratorProgram,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountMetadataAccount,\n TAccountMetadataProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n InitializeLaunchInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountAuthority,\n TAccountMigratorProgram,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountMetadataAccount,\n TAccountMetadataProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n config: { value: input.config ?? null, isWritable: false },\n launch: { value: input.launch ?? null, isWritable: true },\n launchAuthority: {\n value: input.launchAuthority ?? null,\n isWritable: false,\n },\n baseMint: { value: input.baseMint ?? null, isWritable: true },\n quoteMint: { value: input.quoteMint ?? null, isWritable: false },\n baseVault: { value: input.baseVault ?? null, isWritable: true },\n quoteVault: { value: input.quoteVault ?? null, isWritable: true },\n payer: { value: input.payer ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: false },\n migratorProgram: {\n value: input.migratorProgram ?? null,\n isWritable: false,\n },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n rent: { value: input.rent ?? null, isWritable: false },\n metadataAccount: { value: input.metadataAccount ?? null, isWritable: true },\n metadataProgram: {\n value: input.metadataProgram ?? null,\n isWritable: false,\n },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input, migratorProgram: input.migratorProgramArg };\n\n // Resolve default values.\n if (!accounts.config.value) {\n accounts.config.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([99, 111, 110, 102, 105, 103, 95, 118, 51]),\n ),\n ],\n });\n }\n if (!accounts.launchAuthority.value) {\n accounts.launchAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([\n 108, 97, 117, 110, 99, 104, 95, 97, 117, 116, 104, 111, 114, 105,\n 116, 121, 95, 118, 51,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n 'launch',\n accounts.launch.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.rent.value) {\n accounts.rent.value =\n 'SysvarRent111111111111111111111111111111111' as Address<'SysvarRent111111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('config', accounts.config),\n getAccountMeta('launch', accounts.launch),\n getAccountMeta('launchAuthority', accounts.launchAuthority),\n getAccountMeta('baseMint', accounts.baseMint),\n getAccountMeta('quoteMint', accounts.quoteMint),\n getAccountMeta('baseVault', accounts.baseVault),\n getAccountMeta('quoteVault', accounts.quoteVault),\n getAccountMeta('payer', accounts.payer),\n getAccountMeta('authority', accounts.authority),\n getAccountMeta('migratorProgram', accounts.migratorProgram),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('rent', accounts.rent),\n getAccountMeta('metadataAccount', accounts.metadataAccount),\n getAccountMeta('metadataProgram', accounts.metadataProgram),\n ],\n data: getInitializeLaunchInstructionDataEncoder().encode(\n args as InitializeLaunchInstructionDataArgs,\n ),\n programAddress,\n } as InitializeLaunchInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountAuthority,\n TAccountMigratorProgram,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountMetadataAccount,\n TAccountMetadataProgram\n >);\n}\n\nexport type InitializeLaunchInput<\n TAccountConfig extends string = string,\n TAccountLaunch extends string = string,\n TAccountLaunchAuthority extends string = string,\n TAccountBaseMint extends string = string,\n TAccountQuoteMint extends string = string,\n TAccountBaseVault extends string = string,\n TAccountQuoteVault extends string = string,\n TAccountPayer extends string = string,\n TAccountAuthority extends string = string,\n TAccountMigratorProgram extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountRent extends string = string,\n TAccountMetadataAccount extends string = string,\n TAccountMetadataProgram extends string = string,\n> = {\n config: Address<TAccountConfig>;\n launch: Address<TAccountLaunch>;\n launchAuthority: Address<TAccountLaunchAuthority>;\n baseMint: TransactionSigner<TAccountBaseMint>;\n quoteMint: Address<TAccountQuoteMint>;\n baseVault: TransactionSigner<TAccountBaseVault>;\n quoteVault: TransactionSigner<TAccountQuoteVault>;\n payer: TransactionSigner<TAccountPayer>;\n /** Optional authority (creator/admin). If not provided, launch is permissionless. */\n authority?: TransactionSigner<TAccountAuthority>;\n /** Optional migrator program for init hook */\n migratorProgram?: Address<TAccountMigratorProgram>;\n tokenProgram?: Address<TAccountTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n rent?: Address<TAccountRent>;\n /** Metadata account (PDA derived from base_mint via Metaplex Token Metadata). */\n metadataAccount?: Address<TAccountMetadataAccount>;\n /** Metaplex Token Metadata program. */\n metadataProgram?: Address<TAccountMetadataProgram>;\n namespace: InitializeLaunchInstructionDataArgs['namespace'];\n launchId: InitializeLaunchInstructionDataArgs['launchId'];\n baseDecimals: InitializeLaunchInstructionDataArgs['baseDecimals'];\n baseTotalSupply: InitializeLaunchInstructionDataArgs['baseTotalSupply'];\n baseForDistribution: InitializeLaunchInstructionDataArgs['baseForDistribution'];\n baseForLiquidity: InitializeLaunchInstructionDataArgs['baseForLiquidity'];\n curveVirtualBase: InitializeLaunchInstructionDataArgs['curveVirtualBase'];\n curveVirtualQuote: InitializeLaunchInstructionDataArgs['curveVirtualQuote'];\n curveFeeBps: InitializeLaunchInstructionDataArgs['curveFeeBps'];\n curveKind: InitializeLaunchInstructionDataArgs['curveKind'];\n curveParams: InitializeLaunchInstructionDataArgs['curveParams'];\n allowBuy: InitializeLaunchInstructionDataArgs['allowBuy'];\n allowSell: InitializeLaunchInstructionDataArgs['allowSell'];\n sentinelProgram: InitializeLaunchInstructionDataArgs['sentinelProgram'];\n sentinelFlags: InitializeLaunchInstructionDataArgs['sentinelFlags'];\n sentinelCalldata: InitializeLaunchInstructionDataArgs['sentinelCalldata'];\n migratorProgramArg: InitializeLaunchInstructionDataArgs['migratorProgram'];\n migratorInitCalldata: InitializeLaunchInstructionDataArgs['migratorInitCalldata'];\n migratorMigrateCalldata: InitializeLaunchInstructionDataArgs['migratorMigrateCalldata'];\n sentinelRemainingAccountsHash: InitializeLaunchInstructionDataArgs['sentinelRemainingAccountsHash'];\n migratorRemainingAccountsHash: InitializeLaunchInstructionDataArgs['migratorRemainingAccountsHash'];\n metadataName: InitializeLaunchInstructionDataArgs['metadataName'];\n metadataSymbol: InitializeLaunchInstructionDataArgs['metadataSymbol'];\n metadataUri: InitializeLaunchInstructionDataArgs['metadataUri'];\n};\n\nexport function getInitializeLaunchInstruction<\n TAccountConfig extends string,\n TAccountLaunch extends string,\n TAccountLaunchAuthority extends string,\n TAccountBaseMint extends string,\n TAccountQuoteMint extends string,\n TAccountBaseVault extends string,\n TAccountQuoteVault extends string,\n TAccountPayer extends string,\n TAccountAuthority extends string,\n TAccountMigratorProgram extends string,\n TAccountTokenProgram extends string,\n TAccountSystemProgram extends string,\n TAccountRent extends string,\n TAccountMetadataAccount extends string,\n TAccountMetadataProgram extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: InitializeLaunchInput<\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountAuthority,\n TAccountMigratorProgram,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountMetadataAccount,\n TAccountMetadataProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): InitializeLaunchInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountAuthority,\n TAccountMigratorProgram,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountMetadataAccount,\n TAccountMetadataProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n config: { value: input.config ?? null, isWritable: false },\n launch: { value: input.launch ?? null, isWritable: true },\n launchAuthority: {\n value: input.launchAuthority ?? null,\n isWritable: false,\n },\n baseMint: { value: input.baseMint ?? null, isWritable: true },\n quoteMint: { value: input.quoteMint ?? null, isWritable: false },\n baseVault: { value: input.baseVault ?? null, isWritable: true },\n quoteVault: { value: input.quoteVault ?? null, isWritable: true },\n payer: { value: input.payer ?? null, isWritable: true },\n authority: { value: input.authority ?? null, isWritable: false },\n migratorProgram: {\n value: input.migratorProgram ?? null,\n isWritable: false,\n },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n rent: { value: input.rent ?? null, isWritable: false },\n metadataAccount: { value: input.metadataAccount ?? null, isWritable: true },\n metadataProgram: {\n value: input.metadataProgram ?? null,\n isWritable: false,\n },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input, migratorProgram: input.migratorProgramArg };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.rent.value) {\n accounts.rent.value =\n 'SysvarRent111111111111111111111111111111111' as Address<'SysvarRent111111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('config', accounts.config),\n getAccountMeta('launch', accounts.launch),\n getAccountMeta('launchAuthority', accounts.launchAuthority),\n getAccountMeta('baseMint', accounts.baseMint),\n getAccountMeta('quoteMint', accounts.quoteMint),\n getAccountMeta('baseVault', accounts.baseVault),\n getAccountMeta('quoteVault', accounts.quoteVault),\n getAccountMeta('payer', accounts.payer),\n getAccountMeta('authority', accounts.authority),\n getAccountMeta('migratorProgram', accounts.migratorProgram),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('rent', accounts.rent),\n getAccountMeta('metadataAccount', accounts.metadataAccount),\n getAccountMeta('metadataProgram', accounts.metadataProgram),\n ],\n data: getInitializeLaunchInstructionDataEncoder().encode(\n args as InitializeLaunchInstructionDataArgs,\n ),\n programAddress,\n } as InitializeLaunchInstruction<\n TProgramAddress,\n TAccountConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountAuthority,\n TAccountMigratorProgram,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountMetadataAccount,\n TAccountMetadataProgram\n >);\n}\n\nexport type ParsedInitializeLaunchInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n config: TAccountMetas[0];\n launch: TAccountMetas[1];\n launchAuthority: TAccountMetas[2];\n baseMint: TAccountMetas[3];\n quoteMint: TAccountMetas[4];\n baseVault: TAccountMetas[5];\n quoteVault: TAccountMetas[6];\n payer: TAccountMetas[7];\n /** Optional authority (creator/admin). If not provided, launch is permissionless. */\n authority?: TAccountMetas[8] | undefined;\n /** Optional migrator program for init hook */\n migratorProgram?: TAccountMetas[9] | undefined;\n tokenProgram: TAccountMetas[10];\n systemProgram: TAccountMetas[11];\n rent: TAccountMetas[12];\n /** Metadata account (PDA derived from base_mint via Metaplex Token Metadata). */\n metadataAccount?: TAccountMetas[13] | undefined;\n /** Metaplex Token Metadata program. */\n metadataProgram?: TAccountMetas[14] | undefined;\n };\n data: InitializeLaunchInstructionData;\n};\n\nexport function parseInitializeLaunchInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedInitializeLaunchInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 15) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 15,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n const getNextOptionalAccount = () => {\n const accountMeta = getNextAccount();\n return accountMeta.address === INITIALIZER_PROGRAM_ADDRESS\n ? undefined\n : accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n config: getNextAccount(),\n launch: getNextAccount(),\n launchAuthority: getNextAccount(),\n baseMint: getNextAccount(),\n quoteMint: getNextAccount(),\n baseVault: getNextAccount(),\n quoteVault: getNextAccount(),\n payer: getNextAccount(),\n authority: getNextOptionalAccount(),\n migratorProgram: getNextOptionalAccount(),\n tokenProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n rent: getNextAccount(),\n metadataAccount: getNextOptionalAccount(),\n metadataProgram: getNextOptionalAccount(),\n },\n data: getInitializeLaunchInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { INITIALIZER_PROGRAM_ADDRESS } from '../programs';\n\nexport const PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR = new Uint8Array([\n 50, 130, 31, 69, 147, 58, 222, 178,\n]);\n\nexport function getPreviewSwapExactInDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR,\n );\n}\n\nexport type PreviewSwapExactInInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountLaunch extends string | AccountMeta<string> = string,\n TAccountBaseVault extends string | AccountMeta<string> = string,\n TAccountQuoteVault extends string | AccountMeta<string> = string,\n TAccountSentinelProgram extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountLaunch extends string\n ? ReadonlyAccount<TAccountLaunch>\n : TAccountLaunch,\n TAccountBaseVault extends string\n ? ReadonlyAccount<TAccountBaseVault>\n : TAccountBaseVault,\n TAccountQuoteVault extends string\n ? ReadonlyAccount<TAccountQuoteVault>\n : TAccountQuoteVault,\n TAccountSentinelProgram extends string\n ? ReadonlyAccount<TAccountSentinelProgram>\n : TAccountSentinelProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type PreviewSwapExactInInstructionData = {\n discriminator: ReadonlyUint8Array;\n amountIn: bigint;\n direction: number;\n};\n\nexport type PreviewSwapExactInInstructionDataArgs = {\n amountIn: number | bigint;\n direction: number;\n};\n\nexport function getPreviewSwapExactInInstructionDataEncoder(): FixedSizeEncoder<PreviewSwapExactInInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['amountIn', getU64Encoder()],\n ['direction', getU8Encoder()],\n ]),\n (value) => ({\n ...value,\n discriminator: PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getPreviewSwapExactInInstructionDataDecoder(): FixedSizeDecoder<PreviewSwapExactInInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['amountIn', getU64Decoder()],\n ['direction', getU8Decoder()],\n ]);\n}\n\nexport function getPreviewSwapExactInInstructionDataCodec(): FixedSizeCodec<\n PreviewSwapExactInInstructionDataArgs,\n PreviewSwapExactInInstructionData\n> {\n return combineCodec(\n getPreviewSwapExactInInstructionDataEncoder(),\n getPreviewSwapExactInInstructionDataDecoder(),\n );\n}\n\nexport type PreviewSwapExactInInput<\n TAccountLaunch extends string = string,\n TAccountBaseVault extends string = string,\n TAccountQuoteVault extends string = string,\n TAccountSentinelProgram extends string = string,\n> = {\n launch: Address<TAccountLaunch>;\n baseVault: Address<TAccountBaseVault>;\n quoteVault: Address<TAccountQuoteVault>;\n /** Optional sentinel program (must match launch.sentinel_program if set) */\n sentinelProgram?: Address<TAccountSentinelProgram>;\n amountIn: PreviewSwapExactInInstructionDataArgs['amountIn'];\n direction: PreviewSwapExactInInstructionDataArgs['direction'];\n};\n\nexport function getPreviewSwapExactInInstruction<\n TAccountLaunch extends string,\n TAccountBaseVault extends string,\n TAccountQuoteVault extends string,\n TAccountSentinelProgram extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: PreviewSwapExactInInput<\n TAccountLaunch,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountSentinelProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): PreviewSwapExactInInstruction<\n TProgramAddress,\n TAccountLaunch,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountSentinelProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n launch: { value: input.launch ?? null, isWritable: false },\n baseVault: { value: input.baseVault ?? null, isWritable: false },\n quoteVault: { value: input.quoteVault ?? null, isWritable: false },\n sentinelProgram: {\n value: input.sentinelProgram ?? null,\n isWritable: false,\n },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('launch', accounts.launch),\n getAccountMeta('baseVault', accounts.baseVault),\n getAccountMeta('quoteVault', accounts.quoteVault),\n getAccountMeta('sentinelProgram', accounts.sentinelProgram),\n ],\n data: getPreviewSwapExactInInstructionDataEncoder().encode(\n args as PreviewSwapExactInInstructionDataArgs,\n ),\n programAddress,\n } as PreviewSwapExactInInstruction<\n TProgramAddress,\n TAccountLaunch,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountSentinelProgram\n >);\n}\n\nexport type ParsedPreviewSwapExactInInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n launch: TAccountMetas[0];\n baseVault: TAccountMetas[1];\n quoteVault: TAccountMetas[2];\n /** Optional sentinel program (must match launch.sentinel_program if set) */\n sentinelProgram?: TAccountMetas[3] | undefined;\n };\n data: PreviewSwapExactInInstructionData;\n};\n\nexport function parsePreviewSwapExactInInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedPreviewSwapExactInInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 4,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n const getNextOptionalAccount = () => {\n const accountMeta = getNextAccount();\n return accountMeta.address === INITIALIZER_PROGRAM_ADDRESS\n ? undefined\n : accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n launch: getNextAccount(),\n baseVault: getNextAccount(),\n quoteVault: getNextAccount(),\n sentinelProgram: getNextOptionalAccount(),\n },\n data: getPreviewSwapExactInInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { INITIALIZER_PROGRAM_ADDRESS } from '../programs';\n\nexport const SET_MIGRATOR_ALLOWLIST_DISCRIMINATOR = new Uint8Array([\n 209, 90, 181, 104, 99, 108, 233, 168,\n]);\n\nexport function getSetMigratorAllowlistDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n SET_MIGRATOR_ALLOWLIST_DISCRIMINATOR,\n );\n}\n\nexport type SetMigratorAllowlistInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountAdmin extends string | AccountMeta<string> = string,\n TAccountConfig extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAdmin extends string\n ? ReadonlySignerAccount<TAccountAdmin> &\n AccountSignerMeta<TAccountAdmin>\n : TAccountAdmin,\n TAccountConfig extends string\n ? WritableAccount<TAccountConfig>\n : TAccountConfig,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type SetMigratorAllowlistInstructionData = {\n discriminator: ReadonlyUint8Array;\n allowlist: Array<Address>;\n};\n\nexport type SetMigratorAllowlistInstructionDataArgs = {\n allowlist: Array<Address>;\n};\n\nexport function getSetMigratorAllowlistInstructionDataEncoder(): Encoder<SetMigratorAllowlistInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['allowlist', getArrayEncoder(getAddressEncoder())],\n ]),\n (value) => ({\n ...value,\n discriminator: SET_MIGRATOR_ALLOWLIST_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getSetMigratorAllowlistInstructionDataDecoder(): Decoder<SetMigratorAllowlistInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['allowlist', getArrayDecoder(getAddressDecoder())],\n ]);\n}\n\nexport function getSetMigratorAllowlistInstructionDataCodec(): Codec<\n SetMigratorAllowlistInstructionDataArgs,\n SetMigratorAllowlistInstructionData\n> {\n return combineCodec(\n getSetMigratorAllowlistInstructionDataEncoder(),\n getSetMigratorAllowlistInstructionDataDecoder(),\n );\n}\n\nexport type SetMigratorAllowlistAsyncInput<\n TAccountAdmin extends string = string,\n TAccountConfig extends string = string,\n> = {\n admin: TransactionSigner<TAccountAdmin>;\n config?: Address<TAccountConfig>;\n allowlist: SetMigratorAllowlistInstructionDataArgs['allowlist'];\n};\n\nexport async function getSetMigratorAllowlistInstructionAsync<\n TAccountAdmin extends string,\n TAccountConfig extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: SetMigratorAllowlistAsyncInput<TAccountAdmin, TAccountConfig>,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n SetMigratorAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n admin: { value: input.admin ?? null, isWritable: false },\n config: { value: input.config ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.config.value) {\n accounts.config.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([99, 111, 110, 102, 105, 103, 95, 118, 51]),\n ),\n ],\n });\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('admin', accounts.admin),\n getAccountMeta('config', accounts.config),\n ],\n data: getSetMigratorAllowlistInstructionDataEncoder().encode(\n args as SetMigratorAllowlistInstructionDataArgs,\n ),\n programAddress,\n } as SetMigratorAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n >);\n}\n\nexport type SetMigratorAllowlistInput<\n TAccountAdmin extends string = string,\n TAccountConfig extends string = string,\n> = {\n admin: TransactionSigner<TAccountAdmin>;\n config: Address<TAccountConfig>;\n allowlist: SetMigratorAllowlistInstructionDataArgs['allowlist'];\n};\n\nexport function getSetMigratorAllowlistInstruction<\n TAccountAdmin extends string,\n TAccountConfig extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: SetMigratorAllowlistInput<TAccountAdmin, TAccountConfig>,\n config?: { programAddress?: TProgramAddress },\n): SetMigratorAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n admin: { value: input.admin ?? null, isWritable: false },\n config: { value: input.config ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('admin', accounts.admin),\n getAccountMeta('config', accounts.config),\n ],\n data: getSetMigratorAllowlistInstructionDataEncoder().encode(\n args as SetMigratorAllowlistInstructionDataArgs,\n ),\n programAddress,\n } as SetMigratorAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n >);\n}\n\nexport type ParsedSetMigratorAllowlistInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n admin: TAccountMetas[0];\n config: TAccountMetas[1];\n };\n data: SetMigratorAllowlistInstructionData;\n};\n\nexport function parseSetMigratorAllowlistInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedSetMigratorAllowlistInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { admin: getNextAccount(), config: getNextAccount() },\n data: getSetMigratorAllowlistInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { INITIALIZER_PROGRAM_ADDRESS } from '../programs';\n\nexport const SET_SENTINEL_ALLOWLIST_DISCRIMINATOR = new Uint8Array([\n 233, 72, 180, 246, 171, 117, 21, 50,\n]);\n\nexport function getSetSentinelAllowlistDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n SET_SENTINEL_ALLOWLIST_DISCRIMINATOR,\n );\n}\n\nexport type SetSentinelAllowlistInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountAdmin extends string | AccountMeta<string> = string,\n TAccountConfig extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAdmin extends string\n ? ReadonlySignerAccount<TAccountAdmin> &\n AccountSignerMeta<TAccountAdmin>\n : TAccountAdmin,\n TAccountConfig extends string\n ? WritableAccount<TAccountConfig>\n : TAccountConfig,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type SetSentinelAllowlistInstructionData = {\n discriminator: ReadonlyUint8Array;\n allowlist: Array<Address>;\n};\n\nexport type SetSentinelAllowlistInstructionDataArgs = {\n allowlist: Array<Address>;\n};\n\nexport function getSetSentinelAllowlistInstructionDataEncoder(): Encoder<SetSentinelAllowlistInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['allowlist', getArrayEncoder(getAddressEncoder())],\n ]),\n (value) => ({\n ...value,\n discriminator: SET_SENTINEL_ALLOWLIST_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getSetSentinelAllowlistInstructionDataDecoder(): Decoder<SetSentinelAllowlistInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['allowlist', getArrayDecoder(getAddressDecoder())],\n ]);\n}\n\nexport function getSetSentinelAllowlistInstructionDataCodec(): Codec<\n SetSentinelAllowlistInstructionDataArgs,\n SetSentinelAllowlistInstructionData\n> {\n return combineCodec(\n getSetSentinelAllowlistInstructionDataEncoder(),\n getSetSentinelAllowlistInstructionDataDecoder(),\n );\n}\n\nexport type SetSentinelAllowlistAsyncInput<\n TAccountAdmin extends string = string,\n TAccountConfig extends string = string,\n> = {\n admin: TransactionSigner<TAccountAdmin>;\n config?: Address<TAccountConfig>;\n allowlist: SetSentinelAllowlistInstructionDataArgs['allowlist'];\n};\n\nexport async function getSetSentinelAllowlistInstructionAsync<\n TAccountAdmin extends string,\n TAccountConfig extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: SetSentinelAllowlistAsyncInput<TAccountAdmin, TAccountConfig>,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n SetSentinelAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n admin: { value: input.admin ?? null, isWritable: false },\n config: { value: input.config ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.config.value) {\n accounts.config.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([99, 111, 110, 102, 105, 103, 95, 118, 51]),\n ),\n ],\n });\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('admin', accounts.admin),\n getAccountMeta('config', accounts.config),\n ],\n data: getSetSentinelAllowlistInstructionDataEncoder().encode(\n args as SetSentinelAllowlistInstructionDataArgs,\n ),\n programAddress,\n } as SetSentinelAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n >);\n}\n\nexport type SetSentinelAllowlistInput<\n TAccountAdmin extends string = string,\n TAccountConfig extends string = string,\n> = {\n admin: TransactionSigner<TAccountAdmin>;\n config: Address<TAccountConfig>;\n allowlist: SetSentinelAllowlistInstructionDataArgs['allowlist'];\n};\n\nexport function getSetSentinelAllowlistInstruction<\n TAccountAdmin extends string,\n TAccountConfig extends string,\n TProgramAddress extends Address = typeof INITIALIZER_PROGRAM_ADDRESS,\n>(\n input: SetSentinelAllowlistInput<TAccountAdmin, TAccountConfig>,\n config?: { programAddress?: TProgramAddress },\n): SetSentinelAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n> {\n // Program address.\n const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n admin: { value: input.admin ?? null, isWritable: false },\n config: { value: input.config ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('admin', accounts.admin),\n getAccountMeta('config', accounts.config),\n ],\n data: getSetSentinelAllowlistInstructionDataEncoder().encode(\n args as SetSentinelAllowlistInstructionDataArgs,\n ),\n programAddress,\n } as SetSentinelAllowlistInstruction<\n TProgramAddress,\n TAccountAdmin,\n TAccountConfig\n >);\n}\n\nexport type ParsedSetSentinelAllowlistInstruction<\n TProgram extends string = typeof INITIALIZER_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n admin: TAccountMetas[0];\n config: TAccountMetas[1];\n };\n data: SetSentinelAllowlistInstructionData;\n};\n\nexport function parseSetSentinelAllowlistInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedSetSentinelAllowlistInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { admin: getNextAccount(), config: getNextAccount() },\n data: getSetSentinelAllowlistInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n isProgramError,\n type Address,\n type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM,\n type SolanaError,\n} from '@solana/kit';\nimport { INITIALIZER_PROGRAM_ADDRESS } from '../programs';\n\n/** Unauthorized: Unauthorized */\nexport const INITIALIZER_ERROR__UNAUTHORIZED = 0x1770; // 6000\n/** InvalidPhase: Invalid phase */\nexport const INITIALIZER_ERROR__INVALID_PHASE = 0x1771; // 6001\n/** InvalidAmount: Invalid amount */\nexport const INITIALIZER_ERROR__INVALID_AMOUNT = 0x1772; // 6002\n/** InvalidVault: Invalid vault */\nexport const INITIALIZER_ERROR__INVALID_VAULT = 0x1773; // 6003\n/** InvalidMint: Invalid mint */\nexport const INITIALIZER_ERROR__INVALID_MINT = 0x1774; // 6004\n/** MathOverflow: Math overflow */\nexport const INITIALIZER_ERROR__MATH_OVERFLOW = 0x1775; // 6005\n/** InvalidCurveParams: Invalid curve params */\nexport const INITIALIZER_ERROR__INVALID_CURVE_PARAMS = 0x1776; // 6006\n/** SlippageExceeded: Slippage exceeded */\nexport const INITIALIZER_ERROR__SLIPPAGE_EXCEEDED = 0x1777; // 6007\n/** CurveLiquidityInsufficient: Curve liquidity insufficient */\nexport const INITIALIZER_ERROR__CURVE_LIQUIDITY_INSUFFICIENT = 0x1778; // 6008\n/** CalldataTooLarge: Calldata too large */\nexport const INITIALIZER_ERROR__CALLDATA_TOO_LARGE = 0x1779; // 6009\n/** MigratorNotAllowlisted: Migrator not allowlisted */\nexport const INITIALIZER_ERROR__MIGRATOR_NOT_ALLOWLISTED = 0x177a; // 6010\n/** SentinelNotAllowlisted: Sentinel not allowlisted */\nexport const INITIALIZER_ERROR__SENTINEL_NOT_ALLOWLISTED = 0x177b; // 6011\n/** WrongMigrator: Wrong migrator program */\nexport const INITIALIZER_ERROR__WRONG_MIGRATOR = 0x177c; // 6012\n/** WrongSentinel: Wrong sentinel program */\nexport const INITIALIZER_ERROR__WRONG_SENTINEL = 0x177d; // 6013\n/** MigratorCpiFailed: Migrator CPI failed */\nexport const INITIALIZER_ERROR__MIGRATOR_CPI_FAILED = 0x177e; // 6014\n/** SentinelCpiFailed: Sentinel CPI failed */\nexport const INITIALIZER_ERROR__SENTINEL_CPI_FAILED = 0x177f; // 6015\n/** SentinelRejected: Sentinel rejected */\nexport const INITIALIZER_ERROR__SENTINEL_REJECTED = 0x1780; // 6016\n/** BuyNotAllowed: Buy not allowed */\nexport const INITIALIZER_ERROR__BUY_NOT_ALLOWED = 0x1781; // 6017\n/** SellNotAllowed: Sell not allowed */\nexport const INITIALIZER_ERROR__SELL_NOT_ALLOWED = 0x1782; // 6018\n/** InvalidDirection: Invalid direction */\nexport const INITIALIZER_ERROR__INVALID_DIRECTION = 0x1783; // 6019\n/** AllowlistFull: Allowlist full */\nexport const INITIALIZER_ERROR__ALLOWLIST_FULL = 0x1784; // 6020\n/** InvalidInput: Invalid input */\nexport const INITIALIZER_ERROR__INVALID_INPUT = 0x1785; // 6021\n/** AlreadyMigrated: Already migrated */\nexport const INITIALIZER_ERROR__ALREADY_MIGRATED = 0x1786; // 6022\n/** QuoteVaultNotEmpty: Quote vault not empty */\nexport const INITIALIZER_ERROR__QUOTE_VAULT_NOT_EMPTY = 0x1787; // 6023\n/** LaunchLocked: Launch locked */\nexport const INITIALIZER_ERROR__LAUNCH_LOCKED = 0x1788; // 6024\n/** InvalidCurveKind: Invalid curve kind */\nexport const INITIALIZER_ERROR__INVALID_CURVE_KIND = 0x1789; // 6025\n/** CurveParamsInvalid: Curve params invalid */\nexport const INITIALIZER_ERROR__CURVE_PARAMS_INVALID = 0x178a; // 6026\n/** RemainingAccountOverlap: Remaining account overlaps with protocol account */\nexport const INITIALIZER_ERROR__REMAINING_ACCOUNT_OVERLAP = 0x178b; // 6027\n/** MissingRemainingAccountsCommitment: Missing remaining accounts commitment */\nexport const INITIALIZER_ERROR__MISSING_REMAINING_ACCOUNTS_COMMITMENT = 0x178c; // 6028\n/** RemainingAccountsCommitmentMismatch: Remaining accounts commitment mismatch */\nexport const INITIALIZER_ERROR__REMAINING_ACCOUNTS_COMMITMENT_MISMATCH = 0x178d; // 6029\n/** InvalidOracle: Invalid oracle account */\nexport const INITIALIZER_ERROR__INVALID_ORACLE = 0x178e; // 6030\n/** MissingMetadataAccounts: Missing metadata accounts */\nexport const INITIALIZER_ERROR__MISSING_METADATA_ACCOUNTS = 0x178f; // 6031\n/** InvalidMetadataProgram: Invalid metadata program */\nexport const INITIALIZER_ERROR__INVALID_METADATA_PROGRAM = 0x1790; // 6032\n/** InvalidMetadataAccount: Invalid metadata account */\nexport const INITIALIZER_ERROR__INVALID_METADATA_ACCOUNT = 0x1791; // 6033\n/** MetadataCpiFailed: Metadata CPI failed */\nexport const INITIALIZER_ERROR__METADATA_CPI_FAILED = 0x1792; // 6034\n\nexport type InitializerError =\n | typeof INITIALIZER_ERROR__ALLOWLIST_FULL\n | typeof INITIALIZER_ERROR__ALREADY_MIGRATED\n | typeof INITIALIZER_ERROR__BUY_NOT_ALLOWED\n | typeof INITIALIZER_ERROR__CALLDATA_TOO_LARGE\n | typeof INITIALIZER_ERROR__CURVE_LIQUIDITY_INSUFFICIENT\n | typeof INITIALIZER_ERROR__CURVE_PARAMS_INVALID\n | typeof INITIALIZER_ERROR__INVALID_AMOUNT\n | typeof INITIALIZER_ERROR__INVALID_CURVE_KIND\n | typeof INITIALIZER_ERROR__INVALID_CURVE_PARAMS\n | typeof INITIALIZER_ERROR__INVALID_DIRECTION\n | typeof INITIALIZER_ERROR__INVALID_INPUT\n | typeof INITIALIZER_ERROR__INVALID_METADATA_ACCOUNT\n | typeof INITIALIZER_ERROR__INVALID_METADATA_PROGRAM\n | typeof INITIALIZER_ERROR__INVALID_MINT\n | typeof INITIALIZER_ERROR__INVALID_ORACLE\n | typeof INITIALIZER_ERROR__INVALID_PHASE\n | typeof INITIALIZER_ERROR__INVALID_VAULT\n | typeof INITIALIZER_ERROR__LAUNCH_LOCKED\n | typeof INITIALIZER_ERROR__MATH_OVERFLOW\n | typeof INITIALIZER_ERROR__METADATA_CPI_FAILED\n | typeof INITIALIZER_ERROR__MIGRATOR_CPI_FAILED\n | typeof INITIALIZER_ERROR__MIGRATOR_NOT_ALLOWLISTED\n | typeof INITIALIZER_ERROR__MISSING_METADATA_ACCOUNTS\n | typeof INITIALIZER_ERROR__MISSING_REMAINING_ACCOUNTS_COMMITMENT\n | typeof INITIALIZER_ERROR__QUOTE_VAULT_NOT_EMPTY\n | typeof INITIALIZER_ERROR__REMAINING_ACCOUNT_OVERLAP\n | typeof INITIALIZER_ERROR__REMAINING_ACCOUNTS_COMMITMENT_MISMATCH\n | typeof INITIALIZER_ERROR__SELL_NOT_ALLOWED\n | typeof INITIALIZER_ERROR__SENTINEL_CPI_FAILED\n | typeof INITIALIZER_ERROR__SENTINEL_NOT_ALLOWLISTED\n | typeof INITIALIZER_ERROR__SENTINEL_REJECTED\n | typeof INITIALIZER_ERROR__SLIPPAGE_EXCEEDED\n | typeof INITIALIZER_ERROR__UNAUTHORIZED\n | typeof INITIALIZER_ERROR__WRONG_MIGRATOR\n | typeof INITIALIZER_ERROR__WRONG_SENTINEL;\n\nlet initializerErrorMessages: Record<InitializerError, string> | undefined;\nif (process.env.NODE_ENV !== 'production') {\n initializerErrorMessages = {\n [INITIALIZER_ERROR__ALLOWLIST_FULL]: `Allowlist full`,\n [INITIALIZER_ERROR__ALREADY_MIGRATED]: `Already migrated`,\n [INITIALIZER_ERROR__BUY_NOT_ALLOWED]: `Buy not allowed`,\n [INITIALIZER_ERROR__CALLDATA_TOO_LARGE]: `Calldata too large`,\n [INITIALIZER_ERROR__CURVE_LIQUIDITY_INSUFFICIENT]: `Curve liquidity insufficient`,\n [INITIALIZER_ERROR__CURVE_PARAMS_INVALID]: `Curve params invalid`,\n [INITIALIZER_ERROR__INVALID_AMOUNT]: `Invalid amount`,\n [INITIALIZER_ERROR__INVALID_CURVE_KIND]: `Invalid curve kind`,\n [INITIALIZER_ERROR__INVALID_CURVE_PARAMS]: `Invalid curve params`,\n [INITIALIZER_ERROR__INVALID_DIRECTION]: `Invalid direction`,\n [INITIALIZER_ERROR__INVALID_INPUT]: `Invalid input`,\n [INITIALIZER_ERROR__INVALID_METADATA_ACCOUNT]: `Invalid metadata account`,\n [INITIALIZER_ERROR__INVALID_METADATA_PROGRAM]: `Invalid metadata program`,\n [INITIALIZER_ERROR__INVALID_MINT]: `Invalid mint`,\n [INITIALIZER_ERROR__INVALID_ORACLE]: `Invalid oracle account`,\n [INITIALIZER_ERROR__INVALID_PHASE]: `Invalid phase`,\n [INITIALIZER_ERROR__INVALID_VAULT]: `Invalid vault`,\n [INITIALIZER_ERROR__LAUNCH_LOCKED]: `Launch locked`,\n [INITIALIZER_ERROR__MATH_OVERFLOW]: `Math overflow`,\n [INITIALIZER_ERROR__METADATA_CPI_FAILED]: `Metadata CPI failed`,\n [INITIALIZER_ERROR__MIGRATOR_CPI_FAILED]: `Migrator CPI failed`,\n [INITIALIZER_ERROR__MIGRATOR_NOT_ALLOWLISTED]: `Migrator not allowlisted`,\n [INITIALIZER_ERROR__MISSING_METADATA_ACCOUNTS]: `Missing metadata accounts`,\n [INITIALIZER_ERROR__MISSING_REMAINING_ACCOUNTS_COMMITMENT]: `Missing remaining accounts commitment`,\n [INITIALIZER_ERROR__QUOTE_VAULT_NOT_EMPTY]: `Quote vault not empty`,\n [INITIALIZER_ERROR__REMAINING_ACCOUNT_OVERLAP]: `Remaining account overlaps with protocol account`,\n [INITIALIZER_ERROR__REMAINING_ACCOUNTS_COMMITMENT_MISMATCH]: `Remaining accounts commitment mismatch`,\n [INITIALIZER_ERROR__SELL_NOT_ALLOWED]: `Sell not allowed`,\n [INITIALIZER_ERROR__SENTINEL_CPI_FAILED]: `Sentinel CPI failed`,\n [INITIALIZER_ERROR__SENTINEL_NOT_ALLOWLISTED]: `Sentinel not allowlisted`,\n [INITIALIZER_ERROR__SENTINEL_REJECTED]: `Sentinel rejected`,\n [INITIALIZER_ERROR__SLIPPAGE_EXCEEDED]: `Slippage exceeded`,\n [INITIALIZER_ERROR__UNAUTHORIZED]: `Unauthorized`,\n [INITIALIZER_ERROR__WRONG_MIGRATOR]: `Wrong migrator program`,\n [INITIALIZER_ERROR__WRONG_SENTINEL]: `Wrong sentinel program`,\n };\n}\n\nexport function getInitializerErrorMessage(code: InitializerError): string {\n if (process.env.NODE_ENV !== 'production') {\n return (initializerErrorMessages as Record<InitializerError, string>)[code];\n }\n\n return 'Error message not available in production bundles.';\n}\n\nexport function isInitializerError<TProgramErrorCode extends InitializerError>(\n error: unknown,\n transactionMessage: {\n instructions: Record<number, { programAddress: Address }>;\n },\n code?: TProgramErrorCode,\n): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> &\n Readonly<{ context: Readonly<{ code: TProgramErrorCode }> }> {\n return isProgramError<TProgramErrorCode>(\n error,\n transactionMessage,\n INITIALIZER_PROGRAM_ADDRESS,\n code,\n );\n}\n","import {\n type Address,\n type ProgramDerivedAddress,\n getAddressCodec,\n getProgramDerivedAddress,\n} from '@solana/kit';\nimport {\n BPF_LOADER_UPGRADEABLE_PROGRAM_ID,\n INITIALIZER_PROGRAM_ID,\n SEED_CONFIG,\n SEED_LAUNCH,\n SEED_LAUNCH_AUTHORITY,\n} from './constants.js';\n\nconst addressCodec = getAddressCodec();\nconst textEncoder = new TextEncoder();\n\nexport function encodeU64LE(value: bigint): Uint8Array {\n const bytes = new Uint8Array(8);\n const view = new DataView(bytes.buffer);\n view.setBigUint64(0, value, true);\n return bytes;\n}\n\n/**\n * Derive the InitConfig PDA address.\n * Seeds: ['config_v3']\n */\nexport async function getConfigAddress(\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: programId,\n seeds: [textEncoder.encode(SEED_CONFIG)],\n });\n}\n\n/**\n * Derive the ProgramData PDA for an upgradeable program.\n * Seeds: [initializer_program_id] with program = BPFLoaderUpgradeable.\n */\nexport async function getProgramDataAddress(\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: BPF_LOADER_UPGRADEABLE_PROGRAM_ID,\n seeds: [addressCodec.encode(programId)],\n });\n}\n\n/**\n * Derive the Launch PDA address.\n * Seeds: ['launch_v3', namespace, launch_id_bytes_32]\n */\nexport async function getLaunchAddress(\n namespace: Address,\n launchId: Uint8Array,\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Promise<ProgramDerivedAddress> {\n if (launchId.length !== 32) {\n throw new Error('launchId must be 32 bytes');\n }\n return getProgramDerivedAddress({\n programAddress: programId,\n seeds: [\n textEncoder.encode(SEED_LAUNCH),\n addressCodec.encode(namespace),\n launchId,\n ],\n });\n}\n\n/**\n * Derive the Launch authority PDA address.\n * Seeds: ['launch_authority_v3', launch]\n */\nexport async function getLaunchAuthorityAddress(\n launch: Address,\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: programId,\n seeds: [\n textEncoder.encode(SEED_LAUNCH_AUTHORITY),\n addressCodec.encode(launch),\n ],\n });\n}\n\n/**\n * Convenience helper for the common pattern: embed a u64 into a 32-byte launch_id.\n */\nexport function launchIdFromU64(launchId: bigint): Uint8Array {\n const out = new Uint8Array(32);\n out.set(encodeU64LE(launchId), 0);\n return out;\n}\n","import type {\n Address,\n Instruction,\n AccountMeta,\n TransactionSigner,\n AccountSignerMeta,\n} from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport { SYSTEM_PROGRAM_ADDRESS } from '../../core/constants.js';\nimport { INITIALIZER_PROGRAM_ID } from '../constants.js';\nimport type { InitializeConfigArgsArgs } from '../../generated/initializer/index.js';\nimport { getInitializeConfigInstructionDataEncoder } from '../../generated/initializer/index.js';\n\ntype AddressOrSigner = Address | TransactionSigner;\n\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\nfunction createSignerAccountMeta(\n value: AddressOrSigner,\n role: typeof AccountRole.WRITABLE_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return { address: value.address, role, signer: value };\n }\n return { address: value, role };\n}\n\nexport interface InitializeConfigAccounts {\n admin: AddressOrSigner;\n config: Address;\n programData: Address;\n systemProgram?: Address;\n}\n\nexport function createInitializeConfigInstruction(\n accounts: InitializeConfigAccounts,\n args: InitializeConfigArgsArgs,\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const {\n admin,\n config,\n programData,\n systemProgram = SYSTEM_PROGRAM_ADDRESS,\n } = accounts;\n\n const keys: (AccountMeta | AccountSignerMeta)[] = [\n createSignerAccountMeta(admin, AccountRole.WRITABLE_SIGNER),\n { address: config, role: AccountRole.WRITABLE },\n { address: programData, role: AccountRole.READONLY },\n { address: systemProgram, role: AccountRole.READONLY },\n ];\n\n const data = new Uint8Array(\n getInitializeConfigInstructionDataEncoder().encode(args),\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n","import type {\n Address,\n Instruction,\n AccountMeta,\n TransactionSigner,\n AccountSignerMeta,\n} from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {} from '../../core/constants.js';\nimport { INITIALIZER_PROGRAM_ID } from '../constants.js';\nimport { getSetMigratorAllowlistInstructionDataEncoder } from '../../generated/initializer/index.js';\n\ntype AddressOrSigner = Address | TransactionSigner;\n\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\nfunction createSignerAccountMeta(\n value: AddressOrSigner,\n role: typeof AccountRole.WRITABLE_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return { address: value.address, role, signer: value };\n }\n return { address: value, role };\n}\n\nexport interface SetMigratorAllowlistAccounts {\n admin: AddressOrSigner;\n config: Address;\n}\n\nexport function createSetMigratorAllowlistInstruction(\n accounts: SetMigratorAllowlistAccounts,\n allowlist: Address[],\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const { admin, config } = accounts;\n\n const keys: (AccountMeta | AccountSignerMeta)[] = [\n createSignerAccountMeta(admin, AccountRole.WRITABLE_SIGNER),\n { address: config, role: AccountRole.WRITABLE },\n ];\n\n const data = new Uint8Array(\n getSetMigratorAllowlistInstructionDataEncoder().encode({ allowlist }),\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n","import type {\n Address,\n Instruction,\n AccountMeta,\n TransactionSigner,\n AccountSignerMeta,\n} from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {} from '../../core/constants.js';\nimport { INITIALIZER_PROGRAM_ID } from '../constants.js';\nimport { getSetSentinelAllowlistInstructionDataEncoder } from '../../generated/initializer/index.js';\n\ntype AddressOrSigner = Address | TransactionSigner;\n\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\nfunction createSignerAccountMeta(\n value: AddressOrSigner,\n role: typeof AccountRole.WRITABLE_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return { address: value.address, role, signer: value };\n }\n return { address: value, role };\n}\n\nexport interface SetSentinelAllowlistAccounts {\n admin: AddressOrSigner;\n config: Address;\n}\n\nexport function createSetSentinelAllowlistInstruction(\n accounts: SetSentinelAllowlistAccounts,\n allowlist: Address[],\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const { admin, config } = accounts;\n\n const keys: (AccountMeta | AccountSignerMeta)[] = [\n createSignerAccountMeta(admin, AccountRole.WRITABLE_SIGNER),\n { address: config, role: AccountRole.WRITABLE },\n ];\n\n const data = new Uint8Array(\n getSetSentinelAllowlistInstructionDataEncoder().encode({ allowlist }),\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n","import { address, type Address } from '@solana/kit';\n\n// Source of truth: programs/cpmm_migrator/src/lib.rs\nexport const CPMM_MIGRATOR_PROGRAM_ID: Address = address(\n '7WMUTNC41eMCo6eGH5Sy2xbgE3AycvLbFPo95AU9CSUd',\n);\n\nexport const SEED_STATE = 'state';\n\n// Source of truth: programs/cpmm_migrator/src/constants.rs\nexport const MAX_RECIPIENTS = 2;\n\nexport const CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS = {\n // SHA256(\"global:register_launch\")[0:8]\n registerLaunch: new Uint8Array([\n 0x72, 0x72, 0x43, 0x17, 0x29, 0x46, 0x00, 0xe1,\n ]),\n // SHA256(\"global:migrate\")[0:8]\n migrate: new Uint8Array([0x9b, 0xea, 0xe7, 0x92, 0xec, 0x9e, 0xa2, 0x1e]),\n} as const;\n\nexport const CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS = {\n // SHA256(\"account:CpmmMigratorState\")[0:8]\n CpmmMigratorState: new Uint8Array([\n 0xa9, 0x56, 0xff, 0xbb, 0x25, 0xf8, 0x0b, 0xb0,\n ]),\n} as const;\n","import {\n type Address,\n type ProgramDerivedAddress,\n getAddressCodec,\n getProgramDerivedAddress,\n} from '@solana/kit';\nimport { CPMM_MIGRATOR_PROGRAM_ID, SEED_STATE } from './constants.js';\n\nconst addressCodec = getAddressCodec();\nconst textEncoder = new TextEncoder();\n\nexport async function getCpmmMigratorStateAddress(\n launch: Address,\n programId: Address = CPMM_MIGRATOR_PROGRAM_ID,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: programId,\n seeds: [textEncoder.encode(SEED_STATE), addressCodec.encode(launch)],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU128Decoder,\n getU128Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport const CLAIM_RECEIPT_DISCRIMINATOR = new Uint8Array([\n 223, 233, 11, 229, 124, 165, 207, 28,\n]);\n\nexport function getClaimReceiptDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CLAIM_RECEIPT_DISCRIMINATOR,\n );\n}\n\nexport type ClaimReceipt = {\n discriminator: ReadonlyUint8Array;\n /** The market this receipt belongs to */\n market: Address;\n /** The claimer's wallet */\n claimer: Address;\n /** Total winner tokens burned by this user */\n burnedAmount: bigint;\n /** Reward debt for accumulator accounting (scaled by ACC_SCALE) */\n rewardDebt: bigint;\n /** Bump seed for this PDA */\n bump: number;\n /** Reserved for future use */\n reserved: ReadonlyUint8Array;\n};\n\nexport type ClaimReceiptArgs = {\n /** The market this receipt belongs to */\n market: Address;\n /** The claimer's wallet */\n claimer: Address;\n /** Total winner tokens burned by this user */\n burnedAmount: number | bigint;\n /** Reward debt for accumulator accounting (scaled by ACC_SCALE) */\n rewardDebt: number | bigint;\n /** Bump seed for this PDA */\n bump: number;\n /** Reserved for future use */\n reserved: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link ClaimReceiptArgs} account data. */\nexport function getClaimReceiptEncoder(): FixedSizeEncoder<ClaimReceiptArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['market', getAddressEncoder()],\n ['claimer', getAddressEncoder()],\n ['burnedAmount', getU64Encoder()],\n ['rewardDebt', getU128Encoder()],\n ['bump', getU8Encoder()],\n ['reserved', fixEncoderSize(getBytesEncoder(), 7)],\n ]),\n (value) => ({ ...value, discriminator: CLAIM_RECEIPT_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link ClaimReceipt} account data. */\nexport function getClaimReceiptDecoder(): FixedSizeDecoder<ClaimReceipt> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['market', getAddressDecoder()],\n ['claimer', getAddressDecoder()],\n ['burnedAmount', getU64Decoder()],\n ['rewardDebt', getU128Decoder()],\n ['bump', getU8Decoder()],\n ['reserved', fixDecoderSize(getBytesDecoder(), 7)],\n ]);\n}\n\n/** Gets the codec for {@link ClaimReceipt} account data. */\nexport function getClaimReceiptCodec(): FixedSizeCodec<\n ClaimReceiptArgs,\n ClaimReceipt\n> {\n return combineCodec(getClaimReceiptEncoder(), getClaimReceiptDecoder());\n}\n\nexport function decodeClaimReceipt<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<ClaimReceipt, TAddress>;\nexport function decodeClaimReceipt<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<ClaimReceipt, TAddress>;\nexport function decodeClaimReceipt<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<ClaimReceipt, TAddress> | MaybeAccount<ClaimReceipt, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getClaimReceiptDecoder(),\n );\n}\n\nexport async function fetchClaimReceipt<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<ClaimReceipt, TAddress>> {\n const maybeAccount = await fetchMaybeClaimReceipt(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeClaimReceipt<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<ClaimReceipt, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeClaimReceipt(maybeAccount);\n}\n\nexport async function fetchAllClaimReceipt(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<ClaimReceipt>[]> {\n const maybeAccounts = await fetchAllMaybeClaimReceipt(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeClaimReceipt(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<ClaimReceipt>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeClaimReceipt(maybeAccount));\n}\n\nexport function getClaimReceiptSize(): number {\n return 104;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBooleanDecoder,\n getBooleanEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport const ENTRY_DISCRIMINATOR = new Uint8Array([\n 63, 18, 152, 113, 215, 246, 221, 250,\n]);\n\nexport function getEntryDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(ENTRY_DISCRIMINATOR);\n}\n\nexport type Entry = {\n discriminator: ReadonlyUint8Array;\n /** The oracle this entry belongs to */\n oracle: Address;\n /** Unique identifier for this entry within the market */\n entryId: ReadonlyUint8Array;\n /** The token mint for this entry */\n baseMint: Address;\n /** Quote contributed when this entry was migrated */\n contribution: bigint;\n /** Whether this entry has been migrated */\n isMigrated: boolean;\n /** Bump seed for this PDA */\n bump: number;\n /** Reserved for future use */\n reserved: ReadonlyUint8Array;\n};\n\nexport type EntryArgs = {\n /** The oracle this entry belongs to */\n oracle: Address;\n /** Unique identifier for this entry within the market */\n entryId: ReadonlyUint8Array;\n /** The token mint for this entry */\n baseMint: Address;\n /** Quote contributed when this entry was migrated */\n contribution: number | bigint;\n /** Whether this entry has been migrated */\n isMigrated: boolean;\n /** Bump seed for this PDA */\n bump: number;\n /** Reserved for future use */\n reserved: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link EntryArgs} account data. */\nexport function getEntryEncoder(): FixedSizeEncoder<EntryArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['oracle', getAddressEncoder()],\n ['entryId', fixEncoderSize(getBytesEncoder(), 32)],\n ['baseMint', getAddressEncoder()],\n ['contribution', getU64Encoder()],\n ['isMigrated', getBooleanEncoder()],\n ['bump', getU8Encoder()],\n ['reserved', fixEncoderSize(getBytesEncoder(), 14)],\n ]),\n (value) => ({ ...value, discriminator: ENTRY_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link Entry} account data. */\nexport function getEntryDecoder(): FixedSizeDecoder<Entry> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['oracle', getAddressDecoder()],\n ['entryId', fixDecoderSize(getBytesDecoder(), 32)],\n ['baseMint', getAddressDecoder()],\n ['contribution', getU64Decoder()],\n ['isMigrated', getBooleanDecoder()],\n ['bump', getU8Decoder()],\n ['reserved', fixDecoderSize(getBytesDecoder(), 14)],\n ]);\n}\n\n/** Gets the codec for {@link Entry} account data. */\nexport function getEntryCodec(): FixedSizeCodec<EntryArgs, Entry> {\n return combineCodec(getEntryEncoder(), getEntryDecoder());\n}\n\nexport function decodeEntry<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<Entry, TAddress>;\nexport function decodeEntry<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<Entry, TAddress>;\nexport function decodeEntry<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<Entry, TAddress> | MaybeAccount<Entry, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getEntryDecoder(),\n );\n}\n\nexport async function fetchEntry<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<Entry, TAddress>> {\n const maybeAccount = await fetchMaybeEntry(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeEntry<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<Entry, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeEntry(maybeAccount);\n}\n\nexport async function fetchAllEntry(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<Entry>[]> {\n const maybeAccounts = await fetchAllMaybeEntry(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeEntry(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<Entry>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeEntry(maybeAccount));\n}\n\nexport function getEntrySize(): number {\n return 128;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport const ENTRY_BY_MINT_DISCRIMINATOR = new Uint8Array([\n 188, 191, 157, 194, 68, 82, 181, 126,\n]);\n\nexport function getEntryByMintDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n ENTRY_BY_MINT_DISCRIMINATOR,\n );\n}\n\nexport type EntryByMint = {\n discriminator: ReadonlyUint8Array;\n /** The oracle this entry belongs to */\n oracle: Address;\n /** The base mint */\n baseMint: Address;\n /** The entry_id for reverse lookup */\n entryId: ReadonlyUint8Array;\n /** Bump seed for this PDA */\n bump: number;\n /** Reserved for future use */\n reserved: ReadonlyUint8Array;\n};\n\nexport type EntryByMintArgs = {\n /** The oracle this entry belongs to */\n oracle: Address;\n /** The base mint */\n baseMint: Address;\n /** The entry_id for reverse lookup */\n entryId: ReadonlyUint8Array;\n /** Bump seed for this PDA */\n bump: number;\n /** Reserved for future use */\n reserved: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link EntryByMintArgs} account data. */\nexport function getEntryByMintEncoder(): FixedSizeEncoder<EntryByMintArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['oracle', getAddressEncoder()],\n ['baseMint', getAddressEncoder()],\n ['entryId', fixEncoderSize(getBytesEncoder(), 32)],\n ['bump', getU8Encoder()],\n ['reserved', fixEncoderSize(getBytesEncoder(), 7)],\n ]),\n (value) => ({ ...value, discriminator: ENTRY_BY_MINT_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link EntryByMint} account data. */\nexport function getEntryByMintDecoder(): FixedSizeDecoder<EntryByMint> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['oracle', getAddressDecoder()],\n ['baseMint', getAddressDecoder()],\n ['entryId', fixDecoderSize(getBytesDecoder(), 32)],\n ['bump', getU8Decoder()],\n ['reserved', fixDecoderSize(getBytesDecoder(), 7)],\n ]);\n}\n\n/** Gets the codec for {@link EntryByMint} account data. */\nexport function getEntryByMintCodec(): FixedSizeCodec<\n EntryByMintArgs,\n EntryByMint\n> {\n return combineCodec(getEntryByMintEncoder(), getEntryByMintDecoder());\n}\n\nexport function decodeEntryByMint<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<EntryByMint, TAddress>;\nexport function decodeEntryByMint<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<EntryByMint, TAddress>;\nexport function decodeEntryByMint<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<EntryByMint, TAddress> | MaybeAccount<EntryByMint, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getEntryByMintDecoder(),\n );\n}\n\nexport async function fetchEntryByMint<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<EntryByMint, TAddress>> {\n const maybeAccount = await fetchMaybeEntryByMint(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeEntryByMint<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<EntryByMint, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeEntryByMint(maybeAccount);\n}\n\nexport async function fetchAllEntryByMint(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<EntryByMint>[]> {\n const maybeAccounts = await fetchAllMaybeEntryByMint(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeEntryByMint(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<EntryByMint>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeEntryByMint(maybeAccount));\n}\n\nexport function getEntryByMintSize(): number {\n return 112;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n getU128Decoder,\n getU128Encoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type AccumulatorUpdated = {\n market: Address;\n newTotalPot: bigint;\n newAccQuotePerToken: bigint;\n};\n\nexport type AccumulatorUpdatedArgs = {\n market: Address;\n newTotalPot: number | bigint;\n newAccQuotePerToken: number | bigint;\n};\n\nexport function getAccumulatorUpdatedEncoder(): FixedSizeEncoder<AccumulatorUpdatedArgs> {\n return getStructEncoder([\n ['market', getAddressEncoder()],\n ['newTotalPot', getU64Encoder()],\n ['newAccQuotePerToken', getU128Encoder()],\n ]);\n}\n\nexport function getAccumulatorUpdatedDecoder(): FixedSizeDecoder<AccumulatorUpdated> {\n return getStructDecoder([\n ['market', getAddressDecoder()],\n ['newTotalPot', getU64Decoder()],\n ['newAccQuotePerToken', getU128Decoder()],\n ]);\n}\n\nexport function getAccumulatorUpdatedCodec(): FixedSizeCodec<\n AccumulatorUpdatedArgs,\n AccumulatorUpdated\n> {\n return combineCodec(\n getAccumulatorUpdatedEncoder(),\n getAccumulatorUpdatedDecoder(),\n );\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\n/** Variable-length calldata buffer. */\nexport type CalldataBuf = { len: number; bytes: ReadonlyUint8Array };\n\nexport type CalldataBufArgs = CalldataBuf;\n\nexport function getCalldataBufEncoder(): FixedSizeEncoder<CalldataBufArgs> {\n return getStructEncoder([\n ['len', getU16Encoder()],\n ['bytes', fixEncoderSize(getBytesEncoder(), 256)],\n ]);\n}\n\nexport function getCalldataBufDecoder(): FixedSizeDecoder<CalldataBuf> {\n return getStructDecoder([\n ['len', getU16Decoder()],\n ['bytes', fixDecoderSize(getBytesDecoder(), 256)],\n ]);\n}\n\nexport function getCalldataBufCodec(): FixedSizeCodec<\n CalldataBufArgs,\n CalldataBuf\n> {\n return combineCodec(getCalldataBufEncoder(), getCalldataBufDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBooleanDecoder,\n getBooleanEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport type EntryMigrated = {\n market: Address;\n oracle: Address;\n entryId: ReadonlyUint8Array;\n baseMint: Address;\n contribution: bigint;\n isWinner: boolean;\n};\n\nexport type EntryMigratedArgs = {\n market: Address;\n oracle: Address;\n entryId: ReadonlyUint8Array;\n baseMint: Address;\n contribution: number | bigint;\n isWinner: boolean;\n};\n\nexport function getEntryMigratedEncoder(): FixedSizeEncoder<EntryMigratedArgs> {\n return getStructEncoder([\n ['market', getAddressEncoder()],\n ['oracle', getAddressEncoder()],\n ['entryId', fixEncoderSize(getBytesEncoder(), 32)],\n ['baseMint', getAddressEncoder()],\n ['contribution', getU64Encoder()],\n ['isWinner', getBooleanEncoder()],\n ]);\n}\n\nexport function getEntryMigratedDecoder(): FixedSizeDecoder<EntryMigrated> {\n return getStructDecoder([\n ['market', getAddressDecoder()],\n ['oracle', getAddressDecoder()],\n ['entryId', fixDecoderSize(getBytesDecoder(), 32)],\n ['baseMint', getAddressDecoder()],\n ['contribution', getU64Decoder()],\n ['isWinner', getBooleanDecoder()],\n ]);\n}\n\nexport function getEntryMigratedCodec(): FixedSizeCodec<\n EntryMigratedArgs,\n EntryMigrated\n> {\n return combineCodec(getEntryMigratedEncoder(), getEntryMigratedDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport type EntryRegistered = {\n market: Address;\n oracle: Address;\n entryId: ReadonlyUint8Array;\n baseMint: Address;\n};\n\nexport type EntryRegisteredArgs = EntryRegistered;\n\nexport function getEntryRegisteredEncoder(): FixedSizeEncoder<EntryRegisteredArgs> {\n return getStructEncoder([\n ['market', getAddressEncoder()],\n ['oracle', getAddressEncoder()],\n ['entryId', fixEncoderSize(getBytesEncoder(), 32)],\n ['baseMint', getAddressEncoder()],\n ]);\n}\n\nexport function getEntryRegisteredDecoder(): FixedSizeDecoder<EntryRegistered> {\n return getStructDecoder([\n ['market', getAddressDecoder()],\n ['oracle', getAddressDecoder()],\n ['entryId', fixDecoderSize(getBytesDecoder(), 32)],\n ['baseMint', getAddressDecoder()],\n ]);\n}\n\nexport function getEntryRegisteredCodec(): FixedSizeCodec<\n EntryRegisteredArgs,\n EntryRegistered\n> {\n return combineCodec(getEntryRegisteredEncoder(), getEntryRegisteredDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type MarketCreated = {\n market: Address;\n oracle: Address;\n quoteMint: Address;\n};\n\nexport type MarketCreatedArgs = MarketCreated;\n\nexport function getMarketCreatedEncoder(): FixedSizeEncoder<MarketCreatedArgs> {\n return getStructEncoder([\n ['market', getAddressEncoder()],\n ['oracle', getAddressEncoder()],\n ['quoteMint', getAddressEncoder()],\n ]);\n}\n\nexport function getMarketCreatedDecoder(): FixedSizeDecoder<MarketCreated> {\n return getStructDecoder([\n ['market', getAddressDecoder()],\n ['oracle', getAddressDecoder()],\n ['quoteMint', getAddressDecoder()],\n ]);\n}\n\nexport function getMarketCreatedCodec(): FixedSizeCodec<\n MarketCreatedArgs,\n MarketCreated\n> {\n return combineCodec(getMarketCreatedEncoder(), getMarketCreatedDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type MarketResolved = {\n market: Address;\n oracle: Address;\n winnerMint: Address;\n claimableSupply: bigint;\n totalPot: bigint;\n};\n\nexport type MarketResolvedArgs = {\n market: Address;\n oracle: Address;\n winnerMint: Address;\n claimableSupply: number | bigint;\n totalPot: number | bigint;\n};\n\nexport function getMarketResolvedEncoder(): FixedSizeEncoder<MarketResolvedArgs> {\n return getStructEncoder([\n ['market', getAddressEncoder()],\n ['oracle', getAddressEncoder()],\n ['winnerMint', getAddressEncoder()],\n ['claimableSupply', getU64Encoder()],\n ['totalPot', getU64Encoder()],\n ]);\n}\n\nexport function getMarketResolvedDecoder(): FixedSizeDecoder<MarketResolved> {\n return getStructDecoder([\n ['market', getAddressDecoder()],\n ['oracle', getAddressDecoder()],\n ['winnerMint', getAddressDecoder()],\n ['claimableSupply', getU64Decoder()],\n ['totalPot', getU64Decoder()],\n ]);\n}\n\nexport function getMarketResolvedCodec(): FixedSizeCodec<\n MarketResolvedArgs,\n MarketResolved\n> {\n return combineCodec(getMarketResolvedEncoder(), getMarketResolvedDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\n/**\n * Arguments for migrate_entry instruction.\n * This is decoded from migrator_migrate_calldata passed by initializer.\n */\nexport type MigrateEntryArgs = { entryId: ReadonlyUint8Array };\n\nexport type MigrateEntryArgsArgs = MigrateEntryArgs;\n\nexport function getMigrateEntryArgsEncoder(): FixedSizeEncoder<MigrateEntryArgsArgs> {\n return getStructEncoder([['entryId', fixEncoderSize(getBytesEncoder(), 32)]]);\n}\n\nexport function getMigrateEntryArgsDecoder(): FixedSizeDecoder<MigrateEntryArgs> {\n return getStructDecoder([['entryId', fixDecoderSize(getBytesDecoder(), 32)]]);\n}\n\nexport function getMigrateEntryArgsCodec(): FixedSizeCodec<\n MigrateEntryArgsArgs,\n MigrateEntryArgs\n> {\n return combineCodec(\n getMigrateEntryArgsEncoder(),\n getMigrateEntryArgsDecoder(),\n );\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type PreviewPayoutIfWinnerArgs = {\n candidateWinnerMint: Address;\n tokenAmount: bigint;\n};\n\nexport type PreviewPayoutIfWinnerArgsArgs = {\n candidateWinnerMint: Address;\n tokenAmount: number | bigint;\n};\n\nexport function getPreviewPayoutIfWinnerArgsEncoder(): FixedSizeEncoder<PreviewPayoutIfWinnerArgsArgs> {\n return getStructEncoder([\n ['candidateWinnerMint', getAddressEncoder()],\n ['tokenAmount', getU64Encoder()],\n ]);\n}\n\nexport function getPreviewPayoutIfWinnerArgsDecoder(): FixedSizeDecoder<PreviewPayoutIfWinnerArgs> {\n return getStructDecoder([\n ['candidateWinnerMint', getAddressDecoder()],\n ['tokenAmount', getU64Decoder()],\n ]);\n}\n\nexport function getPreviewPayoutIfWinnerArgsCodec(): FixedSizeCodec<\n PreviewPayoutIfWinnerArgsArgs,\n PreviewPayoutIfWinnerArgs\n> {\n return combineCodec(\n getPreviewPayoutIfWinnerArgsEncoder(),\n getPreviewPayoutIfWinnerArgsDecoder(),\n );\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\n/**\n * Arguments for register_entry instruction.\n * This is decoded from migrator_init_calldata passed by initializer.\n */\nexport type RegisterEntryArgs = { entryId: ReadonlyUint8Array };\n\nexport type RegisterEntryArgsArgs = RegisterEntryArgs;\n\nexport function getRegisterEntryArgsEncoder(): FixedSizeEncoder<RegisterEntryArgsArgs> {\n return getStructEncoder([['entryId', fixEncoderSize(getBytesEncoder(), 32)]]);\n}\n\nexport function getRegisterEntryArgsDecoder(): FixedSizeDecoder<RegisterEntryArgs> {\n return getStructDecoder([['entryId', fixDecoderSize(getBytesDecoder(), 32)]]);\n}\n\nexport function getRegisterEntryArgsCodec(): FixedSizeCodec<\n RegisterEntryArgsArgs,\n RegisterEntryArgs\n> {\n return combineCodec(\n getRegisterEntryArgsEncoder(),\n getRegisterEntryArgsDecoder(),\n );\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type RewardsClaimed = {\n market: Address;\n claimer: Address;\n burnedAmount: bigint;\n rewardAmount: bigint;\n totalBurned: bigint;\n};\n\nexport type RewardsClaimedArgs = {\n market: Address;\n claimer: Address;\n burnedAmount: number | bigint;\n rewardAmount: number | bigint;\n totalBurned: number | bigint;\n};\n\nexport function getRewardsClaimedEncoder(): FixedSizeEncoder<RewardsClaimedArgs> {\n return getStructEncoder([\n ['market', getAddressEncoder()],\n ['claimer', getAddressEncoder()],\n ['burnedAmount', getU64Encoder()],\n ['rewardAmount', getU64Encoder()],\n ['totalBurned', getU64Encoder()],\n ]);\n}\n\nexport function getRewardsClaimedDecoder(): FixedSizeDecoder<RewardsClaimed> {\n return getStructDecoder([\n ['market', getAddressDecoder()],\n ['claimer', getAddressDecoder()],\n ['burnedAmount', getU64Decoder()],\n ['rewardAmount', getU64Decoder()],\n ['totalBurned', getU64Decoder()],\n ]);\n}\n\nexport function getRewardsClaimedCodec(): FixedSizeCodec<\n RewardsClaimedArgs,\n RewardsClaimed\n> {\n return combineCodec(getRewardsClaimedEncoder(), getRewardsClaimedDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n getCalldataBufDecoder,\n getCalldataBufEncoder,\n type CalldataBuf,\n type CalldataBufArgs,\n} from '../types';\n\nexport const LAUNCH_DISCRIMINATOR = new Uint8Array([\n 144, 51, 51, 163, 206, 85, 213, 38,\n]);\n\nexport function getLaunchDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(LAUNCH_DISCRIMINATOR);\n}\n\nexport type Launch = {\n discriminator: ReadonlyUint8Array;\n authority: Address;\n namespace: Address;\n launchId: ReadonlyUint8Array;\n phase: number;\n bump: number;\n launchAuthorityBump: number;\n pad0: ReadonlyUint8Array;\n baseMint: Address;\n quoteMint: Address;\n baseVault: Address;\n quoteVault: Address;\n baseTotalSupply: bigint;\n baseForDistribution: bigint;\n baseForLiquidity: bigint;\n baseForCurve: bigint;\n curveVirtualBase: bigint;\n curveVirtualQuote: bigint;\n curveFeeBps: number;\n pad1: ReadonlyUint8Array;\n allowBuy: number;\n allowSell: number;\n pad2: ReadonlyUint8Array;\n sentinelProgram: Address;\n sentinelFlags: number;\n pad3: ReadonlyUint8Array;\n sentinelCalldata: CalldataBuf;\n migratorProgram: Address;\n migratorInitCalldata: CalldataBuf;\n migratorMigrateCalldata: CalldataBuf;\n reserved: ReadonlyUint8Array;\n};\n\nexport type LaunchArgs = {\n authority: Address;\n namespace: Address;\n launchId: ReadonlyUint8Array;\n phase: number;\n bump: number;\n launchAuthorityBump: number;\n pad0: ReadonlyUint8Array;\n baseMint: Address;\n quoteMint: Address;\n baseVault: Address;\n quoteVault: Address;\n baseTotalSupply: number | bigint;\n baseForDistribution: number | bigint;\n baseForLiquidity: number | bigint;\n baseForCurve: number | bigint;\n curveVirtualBase: number | bigint;\n curveVirtualQuote: number | bigint;\n curveFeeBps: number;\n pad1: ReadonlyUint8Array;\n allowBuy: number;\n allowSell: number;\n pad2: ReadonlyUint8Array;\n sentinelProgram: Address;\n sentinelFlags: number;\n pad3: ReadonlyUint8Array;\n sentinelCalldata: CalldataBufArgs;\n migratorProgram: Address;\n migratorInitCalldata: CalldataBufArgs;\n migratorMigrateCalldata: CalldataBufArgs;\n reserved: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link LaunchArgs} account data. */\nexport function getLaunchEncoder(): FixedSizeEncoder<LaunchArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['authority', getAddressEncoder()],\n ['namespace', getAddressEncoder()],\n ['launchId', fixEncoderSize(getBytesEncoder(), 32)],\n ['phase', getU8Encoder()],\n ['bump', getU8Encoder()],\n ['launchAuthorityBump', getU8Encoder()],\n ['pad0', fixEncoderSize(getBytesEncoder(), 5)],\n ['baseMint', getAddressEncoder()],\n ['quoteMint', getAddressEncoder()],\n ['baseVault', getAddressEncoder()],\n ['quoteVault', getAddressEncoder()],\n ['baseTotalSupply', getU64Encoder()],\n ['baseForDistribution', getU64Encoder()],\n ['baseForLiquidity', getU64Encoder()],\n ['baseForCurve', getU64Encoder()],\n ['curveVirtualBase', getU64Encoder()],\n ['curveVirtualQuote', getU64Encoder()],\n ['curveFeeBps', getU16Encoder()],\n ['pad1', fixEncoderSize(getBytesEncoder(), 6)],\n ['allowBuy', getU8Encoder()],\n ['allowSell', getU8Encoder()],\n ['pad2', fixEncoderSize(getBytesEncoder(), 6)],\n ['sentinelProgram', getAddressEncoder()],\n ['sentinelFlags', getU32Encoder()],\n ['pad3', fixEncoderSize(getBytesEncoder(), 4)],\n ['sentinelCalldata', getCalldataBufEncoder()],\n ['migratorProgram', getAddressEncoder()],\n ['migratorInitCalldata', getCalldataBufEncoder()],\n ['migratorMigrateCalldata', getCalldataBufEncoder()],\n ['reserved', fixEncoderSize(getBytesEncoder(), 64)],\n ]),\n (value) => ({ ...value, discriminator: LAUNCH_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link Launch} account data. */\nexport function getLaunchDecoder(): FixedSizeDecoder<Launch> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['authority', getAddressDecoder()],\n ['namespace', getAddressDecoder()],\n ['launchId', fixDecoderSize(getBytesDecoder(), 32)],\n ['phase', getU8Decoder()],\n ['bump', getU8Decoder()],\n ['launchAuthorityBump', getU8Decoder()],\n ['pad0', fixDecoderSize(getBytesDecoder(), 5)],\n ['baseMint', getAddressDecoder()],\n ['quoteMint', getAddressDecoder()],\n ['baseVault', getAddressDecoder()],\n ['quoteVault', getAddressDecoder()],\n ['baseTotalSupply', getU64Decoder()],\n ['baseForDistribution', getU64Decoder()],\n ['baseForLiquidity', getU64Decoder()],\n ['baseForCurve', getU64Decoder()],\n ['curveVirtualBase', getU64Decoder()],\n ['curveVirtualQuote', getU64Decoder()],\n ['curveFeeBps', getU16Decoder()],\n ['pad1', fixDecoderSize(getBytesDecoder(), 6)],\n ['allowBuy', getU8Decoder()],\n ['allowSell', getU8Decoder()],\n ['pad2', fixDecoderSize(getBytesDecoder(), 6)],\n ['sentinelProgram', getAddressDecoder()],\n ['sentinelFlags', getU32Decoder()],\n ['pad3', fixDecoderSize(getBytesDecoder(), 4)],\n ['sentinelCalldata', getCalldataBufDecoder()],\n ['migratorProgram', getAddressDecoder()],\n ['migratorInitCalldata', getCalldataBufDecoder()],\n ['migratorMigrateCalldata', getCalldataBufDecoder()],\n ['reserved', fixDecoderSize(getBytesDecoder(), 64)],\n ]);\n}\n\n/** Gets the codec for {@link Launch} account data. */\nexport function getLaunchCodec(): FixedSizeCodec<LaunchArgs, Launch> {\n return combineCodec(getLaunchEncoder(), getLaunchDecoder());\n}\n\nexport function decodeLaunch<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<Launch, TAddress>;\nexport function decodeLaunch<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<Launch, TAddress>;\nexport function decodeLaunch<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<Launch, TAddress> | MaybeAccount<Launch, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getLaunchDecoder(),\n );\n}\n\nexport async function fetchLaunch<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<Launch, TAddress>> {\n const maybeAccount = await fetchMaybeLaunch(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeLaunch<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<Launch, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeLaunch(maybeAccount);\n}\n\nexport async function fetchAllLaunch(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<Launch>[]> {\n const maybeAccounts = await fetchAllMaybeLaunch(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeLaunch(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<Launch>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeLaunch(maybeAccount));\n}\n\nexport function getLaunchSize(): number {\n return 1214;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBooleanDecoder,\n getBooleanEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU128Decoder,\n getU128Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport const MARKET_DISCRIMINATOR = new Uint8Array([\n 219, 190, 213, 55, 0, 227, 198, 154,\n]);\n\nexport function getMarketDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(MARKET_DISCRIMINATOR);\n}\n\nexport type Market = {\n discriminator: ReadonlyUint8Array;\n /** The oracle that determines the winner */\n oracle: Address;\n /** Quote mint for this market (e.g., USDC) */\n quoteMint: Address;\n /** The pot vault holding quote tokens */\n potVault: Address;\n /** Total quote migrated into pot (cumulative) */\n totalPot: bigint;\n /** Total quote claimed/paid out (cumulative) */\n totalClaimed: bigint;\n /** Winner mint (set when market resolves) */\n winnerMint: Address;\n /** Claimable supply of winner token (fixed after winning entry migrates) */\n claimableSupply: bigint;\n /**\n * Scaled accumulator: total_pot * ACC_SCALE / claimable_supply\n * This tracks quote per token and increases as losing entries migrate\n */\n accQuotePerToken: bigint;\n /** Whether the market has been resolved (winner determined) */\n isResolved: boolean;\n /** Bump seed for this PDA */\n bump: number;\n /** Bump seed for market authority PDA */\n marketAuthorityBump: number;\n /** Reserved for future use */\n reserved: ReadonlyUint8Array;\n};\n\nexport type MarketArgs = {\n /** The oracle that determines the winner */\n oracle: Address;\n /** Quote mint for this market (e.g., USDC) */\n quoteMint: Address;\n /** The pot vault holding quote tokens */\n potVault: Address;\n /** Total quote migrated into pot (cumulative) */\n totalPot: number | bigint;\n /** Total quote claimed/paid out (cumulative) */\n totalClaimed: number | bigint;\n /** Winner mint (set when market resolves) */\n winnerMint: Address;\n /** Claimable supply of winner token (fixed after winning entry migrates) */\n claimableSupply: number | bigint;\n /**\n * Scaled accumulator: total_pot * ACC_SCALE / claimable_supply\n * This tracks quote per token and increases as losing entries migrate\n */\n accQuotePerToken: number | bigint;\n /** Whether the market has been resolved (winner determined) */\n isResolved: boolean;\n /** Bump seed for this PDA */\n bump: number;\n /** Bump seed for market authority PDA */\n marketAuthorityBump: number;\n /** Reserved for future use */\n reserved: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link MarketArgs} account data. */\nexport function getMarketEncoder(): FixedSizeEncoder<MarketArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['oracle', getAddressEncoder()],\n ['quoteMint', getAddressEncoder()],\n ['potVault', getAddressEncoder()],\n ['totalPot', getU64Encoder()],\n ['totalClaimed', getU64Encoder()],\n ['winnerMint', getAddressEncoder()],\n ['claimableSupply', getU64Encoder()],\n ['accQuotePerToken', getU128Encoder()],\n ['isResolved', getBooleanEncoder()],\n ['bump', getU8Encoder()],\n ['marketAuthorityBump', getU8Encoder()],\n ['reserved', fixEncoderSize(getBytesEncoder(), 29)],\n ]),\n (value) => ({ ...value, discriminator: MARKET_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link Market} account data. */\nexport function getMarketDecoder(): FixedSizeDecoder<Market> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['oracle', getAddressDecoder()],\n ['quoteMint', getAddressDecoder()],\n ['potVault', getAddressDecoder()],\n ['totalPot', getU64Decoder()],\n ['totalClaimed', getU64Decoder()],\n ['winnerMint', getAddressDecoder()],\n ['claimableSupply', getU64Decoder()],\n ['accQuotePerToken', getU128Decoder()],\n ['isResolved', getBooleanDecoder()],\n ['bump', getU8Decoder()],\n ['marketAuthorityBump', getU8Decoder()],\n ['reserved', fixDecoderSize(getBytesDecoder(), 29)],\n ]);\n}\n\n/** Gets the codec for {@link Market} account data. */\nexport function getMarketCodec(): FixedSizeCodec<MarketArgs, Market> {\n return combineCodec(getMarketEncoder(), getMarketDecoder());\n}\n\nexport function decodeMarket<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<Market, TAddress>;\nexport function decodeMarket<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<Market, TAddress>;\nexport function decodeMarket<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<Market, TAddress> | MaybeAccount<Market, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getMarketDecoder(),\n );\n}\n\nexport async function fetchMarket<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<Market, TAddress>> {\n const maybeAccount = await fetchMaybeMarket(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeMarket<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<Market, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeMarket(maybeAccount);\n}\n\nexport async function fetchAllMarket(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<Market>[]> {\n const maybeAccounts = await fetchAllMaybeMarket(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeMarket(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<Market>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeMarket(maybeAccount));\n}\n\nexport function getMarketSize(): number {\n return 208;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBooleanDecoder,\n getBooleanEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport const ORACLE_STATE_DISCRIMINATOR = new Uint8Array([\n 97, 156, 157, 189, 194, 73, 8, 15,\n]);\n\nexport function getOracleStateDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n ORACLE_STATE_DISCRIMINATOR,\n );\n}\n\nexport type OracleState = {\n discriminator: ReadonlyUint8Array;\n /** The authority that can finalize this oracle. */\n oracleAuthority: Address;\n /** Optional quote mint for validation (Pubkey::default() if not used). */\n quoteMint: Address;\n /** Whether the oracle has been finalized with a winner. */\n isFinalized: boolean;\n /** The winning mint (only valid if is_finalized == true). */\n winningMint: Address;\n /** Nonce used in PDA derivation. */\n nonce: bigint;\n /** PDA bump seed. */\n bump: number;\n /** Reserved for future use. */\n reserved: ReadonlyUint8Array;\n};\n\nexport type OracleStateArgs = {\n /** The authority that can finalize this oracle. */\n oracleAuthority: Address;\n /** Optional quote mint for validation (Pubkey::default() if not used). */\n quoteMint: Address;\n /** Whether the oracle has been finalized with a winner. */\n isFinalized: boolean;\n /** The winning mint (only valid if is_finalized == true). */\n winningMint: Address;\n /** Nonce used in PDA derivation. */\n nonce: number | bigint;\n /** PDA bump seed. */\n bump: number;\n /** Reserved for future use. */\n reserved: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link OracleStateArgs} account data. */\nexport function getOracleStateEncoder(): FixedSizeEncoder<OracleStateArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['oracleAuthority', getAddressEncoder()],\n ['quoteMint', getAddressEncoder()],\n ['isFinalized', getBooleanEncoder()],\n ['winningMint', getAddressEncoder()],\n ['nonce', getU64Encoder()],\n ['bump', getU8Encoder()],\n ['reserved', fixEncoderSize(getBytesEncoder(), 31)],\n ]),\n (value) => ({ ...value, discriminator: ORACLE_STATE_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link OracleState} account data. */\nexport function getOracleStateDecoder(): FixedSizeDecoder<OracleState> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['oracleAuthority', getAddressDecoder()],\n ['quoteMint', getAddressDecoder()],\n ['isFinalized', getBooleanDecoder()],\n ['winningMint', getAddressDecoder()],\n ['nonce', getU64Decoder()],\n ['bump', getU8Decoder()],\n ['reserved', fixDecoderSize(getBytesDecoder(), 31)],\n ]);\n}\n\n/** Gets the codec for {@link OracleState} account data. */\nexport function getOracleStateCodec(): FixedSizeCodec<\n OracleStateArgs,\n OracleState\n> {\n return combineCodec(getOracleStateEncoder(), getOracleStateDecoder());\n}\n\nexport function decodeOracleState<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<OracleState, TAddress>;\nexport function decodeOracleState<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<OracleState, TAddress>;\nexport function decodeOracleState<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<OracleState, TAddress> | MaybeAccount<OracleState, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getOracleStateDecoder(),\n );\n}\n\nexport async function fetchOracleState<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<OracleState, TAddress>> {\n const maybeAccount = await fetchMaybeOracleState(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeOracleState<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<OracleState, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeOracleState(maybeAccount);\n}\n\nexport async function fetchAllOracleState(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<OracleState>[]> {\n const maybeAccounts = await fetchAllMaybeOracleState(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeOracleState(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<OracleState>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeOracleState(maybeAccount));\n}\n\nexport function getOracleStateSize(): number {\n return 145;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { PREDICTION_MIGRATOR_PROGRAM_ADDRESS } from '../programs';\n\nexport const CLAIM_DISCRIMINATOR = new Uint8Array([\n 62, 198, 214, 193, 213, 159, 108, 210,\n]);\n\nexport function getClaimDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(CLAIM_DISCRIMINATOR);\n}\n\nexport type ClaimInstruction<\n TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n TAccountMarket extends string | AccountMeta<string> = string,\n TAccountMarketAuthority extends string | AccountMeta<string> = string,\n TAccountPotVault extends string | AccountMeta<string> = string,\n TAccountWinnerMint extends string | AccountMeta<string> = string,\n TAccountEntryByMint extends string | AccountMeta<string> = string,\n TAccountClaimerWinnerAta extends string | AccountMeta<string> = string,\n TAccountClaimerQuoteAta extends string | AccountMeta<string> = string,\n TAccountClaimer extends string | AccountMeta<string> = string,\n TAccountReceipt extends string | AccountMeta<string> = string,\n TAccountPayer extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',\n TAccountSystemProgram extends string | AccountMeta<string> =\n '11111111111111111111111111111111',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountMarket extends string\n ? WritableAccount<TAccountMarket>\n : TAccountMarket,\n TAccountMarketAuthority extends string\n ? ReadonlyAccount<TAccountMarketAuthority>\n : TAccountMarketAuthority,\n TAccountPotVault extends string\n ? WritableAccount<TAccountPotVault>\n : TAccountPotVault,\n TAccountWinnerMint extends string\n ? WritableAccount<TAccountWinnerMint>\n : TAccountWinnerMint,\n TAccountEntryByMint extends string\n ? ReadonlyAccount<TAccountEntryByMint>\n : TAccountEntryByMint,\n TAccountClaimerWinnerAta extends string\n ? WritableAccount<TAccountClaimerWinnerAta>\n : TAccountClaimerWinnerAta,\n TAccountClaimerQuoteAta extends string\n ? WritableAccount<TAccountClaimerQuoteAta>\n : TAccountClaimerQuoteAta,\n TAccountClaimer extends string\n ? ReadonlySignerAccount<TAccountClaimer> &\n AccountSignerMeta<TAccountClaimer>\n : TAccountClaimer,\n TAccountReceipt extends string\n ? WritableAccount<TAccountReceipt>\n : TAccountReceipt,\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> &\n AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ClaimInstructionData = {\n discriminator: ReadonlyUint8Array;\n burnAmount: bigint;\n};\n\nexport type ClaimInstructionDataArgs = { burnAmount: number | bigint };\n\nexport function getClaimInstructionDataEncoder(): FixedSizeEncoder<ClaimInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['burnAmount', getU64Encoder()],\n ]),\n (value) => ({ ...value, discriminator: CLAIM_DISCRIMINATOR }),\n );\n}\n\nexport function getClaimInstructionDataDecoder(): FixedSizeDecoder<ClaimInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['burnAmount', getU64Decoder()],\n ]);\n}\n\nexport function getClaimInstructionDataCodec(): FixedSizeCodec<\n ClaimInstructionDataArgs,\n ClaimInstructionData\n> {\n return combineCodec(\n getClaimInstructionDataEncoder(),\n getClaimInstructionDataDecoder(),\n );\n}\n\nexport type ClaimAsyncInput<\n TAccountMarket extends string = string,\n TAccountMarketAuthority extends string = string,\n TAccountPotVault extends string = string,\n TAccountWinnerMint extends string = string,\n TAccountEntryByMint extends string = string,\n TAccountClaimerWinnerAta extends string = string,\n TAccountClaimerQuoteAta extends string = string,\n TAccountClaimer extends string = string,\n TAccountReceipt extends string = string,\n TAccountPayer extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n /** Market PDA */\n market: Address<TAccountMarket>;\n marketAuthority?: Address<TAccountMarketAuthority>;\n /** Pot vault holding quote tokens */\n potVault: Address<TAccountPotVault>;\n /** Winner mint (must match market.winner_mint) */\n winnerMint: Address<TAccountWinnerMint>;\n /** EntryByMint for validation that this mint belongs to this market */\n entryByMint: Address<TAccountEntryByMint>;\n /** Claimer's winner token account (source for burn) */\n claimerWinnerAta: Address<TAccountClaimerWinnerAta>;\n /** Claimer's quote token account (destination for rewards) */\n claimerQuoteAta: Address<TAccountClaimerQuoteAta>;\n /** Claimer wallet (signer) */\n claimer: TransactionSigner<TAccountClaimer>;\n /** Claim receipt PDA (created if first claim) */\n receipt?: Address<TAccountReceipt>;\n /** Payer for receipt creation (can be same as claimer) */\n payer: TransactionSigner<TAccountPayer>;\n tokenProgram?: Address<TAccountTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n burnAmount: ClaimInstructionDataArgs['burnAmount'];\n};\n\nexport async function getClaimInstructionAsync<\n TAccountMarket extends string,\n TAccountMarketAuthority extends string,\n TAccountPotVault extends string,\n TAccountWinnerMint extends string,\n TAccountEntryByMint extends string,\n TAccountClaimerWinnerAta extends string,\n TAccountClaimerQuoteAta extends string,\n TAccountClaimer extends string,\n TAccountReceipt extends string,\n TAccountPayer extends string,\n TAccountTokenProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n>(\n input: ClaimAsyncInput<\n TAccountMarket,\n TAccountMarketAuthority,\n TAccountPotVault,\n TAccountWinnerMint,\n TAccountEntryByMint,\n TAccountClaimerWinnerAta,\n TAccountClaimerQuoteAta,\n TAccountClaimer,\n TAccountReceipt,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n ClaimInstruction<\n TProgramAddress,\n TAccountMarket,\n TAccountMarketAuthority,\n TAccountPotVault,\n TAccountWinnerMint,\n TAccountEntryByMint,\n TAccountClaimerWinnerAta,\n TAccountClaimerQuoteAta,\n TAccountClaimer,\n TAccountReceipt,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? PREDICTION_MIGRATOR_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n market: { value: input.market ?? null, isWritable: true },\n marketAuthority: {\n value: input.marketAuthority ?? null,\n isWritable: false,\n },\n potVault: { value: input.potVault ?? null, isWritable: true },\n winnerMint: { value: input.winnerMint ?? null, isWritable: true },\n entryByMint: { value: input.entryByMint ?? null, isWritable: false },\n claimerWinnerAta: {\n value: input.claimerWinnerAta ?? null,\n isWritable: true,\n },\n claimerQuoteAta: { value: input.claimerQuoteAta ?? null, isWritable: true },\n claimer: { value: input.claimer ?? null, isWritable: false },\n receipt: { value: input.receipt ?? null, isWritable: true },\n payer: { value: input.payer ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.marketAuthority.value) {\n accounts.marketAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([\n 109, 97, 114, 107, 101, 116, 95, 97, 117, 116, 104, 111, 114, 105,\n 116, 121,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n 'market',\n accounts.market.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.receipt.value) {\n accounts.receipt.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([114, 101, 99, 101, 105, 112, 116]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n 'market',\n accounts.market.value,\n ),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n 'claimer',\n accounts.claimer.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('market', accounts.market),\n getAccountMeta('marketAuthority', accounts.marketAuthority),\n getAccountMeta('potVault', accounts.potVault),\n getAccountMeta('winnerMint', accounts.winnerMint),\n getAccountMeta('entryByMint', accounts.entryByMint),\n getAccountMeta('claimerWinnerAta', accounts.claimerWinnerAta),\n getAccountMeta('claimerQuoteAta', accounts.claimerQuoteAta),\n getAccountMeta('claimer', accounts.claimer),\n getAccountMeta('receipt', accounts.receipt),\n getAccountMeta('payer', accounts.payer),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('systemProgram', accounts.systemProgram),\n ],\n data: getClaimInstructionDataEncoder().encode(\n args as ClaimInstructionDataArgs,\n ),\n programAddress,\n } as ClaimInstruction<\n TProgramAddress,\n TAccountMarket,\n TAccountMarketAuthority,\n TAccountPotVault,\n TAccountWinnerMint,\n TAccountEntryByMint,\n TAccountClaimerWinnerAta,\n TAccountClaimerQuoteAta,\n TAccountClaimer,\n TAccountReceipt,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type ClaimInput<\n TAccountMarket extends string = string,\n TAccountMarketAuthority extends string = string,\n TAccountPotVault extends string = string,\n TAccountWinnerMint extends string = string,\n TAccountEntryByMint extends string = string,\n TAccountClaimerWinnerAta extends string = string,\n TAccountClaimerQuoteAta extends string = string,\n TAccountClaimer extends string = string,\n TAccountReceipt extends string = string,\n TAccountPayer extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n /** Market PDA */\n market: Address<TAccountMarket>;\n marketAuthority: Address<TAccountMarketAuthority>;\n /** Pot vault holding quote tokens */\n potVault: Address<TAccountPotVault>;\n /** Winner mint (must match market.winner_mint) */\n winnerMint: Address<TAccountWinnerMint>;\n /** EntryByMint for validation that this mint belongs to this market */\n entryByMint: Address<TAccountEntryByMint>;\n /** Claimer's winner token account (source for burn) */\n claimerWinnerAta: Address<TAccountClaimerWinnerAta>;\n /** Claimer's quote token account (destination for rewards) */\n claimerQuoteAta: Address<TAccountClaimerQuoteAta>;\n /** Claimer wallet (signer) */\n claimer: TransactionSigner<TAccountClaimer>;\n /** Claim receipt PDA (created if first claim) */\n receipt: Address<TAccountReceipt>;\n /** Payer for receipt creation (can be same as claimer) */\n payer: TransactionSigner<TAccountPayer>;\n tokenProgram?: Address<TAccountTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n burnAmount: ClaimInstructionDataArgs['burnAmount'];\n};\n\nexport function getClaimInstruction<\n TAccountMarket extends string,\n TAccountMarketAuthority extends string,\n TAccountPotVault extends string,\n TAccountWinnerMint extends string,\n TAccountEntryByMint extends string,\n TAccountClaimerWinnerAta extends string,\n TAccountClaimerQuoteAta extends string,\n TAccountClaimer extends string,\n TAccountReceipt extends string,\n TAccountPayer extends string,\n TAccountTokenProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n>(\n input: ClaimInput<\n TAccountMarket,\n TAccountMarketAuthority,\n TAccountPotVault,\n TAccountWinnerMint,\n TAccountEntryByMint,\n TAccountClaimerWinnerAta,\n TAccountClaimerQuoteAta,\n TAccountClaimer,\n TAccountReceipt,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): ClaimInstruction<\n TProgramAddress,\n TAccountMarket,\n TAccountMarketAuthority,\n TAccountPotVault,\n TAccountWinnerMint,\n TAccountEntryByMint,\n TAccountClaimerWinnerAta,\n TAccountClaimerQuoteAta,\n TAccountClaimer,\n TAccountReceipt,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? PREDICTION_MIGRATOR_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n market: { value: input.market ?? null, isWritable: true },\n marketAuthority: {\n value: input.marketAuthority ?? null,\n isWritable: false,\n },\n potVault: { value: input.potVault ?? null, isWritable: true },\n winnerMint: { value: input.winnerMint ?? null, isWritable: true },\n entryByMint: { value: input.entryByMint ?? null, isWritable: false },\n claimerWinnerAta: {\n value: input.claimerWinnerAta ?? null,\n isWritable: true,\n },\n claimerQuoteAta: { value: input.claimerQuoteAta ?? null, isWritable: true },\n claimer: { value: input.claimer ?? null, isWritable: false },\n receipt: { value: input.receipt ?? null, isWritable: true },\n payer: { value: input.payer ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('market', accounts.market),\n getAccountMeta('marketAuthority', accounts.marketAuthority),\n getAccountMeta('potVault', accounts.potVault),\n getAccountMeta('winnerMint', accounts.winnerMint),\n getAccountMeta('entryByMint', accounts.entryByMint),\n getAccountMeta('claimerWinnerAta', accounts.claimerWinnerAta),\n getAccountMeta('claimerQuoteAta', accounts.claimerQuoteAta),\n getAccountMeta('claimer', accounts.claimer),\n getAccountMeta('receipt', accounts.receipt),\n getAccountMeta('payer', accounts.payer),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('systemProgram', accounts.systemProgram),\n ],\n data: getClaimInstructionDataEncoder().encode(\n args as ClaimInstructionDataArgs,\n ),\n programAddress,\n } as ClaimInstruction<\n TProgramAddress,\n TAccountMarket,\n TAccountMarketAuthority,\n TAccountPotVault,\n TAccountWinnerMint,\n TAccountEntryByMint,\n TAccountClaimerWinnerAta,\n TAccountClaimerQuoteAta,\n TAccountClaimer,\n TAccountReceipt,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedClaimInstruction<\n TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** Market PDA */\n market: TAccountMetas[0];\n marketAuthority: TAccountMetas[1];\n /** Pot vault holding quote tokens */\n potVault: TAccountMetas[2];\n /** Winner mint (must match market.winner_mint) */\n winnerMint: TAccountMetas[3];\n /** EntryByMint for validation that this mint belongs to this market */\n entryByMint: TAccountMetas[4];\n /** Claimer's winner token account (source for burn) */\n claimerWinnerAta: TAccountMetas[5];\n /** Claimer's quote token account (destination for rewards) */\n claimerQuoteAta: TAccountMetas[6];\n /** Claimer wallet (signer) */\n claimer: TAccountMetas[7];\n /** Claim receipt PDA (created if first claim) */\n receipt: TAccountMetas[8];\n /** Payer for receipt creation (can be same as claimer) */\n payer: TAccountMetas[9];\n tokenProgram: TAccountMetas[10];\n systemProgram: TAccountMetas[11];\n };\n data: ClaimInstructionData;\n};\n\nexport function parseClaimInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedClaimInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 12) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 12,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n market: getNextAccount(),\n marketAuthority: getNextAccount(),\n potVault: getNextAccount(),\n winnerMint: getNextAccount(),\n entryByMint: getNextAccount(),\n claimerWinnerAta: getNextAccount(),\n claimerQuoteAta: getNextAccount(),\n claimer: getNextAccount(),\n receipt: getNextAccount(),\n payer: getNextAccount(),\n tokenProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getClaimInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { PREDICTION_MIGRATOR_PROGRAM_ADDRESS } from '../programs';\n\nexport const MIGRATE_ENTRY_DISCRIMINATOR = new Uint8Array([\n 239, 154, 55, 173, 110, 36, 188, 214,\n]);\n\nexport function getMigrateEntryDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n MIGRATE_ENTRY_DISCRIMINATOR,\n );\n}\n\nexport type MigrateEntryInstruction<\n TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n TAccountInitializerConfig extends string | AccountMeta<string> = string,\n TAccountLaunch extends string | AccountMeta<string> = string,\n TAccountLaunchAuthority extends string | AccountMeta<string> = string,\n TAccountBaseMint extends string | AccountMeta<string> = string,\n TAccountQuoteMint extends string | AccountMeta<string> = string,\n TAccountBaseVault extends string | AccountMeta<string> = string,\n TAccountQuoteVault extends string | AccountMeta<string> = string,\n TAccountPayer extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',\n TAccountSystemProgram extends string | AccountMeta<string> =\n '11111111111111111111111111111111',\n TAccountRent extends string | AccountMeta<string> =\n 'SysvarRent111111111111111111111111111111111',\n TAccountOracle extends string | AccountMeta<string> = string,\n TAccountMarket extends string | AccountMeta<string> = string,\n TAccountPotVault extends string | AccountMeta<string> = string,\n TAccountMarketAuthority extends string | AccountMeta<string> = string,\n TAccountEntry extends string | AccountMeta<string> = string,\n TAccountEntryByMint extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountInitializerConfig extends string\n ? ReadonlyAccount<TAccountInitializerConfig>\n : TAccountInitializerConfig,\n TAccountLaunch extends string\n ? ReadonlyAccount<TAccountLaunch>\n : TAccountLaunch,\n TAccountLaunchAuthority extends string\n ? ReadonlySignerAccount<TAccountLaunchAuthority> &\n AccountSignerMeta<TAccountLaunchAuthority>\n : TAccountLaunchAuthority,\n TAccountBaseMint extends string\n ? WritableAccount<TAccountBaseMint>\n : TAccountBaseMint,\n TAccountQuoteMint extends string\n ? ReadonlyAccount<TAccountQuoteMint>\n : TAccountQuoteMint,\n TAccountBaseVault extends string\n ? WritableAccount<TAccountBaseVault>\n : TAccountBaseVault,\n TAccountQuoteVault extends string\n ? WritableAccount<TAccountQuoteVault>\n : TAccountQuoteVault,\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> &\n AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n TAccountRent extends string\n ? ReadonlyAccount<TAccountRent>\n : TAccountRent,\n TAccountOracle extends string\n ? ReadonlyAccount<TAccountOracle>\n : TAccountOracle,\n TAccountMarket extends string\n ? WritableAccount<TAccountMarket>\n : TAccountMarket,\n TAccountPotVault extends string\n ? WritableAccount<TAccountPotVault>\n : TAccountPotVault,\n TAccountMarketAuthority extends string\n ? ReadonlyAccount<TAccountMarketAuthority>\n : TAccountMarketAuthority,\n TAccountEntry extends string\n ? WritableAccount<TAccountEntry>\n : TAccountEntry,\n TAccountEntryByMint extends string\n ? ReadonlyAccount<TAccountEntryByMint>\n : TAccountEntryByMint,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type MigrateEntryInstructionData = {\n discriminator: ReadonlyUint8Array;\n entryId: ReadonlyUint8Array;\n};\n\nexport type MigrateEntryInstructionDataArgs = { entryId: ReadonlyUint8Array };\n\nexport function getMigrateEntryInstructionDataEncoder(): FixedSizeEncoder<MigrateEntryInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['entryId', fixEncoderSize(getBytesEncoder(), 32)],\n ]),\n (value) => ({ ...value, discriminator: MIGRATE_ENTRY_DISCRIMINATOR }),\n );\n}\n\nexport function getMigrateEntryInstructionDataDecoder(): FixedSizeDecoder<MigrateEntryInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['entryId', fixDecoderSize(getBytesDecoder(), 32)],\n ]);\n}\n\nexport function getMigrateEntryInstructionDataCodec(): FixedSizeCodec<\n MigrateEntryInstructionDataArgs,\n MigrateEntryInstructionData\n> {\n return combineCodec(\n getMigrateEntryInstructionDataEncoder(),\n getMigrateEntryInstructionDataDecoder(),\n );\n}\n\nexport type MigrateEntryAsyncInput<\n TAccountInitializerConfig extends string = string,\n TAccountLaunch extends string = string,\n TAccountLaunchAuthority extends string = string,\n TAccountBaseMint extends string = string,\n TAccountQuoteMint extends string = string,\n TAccountBaseVault extends string = string,\n TAccountQuoteVault extends string = string,\n TAccountPayer extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountRent extends string = string,\n TAccountOracle extends string = string,\n TAccountMarket extends string = string,\n TAccountPotVault extends string = string,\n TAccountMarketAuthority extends string = string,\n TAccountEntry extends string = string,\n TAccountEntryByMint extends string = string,\n> = {\n initializerConfig: Address<TAccountInitializerConfig>;\n /** Launch account from initializer */\n launch: Address<TAccountLaunch>;\n /** Launch authority PDA - signed by initializer */\n launchAuthority: TransactionSigner<TAccountLaunchAuthority>;\n /** Base mint for this entry (will burn unsold) */\n baseMint: Address<TAccountBaseMint>;\n /** Quote mint for this market */\n quoteMint: Address<TAccountQuoteMint>;\n /** Base vault from launch (source for burn) */\n baseVault: Address<TAccountBaseVault>;\n /** Quote vault from launch (source for transfer) */\n quoteVault: Address<TAccountQuoteVault>;\n payer: TransactionSigner<TAccountPayer>;\n tokenProgram?: Address<TAccountTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n rent?: Address<TAccountRent>;\n /**\n * The oracle that determines the winner.\n * Anchor enforces owner + discriminator (trusted_oracle_interface).\n */\n oracle: Address<TAccountOracle>;\n /** Market PDA */\n market?: Address<TAccountMarket>;\n /** Pot vault for holding quote tokens */\n potVault: Address<TAccountPotVault>;\n marketAuthority?: Address<TAccountMarketAuthority>;\n /** Entry PDA */\n entry: Address<TAccountEntry>;\n /** EntryByMint PDA (for validation) */\n entryByMint?: Address<TAccountEntryByMint>;\n entryId: MigrateEntryInstructionDataArgs['entryId'];\n};\n\nexport async function getMigrateEntryInstructionAsync<\n TAccountInitializerConfig extends string,\n TAccountLaunch extends string,\n TAccountLaunchAuthority extends string,\n TAccountBaseMint extends string,\n TAccountQuoteMint extends string,\n TAccountBaseVault extends string,\n TAccountQuoteVault extends string,\n TAccountPayer extends string,\n TAccountTokenProgram extends string,\n TAccountSystemProgram extends string,\n TAccountRent extends string,\n TAccountOracle extends string,\n TAccountMarket extends string,\n TAccountPotVault extends string,\n TAccountMarketAuthority extends string,\n TAccountEntry extends string,\n TAccountEntryByMint extends string,\n TProgramAddress extends Address = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n>(\n input: MigrateEntryAsyncInput<\n TAccountInitializerConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountOracle,\n TAccountMarket,\n TAccountPotVault,\n TAccountMarketAuthority,\n TAccountEntry,\n TAccountEntryByMint\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n MigrateEntryInstruction<\n TProgramAddress,\n TAccountInitializerConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountOracle,\n TAccountMarket,\n TAccountPotVault,\n TAccountMarketAuthority,\n TAccountEntry,\n TAccountEntryByMint\n >\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? PREDICTION_MIGRATOR_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n initializerConfig: {\n value: input.initializerConfig ?? null,\n isWritable: false,\n },\n launch: { value: input.launch ?? null, isWritable: false },\n launchAuthority: {\n value: input.launchAuthority ?? null,\n isWritable: false,\n },\n baseMint: { value: input.baseMint ?? null, isWritable: true },\n quoteMint: { value: input.quoteMint ?? null, isWritable: false },\n baseVault: { value: input.baseVault ?? null, isWritable: true },\n quoteVault: { value: input.quoteVault ?? null, isWritable: true },\n payer: { value: input.payer ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n rent: { value: input.rent ?? null, isWritable: false },\n oracle: { value: input.oracle ?? null, isWritable: false },\n market: { value: input.market ?? null, isWritable: true },\n potVault: { value: input.potVault ?? null, isWritable: true },\n marketAuthority: {\n value: input.marketAuthority ?? null,\n isWritable: false,\n },\n entry: { value: input.entry ?? null, isWritable: true },\n entryByMint: { value: input.entryByMint ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.rent.value) {\n accounts.rent.value =\n 'SysvarRent111111111111111111111111111111111' as Address<'SysvarRent111111111111111111111111111111111'>;\n }\n if (!accounts.market.value) {\n accounts.market.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(new Uint8Array([109, 97, 114, 107, 101, 116])),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n 'oracle',\n accounts.oracle.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.marketAuthority.value) {\n accounts.marketAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([\n 109, 97, 114, 107, 101, 116, 95, 97, 117, 116, 104, 111, 114, 105,\n 116, 121,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n 'market',\n accounts.market.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.entryByMint.value) {\n accounts.entryByMint.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([\n 101, 110, 116, 114, 121, 95, 98, 121, 95, 109, 105, 110, 116,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n 'oracle',\n accounts.oracle.value,\n ),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n 'baseMint',\n accounts.baseMint.value,\n ),\n ),\n ],\n });\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('initializerConfig', accounts.initializerConfig),\n getAccountMeta('launch', accounts.launch),\n getAccountMeta('launchAuthority', accounts.launchAuthority),\n getAccountMeta('baseMint', accounts.baseMint),\n getAccountMeta('quoteMint', accounts.quoteMint),\n getAccountMeta('baseVault', accounts.baseVault),\n getAccountMeta('quoteVault', accounts.quoteVault),\n getAccountMeta('payer', accounts.payer),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('rent', accounts.rent),\n getAccountMeta('oracle', accounts.oracle),\n getAccountMeta('market', accounts.market),\n getAccountMeta('potVault', accounts.potVault),\n getAccountMeta('marketAuthority', accounts.marketAuthority),\n getAccountMeta('entry', accounts.entry),\n getAccountMeta('entryByMint', accounts.entryByMint),\n ],\n data: getMigrateEntryInstructionDataEncoder().encode(\n args as MigrateEntryInstructionDataArgs,\n ),\n programAddress,\n } as MigrateEntryInstruction<\n TProgramAddress,\n TAccountInitializerConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountOracle,\n TAccountMarket,\n TAccountPotVault,\n TAccountMarketAuthority,\n TAccountEntry,\n TAccountEntryByMint\n >);\n}\n\nexport type MigrateEntryInput<\n TAccountInitializerConfig extends string = string,\n TAccountLaunch extends string = string,\n TAccountLaunchAuthority extends string = string,\n TAccountBaseMint extends string = string,\n TAccountQuoteMint extends string = string,\n TAccountBaseVault extends string = string,\n TAccountQuoteVault extends string = string,\n TAccountPayer extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountRent extends string = string,\n TAccountOracle extends string = string,\n TAccountMarket extends string = string,\n TAccountPotVault extends string = string,\n TAccountMarketAuthority extends string = string,\n TAccountEntry extends string = string,\n TAccountEntryByMint extends string = string,\n> = {\n initializerConfig: Address<TAccountInitializerConfig>;\n /** Launch account from initializer */\n launch: Address<TAccountLaunch>;\n /** Launch authority PDA - signed by initializer */\n launchAuthority: TransactionSigner<TAccountLaunchAuthority>;\n /** Base mint for this entry (will burn unsold) */\n baseMint: Address<TAccountBaseMint>;\n /** Quote mint for this market */\n quoteMint: Address<TAccountQuoteMint>;\n /** Base vault from launch (source for burn) */\n baseVault: Address<TAccountBaseVault>;\n /** Quote vault from launch (source for transfer) */\n quoteVault: Address<TAccountQuoteVault>;\n payer: TransactionSigner<TAccountPayer>;\n tokenProgram?: Address<TAccountTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n rent?: Address<TAccountRent>;\n /**\n * The oracle that determines the winner.\n * Anchor enforces owner + discriminator (trusted_oracle_interface).\n */\n oracle: Address<TAccountOracle>;\n /** Market PDA */\n market: Address<TAccountMarket>;\n /** Pot vault for holding quote tokens */\n potVault: Address<TAccountPotVault>;\n marketAuthority: Address<TAccountMarketAuthority>;\n /** Entry PDA */\n entry: Address<TAccountEntry>;\n /** EntryByMint PDA (for validation) */\n entryByMint: Address<TAccountEntryByMint>;\n entryId: MigrateEntryInstructionDataArgs['entryId'];\n};\n\nexport function getMigrateEntryInstruction<\n TAccountInitializerConfig extends string,\n TAccountLaunch extends string,\n TAccountLaunchAuthority extends string,\n TAccountBaseMint extends string,\n TAccountQuoteMint extends string,\n TAccountBaseVault extends string,\n TAccountQuoteVault extends string,\n TAccountPayer extends string,\n TAccountTokenProgram extends string,\n TAccountSystemProgram extends string,\n TAccountRent extends string,\n TAccountOracle extends string,\n TAccountMarket extends string,\n TAccountPotVault extends string,\n TAccountMarketAuthority extends string,\n TAccountEntry extends string,\n TAccountEntryByMint extends string,\n TProgramAddress extends Address = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n>(\n input: MigrateEntryInput<\n TAccountInitializerConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountOracle,\n TAccountMarket,\n TAccountPotVault,\n TAccountMarketAuthority,\n TAccountEntry,\n TAccountEntryByMint\n >,\n config?: { programAddress?: TProgramAddress },\n): MigrateEntryInstruction<\n TProgramAddress,\n TAccountInitializerConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountOracle,\n TAccountMarket,\n TAccountPotVault,\n TAccountMarketAuthority,\n TAccountEntry,\n TAccountEntryByMint\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? PREDICTION_MIGRATOR_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n initializerConfig: {\n value: input.initializerConfig ?? null,\n isWritable: false,\n },\n launch: { value: input.launch ?? null, isWritable: false },\n launchAuthority: {\n value: input.launchAuthority ?? null,\n isWritable: false,\n },\n baseMint: { value: input.baseMint ?? null, isWritable: true },\n quoteMint: { value: input.quoteMint ?? null, isWritable: false },\n baseVault: { value: input.baseVault ?? null, isWritable: true },\n quoteVault: { value: input.quoteVault ?? null, isWritable: true },\n payer: { value: input.payer ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n rent: { value: input.rent ?? null, isWritable: false },\n oracle: { value: input.oracle ?? null, isWritable: false },\n market: { value: input.market ?? null, isWritable: true },\n potVault: { value: input.potVault ?? null, isWritable: true },\n marketAuthority: {\n value: input.marketAuthority ?? null,\n isWritable: false,\n },\n entry: { value: input.entry ?? null, isWritable: true },\n entryByMint: { value: input.entryByMint ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.rent.value) {\n accounts.rent.value =\n 'SysvarRent111111111111111111111111111111111' as Address<'SysvarRent111111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('initializerConfig', accounts.initializerConfig),\n getAccountMeta('launch', accounts.launch),\n getAccountMeta('launchAuthority', accounts.launchAuthority),\n getAccountMeta('baseMint', accounts.baseMint),\n getAccountMeta('quoteMint', accounts.quoteMint),\n getAccountMeta('baseVault', accounts.baseVault),\n getAccountMeta('quoteVault', accounts.quoteVault),\n getAccountMeta('payer', accounts.payer),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('rent', accounts.rent),\n getAccountMeta('oracle', accounts.oracle),\n getAccountMeta('market', accounts.market),\n getAccountMeta('potVault', accounts.potVault),\n getAccountMeta('marketAuthority', accounts.marketAuthority),\n getAccountMeta('entry', accounts.entry),\n getAccountMeta('entryByMint', accounts.entryByMint),\n ],\n data: getMigrateEntryInstructionDataEncoder().encode(\n args as MigrateEntryInstructionDataArgs,\n ),\n programAddress,\n } as MigrateEntryInstruction<\n TProgramAddress,\n TAccountInitializerConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountOracle,\n TAccountMarket,\n TAccountPotVault,\n TAccountMarketAuthority,\n TAccountEntry,\n TAccountEntryByMint\n >);\n}\n\nexport type ParsedMigrateEntryInstruction<\n TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n initializerConfig: TAccountMetas[0];\n /** Launch account from initializer */\n launch: TAccountMetas[1];\n /** Launch authority PDA - signed by initializer */\n launchAuthority: TAccountMetas[2];\n /** Base mint for this entry (will burn unsold) */\n baseMint: TAccountMetas[3];\n /** Quote mint for this market */\n quoteMint: TAccountMetas[4];\n /** Base vault from launch (source for burn) */\n baseVault: TAccountMetas[5];\n /** Quote vault from launch (source for transfer) */\n quoteVault: TAccountMetas[6];\n payer: TAccountMetas[7];\n tokenProgram: TAccountMetas[8];\n systemProgram: TAccountMetas[9];\n rent: TAccountMetas[10];\n /**\n * The oracle that determines the winner.\n * Anchor enforces owner + discriminator (trusted_oracle_interface).\n */\n oracle: TAccountMetas[11];\n /** Market PDA */\n market: TAccountMetas[12];\n /** Pot vault for holding quote tokens */\n potVault: TAccountMetas[13];\n marketAuthority: TAccountMetas[14];\n /** Entry PDA */\n entry: TAccountMetas[15];\n /** EntryByMint PDA (for validation) */\n entryByMint: TAccountMetas[16];\n };\n data: MigrateEntryInstructionData;\n};\n\nexport function parseMigrateEntryInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedMigrateEntryInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 17) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 17,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n initializerConfig: getNextAccount(),\n launch: getNextAccount(),\n launchAuthority: getNextAccount(),\n baseMint: getNextAccount(),\n quoteMint: getNextAccount(),\n baseVault: getNextAccount(),\n quoteVault: getNextAccount(),\n payer: getNextAccount(),\n tokenProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n rent: getNextAccount(),\n oracle: getNextAccount(),\n market: getNextAccount(),\n potVault: getNextAccount(),\n marketAuthority: getNextAccount(),\n entry: getNextAccount(),\n entryByMint: getNextAccount(),\n },\n data: getMigrateEntryInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { PREDICTION_MIGRATOR_PROGRAM_ADDRESS } from '../programs';\n\nexport const PREVIEW_PAYOUT_IF_WINNER_DISCRIMINATOR = new Uint8Array([\n 228, 144, 72, 185, 234, 186, 183, 143,\n]);\n\nexport function getPreviewPayoutIfWinnerDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n PREVIEW_PAYOUT_IF_WINNER_DISCRIMINATOR,\n );\n}\n\nexport type PreviewPayoutIfWinnerInstruction<\n TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n TAccountMarket extends string | AccountMeta<string> = string,\n TAccountCandidateMint extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountMarket extends string\n ? ReadonlyAccount<TAccountMarket>\n : TAccountMarket,\n TAccountCandidateMint extends string\n ? ReadonlyAccount<TAccountCandidateMint>\n : TAccountCandidateMint,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type PreviewPayoutIfWinnerInstructionData = {\n discriminator: ReadonlyUint8Array;\n candidateWinnerMint: Address;\n tokenAmount: bigint;\n};\n\nexport type PreviewPayoutIfWinnerInstructionDataArgs = {\n candidateWinnerMint: Address;\n tokenAmount: number | bigint;\n};\n\nexport function getPreviewPayoutIfWinnerInstructionDataEncoder(): FixedSizeEncoder<PreviewPayoutIfWinnerInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['candidateWinnerMint', getAddressEncoder()],\n ['tokenAmount', getU64Encoder()],\n ]),\n (value) => ({\n ...value,\n discriminator: PREVIEW_PAYOUT_IF_WINNER_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getPreviewPayoutIfWinnerInstructionDataDecoder(): FixedSizeDecoder<PreviewPayoutIfWinnerInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['candidateWinnerMint', getAddressDecoder()],\n ['tokenAmount', getU64Decoder()],\n ]);\n}\n\nexport function getPreviewPayoutIfWinnerInstructionDataCodec(): FixedSizeCodec<\n PreviewPayoutIfWinnerInstructionDataArgs,\n PreviewPayoutIfWinnerInstructionData\n> {\n return combineCodec(\n getPreviewPayoutIfWinnerInstructionDataEncoder(),\n getPreviewPayoutIfWinnerInstructionDataDecoder(),\n );\n}\n\nexport type PreviewPayoutIfWinnerInput<\n TAccountMarket extends string = string,\n TAccountCandidateMint extends string = string,\n> = {\n /** Market PDA */\n market: Address<TAccountMarket>;\n /** Candidate winner mint (may or may not match oracle winner) */\n candidateMint: Address<TAccountCandidateMint>;\n candidateWinnerMint: PreviewPayoutIfWinnerInstructionDataArgs['candidateWinnerMint'];\n tokenAmount: PreviewPayoutIfWinnerInstructionDataArgs['tokenAmount'];\n};\n\nexport function getPreviewPayoutIfWinnerInstruction<\n TAccountMarket extends string,\n TAccountCandidateMint extends string,\n TProgramAddress extends Address = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n>(\n input: PreviewPayoutIfWinnerInput<TAccountMarket, TAccountCandidateMint>,\n config?: { programAddress?: TProgramAddress },\n): PreviewPayoutIfWinnerInstruction<\n TProgramAddress,\n TAccountMarket,\n TAccountCandidateMint\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? PREDICTION_MIGRATOR_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n market: { value: input.market ?? null, isWritable: false },\n candidateMint: { value: input.candidateMint ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('market', accounts.market),\n getAccountMeta('candidateMint', accounts.candidateMint),\n ],\n data: getPreviewPayoutIfWinnerInstructionDataEncoder().encode(\n args as PreviewPayoutIfWinnerInstructionDataArgs,\n ),\n programAddress,\n } as PreviewPayoutIfWinnerInstruction<\n TProgramAddress,\n TAccountMarket,\n TAccountCandidateMint\n >);\n}\n\nexport type ParsedPreviewPayoutIfWinnerInstruction<\n TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** Market PDA */\n market: TAccountMetas[0];\n /** Candidate winner mint (may or may not match oracle winner) */\n candidateMint: TAccountMetas[1];\n };\n data: PreviewPayoutIfWinnerInstructionData;\n};\n\nexport function parsePreviewPayoutIfWinnerInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedPreviewPayoutIfWinnerInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { market: getNextAccount(), candidateMint: getNextAccount() },\n data: getPreviewPayoutIfWinnerInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { PREDICTION_MIGRATOR_PROGRAM_ADDRESS } from '../programs';\n\nexport const REGISTER_ENTRY_DISCRIMINATOR = new Uint8Array([\n 198, 25, 1, 183, 73, 219, 215, 14,\n]);\n\nexport function getRegisterEntryDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n REGISTER_ENTRY_DISCRIMINATOR,\n );\n}\n\nexport type RegisterEntryInstruction<\n TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n TAccountInitializerConfig extends string | AccountMeta<string> = string,\n TAccountLaunch extends string | AccountMeta<string> = string,\n TAccountLaunchAuthority extends string | AccountMeta<string> = string,\n TAccountBaseMint extends string | AccountMeta<string> = string,\n TAccountQuoteMint extends string | AccountMeta<string> = string,\n TAccountBaseVault extends string | AccountMeta<string> = string,\n TAccountQuoteVault extends string | AccountMeta<string> = string,\n TAccountPayer extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',\n TAccountSystemProgram extends string | AccountMeta<string> =\n '11111111111111111111111111111111',\n TAccountRent extends string | AccountMeta<string> =\n 'SysvarRent111111111111111111111111111111111',\n TAccountOracle extends string | AccountMeta<string> = string,\n TAccountMarket extends string | AccountMeta<string> = string,\n TAccountPotVault extends string | AccountMeta<string> = string,\n TAccountMarketAuthority extends string | AccountMeta<string> = string,\n TAccountEntry extends string | AccountMeta<string> = string,\n TAccountEntryByMint extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountInitializerConfig extends string\n ? ReadonlyAccount<TAccountInitializerConfig>\n : TAccountInitializerConfig,\n TAccountLaunch extends string\n ? ReadonlyAccount<TAccountLaunch>\n : TAccountLaunch,\n TAccountLaunchAuthority extends string\n ? ReadonlySignerAccount<TAccountLaunchAuthority> &\n AccountSignerMeta<TAccountLaunchAuthority>\n : TAccountLaunchAuthority,\n TAccountBaseMint extends string\n ? ReadonlyAccount<TAccountBaseMint>\n : TAccountBaseMint,\n TAccountQuoteMint extends string\n ? ReadonlyAccount<TAccountQuoteMint>\n : TAccountQuoteMint,\n TAccountBaseVault extends string\n ? ReadonlyAccount<TAccountBaseVault>\n : TAccountBaseVault,\n TAccountQuoteVault extends string\n ? ReadonlyAccount<TAccountQuoteVault>\n : TAccountQuoteVault,\n TAccountPayer extends string\n ? WritableSignerAccount<TAccountPayer> &\n AccountSignerMeta<TAccountPayer>\n : TAccountPayer,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n TAccountRent extends string\n ? ReadonlyAccount<TAccountRent>\n : TAccountRent,\n TAccountOracle extends string\n ? ReadonlyAccount<TAccountOracle>\n : TAccountOracle,\n TAccountMarket extends string\n ? WritableAccount<TAccountMarket>\n : TAccountMarket,\n TAccountPotVault extends string\n ? WritableAccount<TAccountPotVault>\n : TAccountPotVault,\n TAccountMarketAuthority extends string\n ? ReadonlyAccount<TAccountMarketAuthority>\n : TAccountMarketAuthority,\n TAccountEntry extends string\n ? WritableAccount<TAccountEntry>\n : TAccountEntry,\n TAccountEntryByMint extends string\n ? WritableAccount<TAccountEntryByMint>\n : TAccountEntryByMint,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RegisterEntryInstructionData = {\n discriminator: ReadonlyUint8Array;\n entryId: ReadonlyUint8Array;\n};\n\nexport type RegisterEntryInstructionDataArgs = { entryId: ReadonlyUint8Array };\n\nexport function getRegisterEntryInstructionDataEncoder(): FixedSizeEncoder<RegisterEntryInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['entryId', fixEncoderSize(getBytesEncoder(), 32)],\n ]),\n (value) => ({ ...value, discriminator: REGISTER_ENTRY_DISCRIMINATOR }),\n );\n}\n\nexport function getRegisterEntryInstructionDataDecoder(): FixedSizeDecoder<RegisterEntryInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['entryId', fixDecoderSize(getBytesDecoder(), 32)],\n ]);\n}\n\nexport function getRegisterEntryInstructionDataCodec(): FixedSizeCodec<\n RegisterEntryInstructionDataArgs,\n RegisterEntryInstructionData\n> {\n return combineCodec(\n getRegisterEntryInstructionDataEncoder(),\n getRegisterEntryInstructionDataDecoder(),\n );\n}\n\nexport type RegisterEntryAsyncInput<\n TAccountInitializerConfig extends string = string,\n TAccountLaunch extends string = string,\n TAccountLaunchAuthority extends string = string,\n TAccountBaseMint extends string = string,\n TAccountQuoteMint extends string = string,\n TAccountBaseVault extends string = string,\n TAccountQuoteVault extends string = string,\n TAccountPayer extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountRent extends string = string,\n TAccountOracle extends string = string,\n TAccountMarket extends string = string,\n TAccountPotVault extends string = string,\n TAccountMarketAuthority extends string = string,\n TAccountEntry extends string = string,\n TAccountEntryByMint extends string = string,\n> = {\n initializerConfig: Address<TAccountInitializerConfig>;\n /** Launch account from initializer */\n launch: Address<TAccountLaunch>;\n /** Launch authority PDA - signed by initializer */\n launchAuthority: TransactionSigner<TAccountLaunchAuthority>;\n /** Base mint for this entry */\n baseMint: Address<TAccountBaseMint>;\n /** Quote mint for this market */\n quoteMint: Address<TAccountQuoteMint>;\n baseVault: Address<TAccountBaseVault>;\n quoteVault: Address<TAccountQuoteVault>;\n payer: TransactionSigner<TAccountPayer>;\n tokenProgram?: Address<TAccountTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n rent?: Address<TAccountRent>;\n /** The oracle that this market is tied to */\n oracle: Address<TAccountOracle>;\n /** Market PDA - created if first entry */\n market?: Address<TAccountMarket>;\n /** Pot vault for holding quote tokens */\n potVault?: Address<TAccountPotVault>;\n marketAuthority?: Address<TAccountMarketAuthority>;\n /** Entry PDA for this entry */\n entry: Address<TAccountEntry>;\n /** EntryByMint PDA for reverse lookup */\n entryByMint?: Address<TAccountEntryByMint>;\n entryId: RegisterEntryInstructionDataArgs['entryId'];\n};\n\nexport async function getRegisterEntryInstructionAsync<\n TAccountInitializerConfig extends string,\n TAccountLaunch extends string,\n TAccountLaunchAuthority extends string,\n TAccountBaseMint extends string,\n TAccountQuoteMint extends string,\n TAccountBaseVault extends string,\n TAccountQuoteVault extends string,\n TAccountPayer extends string,\n TAccountTokenProgram extends string,\n TAccountSystemProgram extends string,\n TAccountRent extends string,\n TAccountOracle extends string,\n TAccountMarket extends string,\n TAccountPotVault extends string,\n TAccountMarketAuthority extends string,\n TAccountEntry extends string,\n TAccountEntryByMint extends string,\n TProgramAddress extends Address = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n>(\n input: RegisterEntryAsyncInput<\n TAccountInitializerConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountOracle,\n TAccountMarket,\n TAccountPotVault,\n TAccountMarketAuthority,\n TAccountEntry,\n TAccountEntryByMint\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n RegisterEntryInstruction<\n TProgramAddress,\n TAccountInitializerConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountOracle,\n TAccountMarket,\n TAccountPotVault,\n TAccountMarketAuthority,\n TAccountEntry,\n TAccountEntryByMint\n >\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? PREDICTION_MIGRATOR_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n initializerConfig: {\n value: input.initializerConfig ?? null,\n isWritable: false,\n },\n launch: { value: input.launch ?? null, isWritable: false },\n launchAuthority: {\n value: input.launchAuthority ?? null,\n isWritable: false,\n },\n baseMint: { value: input.baseMint ?? null, isWritable: false },\n quoteMint: { value: input.quoteMint ?? null, isWritable: false },\n baseVault: { value: input.baseVault ?? null, isWritable: false },\n quoteVault: { value: input.quoteVault ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n rent: { value: input.rent ?? null, isWritable: false },\n oracle: { value: input.oracle ?? null, isWritable: false },\n market: { value: input.market ?? null, isWritable: true },\n potVault: { value: input.potVault ?? null, isWritable: true },\n marketAuthority: {\n value: input.marketAuthority ?? null,\n isWritable: false,\n },\n entry: { value: input.entry ?? null, isWritable: true },\n entryByMint: { value: input.entryByMint ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.rent.value) {\n accounts.rent.value =\n 'SysvarRent111111111111111111111111111111111' as Address<'SysvarRent111111111111111111111111111111111'>;\n }\n if (!accounts.market.value) {\n accounts.market.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(new Uint8Array([109, 97, 114, 107, 101, 116])),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n 'oracle',\n accounts.oracle.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.potVault.value) {\n accounts.potVault.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([112, 111, 116, 95, 118, 97, 117, 108, 116]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n 'market',\n accounts.market.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.marketAuthority.value) {\n accounts.marketAuthority.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([\n 109, 97, 114, 107, 101, 116, 95, 97, 117, 116, 104, 111, 114, 105,\n 116, 121,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n 'market',\n accounts.market.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.entryByMint.value) {\n accounts.entryByMint.value = await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([\n 101, 110, 116, 114, 121, 95, 98, 121, 95, 109, 105, 110, 116,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n 'oracle',\n accounts.oracle.value,\n ),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n 'baseMint',\n accounts.baseMint.value,\n ),\n ),\n ],\n });\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('initializerConfig', accounts.initializerConfig),\n getAccountMeta('launch', accounts.launch),\n getAccountMeta('launchAuthority', accounts.launchAuthority),\n getAccountMeta('baseMint', accounts.baseMint),\n getAccountMeta('quoteMint', accounts.quoteMint),\n getAccountMeta('baseVault', accounts.baseVault),\n getAccountMeta('quoteVault', accounts.quoteVault),\n getAccountMeta('payer', accounts.payer),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('rent', accounts.rent),\n getAccountMeta('oracle', accounts.oracle),\n getAccountMeta('market', accounts.market),\n getAccountMeta('potVault', accounts.potVault),\n getAccountMeta('marketAuthority', accounts.marketAuthority),\n getAccountMeta('entry', accounts.entry),\n getAccountMeta('entryByMint', accounts.entryByMint),\n ],\n data: getRegisterEntryInstructionDataEncoder().encode(\n args as RegisterEntryInstructionDataArgs,\n ),\n programAddress,\n } as RegisterEntryInstruction<\n TProgramAddress,\n TAccountInitializerConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountOracle,\n TAccountMarket,\n TAccountPotVault,\n TAccountMarketAuthority,\n TAccountEntry,\n TAccountEntryByMint\n >);\n}\n\nexport type RegisterEntryInput<\n TAccountInitializerConfig extends string = string,\n TAccountLaunch extends string = string,\n TAccountLaunchAuthority extends string = string,\n TAccountBaseMint extends string = string,\n TAccountQuoteMint extends string = string,\n TAccountBaseVault extends string = string,\n TAccountQuoteVault extends string = string,\n TAccountPayer extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n TAccountRent extends string = string,\n TAccountOracle extends string = string,\n TAccountMarket extends string = string,\n TAccountPotVault extends string = string,\n TAccountMarketAuthority extends string = string,\n TAccountEntry extends string = string,\n TAccountEntryByMint extends string = string,\n> = {\n initializerConfig: Address<TAccountInitializerConfig>;\n /** Launch account from initializer */\n launch: Address<TAccountLaunch>;\n /** Launch authority PDA - signed by initializer */\n launchAuthority: TransactionSigner<TAccountLaunchAuthority>;\n /** Base mint for this entry */\n baseMint: Address<TAccountBaseMint>;\n /** Quote mint for this market */\n quoteMint: Address<TAccountQuoteMint>;\n baseVault: Address<TAccountBaseVault>;\n quoteVault: Address<TAccountQuoteVault>;\n payer: TransactionSigner<TAccountPayer>;\n tokenProgram?: Address<TAccountTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n rent?: Address<TAccountRent>;\n /** The oracle that this market is tied to */\n oracle: Address<TAccountOracle>;\n /** Market PDA - created if first entry */\n market: Address<TAccountMarket>;\n /** Pot vault for holding quote tokens */\n potVault: Address<TAccountPotVault>;\n marketAuthority: Address<TAccountMarketAuthority>;\n /** Entry PDA for this entry */\n entry: Address<TAccountEntry>;\n /** EntryByMint PDA for reverse lookup */\n entryByMint: Address<TAccountEntryByMint>;\n entryId: RegisterEntryInstructionDataArgs['entryId'];\n};\n\nexport function getRegisterEntryInstruction<\n TAccountInitializerConfig extends string,\n TAccountLaunch extends string,\n TAccountLaunchAuthority extends string,\n TAccountBaseMint extends string,\n TAccountQuoteMint extends string,\n TAccountBaseVault extends string,\n TAccountQuoteVault extends string,\n TAccountPayer extends string,\n TAccountTokenProgram extends string,\n TAccountSystemProgram extends string,\n TAccountRent extends string,\n TAccountOracle extends string,\n TAccountMarket extends string,\n TAccountPotVault extends string,\n TAccountMarketAuthority extends string,\n TAccountEntry extends string,\n TAccountEntryByMint extends string,\n TProgramAddress extends Address = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n>(\n input: RegisterEntryInput<\n TAccountInitializerConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountOracle,\n TAccountMarket,\n TAccountPotVault,\n TAccountMarketAuthority,\n TAccountEntry,\n TAccountEntryByMint\n >,\n config?: { programAddress?: TProgramAddress },\n): RegisterEntryInstruction<\n TProgramAddress,\n TAccountInitializerConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountOracle,\n TAccountMarket,\n TAccountPotVault,\n TAccountMarketAuthority,\n TAccountEntry,\n TAccountEntryByMint\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? PREDICTION_MIGRATOR_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n initializerConfig: {\n value: input.initializerConfig ?? null,\n isWritable: false,\n },\n launch: { value: input.launch ?? null, isWritable: false },\n launchAuthority: {\n value: input.launchAuthority ?? null,\n isWritable: false,\n },\n baseMint: { value: input.baseMint ?? null, isWritable: false },\n quoteMint: { value: input.quoteMint ?? null, isWritable: false },\n baseVault: { value: input.baseVault ?? null, isWritable: false },\n quoteVault: { value: input.quoteVault ?? null, isWritable: false },\n payer: { value: input.payer ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n rent: { value: input.rent ?? null, isWritable: false },\n oracle: { value: input.oracle ?? null, isWritable: false },\n market: { value: input.market ?? null, isWritable: true },\n potVault: { value: input.potVault ?? null, isWritable: true },\n marketAuthority: {\n value: input.marketAuthority ?? null,\n isWritable: false,\n },\n entry: { value: input.entry ?? null, isWritable: true },\n entryByMint: { value: input.entryByMint ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' as Address<'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'>;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n if (!accounts.rent.value) {\n accounts.rent.value =\n 'SysvarRent111111111111111111111111111111111' as Address<'SysvarRent111111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('initializerConfig', accounts.initializerConfig),\n getAccountMeta('launch', accounts.launch),\n getAccountMeta('launchAuthority', accounts.launchAuthority),\n getAccountMeta('baseMint', accounts.baseMint),\n getAccountMeta('quoteMint', accounts.quoteMint),\n getAccountMeta('baseVault', accounts.baseVault),\n getAccountMeta('quoteVault', accounts.quoteVault),\n getAccountMeta('payer', accounts.payer),\n getAccountMeta('tokenProgram', accounts.tokenProgram),\n getAccountMeta('systemProgram', accounts.systemProgram),\n getAccountMeta('rent', accounts.rent),\n getAccountMeta('oracle', accounts.oracle),\n getAccountMeta('market', accounts.market),\n getAccountMeta('potVault', accounts.potVault),\n getAccountMeta('marketAuthority', accounts.marketAuthority),\n getAccountMeta('entry', accounts.entry),\n getAccountMeta('entryByMint', accounts.entryByMint),\n ],\n data: getRegisterEntryInstructionDataEncoder().encode(\n args as RegisterEntryInstructionDataArgs,\n ),\n programAddress,\n } as RegisterEntryInstruction<\n TProgramAddress,\n TAccountInitializerConfig,\n TAccountLaunch,\n TAccountLaunchAuthority,\n TAccountBaseMint,\n TAccountQuoteMint,\n TAccountBaseVault,\n TAccountQuoteVault,\n TAccountPayer,\n TAccountTokenProgram,\n TAccountSystemProgram,\n TAccountRent,\n TAccountOracle,\n TAccountMarket,\n TAccountPotVault,\n TAccountMarketAuthority,\n TAccountEntry,\n TAccountEntryByMint\n >);\n}\n\nexport type ParsedRegisterEntryInstruction<\n TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n initializerConfig: TAccountMetas[0];\n /** Launch account from initializer */\n launch: TAccountMetas[1];\n /** Launch authority PDA - signed by initializer */\n launchAuthority: TAccountMetas[2];\n /** Base mint for this entry */\n baseMint: TAccountMetas[3];\n /** Quote mint for this market */\n quoteMint: TAccountMetas[4];\n baseVault: TAccountMetas[5];\n quoteVault: TAccountMetas[6];\n payer: TAccountMetas[7];\n tokenProgram: TAccountMetas[8];\n systemProgram: TAccountMetas[9];\n rent: TAccountMetas[10];\n /** The oracle that this market is tied to */\n oracle: TAccountMetas[11];\n /** Market PDA - created if first entry */\n market: TAccountMetas[12];\n /** Pot vault for holding quote tokens */\n potVault: TAccountMetas[13];\n marketAuthority: TAccountMetas[14];\n /** Entry PDA for this entry */\n entry: TAccountMetas[15];\n /** EntryByMint PDA for reverse lookup */\n entryByMint: TAccountMetas[16];\n };\n data: RegisterEntryInstructionData;\n};\n\nexport function parseRegisterEntryInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRegisterEntryInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 17) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 17,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n initializerConfig: getNextAccount(),\n launch: getNextAccount(),\n launchAuthority: getNextAccount(),\n baseMint: getNextAccount(),\n quoteMint: getNextAccount(),\n baseVault: getNextAccount(),\n quoteVault: getNextAccount(),\n payer: getNextAccount(),\n tokenProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n rent: getNextAccount(),\n oracle: getNextAccount(),\n market: getNextAccount(),\n potVault: getNextAccount(),\n marketAuthority: getNextAccount(),\n entry: getNextAccount(),\n entryByMint: getNextAccount(),\n },\n data: getRegisterEntryInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertIsInstructionWithAccounts,\n containsBytes,\n fixEncoderSize,\n getBytesEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,\n SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,\n SolanaError,\n type Address,\n type ClientWithPayer,\n type ClientWithRpc,\n type ClientWithTransactionPlanning,\n type ClientWithTransactionSending,\n type GetAccountInfoApi,\n type GetMultipleAccountsApi,\n type Instruction,\n type InstructionWithData,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n addSelfFetchFunctions,\n addSelfPlanAndSendFunctions,\n type SelfFetchFunctions,\n type SelfPlanAndSendFunctions,\n} from '@solana/program-client-core';\nimport {\n getClaimReceiptCodec,\n getEntryByMintCodec,\n getEntryCodec,\n getLaunchCodec,\n getMarketCodec,\n getOracleStateCodec,\n type ClaimReceipt,\n type ClaimReceiptArgs,\n type Entry,\n type EntryArgs,\n type EntryByMint,\n type EntryByMintArgs,\n type Launch,\n type LaunchArgs,\n type Market,\n type MarketArgs,\n type OracleState,\n type OracleStateArgs,\n} from '../accounts';\nimport {\n getClaimInstructionAsync,\n getMigrateEntryInstructionAsync,\n getPreviewPayoutIfWinnerInstruction,\n getRegisterEntryInstructionAsync,\n parseClaimInstruction,\n parseMigrateEntryInstruction,\n parsePreviewPayoutIfWinnerInstruction,\n parseRegisterEntryInstruction,\n type ClaimAsyncInput,\n type MigrateEntryAsyncInput,\n type ParsedClaimInstruction,\n type ParsedMigrateEntryInstruction,\n type ParsedPreviewPayoutIfWinnerInstruction,\n type ParsedRegisterEntryInstruction,\n type PreviewPayoutIfWinnerInput,\n type RegisterEntryAsyncInput,\n} from '../instructions';\n\nexport const PREDICTION_MIGRATOR_PROGRAM_ADDRESS =\n 'HYHdyy7QZg8Ucky9Z97xNtSCvrZxVNkeoney8xEPXjiZ' as Address<'HYHdyy7QZg8Ucky9Z97xNtSCvrZxVNkeoney8xEPXjiZ'>;\n\nexport enum PredictionMigratorAccount {\n ClaimReceipt,\n Entry,\n EntryByMint,\n Launch,\n Market,\n OracleState,\n}\n\nexport function identifyPredictionMigratorAccount(\n account: { data: ReadonlyUint8Array } | ReadonlyUint8Array,\n): PredictionMigratorAccount {\n const data = 'data' in account ? account.data : account;\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([223, 233, 11, 229, 124, 165, 207, 28]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorAccount.ClaimReceipt;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([63, 18, 152, 113, 215, 246, 221, 250]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorAccount.Entry;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([188, 191, 157, 194, 68, 82, 181, 126]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorAccount.EntryByMint;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([144, 51, 51, 163, 206, 85, 213, 38]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorAccount.Launch;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([219, 190, 213, 55, 0, 227, 198, 154]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorAccount.Market;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([97, 156, 157, 189, 194, 73, 8, 15]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorAccount.OracleState;\n }\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,\n { accountData: data, programName: 'predictionMigrator' },\n );\n}\n\nexport enum PredictionMigratorInstruction {\n Claim,\n MigrateEntry,\n PreviewPayoutIfWinner,\n RegisterEntry,\n}\n\nexport function identifyPredictionMigratorInstruction(\n instruction: { data: ReadonlyUint8Array } | ReadonlyUint8Array,\n): PredictionMigratorInstruction {\n const data = 'data' in instruction ? instruction.data : instruction;\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([62, 198, 214, 193, 213, 159, 108, 210]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorInstruction.Claim;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([239, 154, 55, 173, 110, 36, 188, 214]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorInstruction.MigrateEntry;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([228, 144, 72, 185, 234, 186, 183, 143]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorInstruction.PreviewPayoutIfWinner;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([198, 25, 1, 183, 73, 219, 215, 14]),\n ),\n 0,\n )\n ) {\n return PredictionMigratorInstruction.RegisterEntry;\n }\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,\n { instructionData: data, programName: 'predictionMigrator' },\n );\n}\n\nexport type ParsedPredictionMigratorInstruction<\n TProgram extends string = 'HYHdyy7QZg8Ucky9Z97xNtSCvrZxVNkeoney8xEPXjiZ',\n> =\n | ({\n instructionType: PredictionMigratorInstruction.Claim;\n } & ParsedClaimInstruction<TProgram>)\n | ({\n instructionType: PredictionMigratorInstruction.MigrateEntry;\n } & ParsedMigrateEntryInstruction<TProgram>)\n | ({\n instructionType: PredictionMigratorInstruction.PreviewPayoutIfWinner;\n } & ParsedPreviewPayoutIfWinnerInstruction<TProgram>)\n | ({\n instructionType: PredictionMigratorInstruction.RegisterEntry;\n } & ParsedRegisterEntryInstruction<TProgram>);\n\nexport function parsePredictionMigratorInstruction<TProgram extends string>(\n instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>,\n): ParsedPredictionMigratorInstruction<TProgram> {\n const instructionType = identifyPredictionMigratorInstruction(instruction);\n switch (instructionType) {\n case PredictionMigratorInstruction.Claim: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: PredictionMigratorInstruction.Claim,\n ...parseClaimInstruction(instruction),\n };\n }\n case PredictionMigratorInstruction.MigrateEntry: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: PredictionMigratorInstruction.MigrateEntry,\n ...parseMigrateEntryInstruction(instruction),\n };\n }\n case PredictionMigratorInstruction.PreviewPayoutIfWinner: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: PredictionMigratorInstruction.PreviewPayoutIfWinner,\n ...parsePreviewPayoutIfWinnerInstruction(instruction),\n };\n }\n case PredictionMigratorInstruction.RegisterEntry: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: PredictionMigratorInstruction.RegisterEntry,\n ...parseRegisterEntryInstruction(instruction),\n };\n }\n default:\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,\n {\n instructionType: instructionType as string,\n programName: 'predictionMigrator',\n },\n );\n }\n}\n\nexport type PredictionMigratorPlugin = {\n accounts: PredictionMigratorPluginAccounts;\n instructions: PredictionMigratorPluginInstructions;\n};\n\nexport type PredictionMigratorPluginAccounts = {\n claimReceipt: ReturnType<typeof getClaimReceiptCodec> &\n SelfFetchFunctions<ClaimReceiptArgs, ClaimReceipt>;\n entry: ReturnType<typeof getEntryCodec> &\n SelfFetchFunctions<EntryArgs, Entry>;\n entryByMint: ReturnType<typeof getEntryByMintCodec> &\n SelfFetchFunctions<EntryByMintArgs, EntryByMint>;\n launch: ReturnType<typeof getLaunchCodec> &\n SelfFetchFunctions<LaunchArgs, Launch>;\n market: ReturnType<typeof getMarketCodec> &\n SelfFetchFunctions<MarketArgs, Market>;\n oracleState: ReturnType<typeof getOracleStateCodec> &\n SelfFetchFunctions<OracleStateArgs, OracleState>;\n};\n\nexport type PredictionMigratorPluginInstructions = {\n claim: (\n input: MakeOptional<ClaimAsyncInput, 'payer'>,\n ) => ReturnType<typeof getClaimInstructionAsync> & SelfPlanAndSendFunctions;\n migrateEntry: (\n input: MakeOptional<MigrateEntryAsyncInput, 'payer'>,\n ) => ReturnType<typeof getMigrateEntryInstructionAsync> &\n SelfPlanAndSendFunctions;\n previewPayoutIfWinner: (\n input: PreviewPayoutIfWinnerInput,\n ) => ReturnType<typeof getPreviewPayoutIfWinnerInstruction> &\n SelfPlanAndSendFunctions;\n registerEntry: (\n input: MakeOptional<RegisterEntryAsyncInput, 'payer'>,\n ) => ReturnType<typeof getRegisterEntryInstructionAsync> &\n SelfPlanAndSendFunctions;\n};\n\nexport type PredictionMigratorPluginRequirements = ClientWithRpc<\n GetAccountInfoApi & GetMultipleAccountsApi\n> &\n ClientWithPayer &\n ClientWithTransactionPlanning &\n ClientWithTransactionSending;\n\nexport function predictionMigratorProgram() {\n return <T extends PredictionMigratorPluginRequirements>(client: T) => {\n return {\n ...client,\n predictionMigrator: <PredictionMigratorPlugin>{\n accounts: {\n claimReceipt: addSelfFetchFunctions(client, getClaimReceiptCodec()),\n entry: addSelfFetchFunctions(client, getEntryCodec()),\n entryByMint: addSelfFetchFunctions(client, getEntryByMintCodec()),\n launch: addSelfFetchFunctions(client, getLaunchCodec()),\n market: addSelfFetchFunctions(client, getMarketCodec()),\n oracleState: addSelfFetchFunctions(client, getOracleStateCodec()),\n },\n instructions: {\n claim: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getClaimInstructionAsync({\n ...input,\n payer: input.payer ?? client.payer,\n }),\n ),\n migrateEntry: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getMigrateEntryInstructionAsync({\n ...input,\n payer: input.payer ?? client.payer,\n }),\n ),\n previewPayoutIfWinner: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getPreviewPayoutIfWinnerInstruction(input),\n ),\n registerEntry: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getRegisterEntryInstructionAsync({\n ...input,\n payer: input.payer ?? client.payer,\n }),\n ),\n },\n },\n };\n };\n}\n\ntype MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n","import {\n type Address,\n type ProgramDerivedAddress,\n type ReadonlyUint8Array,\n getAddressCodec,\n getProgramDerivedAddress,\n} from '@solana/kit';\nimport { PREDICTION_MIGRATOR_PROGRAM_ADDRESS } from '../../generated/predictionMigrator/programs/predictionMigrator.js';\n\nconst addressCodec = getAddressCodec();\nconst textEncoder = new TextEncoder();\n\nexport async function getPredictionMarketAddress(\n oracleState: Address,\n programId: Address = PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: programId,\n seeds: [textEncoder.encode('market'), addressCodec.encode(oracleState)],\n });\n}\n\nexport async function getPredictionMarketAuthorityAddress(\n market: Address,\n programId: Address = PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: programId,\n seeds: [\n textEncoder.encode('market_authority'),\n addressCodec.encode(market),\n ],\n });\n}\n\nexport async function getPredictionPotVaultAddress(\n market: Address,\n programId: Address = PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: programId,\n seeds: [textEncoder.encode('pot_vault'), addressCodec.encode(market)],\n });\n}\n\nexport async function getPredictionEntryAddress(\n oracleState: Address,\n entryId: ReadonlyUint8Array | Uint8Array,\n programId: Address = PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: programId,\n seeds: [\n textEncoder.encode('entry'),\n addressCodec.encode(oracleState),\n entryId,\n ],\n });\n}\n\nexport async function getPredictionEntryByMintAddress(\n oracleState: Address,\n mint: Address,\n programId: Address = PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n): Promise<ProgramDerivedAddress> {\n return getProgramDerivedAddress({\n programAddress: programId,\n seeds: [\n textEncoder.encode('entry_by_mint'),\n addressCodec.encode(oracleState),\n addressCodec.encode(mint),\n ],\n });\n}\n","import type {\n Address,\n Instruction,\n AccountMeta,\n AccountLookupMeta,\n TransactionSigner,\n AccountSignerMeta,\n} from '@solana/kit';\nimport {\n AccountRole,\n getProgramDerivedAddress,\n getAddressEncoder,\n} from '@solana/kit';\nimport {\n SYSTEM_PROGRAM_ADDRESS,\n TOKEN_PROGRAM_ADDRESS,\n TOKEN_METADATA_PROGRAM_ID,\n} from '../../core/constants.js';\nimport {\n CURVE_KIND_XYK,\n CURVE_PARAMS_FORMAT_XYK_V0,\n INITIALIZER_PROGRAM_ID,\n} from '../constants.js';\nimport { CPMM_MIGRATOR_PROGRAM_ID } from '../../migrators/cpmmMigrator/constants.js';\nimport { getCpmmMigratorStateAddress } from '../../migrators/cpmmMigrator/pda.js';\nimport { PREDICTION_MIGRATOR_PROGRAM_ADDRESS } from '../../generated/predictionMigrator/programs/predictionMigrator.js';\nimport {\n getPredictionMarketAddress,\n getPredictionMarketAuthorityAddress,\n getPredictionPotVaultAddress,\n getPredictionEntryAddress,\n getPredictionEntryByMintAddress,\n} from '../../migrators/predictionMigrator/pda.js';\nimport type { InitializeLaunchArgsArgs } from '../../generated/initializer/index.js';\nimport { getInitializeLaunchInstructionDataEncoder } from '../../generated/initializer/index.js';\n\n/**\n * Public params for createInitializeLaunchInstruction.\n * - allowBuy / allowSell are boolean; converted to u8 wire format (1/0).\n * - migratorProgram is omitted — it is derived from accounts.migratorProgram\n * so callers do not need to repeat it in both the accounts object and args.\n */\nexport type InitializeLaunchParams = Omit<\n InitializeLaunchArgsArgs,\n 'allowBuy' | 'allowSell' | 'migratorProgram'\n> & {\n allowBuy: boolean;\n allowSell: boolean;\n};\n\ntype AddressOrSigner = Address | TransactionSigner;\n\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\nfunction createAccountMeta(\n value: AddressOrSigner,\n role:\n | typeof AccountRole.READONLY\n | typeof AccountRole.WRITABLE\n | typeof AccountRole.READONLY_SIGNER\n | typeof AccountRole.WRITABLE_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return { address: value.address, role, signer: value };\n }\n return { address: value, role };\n}\n\n/**\n * Derive the Metaplex token metadata PDA for a given mint.\n * Seeds: [\"metadata\", TOKEN_METADATA_PROGRAM_ID, mint]\n *\n * Pass the result as `metadataAccount` in InitializeLaunchAccounts\n * whenever `metadataName` is non-empty.\n */\nexport async function getTokenMetadataAddress(mint: Address): Promise<Address> {\n const encoder = getAddressEncoder();\n const [metadataAddress] = await getProgramDerivedAddress({\n programAddress: TOKEN_METADATA_PROGRAM_ID,\n seeds: [\n new TextEncoder().encode('metadata'),\n encoder.encode(TOKEN_METADATA_PROGRAM_ID),\n encoder.encode(mint),\n ],\n });\n return metadataAddress;\n}\n\n/**\n * Known index of each static account in the Doppler devnet ALT\n * (7r5rdLkGMzTq5Q2kBhkePw4ZTeZEooHgTXktYoamNmVq).\n */\nconst ALT_INDEX: Record<string, number> = {\n [TOKEN_PROGRAM_ADDRESS]: 0,\n [SYSTEM_PROGRAM_ADDRESS]: 1,\n SysvarRent111111111111111111111111111111111: 2,\n [INITIALIZER_PROGRAM_ID]: 3,\n [TOKEN_METADATA_PROGRAM_ID]: 4,\n [CPMM_MIGRATOR_PROGRAM_ID]: 5,\n So11111111111111111111111111111111111111112: 6,\n // index 7 = config PDA — resolved at call time from accounts.config\n [PREDICTION_MIGRATOR_PROGRAM_ADDRESS]: 8,\n};\n\nexport interface InitializeLaunchAccounts {\n config: Address;\n launch: Address;\n launchAuthority: Address;\n baseMint: AddressOrSigner;\n quoteMint: Address;\n baseVault: AddressOrSigner;\n quoteVault: AddressOrSigner;\n payer: AddressOrSigner;\n authority?: AddressOrSigner;\n migratorProgram?: Address;\n tokenProgram?: Address;\n systemProgram?: Address;\n rent: Address;\n /** Required when args.metadataName is non-empty. Derive with getTokenMetadataAddress(baseMint). */\n metadataAccount?: Address;\n /**\n * Optional Address Lookup Table to reference for static accounts.\n * When provided, constant non-signer accounts (tokenProgram, systemProgram,\n * rent, migratorProgram, quoteMint when WSOL, metadataProgram, config) are\n * encoded as ALT lookup metas instead of 32-byte static keys, reducing\n * transaction size by ~200+ bytes and enabling V4 metadata within the\n * 1232-byte Solana transaction limit.\n *\n * Use DOPPLER_DEVNET_ALT for devnet.\n */\n addressLookupTable?: Address;\n}\n\nfunction validateInitializeLaunchCurveParams(\n args: InitializeLaunchParams,\n): void {\n if (args.curveKind !== CURVE_KIND_XYK) {\n throw new Error(\n `unsupported curve kind: ${args.curveKind}; only CURVE_KIND_XYK is currently enabled`,\n );\n }\n if (\n args.curveParams.length !== 1 ||\n args.curveParams[0] !== CURVE_PARAMS_FORMAT_XYK_V0\n ) {\n throw new Error('xyk curve params must be [CURVE_PARAMS_FORMAT_XYK_V0]');\n }\n}\n\nexport async function createInitializeLaunchInstruction(\n accounts: InitializeLaunchAccounts,\n args: InitializeLaunchParams,\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Promise<Instruction> {\n validateInitializeLaunchCurveParams(args);\n\n const {\n config,\n launch,\n launchAuthority,\n baseMint,\n quoteMint,\n baseVault,\n quoteVault,\n payer,\n authority,\n migratorProgram,\n tokenProgram = TOKEN_PROGRAM_ADDRESS,\n systemProgram = SYSTEM_PROGRAM_ADDRESS,\n rent,\n metadataAccount,\n addressLookupTable: alt,\n } = accounts;\n\n const withMetadata = Boolean(\n args.metadataName && args.metadataName.length > 0,\n );\n\n if (withMetadata && !metadataAccount) {\n throw new Error(\n 'metadataName is set but metadataAccount was not provided. ' +\n 'Derive it with await initializer.getTokenMetadataAddress(baseMintAddress).',\n );\n }\n\n // Build an ALT index map that also includes the config PDA at index 7.\n const altIndexMap: Record<string, number> = alt\n ? { ...ALT_INDEX, [config]: 7 }\n : {};\n\n function staticOrLookup(\n addr: Address,\n role: AccountRole.READONLY | AccountRole.WRITABLE,\n ): AccountMeta | AccountLookupMeta {\n if (alt && altIndexMap[addr] !== undefined) {\n return {\n address: addr,\n role,\n lookupTableAddress: alt,\n addressIndex: altIndexMap[addr]!,\n };\n }\n return { address: addr, role };\n }\n\n const keys: (AccountMeta | AccountSignerMeta | AccountLookupMeta)[] = [\n staticOrLookup(config, AccountRole.READONLY),\n { address: launch, role: AccountRole.WRITABLE },\n { address: launchAuthority, role: AccountRole.READONLY },\n createAccountMeta(baseMint, AccountRole.WRITABLE_SIGNER),\n staticOrLookup(quoteMint, AccountRole.READONLY),\n createAccountMeta(baseVault, AccountRole.WRITABLE_SIGNER),\n createAccountMeta(quoteVault, AccountRole.WRITABLE_SIGNER),\n createAccountMeta(payer, AccountRole.WRITABLE_SIGNER),\n ];\n\n if (authority) {\n keys.push(createAccountMeta(authority, AccountRole.READONLY_SIGNER));\n }\n if (migratorProgram) {\n keys.push(staticOrLookup(migratorProgram, AccountRole.READONLY));\n }\n\n keys.push(staticOrLookup(tokenProgram, AccountRole.READONLY));\n keys.push(staticOrLookup(systemProgram, AccountRole.READONLY));\n keys.push(staticOrLookup(rent, AccountRole.READONLY));\n\n if (withMetadata) {\n keys.push({ address: metadataAccount!, role: AccountRole.WRITABLE });\n keys.push(staticOrLookup(TOKEN_METADATA_PROGRAM_ID, AccountRole.READONLY));\n }\n\n const encoderArgs: InitializeLaunchArgsArgs = {\n ...args,\n allowBuy: args.allowBuy ? 1 : 0,\n allowSell: args.allowSell ? 1 : 0,\n migratorProgram: migratorProgram ?? SYSTEM_PROGRAM_ADDRESS,\n };\n\n const data = new Uint8Array(\n getInitializeLaunchInstructionDataEncoder().encode(encoderArgs),\n );\n\n // When using the CPMM migrator, automatically append the CpmmMigratorState\n // PDA as a writable remaining account so the register_launch CPI can write\n // the launch's graduation parameters without the caller managing it manually.\n if (migratorProgram === CPMM_MIGRATOR_PROGRAM_ID) {\n const [cpmmMigratorState] = await getCpmmMigratorStateAddress(launch);\n keys.push({ address: cpmmMigratorState, role: AccountRole.WRITABLE });\n }\n\n // When using the prediction migrator, automatically derive and append the 6\n // remaining accounts required by register_entry:\n // [oracle_state, market, pot_vault, market_authority, entry, entry_by_mint]\n // namespace === oracle_state and launchId === entryId per program validation.\n if (migratorProgram === PREDICTION_MIGRATOR_PROGRAM_ADDRESS) {\n const oracleState = args.namespace as Address;\n const entryId = args.launchId;\n const baseMintAddress = isTransactionSigner(baseMint)\n ? baseMint.address\n : baseMint;\n\n const [market] = await getPredictionMarketAddress(oracleState);\n const [potVault] = await getPredictionPotVaultAddress(market);\n const [marketAuthority] = await getPredictionMarketAuthorityAddress(market);\n const [entry] = await getPredictionEntryAddress(oracleState, entryId);\n const [entryByMint] = await getPredictionEntryByMintAddress(\n oracleState,\n baseMintAddress,\n );\n\n keys.push({ address: oracleState, role: AccountRole.READONLY });\n keys.push({ address: market, role: AccountRole.WRITABLE });\n keys.push({ address: potVault, role: AccountRole.WRITABLE });\n keys.push({ address: marketAuthority, role: AccountRole.READONLY });\n keys.push({ address: entry, role: AccountRole.WRITABLE });\n keys.push({ address: entryByMint, role: AccountRole.WRITABLE });\n }\n\n return { programAddress: programId, accounts: keys, data };\n}\n","import type {\n Address,\n Instruction,\n AccountMeta,\n TransactionSigner,\n AccountSignerMeta,\n} from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n SYSTEM_PROGRAM_ADDRESS,\n TOKEN_PROGRAM_ADDRESS,\n} from '../../core/constants.js';\nimport { INITIALIZER_PROGRAM_ID } from '../constants.js';\nimport { getCurveSwapExactInInstructionDataEncoder } from '../../generated/initializer/index.js';\n\ntype AddressOrSigner = Address | TransactionSigner;\n\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\nfunction createAccountMeta(\n value: AddressOrSigner,\n role:\n | typeof AccountRole.READONLY\n | typeof AccountRole.WRITABLE\n | typeof AccountRole.READONLY_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return { address: value.address, role, signer: value };\n }\n return { address: value, role };\n}\n\nexport interface CurveSwapExactInAccounts {\n config: Address;\n launch: Address;\n launchAuthority: Address;\n baseVault: Address;\n quoteVault: Address;\n userBaseAccount: Address;\n userQuoteAccount: Address;\n baseMint: Address;\n quoteMint: Address;\n user: AddressOrSigner;\n /** Pass the actual sentinel program address, or omit to use System Program as a no-op placeholder. */\n sentinelProgram?: Address;\n tokenProgram?: Address;\n}\n\nexport function createCurveSwapExactInInstruction(\n accounts: CurveSwapExactInAccounts,\n args: { amountIn: bigint; minAmountOut: bigint; direction: number },\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const {\n config,\n launch,\n launchAuthority,\n baseVault,\n quoteVault,\n userBaseAccount,\n userQuoteAccount,\n baseMint,\n quoteMint,\n user,\n sentinelProgram = SYSTEM_PROGRAM_ADDRESS,\n tokenProgram = TOKEN_PROGRAM_ADDRESS,\n } = accounts;\n\n const keys: (AccountMeta | AccountSignerMeta)[] = [\n { address: config, role: AccountRole.READONLY },\n { address: launch, role: AccountRole.WRITABLE },\n { address: launchAuthority, role: AccountRole.READONLY },\n { address: baseVault, role: AccountRole.WRITABLE },\n { address: quoteVault, role: AccountRole.WRITABLE },\n { address: userBaseAccount, role: AccountRole.WRITABLE },\n { address: userQuoteAccount, role: AccountRole.WRITABLE },\n { address: baseMint, role: AccountRole.READONLY },\n { address: quoteMint, role: AccountRole.READONLY },\n createAccountMeta(user, AccountRole.READONLY_SIGNER),\n // sentinel_program is Optional in the on-chain struct but still occupies a fixed\n // slot (token_program follows it). Always emit it — use SYSTEM_PROGRAM_ADDRESS as the\n // no-op placeholder when no real sentinel is configured.\n { address: sentinelProgram, role: AccountRole.READONLY },\n { address: tokenProgram, role: AccountRole.READONLY },\n ];\n\n const data = new Uint8Array(\n getCurveSwapExactInInstructionDataEncoder().encode(args),\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n","import type {\n Address,\n Instruction,\n AccountMeta,\n TransactionSigner,\n AccountSignerMeta,\n} from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport {\n SYSTEM_PROGRAM_ADDRESS,\n TOKEN_PROGRAM_ADDRESS,\n} from '../../core/constants.js';\nimport {\n INITIALIZER_INSTRUCTION_DISCRIMINATORS,\n INITIALIZER_PROGRAM_ID,\n} from '../constants.js';\nimport { encodeInstructionData } from '../../core/codecs.js';\n\ntype AddressOrSigner = Address | TransactionSigner;\n\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\nfunction createSignerAccountMeta(\n value: AddressOrSigner,\n role: typeof AccountRole.WRITABLE_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return { address: value.address, role, signer: value };\n }\n return { address: value, role };\n}\n\nexport interface MigrateLaunchAccounts {\n config: Address;\n launch: Address;\n launchAuthority: Address;\n baseMint: Address;\n quoteMint: Address;\n baseVault: Address;\n quoteVault: Address;\n migratorProgram: Address;\n payer: AddressOrSigner;\n tokenProgram?: Address;\n systemProgram?: Address;\n rent: Address;\n}\n\nexport function createMigrateLaunchInstruction(\n accounts: MigrateLaunchAccounts,\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const {\n config,\n launch,\n launchAuthority,\n baseMint,\n quoteMint,\n baseVault,\n quoteVault,\n migratorProgram,\n payer,\n tokenProgram = TOKEN_PROGRAM_ADDRESS,\n systemProgram = SYSTEM_PROGRAM_ADDRESS,\n rent,\n } = accounts;\n\n const keys: (AccountMeta | AccountSignerMeta)[] = [\n { address: config, role: AccountRole.READONLY },\n { address: launch, role: AccountRole.WRITABLE },\n { address: launchAuthority, role: AccountRole.READONLY },\n { address: baseMint, role: AccountRole.READONLY },\n { address: quoteMint, role: AccountRole.READONLY },\n { address: baseVault, role: AccountRole.WRITABLE },\n { address: quoteVault, role: AccountRole.WRITABLE },\n { address: migratorProgram, role: AccountRole.READONLY },\n createSignerAccountMeta(payer, AccountRole.WRITABLE_SIGNER),\n { address: tokenProgram, role: AccountRole.READONLY },\n { address: systemProgram, role: AccountRole.READONLY },\n { address: rent, role: AccountRole.READONLY },\n ];\n\n const data = encodeInstructionData(\n INITIALIZER_INSTRUCTION_DISCRIMINATORS.migrateLaunch,\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n","import type {\n Address,\n Instruction,\n AccountMeta,\n TransactionSigner,\n AccountSignerMeta,\n} from '@solana/kit';\nimport { AccountRole } from '@solana/kit';\nimport { TOKEN_PROGRAM_ADDRESS } from '../../core/constants.js';\nimport {\n INITIALIZER_INSTRUCTION_DISCRIMINATORS,\n INITIALIZER_PROGRAM_ID,\n} from '../constants.js';\nimport { encodeInstructionData } from '../../core/codecs.js';\n\ntype AddressOrSigner = Address | TransactionSigner;\n\nfunction isTransactionSigner(\n value: AddressOrSigner,\n): value is TransactionSigner {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'address' in value &&\n 'signTransactions' in value\n );\n}\n\nfunction createAccountMeta(\n value: AddressOrSigner,\n role:\n | typeof AccountRole.READONLY\n | typeof AccountRole.WRITABLE\n | typeof AccountRole.READONLY_SIGNER,\n): AccountMeta | AccountSignerMeta {\n if (isTransactionSigner(value)) {\n return { address: value.address, role, signer: value };\n }\n return { address: value, role };\n}\n\nexport interface AbortLaunchAccounts {\n config: Address;\n launch: Address;\n launchAuthority: Address;\n baseVault: Address;\n quoteVault: Address;\n authority: AddressOrSigner;\n authorityBaseAccount: Address;\n baseMint: Address;\n tokenProgram?: Address;\n}\n\nexport function createAbortLaunchInstruction(\n accounts: AbortLaunchAccounts,\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const {\n config,\n launch,\n launchAuthority,\n baseVault,\n quoteVault,\n authority,\n authorityBaseAccount,\n baseMint,\n tokenProgram = TOKEN_PROGRAM_ADDRESS,\n } = accounts;\n\n const keys: (AccountMeta | AccountSignerMeta)[] = [\n { address: config, role: AccountRole.READONLY },\n { address: launch, role: AccountRole.WRITABLE },\n { address: launchAuthority, role: AccountRole.READONLY },\n { address: baseVault, role: AccountRole.WRITABLE },\n { address: quoteVault, role: AccountRole.READONLY },\n createAccountMeta(authority, AccountRole.READONLY_SIGNER),\n { address: authorityBaseAccount, role: AccountRole.WRITABLE },\n { address: baseMint, role: AccountRole.READONLY },\n { address: tokenProgram, role: AccountRole.READONLY },\n ];\n\n const data = encodeInstructionData(\n INITIALIZER_INSTRUCTION_DISCRIMINATORS.abortLaunch,\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n","import type { Address, Instruction } from '@solana/kit';\nimport { getStructCodec, getU64Codec, AccountRole } from '@solana/kit';\nimport { INITIALIZER_PROGRAM_ID } from '../constants.js';\nimport { getPreviewSwapExactInInstructionDataEncoder } from '../../generated/initializer/index.js';\n\nexport interface PreviewSwapExactInResult {\n amountOut: bigint;\n feePaid: bigint;\n}\n\nconst previewSwapExactInResultCodec = getStructCodec([\n ['amountOut', getU64Codec()],\n ['feePaid', getU64Codec()],\n]);\n\nexport interface PreviewSwapExactInAccounts {\n launch: Address;\n baseVault: Address;\n quoteVault: Address;\n sentinelProgram?: Address;\n}\n\nexport function createPreviewSwapExactInInstruction(\n accounts: PreviewSwapExactInAccounts,\n args: { amountIn: bigint; direction: number },\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const { launch, baseVault, quoteVault, sentinelProgram } = accounts;\n\n const keys = [\n { address: launch, role: AccountRole.READONLY },\n { address: baseVault, role: AccountRole.READONLY },\n { address: quoteVault, role: AccountRole.READONLY },\n ] as const;\n\n const accountsList = sentinelProgram\n ? [...keys, { address: sentinelProgram, role: AccountRole.READONLY }]\n : keys;\n\n const data = new Uint8Array(\n getPreviewSwapExactInInstructionDataEncoder().encode(args),\n );\n\n return { programAddress: programId, accounts: accountsList, data };\n}\n\nexport function decodePreviewSwapExactInResult(\n data: Uint8Array,\n): PreviewSwapExactInResult {\n return previewSwapExactInResultCodec.decode(data);\n}\n","import type { Address, Instruction } from '@solana/kit';\nimport { getStructCodec, getU64Codec, AccountRole } from '@solana/kit';\nimport {\n INITIALIZER_INSTRUCTION_DISCRIMINATORS,\n INITIALIZER_PROGRAM_ID,\n} from '../constants.js';\nimport { encodeInstructionData } from '../../core/codecs.js';\n\nexport interface PreviewMigrationResult {\n baseVaultAmount: bigint;\n quoteVaultAmount: bigint;\n baseMintSupply: bigint;\n}\n\nconst previewMigrationResultCodec = getStructCodec([\n ['baseVaultAmount', getU64Codec()],\n ['quoteVaultAmount', getU64Codec()],\n ['baseMintSupply', getU64Codec()],\n]);\n\nexport interface PreviewMigrationAccounts {\n launch: Address;\n baseMint: Address;\n baseVault: Address;\n quoteVault: Address;\n}\n\nexport function createPreviewMigrationInstruction(\n accounts: PreviewMigrationAccounts,\n programId: Address = INITIALIZER_PROGRAM_ID,\n): Instruction {\n const { launch, baseMint, baseVault, quoteVault } = accounts;\n\n const keys = [\n { address: launch, role: AccountRole.READONLY },\n { address: baseMint, role: AccountRole.READONLY },\n { address: baseVault, role: AccountRole.READONLY },\n { address: quoteVault, role: AccountRole.READONLY },\n ];\n\n const data = encodeInstructionData(\n INITIALIZER_INSTRUCTION_DISCRIMINATORS.previewMigration,\n );\n\n return { programAddress: programId, accounts: keys, data };\n}\n\nexport function decodePreviewMigrationResult(\n data: Uint8Array,\n): PreviewMigrationResult {\n return previewMigrationResultCodec.decode(data);\n}\n","import { getAddressEncoder, type Address } from '@solana/kit';\nimport { keccak_256 } from '@noble/hashes/sha3.js';\nimport { PHASE_TRADING, PHASE_MIGRATED, PHASE_ABORTED } from './constants.js';\n\n/**\n * Compute the remaining-accounts commitment hash used by the Initializer program.\n *\n * Algorithm: keccak256(u32_len_le || pubkey_0 || ... || pubkey_n)\n *\n * This matches compute_remaining_accounts_hash in\n * programs/initializer/src/instructions/launch_common.rs.\n *\n * Commit the result as sentinelRemainingAccountsHash or migratorRemainingAccountsHash\n * when calling initializeLaunch. At migrate_launch (or sentinel invoke) time, pass the\n * same accounts in the same order as remaining accounts — the program verifies they match.\n *\n * For an empty account list use EMPTY_REMAINING_ACCOUNTS_HASH instead.\n */\nexport function computeRemainingAccountsHash(addresses: Address[]): Uint8Array {\n const addressEncoder = getAddressEncoder();\n // 4-byte LE count followed by 32 bytes per pubkey\n const buf = new Uint8Array(4 + addresses.length * 32);\n new DataView(buf.buffer).setUint32(0, addresses.length, true);\n for (let i = 0; i < addresses.length; i++) {\n buf.set(addressEncoder.encode(addresses[i]), 4 + i * 32);\n }\n return keccak_256(buf);\n}\n\n/**\n * Returns a human-readable label for a launch phase value.\n * Falls back to the numeric string for any unrecognised phase.\n */\nexport function phaseLabel(phase: number): string {\n switch (phase) {\n case PHASE_TRADING:\n return 'TRADING';\n case PHASE_MIGRATED:\n return 'MIGRATED';\n case PHASE_ABORTED:\n return 'ABORTED';\n default:\n return String(phase);\n }\n}\n","/**\n * Launch fetching functions for the Initializer SDK\n */\n\nimport { getAddressCodec, type Address } from '@solana/kit';\nimport type { ReadonlyUint8Array } from '@solana/kit';\nimport type { Rpc, GetAccountInfoApi } from '@solana/kit';\nimport type { GetProgramAccountsRpc } from '../../core/rpc.js';\nimport type { Base64EncodedBytes } from '@solana/kit';\nimport {\n getLaunchDecoder,\n type Launch,\n} from '../../generated/initializer/index.js';\nimport {\n INITIALIZER_PROGRAM_ID,\n INITIALIZER_ACCOUNT_DISCRIMINATORS,\n} from '../constants.js';\nimport { getLaunchAddress } from '../pda.js';\n\nconst addressCodec = getAddressCodec();\n\nfunction bytesToBase64(bytes: ReadonlyUint8Array): string {\n let binary = '';\n for (let i = 0; i < bytes.length; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\n\nfunction base64ToBytes(base64: string): Uint8Array {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n\nexport interface FetchLaunchesConfig {\n programId?: Address;\n commitment?: 'processed' | 'confirmed' | 'finalized';\n}\n\nexport interface LaunchWithAddress {\n address: Address;\n account: Launch;\n}\n\ntype ProgramAccount = Readonly<{\n pubkey: Address;\n account: Readonly<{ data: [string, 'base64'] }>;\n}>;\n\nexport async function fetchLaunch(\n rpc: Rpc<GetAccountInfoApi>,\n address: Address,\n config?: FetchLaunchesConfig,\n): Promise<Launch | null> {\n const response = await rpc\n .getAccountInfo(address, {\n encoding: 'base64',\n commitment: config?.commitment,\n })\n .send();\n\n if (!response.value) {\n return null;\n }\n\n return getLaunchDecoder().decode(base64ToBytes(response.value.data[0]));\n}\n\nexport async function fetchAllLaunches(\n rpc: GetProgramAccountsRpc,\n config?: FetchLaunchesConfig,\n): Promise<LaunchWithAddress[]> {\n const programId = config?.programId ?? INITIALIZER_PROGRAM_ID;\n\n const discriminatorFilter = {\n memcmp: {\n offset: 0n,\n bytes: bytesToBase64(\n INITIALIZER_ACCOUNT_DISCRIMINATORS.Launch,\n ) as Base64EncodedBytes,\n encoding: 'base64' as const,\n },\n };\n\n const response = (await rpc\n .getProgramAccounts(programId, {\n encoding: 'base64',\n commitment: config?.commitment,\n filters: [discriminatorFilter],\n })\n .send()) as unknown;\n\n const accounts = (\n Array.isArray(response)\n ? response\n : (response as { value: ProgramAccount[] }).value\n ) as ProgramAccount[];\n\n const launches: LaunchWithAddress[] = [];\n const decoder = getLaunchDecoder();\n\n for (const account of accounts) {\n try {\n const launch = decoder.decode(base64ToBytes(account.account.data[0]));\n launches.push({ address: account.pubkey, account: launch });\n } catch {\n console.warn(`Failed to decode launch account: ${account.pubkey}`);\n }\n }\n\n return launches;\n}\n\n/**\n * Fetch launches filtered by Launch.authority (offset 8).\n * Note: Permissionless launches have authority == Pubkey::default().\n */\nexport async function fetchLaunchesByAuthority(\n rpc: GetProgramAccountsRpc,\n authority: Address,\n config?: FetchLaunchesConfig,\n): Promise<LaunchWithAddress[]> {\n const programId = config?.programId ?? INITIALIZER_PROGRAM_ID;\n\n const discriminatorFilter = {\n memcmp: {\n offset: 0n,\n bytes: bytesToBase64(\n INITIALIZER_ACCOUNT_DISCRIMINATORS.Launch,\n ) as Base64EncodedBytes,\n encoding: 'base64' as const,\n },\n };\n\n const authorityFilter = {\n memcmp: {\n offset: 8n,\n bytes: bytesToBase64(\n addressCodec.encode(authority),\n ) as Base64EncodedBytes,\n encoding: 'base64' as const,\n },\n };\n\n const response = (await rpc\n .getProgramAccounts(programId, {\n encoding: 'base64',\n commitment: config?.commitment,\n filters: [discriminatorFilter, authorityFilter],\n })\n .send()) as unknown;\n\n const accounts = (\n Array.isArray(response)\n ? response\n : (response as { value: ProgramAccount[] }).value\n ) as ProgramAccount[];\n\n const launches: LaunchWithAddress[] = [];\n const decoder = getLaunchDecoder();\n\n for (const account of accounts) {\n try {\n const launch = decoder.decode(base64ToBytes(account.account.data[0]));\n launches.push({ address: account.pubkey, account: launch });\n } catch {\n console.warn(`Failed to decode launch account: ${account.pubkey}`);\n }\n }\n\n return launches;\n}\n\nexport async function launchExists(\n rpc: Rpc<GetAccountInfoApi>,\n namespace: Address,\n launchId: Uint8Array,\n config?: FetchLaunchesConfig,\n): Promise<boolean> {\n const programId = config?.programId ?? INITIALIZER_PROGRAM_ID;\n const [launchAddress] = await getLaunchAddress(\n namespace,\n launchId,\n programId,\n );\n const launch = await fetchLaunch(rpc, launchAddress, config);\n return launch !== null;\n}\n","import { mergeBytes } from '@solana/kit';\nimport {\n getRegisterLaunchArgsEncoder,\n getMigrateArgsEncoder,\n type RegisterLaunchArgsArgs,\n type MigrateArgsArgs,\n} from '../../generated/cpmmMigrator/index.js';\nimport { CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS } from './constants.js';\n\nexport {\n CPMM_MIGRATOR_PROGRAM_ID,\n SEED_STATE,\n MAX_RECIPIENTS,\n CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS,\n CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS,\n} from './constants.js';\n\nexport type {\n Recipient,\n RecipientArgs,\n RegisterLaunchArgs,\n RegisterLaunchArgsArgs,\n MigrateArgs,\n MigrateArgsArgs,\n CpmmMigratorState,\n CpmmMigratorStateArgs,\n} from '../../generated/cpmmMigrator/index.js';\n\nexport {\n getRecipientEncoder,\n getRecipientDecoder,\n getRecipientCodec,\n getRegisterLaunchArgsEncoder,\n getRegisterLaunchArgsDecoder,\n getRegisterLaunchArgsCodec,\n getMigrateArgsEncoder,\n getMigrateArgsDecoder,\n getMigrateArgsCodec,\n getCpmmMigratorStateEncoder,\n getCpmmMigratorStateDecoder,\n getCpmmMigratorStateCodec,\n} from '../../generated/cpmmMigrator/index.js';\n\nexport { getCpmmMigratorStateAddress } from './pda.js';\n\nexport { fetchCpmmMigratorState } from './client.js';\n\nexport function encodeRegisterLaunchCalldata(\n args: RegisterLaunchArgsArgs,\n): Uint8Array {\n const encoded = new Uint8Array(getRegisterLaunchArgsEncoder().encode(args));\n return mergeBytes([\n CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS.registerLaunch,\n encoded,\n ]);\n}\n\nexport function encodeMigrateCalldata(args: MigrateArgsArgs): Uint8Array {\n const encoded = new Uint8Array(getMigrateArgsEncoder().encode(args));\n return mergeBytes([\n CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS.migrate,\n encoded,\n ]);\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\n/**\n * Arguments for migrate instruction.\n * These are deserialized from the migrator_migrate_calldata passed by initializer.\n */\nexport type MigrateArgs = {\n /** Base tokens reserved for distribution to recipients */\n baseForDistribution: bigint;\n /** Base tokens reserved for CPMM liquidity */\n baseForLiquidity: bigint;\n};\n\nexport type MigrateArgsArgs = {\n /** Base tokens reserved for distribution to recipients */\n baseForDistribution: number | bigint;\n /** Base tokens reserved for CPMM liquidity */\n baseForLiquidity: number | bigint;\n};\n\nexport function getMigrateArgsEncoder(): FixedSizeEncoder<MigrateArgsArgs> {\n return getStructEncoder([\n ['baseForDistribution', getU64Encoder()],\n ['baseForLiquidity', getU64Encoder()],\n ]);\n}\n\nexport function getMigrateArgsDecoder(): FixedSizeDecoder<MigrateArgs> {\n return getStructDecoder([\n ['baseForDistribution', getU64Decoder()],\n ['baseForLiquidity', getU64Decoder()],\n ]);\n}\n\nexport function getMigrateArgsCodec(): FixedSizeCodec<\n MigrateArgsArgs,\n MigrateArgs\n> {\n return combineCodec(getMigrateArgsEncoder(), getMigrateArgsDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type Recipient = { wallet: Address; amount: bigint };\n\nexport type RecipientArgs = { wallet: Address; amount: number | bigint };\n\nexport function getRecipientEncoder(): FixedSizeEncoder<RecipientArgs> {\n return getStructEncoder([\n ['wallet', getAddressEncoder()],\n ['amount', getU64Encoder()],\n ]);\n}\n\nexport function getRecipientDecoder(): FixedSizeDecoder<Recipient> {\n return getStructDecoder([\n ['wallet', getAddressDecoder()],\n ['amount', getU64Decoder()],\n ]);\n}\n\nexport function getRecipientCodec(): FixedSizeCodec<RecipientArgs, Recipient> {\n return combineCodec(getRecipientEncoder(), getRecipientDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getOptionDecoder,\n getOptionEncoder,\n getStructDecoder,\n getStructEncoder,\n getU128Decoder,\n getU128Encoder,\n getU16Decoder,\n getU16Encoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Option,\n type OptionOrNullable,\n} from '@solana/kit';\nimport {\n getRecipientDecoder,\n getRecipientEncoder,\n type Recipient,\n type RecipientArgs,\n} from '.';\n\n/**\n * Arguments for register_launch instruction.\n * These are deserialized from the migrator_init_calldata passed by initializer.\n */\nexport type RegisterLaunchArgs = {\n cpmmConfig: Address;\n initialSwapFeeBps: number;\n initialFeeSplitBps: number;\n recipients: Array<Recipient>;\n minRaiseQuote: bigint;\n minMigrationPriceQ64Opt: Option<bigint>;\n};\n\nexport type RegisterLaunchArgsArgs = {\n cpmmConfig: Address;\n initialSwapFeeBps: number;\n initialFeeSplitBps: number;\n recipients: Array<RecipientArgs>;\n minRaiseQuote: number | bigint;\n minMigrationPriceQ64Opt: OptionOrNullable<number | bigint>;\n};\n\nexport function getRegisterLaunchArgsEncoder(): Encoder<RegisterLaunchArgsArgs> {\n return getStructEncoder([\n ['cpmmConfig', getAddressEncoder()],\n ['initialSwapFeeBps', getU16Encoder()],\n ['initialFeeSplitBps', getU16Encoder()],\n ['recipients', getArrayEncoder(getRecipientEncoder())],\n ['minRaiseQuote', getU64Encoder()],\n ['minMigrationPriceQ64Opt', getOptionEncoder(getU128Encoder())],\n ]);\n}\n\nexport function getRegisterLaunchArgsDecoder(): Decoder<RegisterLaunchArgs> {\n return getStructDecoder([\n ['cpmmConfig', getAddressDecoder()],\n ['initialSwapFeeBps', getU16Decoder()],\n ['initialFeeSplitBps', getU16Decoder()],\n ['recipients', getArrayDecoder(getRecipientDecoder())],\n ['minRaiseQuote', getU64Decoder()],\n ['minMigrationPriceQ64Opt', getOptionDecoder(getU128Decoder())],\n ]);\n}\n\nexport function getRegisterLaunchArgsCodec(): Codec<\n RegisterLaunchArgsArgs,\n RegisterLaunchArgs\n> {\n return combineCodec(\n getRegisterLaunchArgsEncoder(),\n getRegisterLaunchArgsDecoder(),\n );\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBooleanDecoder,\n getBooleanEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getOptionDecoder,\n getOptionEncoder,\n getStructDecoder,\n getStructEncoder,\n getU128Decoder,\n getU128Encoder,\n getU16Decoder,\n getU16Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type Codec,\n type Decoder,\n type EncodedAccount,\n type Encoder,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type Option,\n type OptionOrNullable,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n getRecipientDecoder,\n getRecipientEncoder,\n type Recipient,\n type RecipientArgs,\n} from '../types';\n\nexport const CPMM_MIGRATOR_STATE_DISCRIMINATOR = new Uint8Array([\n 169, 86, 255, 187, 37, 248, 11, 176,\n]);\n\nexport function getCpmmMigratorStateDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CPMM_MIGRATOR_STATE_DISCRIMINATOR,\n );\n}\n\nexport type CpmmMigratorState = {\n discriminator: ReadonlyUint8Array;\n /** The launch this state is associated with */\n launch: Address;\n /** Admin who registered this launch (receives unsold curve base tokens) */\n admin: Address;\n /** CPMM config to use for pool initialization */\n cpmmConfig: Address;\n /** Initial swap fee for the CPMM pool (basis points) */\n initialSwapFeeBps: number;\n /** Initial fee split for the CPMM pool (basis points) */\n initialFeeSplitBps: number;\n /** Padding for alignment */\n pad0: ReadonlyUint8Array;\n /** Recipients for base token distribution at migration */\n recipients: Array<Recipient>;\n /** Minimum quote tokens required to migrate */\n minRaiseQuote: bigint;\n /** Optional minimum price floor (Q64 fixed point) */\n minMigrationPriceQ64Opt: Option<bigint>;\n /** Whether this launch has been migrated */\n isMigrated: boolean;\n /** Bump seed for this PDA */\n bump: number;\n /** Reserved for future use */\n reserved: ReadonlyUint8Array;\n};\n\nexport type CpmmMigratorStateArgs = {\n /** The launch this state is associated with */\n launch: Address;\n /** Admin who registered this launch (receives unsold curve base tokens) */\n admin: Address;\n /** CPMM config to use for pool initialization */\n cpmmConfig: Address;\n /** Initial swap fee for the CPMM pool (basis points) */\n initialSwapFeeBps: number;\n /** Initial fee split for the CPMM pool (basis points) */\n initialFeeSplitBps: number;\n /** Padding for alignment */\n pad0: ReadonlyUint8Array;\n /** Recipients for base token distribution at migration */\n recipients: Array<RecipientArgs>;\n /** Minimum quote tokens required to migrate */\n minRaiseQuote: number | bigint;\n /** Optional minimum price floor (Q64 fixed point) */\n minMigrationPriceQ64Opt: OptionOrNullable<number | bigint>;\n /** Whether this launch has been migrated */\n isMigrated: boolean;\n /** Bump seed for this PDA */\n bump: number;\n /** Reserved for future use */\n reserved: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link CpmmMigratorStateArgs} account data. */\nexport function getCpmmMigratorStateEncoder(): Encoder<CpmmMigratorStateArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['launch', getAddressEncoder()],\n ['admin', getAddressEncoder()],\n ['cpmmConfig', getAddressEncoder()],\n ['initialSwapFeeBps', getU16Encoder()],\n ['initialFeeSplitBps', getU16Encoder()],\n ['pad0', fixEncoderSize(getBytesEncoder(), 4)],\n ['recipients', getArrayEncoder(getRecipientEncoder(), { size: 2 })],\n ['minRaiseQuote', getU64Encoder()],\n ['minMigrationPriceQ64Opt', getOptionEncoder(getU128Encoder())],\n ['isMigrated', getBooleanEncoder()],\n ['bump', getU8Encoder()],\n ['reserved', fixEncoderSize(getBytesEncoder(), 14)],\n ]),\n (value) => ({ ...value, discriminator: CPMM_MIGRATOR_STATE_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link CpmmMigratorState} account data. */\nexport function getCpmmMigratorStateDecoder(): Decoder<CpmmMigratorState> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['launch', getAddressDecoder()],\n ['admin', getAddressDecoder()],\n ['cpmmConfig', getAddressDecoder()],\n ['initialSwapFeeBps', getU16Decoder()],\n ['initialFeeSplitBps', getU16Decoder()],\n ['pad0', fixDecoderSize(getBytesDecoder(), 4)],\n ['recipients', getArrayDecoder(getRecipientDecoder(), { size: 2 })],\n ['minRaiseQuote', getU64Decoder()],\n ['minMigrationPriceQ64Opt', getOptionDecoder(getU128Decoder())],\n ['isMigrated', getBooleanDecoder()],\n ['bump', getU8Decoder()],\n ['reserved', fixDecoderSize(getBytesDecoder(), 14)],\n ]);\n}\n\n/** Gets the codec for {@link CpmmMigratorState} account data. */\nexport function getCpmmMigratorStateCodec(): Codec<\n CpmmMigratorStateArgs,\n CpmmMigratorState\n> {\n return combineCodec(\n getCpmmMigratorStateEncoder(),\n getCpmmMigratorStateDecoder(),\n );\n}\n\nexport function decodeCpmmMigratorState<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<CpmmMigratorState, TAddress>;\nexport function decodeCpmmMigratorState<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<CpmmMigratorState, TAddress>;\nexport function decodeCpmmMigratorState<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n):\n | Account<CpmmMigratorState, TAddress>\n | MaybeAccount<CpmmMigratorState, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getCpmmMigratorStateDecoder(),\n );\n}\n\nexport async function fetchCpmmMigratorState<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<CpmmMigratorState, TAddress>> {\n const maybeAccount = await fetchMaybeCpmmMigratorState(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeCpmmMigratorState<\n TAddress extends string = string,\n>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<CpmmMigratorState, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeCpmmMigratorState(maybeAccount);\n}\n\nexport async function fetchAllCpmmMigratorState(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<CpmmMigratorState>[]> {\n const maybeAccounts = await fetchAllMaybeCpmmMigratorState(\n rpc,\n addresses,\n config,\n );\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeCpmmMigratorState(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<CpmmMigratorState>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) =>\n decodeCpmmMigratorState(maybeAccount),\n );\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n isProgramError,\n type Address,\n type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM,\n type SolanaError,\n} from '@solana/kit';\nimport { CPMM_MIGRATOR_PROGRAM_ADDRESS } from '../programs';\n\n/** Unauthorized: Unauthorized */\nexport const CPMM_MIGRATOR_ERROR__UNAUTHORIZED = 0x1770; // 6000\n/** InvalidPhase: Invalid phase */\nexport const CPMM_MIGRATOR_ERROR__INVALID_PHASE = 0x1771; // 6001\n/** InvalidAmount: Invalid amount */\nexport const CPMM_MIGRATOR_ERROR__INVALID_AMOUNT = 0x1772; // 6002\n/** InvalidVault: Invalid vault */\nexport const CPMM_MIGRATOR_ERROR__INVALID_VAULT = 0x1773; // 6003\n/** InvalidMint: Invalid mint */\nexport const CPMM_MIGRATOR_ERROR__INVALID_MINT = 0x1774; // 6004\n/** MathOverflow: Math overflow */\nexport const CPMM_MIGRATOR_ERROR__MATH_OVERFLOW = 0x1775; // 6005\n/** InvalidConfig: Invalid config */\nexport const CPMM_MIGRATOR_ERROR__INVALID_CONFIG = 0x1776; // 6006\n/** MinRaiseNotMet: Minimum raise not met */\nexport const CPMM_MIGRATOR_ERROR__MIN_RAISE_NOT_MET = 0x1777; // 6007\n/** PriceFloorNotMet: Price floor not met */\nexport const CPMM_MIGRATOR_ERROR__PRICE_FLOOR_NOT_MET = 0x1778; // 6008\n/** MissingRecipientAccount: Missing recipient account */\nexport const CPMM_MIGRATOR_ERROR__MISSING_RECIPIENT_ACCOUNT = 0x1779; // 6009\n/** InvalidRecipientAccount: Invalid recipient account */\nexport const CPMM_MIGRATOR_ERROR__INVALID_RECIPIENT_ACCOUNT = 0x177a; // 6010\n/** ExtraRecipientAccounts: Extra recipient accounts */\nexport const CPMM_MIGRATOR_ERROR__EXTRA_RECIPIENT_ACCOUNTS = 0x177b; // 6011\n/** PoolAlreadyInitialized: Pool already initialized */\nexport const CPMM_MIGRATOR_ERROR__POOL_ALREADY_INITIALIZED = 0x177c; // 6012\n/** PositionAlreadyInitialized: Position already initialized */\nexport const CPMM_MIGRATOR_ERROR__POSITION_ALREADY_INITIALIZED = 0x177d; // 6013\n/** AlreadyMigrated: Already migrated */\nexport const CPMM_MIGRATOR_ERROR__ALREADY_MIGRATED = 0x177e; // 6014\n/** TooManyRecipients: Too many recipients */\nexport const CPMM_MIGRATOR_ERROR__TOO_MANY_RECIPIENTS = 0x177f; // 6015\n/** InvalidRecipient: Invalid recipient */\nexport const CPMM_MIGRATOR_ERROR__INVALID_RECIPIENT = 0x1780; // 6016\n/** InvalidLaunch: Invalid launch */\nexport const CPMM_MIGRATOR_ERROR__INVALID_LAUNCH = 0x1781; // 6017\n/** LaunchConfigMismatch: Launch configuration mismatch */\nexport const CPMM_MIGRATOR_ERROR__LAUNCH_CONFIG_MISMATCH = 0x1782; // 6018\n\nexport type CpmmMigratorError =\n | typeof CPMM_MIGRATOR_ERROR__ALREADY_MIGRATED\n | typeof CPMM_MIGRATOR_ERROR__EXTRA_RECIPIENT_ACCOUNTS\n | typeof CPMM_MIGRATOR_ERROR__INVALID_AMOUNT\n | typeof CPMM_MIGRATOR_ERROR__INVALID_CONFIG\n | typeof CPMM_MIGRATOR_ERROR__INVALID_LAUNCH\n | typeof CPMM_MIGRATOR_ERROR__INVALID_MINT\n | typeof CPMM_MIGRATOR_ERROR__INVALID_PHASE\n | typeof CPMM_MIGRATOR_ERROR__INVALID_RECIPIENT\n | typeof CPMM_MIGRATOR_ERROR__INVALID_RECIPIENT_ACCOUNT\n | typeof CPMM_MIGRATOR_ERROR__INVALID_VAULT\n | typeof CPMM_MIGRATOR_ERROR__LAUNCH_CONFIG_MISMATCH\n | typeof CPMM_MIGRATOR_ERROR__MATH_OVERFLOW\n | typeof CPMM_MIGRATOR_ERROR__MIN_RAISE_NOT_MET\n | typeof CPMM_MIGRATOR_ERROR__MISSING_RECIPIENT_ACCOUNT\n | typeof CPMM_MIGRATOR_ERROR__POOL_ALREADY_INITIALIZED\n | typeof CPMM_MIGRATOR_ERROR__POSITION_ALREADY_INITIALIZED\n | typeof CPMM_MIGRATOR_ERROR__PRICE_FLOOR_NOT_MET\n | typeof CPMM_MIGRATOR_ERROR__TOO_MANY_RECIPIENTS\n | typeof CPMM_MIGRATOR_ERROR__UNAUTHORIZED;\n\nlet cpmmMigratorErrorMessages: Record<CpmmMigratorError, string> | undefined;\nif (process.env.NODE_ENV !== 'production') {\n cpmmMigratorErrorMessages = {\n [CPMM_MIGRATOR_ERROR__ALREADY_MIGRATED]: `Already migrated`,\n [CPMM_MIGRATOR_ERROR__EXTRA_RECIPIENT_ACCOUNTS]: `Extra recipient accounts`,\n [CPMM_MIGRATOR_ERROR__INVALID_AMOUNT]: `Invalid amount`,\n [CPMM_MIGRATOR_ERROR__INVALID_CONFIG]: `Invalid config`,\n [CPMM_MIGRATOR_ERROR__INVALID_LAUNCH]: `Invalid launch`,\n [CPMM_MIGRATOR_ERROR__INVALID_MINT]: `Invalid mint`,\n [CPMM_MIGRATOR_ERROR__INVALID_PHASE]: `Invalid phase`,\n [CPMM_MIGRATOR_ERROR__INVALID_RECIPIENT]: `Invalid recipient`,\n [CPMM_MIGRATOR_ERROR__INVALID_RECIPIENT_ACCOUNT]: `Invalid recipient account`,\n [CPMM_MIGRATOR_ERROR__INVALID_VAULT]: `Invalid vault`,\n [CPMM_MIGRATOR_ERROR__LAUNCH_CONFIG_MISMATCH]: `Launch configuration mismatch`,\n [CPMM_MIGRATOR_ERROR__MATH_OVERFLOW]: `Math overflow`,\n [CPMM_MIGRATOR_ERROR__MIN_RAISE_NOT_MET]: `Minimum raise not met`,\n [CPMM_MIGRATOR_ERROR__MISSING_RECIPIENT_ACCOUNT]: `Missing recipient account`,\n [CPMM_MIGRATOR_ERROR__POOL_ALREADY_INITIALIZED]: `Pool already initialized`,\n [CPMM_MIGRATOR_ERROR__POSITION_ALREADY_INITIALIZED]: `Position already initialized`,\n [CPMM_MIGRATOR_ERROR__PRICE_FLOOR_NOT_MET]: `Price floor not met`,\n [CPMM_MIGRATOR_ERROR__TOO_MANY_RECIPIENTS]: `Too many recipients`,\n [CPMM_MIGRATOR_ERROR__UNAUTHORIZED]: `Unauthorized`,\n };\n}\n\nexport function getCpmmMigratorErrorMessage(code: CpmmMigratorError): string {\n if (process.env.NODE_ENV !== 'production') {\n return (cpmmMigratorErrorMessages as Record<CpmmMigratorError, string>)[\n code\n ];\n }\n\n return 'Error message not available in production bundles.';\n}\n\nexport function isCpmmMigratorError<\n TProgramErrorCode extends CpmmMigratorError,\n>(\n error: unknown,\n transactionMessage: {\n instructions: Record<number, { programAddress: Address }>;\n },\n code?: TProgramErrorCode,\n): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> &\n Readonly<{ context: Readonly<{ code: TProgramErrorCode }> }> {\n return isProgramError<TProgramErrorCode>(\n error,\n transactionMessage,\n CPMM_MIGRATOR_PROGRAM_ADDRESS,\n code,\n );\n}\n","import type { Address } from '@solana/kit';\nimport type { Rpc, GetAccountInfoApi } from '@solana/kit';\nimport {\n getCpmmMigratorStateDecoder,\n type CpmmMigratorState,\n} from '../../generated/cpmmMigrator/index.js';\n\nfunction base64ToBytes(base64: string): Uint8Array {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n\nexport async function fetchCpmmMigratorState(\n rpc: Rpc<GetAccountInfoApi>,\n address: Address,\n): Promise<CpmmMigratorState | null> {\n const response = await rpc\n .getAccountInfo(address, { encoding: 'base64' })\n .send();\n if (!response.value) return null;\n return getCpmmMigratorStateDecoder().decode(\n base64ToBytes(response.value.data[0]),\n );\n}\n","export * from '../../generated/predictionMigrator/index.js';\nexport {\n getPredictionMarketAddress,\n getPredictionMarketAuthorityAddress,\n getPredictionPotVaultAddress,\n getPredictionEntryAddress,\n getPredictionEntryByMintAddress,\n} from './pda.js';\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n isProgramError,\n type Address,\n type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM,\n type SolanaError,\n} from '@solana/kit';\nimport { PREDICTION_MIGRATOR_PROGRAM_ADDRESS } from '../programs';\n\n/** Unauthorized: Unauthorized */\nexport const PREDICTION_MIGRATOR_ERROR__UNAUTHORIZED = 0x1770; // 6000\n/** QuoteMintMismatch: Quote mint mismatch */\nexport const PREDICTION_MIGRATOR_ERROR__QUOTE_MINT_MISMATCH = 0x1771; // 6001\n/** EntryAlreadyRegistered: Entry already registered */\nexport const PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_REGISTERED = 0x1772; // 6002\n/** EntryNotRegistered: Entry not registered */\nexport const PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_REGISTERED = 0x1773; // 6003\n/** EntryAlreadyMigrated: Entry already migrated */\nexport const PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_MIGRATED = 0x1774; // 6004\n/** EntryNotMigrated: Entry not migrated */\nexport const PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_MIGRATED = 0x1775; // 6005\n/** OracleNotFinalized: Oracle not finalized */\nexport const PREDICTION_MIGRATOR_ERROR__ORACLE_NOT_FINALIZED = 0x1776; // 6006\n/** MarketNotResolved: Market not resolved */\nexport const PREDICTION_MIGRATOR_ERROR__MARKET_NOT_RESOLVED = 0x1777; // 6007\n/** InvalidWinnerMint: Invalid winner mint */\nexport const PREDICTION_MIGRATOR_ERROR__INVALID_WINNER_MINT = 0x1778; // 6008\n/** InsufficientBalance: Insufficient balance */\nexport const PREDICTION_MIGRATOR_ERROR__INSUFFICIENT_BALANCE = 0x1779; // 6009\n/** MathOverflow: Math overflow */\nexport const PREDICTION_MIGRATOR_ERROR__MATH_OVERFLOW = 0x177a; // 6010\n/** InvalidEntryId: Invalid entry ID */\nexport const PREDICTION_MIGRATOR_ERROR__INVALID_ENTRY_ID = 0x177b; // 6011\n/** InvalidMarket: Invalid market */\nexport const PREDICTION_MIGRATOR_ERROR__INVALID_MARKET = 0x177c; // 6012\n/** InvalidVault: Invalid vault */\nexport const PREDICTION_MIGRATOR_ERROR__INVALID_VAULT = 0x177d; // 6013\n/** InvalidMint: Invalid mint */\nexport const PREDICTION_MIGRATOR_ERROR__INVALID_MINT = 0x177e; // 6014\n/** WinningEntryNotMigrated: Winning entry not migrated */\nexport const PREDICTION_MIGRATOR_ERROR__WINNING_ENTRY_NOT_MIGRATED = 0x177f; // 6015\n/** NoPendingRewards: No pending rewards */\nexport const PREDICTION_MIGRATOR_ERROR__NO_PENDING_REWARDS = 0x1780; // 6016\n/** InvalidOracle: Invalid oracle */\nexport const PREDICTION_MIGRATOR_ERROR__INVALID_ORACLE = 0x1781; // 6017\n/** ZeroClaimableSupply: Zero claimable supply */\nexport const PREDICTION_MIGRATOR_ERROR__ZERO_CLAIMABLE_SUPPLY = 0x1782; // 6018\n/** InvalidInput: Invalid input */\nexport const PREDICTION_MIGRATOR_ERROR__INVALID_INPUT = 0x1783; // 6019\n\nexport type PredictionMigratorError =\n | typeof PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_MIGRATED\n | typeof PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_REGISTERED\n | typeof PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_MIGRATED\n | typeof PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_REGISTERED\n | typeof PREDICTION_MIGRATOR_ERROR__INSUFFICIENT_BALANCE\n | typeof PREDICTION_MIGRATOR_ERROR__INVALID_ENTRY_ID\n | typeof PREDICTION_MIGRATOR_ERROR__INVALID_INPUT\n | typeof PREDICTION_MIGRATOR_ERROR__INVALID_MARKET\n | typeof PREDICTION_MIGRATOR_ERROR__INVALID_MINT\n | typeof PREDICTION_MIGRATOR_ERROR__INVALID_ORACLE\n | typeof PREDICTION_MIGRATOR_ERROR__INVALID_VAULT\n | typeof PREDICTION_MIGRATOR_ERROR__INVALID_WINNER_MINT\n | typeof PREDICTION_MIGRATOR_ERROR__MARKET_NOT_RESOLVED\n | typeof PREDICTION_MIGRATOR_ERROR__MATH_OVERFLOW\n | typeof PREDICTION_MIGRATOR_ERROR__NO_PENDING_REWARDS\n | typeof PREDICTION_MIGRATOR_ERROR__ORACLE_NOT_FINALIZED\n | typeof PREDICTION_MIGRATOR_ERROR__QUOTE_MINT_MISMATCH\n | typeof PREDICTION_MIGRATOR_ERROR__UNAUTHORIZED\n | typeof PREDICTION_MIGRATOR_ERROR__WINNING_ENTRY_NOT_MIGRATED\n | typeof PREDICTION_MIGRATOR_ERROR__ZERO_CLAIMABLE_SUPPLY;\n\nlet predictionMigratorErrorMessages:\n | Record<PredictionMigratorError, string>\n | undefined;\nif (process.env.NODE_ENV !== 'production') {\n predictionMigratorErrorMessages = {\n [PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_MIGRATED]: `Entry already migrated`,\n [PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_REGISTERED]: `Entry already registered`,\n [PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_MIGRATED]: `Entry not migrated`,\n [PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_REGISTERED]: `Entry not registered`,\n [PREDICTION_MIGRATOR_ERROR__INSUFFICIENT_BALANCE]: `Insufficient balance`,\n [PREDICTION_MIGRATOR_ERROR__INVALID_ENTRY_ID]: `Invalid entry ID`,\n [PREDICTION_MIGRATOR_ERROR__INVALID_INPUT]: `Invalid input`,\n [PREDICTION_MIGRATOR_ERROR__INVALID_MARKET]: `Invalid market`,\n [PREDICTION_MIGRATOR_ERROR__INVALID_MINT]: `Invalid mint`,\n [PREDICTION_MIGRATOR_ERROR__INVALID_ORACLE]: `Invalid oracle`,\n [PREDICTION_MIGRATOR_ERROR__INVALID_VAULT]: `Invalid vault`,\n [PREDICTION_MIGRATOR_ERROR__INVALID_WINNER_MINT]: `Invalid winner mint`,\n [PREDICTION_MIGRATOR_ERROR__MARKET_NOT_RESOLVED]: `Market not resolved`,\n [PREDICTION_MIGRATOR_ERROR__MATH_OVERFLOW]: `Math overflow`,\n [PREDICTION_MIGRATOR_ERROR__NO_PENDING_REWARDS]: `No pending rewards`,\n [PREDICTION_MIGRATOR_ERROR__ORACLE_NOT_FINALIZED]: `Oracle not finalized`,\n [PREDICTION_MIGRATOR_ERROR__QUOTE_MINT_MISMATCH]: `Quote mint mismatch`,\n [PREDICTION_MIGRATOR_ERROR__UNAUTHORIZED]: `Unauthorized`,\n [PREDICTION_MIGRATOR_ERROR__WINNING_ENTRY_NOT_MIGRATED]: `Winning entry not migrated`,\n [PREDICTION_MIGRATOR_ERROR__ZERO_CLAIMABLE_SUPPLY]: `Zero claimable supply`,\n };\n}\n\nexport function getPredictionMigratorErrorMessage(\n code: PredictionMigratorError,\n): string {\n if (process.env.NODE_ENV !== 'production') {\n return (\n predictionMigratorErrorMessages as Record<PredictionMigratorError, string>\n )[code];\n }\n\n return 'Error message not available in production bundles.';\n}\n\nexport function isPredictionMigratorError<\n TProgramErrorCode extends PredictionMigratorError,\n>(\n error: unknown,\n transactionMessage: {\n instructions: Record<number, { programAddress: Address }>;\n },\n code?: TProgramErrorCode,\n): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> &\n Readonly<{ context: Readonly<{ code: TProgramErrorCode }> }> {\n return isProgramError<TProgramErrorCode>(\n error,\n transactionMessage,\n PREDICTION_MIGRATOR_PROGRAM_ADDRESS,\n code,\n );\n}\n","export * from '../generated/trustedOracle/index.js';\nexport { getOracleStateAddress } from './pda.js';\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBooleanDecoder,\n getBooleanEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from '@solana/kit';\n\nexport const ORACLE_STATE_DISCRIMINATOR = new Uint8Array([\n 97, 156, 157, 189, 194, 73, 8, 15,\n]);\n\nexport function getOracleStateDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n ORACLE_STATE_DISCRIMINATOR,\n );\n}\n\nexport type OracleState = {\n discriminator: ReadonlyUint8Array;\n /** The authority that can finalize this oracle */\n oracleAuthority: Address;\n /** Optional quote mint for validation (Pubkey::default() if not used) */\n quoteMint: Address;\n /** Whether the oracle has been finalized with a winner */\n isFinalized: boolean;\n /** The winning mint (only valid if is_finalized == true) */\n winningMint: Address;\n /** Nonce used in PDA derivation */\n nonce: bigint;\n /** PDA bump seed */\n bump: number;\n /** Reserved for future use */\n reserved: ReadonlyUint8Array;\n};\n\nexport type OracleStateArgs = {\n /** The authority that can finalize this oracle */\n oracleAuthority: Address;\n /** Optional quote mint for validation (Pubkey::default() if not used) */\n quoteMint: Address;\n /** Whether the oracle has been finalized with a winner */\n isFinalized: boolean;\n /** The winning mint (only valid if is_finalized == true) */\n winningMint: Address;\n /** Nonce used in PDA derivation */\n nonce: number | bigint;\n /** PDA bump seed */\n bump: number;\n /** Reserved for future use */\n reserved: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link OracleStateArgs} account data. */\nexport function getOracleStateEncoder(): FixedSizeEncoder<OracleStateArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['oracleAuthority', getAddressEncoder()],\n ['quoteMint', getAddressEncoder()],\n ['isFinalized', getBooleanEncoder()],\n ['winningMint', getAddressEncoder()],\n ['nonce', getU64Encoder()],\n ['bump', getU8Encoder()],\n ['reserved', fixEncoderSize(getBytesEncoder(), 31)],\n ]),\n (value) => ({ ...value, discriminator: ORACLE_STATE_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link OracleState} account data. */\nexport function getOracleStateDecoder(): FixedSizeDecoder<OracleState> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['oracleAuthority', getAddressDecoder()],\n ['quoteMint', getAddressDecoder()],\n ['isFinalized', getBooleanDecoder()],\n ['winningMint', getAddressDecoder()],\n ['nonce', getU64Decoder()],\n ['bump', getU8Decoder()],\n ['reserved', fixDecoderSize(getBytesDecoder(), 31)],\n ]);\n}\n\n/** Gets the codec for {@link OracleState} account data. */\nexport function getOracleStateCodec(): FixedSizeCodec<\n OracleStateArgs,\n OracleState\n> {\n return combineCodec(getOracleStateEncoder(), getOracleStateDecoder());\n}\n\nexport function decodeOracleState<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<OracleState, TAddress>;\nexport function decodeOracleState<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<OracleState, TAddress>;\nexport function decodeOracleState<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<OracleState, TAddress> | MaybeAccount<OracleState, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getOracleStateDecoder(),\n );\n}\n\nexport async function fetchOracleState<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<OracleState, TAddress>> {\n const maybeAccount = await fetchMaybeOracleState(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeOracleState<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<OracleState, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeOracleState(maybeAccount);\n}\n\nexport async function fetchAllOracleState(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<OracleState>[]> {\n const maybeAccounts = await fetchAllMaybeOracleState(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeOracleState(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<OracleState>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeOracleState(maybeAccount));\n}\n\nexport function getOracleStateSize(): number {\n return 145;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { TRUSTED_ORACLE_PROGRAM_ADDRESS } from '../programs';\n\nexport const FINALIZE_DISCRIMINATOR = new Uint8Array([\n 171, 61, 218, 56, 127, 115, 12, 217,\n]);\n\nexport function getFinalizeDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(FINALIZE_DISCRIMINATOR);\n}\n\nexport type FinalizeInstruction<\n TProgram extends string = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS,\n TAccountOracleAuthority extends string | AccountMeta<string> = string,\n TAccountOracleState extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountOracleAuthority extends string\n ? ReadonlySignerAccount<TAccountOracleAuthority> &\n AccountSignerMeta<TAccountOracleAuthority>\n : TAccountOracleAuthority,\n TAccountOracleState extends string\n ? WritableAccount<TAccountOracleState>\n : TAccountOracleState,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type FinalizeInstructionData = {\n discriminator: ReadonlyUint8Array;\n winningMint: Address;\n};\n\nexport type FinalizeInstructionDataArgs = { winningMint: Address };\n\nexport function getFinalizeInstructionDataEncoder(): FixedSizeEncoder<FinalizeInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['winningMint', getAddressEncoder()],\n ]),\n (value) => ({ ...value, discriminator: FINALIZE_DISCRIMINATOR }),\n );\n}\n\nexport function getFinalizeInstructionDataDecoder(): FixedSizeDecoder<FinalizeInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['winningMint', getAddressDecoder()],\n ]);\n}\n\nexport function getFinalizeInstructionDataCodec(): FixedSizeCodec<\n FinalizeInstructionDataArgs,\n FinalizeInstructionData\n> {\n return combineCodec(\n getFinalizeInstructionDataEncoder(),\n getFinalizeInstructionDataDecoder(),\n );\n}\n\nexport type FinalizeInput<\n TAccountOracleAuthority extends string = string,\n TAccountOracleState extends string = string,\n> = {\n /** The oracle authority - must sign to finalize */\n oracleAuthority: TransactionSigner<TAccountOracleAuthority>;\n oracleState: Address<TAccountOracleState>;\n winningMint: FinalizeInstructionDataArgs['winningMint'];\n};\n\nexport function getFinalizeInstruction<\n TAccountOracleAuthority extends string,\n TAccountOracleState extends string,\n TProgramAddress extends Address = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS,\n>(\n input: FinalizeInput<TAccountOracleAuthority, TAccountOracleState>,\n config?: { programAddress?: TProgramAddress },\n): FinalizeInstruction<\n TProgramAddress,\n TAccountOracleAuthority,\n TAccountOracleState\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? TRUSTED_ORACLE_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n oracleAuthority: {\n value: input.oracleAuthority ?? null,\n isWritable: false,\n },\n oracleState: { value: input.oracleState ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('oracleAuthority', accounts.oracleAuthority),\n getAccountMeta('oracleState', accounts.oracleState),\n ],\n data: getFinalizeInstructionDataEncoder().encode(\n args as FinalizeInstructionDataArgs,\n ),\n programAddress,\n } as FinalizeInstruction<\n TProgramAddress,\n TAccountOracleAuthority,\n TAccountOracleState\n >);\n}\n\nexport type ParsedFinalizeInstruction<\n TProgram extends string = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The oracle authority - must sign to finalize */\n oracleAuthority: TAccountMetas[0];\n oracleState: TAccountMetas[1];\n };\n data: FinalizeInstructionData;\n};\n\nexport function parseFinalizeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedFinalizeInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n oracleAuthority: getNextAccount(),\n oracleState: getNextAccount(),\n },\n data: getFinalizeInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from '@solana/kit';\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from '@solana/program-client-core';\nimport { TRUSTED_ORACLE_PROGRAM_ADDRESS } from '../programs';\n\nexport const INITIALIZE_ORACLE_DISCRIMINATOR = new Uint8Array([\n 144, 223, 131, 120, 196, 253, 181, 99,\n]);\n\nexport function getInitializeOracleDiscriminatorBytes() {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n INITIALIZE_ORACLE_DISCRIMINATOR,\n );\n}\n\nexport type InitializeOracleInstruction<\n TProgram extends string = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS,\n TAccountOracleAuthority extends string | AccountMeta<string> = string,\n TAccountOracleState extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n '11111111111111111111111111111111',\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountOracleAuthority extends string\n ? WritableSignerAccount<TAccountOracleAuthority> &\n AccountSignerMeta<TAccountOracleAuthority>\n : TAccountOracleAuthority,\n TAccountOracleState extends string\n ? WritableAccount<TAccountOracleState>\n : TAccountOracleState,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializeOracleInstructionData = {\n discriminator: ReadonlyUint8Array;\n /** Nonce for PDA derivation (allows multiple oracles per authority) */\n nonce: bigint;\n /** Optional quote mint for validation (use Pubkey::default() if not needed) */\n quoteMint: Address;\n};\n\nexport type InitializeOracleInstructionDataArgs = {\n /** Nonce for PDA derivation (allows multiple oracles per authority) */\n nonce: number | bigint;\n /** Optional quote mint for validation (use Pubkey::default() if not needed) */\n quoteMint: Address;\n};\n\nexport function getInitializeOracleInstructionDataEncoder(): FixedSizeEncoder<InitializeOracleInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n ['discriminator', fixEncoderSize(getBytesEncoder(), 8)],\n ['nonce', getU64Encoder()],\n ['quoteMint', getAddressEncoder()],\n ]),\n (value) => ({ ...value, discriminator: INITIALIZE_ORACLE_DISCRIMINATOR }),\n );\n}\n\nexport function getInitializeOracleInstructionDataDecoder(): FixedSizeDecoder<InitializeOracleInstructionData> {\n return getStructDecoder([\n ['discriminator', fixDecoderSize(getBytesDecoder(), 8)],\n ['nonce', getU64Decoder()],\n ['quoteMint', getAddressDecoder()],\n ]);\n}\n\nexport function getInitializeOracleInstructionDataCodec(): FixedSizeCodec<\n InitializeOracleInstructionDataArgs,\n InitializeOracleInstructionData\n> {\n return combineCodec(\n getInitializeOracleInstructionDataEncoder(),\n getInitializeOracleInstructionDataDecoder(),\n );\n}\n\nexport type InitializeOracleInput<\n TAccountOracleAuthority extends string = string,\n TAccountOracleState extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n /** The authority that will be able to finalize this oracle */\n oracleAuthority: TransactionSigner<TAccountOracleAuthority>;\n oracleState: Address<TAccountOracleState>;\n systemProgram?: Address<TAccountSystemProgram>;\n nonce: InitializeOracleInstructionDataArgs['nonce'];\n quoteMint: InitializeOracleInstructionDataArgs['quoteMint'];\n};\n\nexport function getInitializeOracleInstruction<\n TAccountOracleAuthority extends string,\n TAccountOracleState extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS,\n>(\n input: InitializeOracleInput<\n TAccountOracleAuthority,\n TAccountOracleState,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): InitializeOracleInstruction<\n TProgramAddress,\n TAccountOracleAuthority,\n TAccountOracleState,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress =\n config?.programAddress ?? TRUSTED_ORACLE_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n oracleAuthority: { value: input.oracleAuthority ?? null, isWritable: true },\n oracleState: { value: input.oracleState ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n '11111111111111111111111111111111' as Address<'11111111111111111111111111111111'>;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, 'programId');\n return Object.freeze({\n accounts: [\n getAccountMeta('oracleAuthority', accounts.oracleAuthority),\n getAccountMeta('oracleState', accounts.oracleState),\n getAccountMeta('systemProgram', accounts.systemProgram),\n ],\n data: getInitializeOracleInstructionDataEncoder().encode(\n args as InitializeOracleInstructionDataArgs,\n ),\n programAddress,\n } as InitializeOracleInstruction<\n TProgramAddress,\n TAccountOracleAuthority,\n TAccountOracleState,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedInitializeOracleInstruction<\n TProgram extends string = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** The authority that will be able to finalize this oracle */\n oracleAuthority: TAccountMetas[0];\n oracleState: TAccountMetas[1];\n systemProgram: TAccountMetas[2];\n };\n data: InitializeOracleInstructionData;\n};\n\nexport function parseInitializeOracleInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedInitializeOracleInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 3) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 3,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n oracleAuthority: getNextAccount(),\n oracleState: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getInitializeOracleInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertIsInstructionWithAccounts,\n containsBytes,\n fixEncoderSize,\n getBytesEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,\n SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,\n SolanaError,\n type Address,\n type ClientWithRpc,\n type ClientWithTransactionPlanning,\n type ClientWithTransactionSending,\n type GetAccountInfoApi,\n type GetMultipleAccountsApi,\n type Instruction,\n type InstructionWithData,\n type ReadonlyUint8Array,\n} from '@solana/kit';\nimport {\n addSelfFetchFunctions,\n addSelfPlanAndSendFunctions,\n type SelfFetchFunctions,\n type SelfPlanAndSendFunctions,\n} from '@solana/program-client-core';\nimport {\n getOracleStateCodec,\n type OracleState,\n type OracleStateArgs,\n} from '../accounts';\nimport {\n getFinalizeInstruction,\n getInitializeOracleInstruction,\n parseFinalizeInstruction,\n parseInitializeOracleInstruction,\n type FinalizeInput,\n type InitializeOracleInput,\n type ParsedFinalizeInstruction,\n type ParsedInitializeOracleInstruction,\n} from '../instructions';\n\nexport const TRUSTED_ORACLE_PROGRAM_ADDRESS =\n 'HhUzN7VvonNUevATyugZUepzxpeEZMXQbV92X2xvsp5m' as Address<'HhUzN7VvonNUevATyugZUepzxpeEZMXQbV92X2xvsp5m'>;\n\nexport enum TrustedOracleAccount {\n OracleState,\n}\n\nexport function identifyTrustedOracleAccount(\n account: { data: ReadonlyUint8Array } | ReadonlyUint8Array,\n): TrustedOracleAccount {\n const data = 'data' in account ? account.data : account;\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([97, 156, 157, 189, 194, 73, 8, 15]),\n ),\n 0,\n )\n ) {\n return TrustedOracleAccount.OracleState;\n }\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,\n { accountData: data, programName: 'trustedOracle' },\n );\n}\n\nexport enum TrustedOracleInstruction {\n Finalize,\n InitializeOracle,\n}\n\nexport function identifyTrustedOracleInstruction(\n instruction: { data: ReadonlyUint8Array } | ReadonlyUint8Array,\n): TrustedOracleInstruction {\n const data = 'data' in instruction ? instruction.data : instruction;\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([171, 61, 218, 56, 127, 115, 12, 217]),\n ),\n 0,\n )\n ) {\n return TrustedOracleInstruction.Finalize;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([144, 223, 131, 120, 196, 253, 181, 99]),\n ),\n 0,\n )\n ) {\n return TrustedOracleInstruction.InitializeOracle;\n }\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,\n { instructionData: data, programName: 'trustedOracle' },\n );\n}\n\nexport type ParsedTrustedOracleInstruction<\n TProgram extends string = 'HhUzN7VvonNUevATyugZUepzxpeEZMXQbV92X2xvsp5m',\n> =\n | ({\n instructionType: TrustedOracleInstruction.Finalize;\n } & ParsedFinalizeInstruction<TProgram>)\n | ({\n instructionType: TrustedOracleInstruction.InitializeOracle;\n } & ParsedInitializeOracleInstruction<TProgram>);\n\nexport function parseTrustedOracleInstruction<TProgram extends string>(\n instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>,\n): ParsedTrustedOracleInstruction<TProgram> {\n const instructionType = identifyTrustedOracleInstruction(instruction);\n switch (instructionType) {\n case TrustedOracleInstruction.Finalize: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: TrustedOracleInstruction.Finalize,\n ...parseFinalizeInstruction(instruction),\n };\n }\n case TrustedOracleInstruction.InitializeOracle: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: TrustedOracleInstruction.InitializeOracle,\n ...parseInitializeOracleInstruction(instruction),\n };\n }\n default:\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,\n {\n instructionType: instructionType as string,\n programName: 'trustedOracle',\n },\n );\n }\n}\n\nexport type TrustedOraclePlugin = {\n accounts: TrustedOraclePluginAccounts;\n instructions: TrustedOraclePluginInstructions;\n};\n\nexport type TrustedOraclePluginAccounts = {\n oracleState: ReturnType<typeof getOracleStateCodec> &\n SelfFetchFunctions<OracleStateArgs, OracleState>;\n};\n\nexport type TrustedOraclePluginInstructions = {\n finalize: (\n input: FinalizeInput,\n ) => ReturnType<typeof getFinalizeInstruction> & SelfPlanAndSendFunctions;\n initializeOracle: (\n input: InitializeOracleInput,\n ) => ReturnType<typeof getInitializeOracleInstruction> &\n SelfPlanAndSendFunctions;\n};\n\nexport type TrustedOraclePluginRequirements = ClientWithRpc<\n GetAccountInfoApi & GetMultipleAccountsApi\n> &\n ClientWithTransactionPlanning &\n ClientWithTransactionSending;\n\nexport function trustedOracleProgram() {\n return <T extends TrustedOraclePluginRequirements>(client: T) => {\n return {\n ...client,\n trustedOracle: <TrustedOraclePlugin>{\n accounts: {\n oracleState: addSelfFetchFunctions(client, getOracleStateCodec()),\n },\n instructions: {\n finalize: (input) =>\n addSelfPlanAndSendFunctions(client, getFinalizeInstruction(input)),\n initializeOracle: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getInitializeOracleInstruction(input),\n ),\n },\n },\n };\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n isProgramError,\n type Address,\n type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM,\n type SolanaError,\n} from '@solana/kit';\nimport { TRUSTED_ORACLE_PROGRAM_ADDRESS } from '../programs';\n\n/** Unauthorized: Unauthorized: only oracle authority can perform this action */\nexport const TRUSTED_ORACLE_ERROR__UNAUTHORIZED = 0x1770; // 6000\n/** AlreadyFinalized: Oracle already finalized */\nexport const TRUSTED_ORACLE_ERROR__ALREADY_FINALIZED = 0x1771; // 6001\n/** NotFinalized: Oracle not finalized */\nexport const TRUSTED_ORACLE_ERROR__NOT_FINALIZED = 0x1772; // 6002\n/** InvalidWinningMint: Invalid winning mint */\nexport const TRUSTED_ORACLE_ERROR__INVALID_WINNING_MINT = 0x1773; // 6003\n\nexport type TrustedOracleError =\n | typeof TRUSTED_ORACLE_ERROR__ALREADY_FINALIZED\n | typeof TRUSTED_ORACLE_ERROR__INVALID_WINNING_MINT\n | typeof TRUSTED_ORACLE_ERROR__NOT_FINALIZED\n | typeof TRUSTED_ORACLE_ERROR__UNAUTHORIZED;\n\nlet trustedOracleErrorMessages: Record<TrustedOracleError, string> | undefined;\nif (process.env.NODE_ENV !== 'production') {\n trustedOracleErrorMessages = {\n [TRUSTED_ORACLE_ERROR__ALREADY_FINALIZED]: `Oracle already finalized`,\n [TRUSTED_ORACLE_ERROR__INVALID_WINNING_MINT]: `Invalid winning mint`,\n [TRUSTED_ORACLE_ERROR__NOT_FINALIZED]: `Oracle not finalized`,\n [TRUSTED_ORACLE_ERROR__UNAUTHORIZED]: `Unauthorized: only oracle authority can perform this action`,\n };\n}\n\nexport function getTrustedOracleErrorMessage(code: TrustedOracleError): string {\n if (process.env.NODE_ENV !== 'production') {\n return (trustedOracleErrorMessages as Record<TrustedOracleError, string>)[\n code\n ];\n }\n\n return 'Error message not available in production bundles.';\n}\n\nexport function isTrustedOracleError<\n TProgramErrorCode extends TrustedOracleError,\n>(\n error: unknown,\n transactionMessage: {\n instructions: Record<number, { programAddress: Address }>;\n },\n code?: TProgramErrorCode,\n): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> &\n Readonly<{ context: Readonly<{ code: TProgramErrorCode }> }> {\n return isProgramError<TProgramErrorCode>(\n error,\n transactionMessage,\n TRUSTED_ORACLE_PROGRAM_ADDRESS,\n code,\n );\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from '@solana/kit';\n\nexport type InitializeOracleArgs = {\n /** Nonce for PDA derivation (allows multiple oracles per authority) */\n nonce: bigint;\n /** Optional quote mint for validation (use Pubkey::default() if not needed) */\n quoteMint: Address;\n};\n\nexport type InitializeOracleArgsArgs = {\n /** Nonce for PDA derivation (allows multiple oracles per authority) */\n nonce: number | bigint;\n /** Optional quote mint for validation (use Pubkey::default() if not needed) */\n quoteMint: Address;\n};\n\nexport function getInitializeOracleArgsEncoder(): FixedSizeEncoder<InitializeOracleArgsArgs> {\n return getStructEncoder([\n ['nonce', getU64Encoder()],\n ['quoteMint', getAddressEncoder()],\n ]);\n}\n\nexport function getInitializeOracleArgsDecoder(): FixedSizeDecoder<InitializeOracleArgs> {\n return getStructDecoder([\n ['nonce', getU64Decoder()],\n ['quoteMint', getAddressDecoder()],\n ]);\n}\n\nexport function getInitializeOracleArgsCodec(): FixedSizeCodec<\n InitializeOracleArgsArgs,\n InitializeOracleArgs\n> {\n return combineCodec(\n getInitializeOracleArgsEncoder(),\n getInitializeOracleArgsDecoder(),\n );\n}\n","import {\n getProgramDerivedAddress,\n getAddressEncoder,\n type Address,\n type ProgramDerivedAddress,\n} from '@solana/kit';\nimport { TRUSTED_ORACLE_PROGRAM_ADDRESS } from '../generated/trustedOracle/programs/trustedOracle.js';\n\n/**\n * Derive the OracleState PDA address.\n * Seeds: [\"oracle\", oracleAuthority, nonce_le_u64]\n *\n * The nonce allows a single authority to create multiple independent oracles.\n * Use Date.now() or any unique u64 value.\n */\nexport async function getOracleStateAddress(\n oracleAuthority: Address,\n nonce: bigint,\n): Promise<ProgramDerivedAddress> {\n const nonceBytes = new Uint8Array(8);\n new DataView(nonceBytes.buffer).setBigUint64(0, nonce, true);\n\n return getProgramDerivedAddress({\n programAddress: TRUSTED_ORACLE_PROGRAM_ADDRESS,\n seeds: [\n new TextEncoder().encode('oracle'),\n getAddressEncoder().encode(oracleAuthority),\n nonceBytes,\n ],\n });\n}\n"]}
|