/** * This code was AUTOGENERATED using the Codama library. * Please DO NOT EDIT THIS FILE, instead use visitors * to add features, then rerun Codama to update it. * * @see https://github.com/codama-idl/codama */ import { combineCodec, getAddressDecoder, getAddressEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from "@solana/kit"; import { getFeeDecoder, getFeeEncoder, type Fee, type FeeArgs } from "."; export type LiqPool = { lpMint: Address; lpMintAuthorityBumpSeed: number; solLegBumpSeed: number; msolLegAuthorityBumpSeed: number; msolLeg: Address; /** Liquidity target. If the Liquidity reach this amount, the fee reaches lp_min_discount_fee */ lpLiquidityTarget: bigint; /** Liquidity pool max fee */ lpMaxFee: Fee; /** SOL/mSOL Liquidity pool min fee */ lpMinFee: Fee; /** Treasury cut */ treasuryCut: Fee; lpSupply: bigint; lentFromSolLeg: bigint; liquiditySolCap: bigint; }; export type LiqPoolArgs = { lpMint: Address; lpMintAuthorityBumpSeed: number; solLegBumpSeed: number; msolLegAuthorityBumpSeed: number; msolLeg: Address; /** Liquidity target. If the Liquidity reach this amount, the fee reaches lp_min_discount_fee */ lpLiquidityTarget: number | bigint; /** Liquidity pool max fee */ lpMaxFee: FeeArgs; /** SOL/mSOL Liquidity pool min fee */ lpMinFee: FeeArgs; /** Treasury cut */ treasuryCut: FeeArgs; lpSupply: number | bigint; lentFromSolLeg: number | bigint; liquiditySolCap: number | bigint; }; export function getLiqPoolEncoder(): FixedSizeEncoder { return getStructEncoder([ ["lpMint", getAddressEncoder()], ["lpMintAuthorityBumpSeed", getU8Encoder()], ["solLegBumpSeed", getU8Encoder()], ["msolLegAuthorityBumpSeed", getU8Encoder()], ["msolLeg", getAddressEncoder()], ["lpLiquidityTarget", getU64Encoder()], ["lpMaxFee", getFeeEncoder()], ["lpMinFee", getFeeEncoder()], ["treasuryCut", getFeeEncoder()], ["lpSupply", getU64Encoder()], ["lentFromSolLeg", getU64Encoder()], ["liquiditySolCap", getU64Encoder()], ]); } export function getLiqPoolDecoder(): FixedSizeDecoder { return getStructDecoder([ ["lpMint", getAddressDecoder()], ["lpMintAuthorityBumpSeed", getU8Decoder()], ["solLegBumpSeed", getU8Decoder()], ["msolLegAuthorityBumpSeed", getU8Decoder()], ["msolLeg", getAddressDecoder()], ["lpLiquidityTarget", getU64Decoder()], ["lpMaxFee", getFeeDecoder()], ["lpMinFee", getFeeDecoder()], ["treasuryCut", getFeeDecoder()], ["lpSupply", getU64Decoder()], ["lentFromSolLeg", getU64Decoder()], ["liquiditySolCap", getU64Decoder()], ]); } export function getLiqPoolCodec(): FixedSizeCodec { return combineCodec(getLiqPoolEncoder(), getLiqPoolDecoder()); }