/** * 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, getBooleanDecoder, getBooleanEncoder, getOptionDecoder, getOptionEncoder, getStructDecoder, getStructEncoder, getU128Decoder, getU128Encoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, type Codec, type Decoder, type Encoder, type Option, type OptionOrNullable, } from "@solana/kit"; import { getPoolFeeParametersDecoder, getPoolFeeParametersEncoder, type PoolFeeParameters, type PoolFeeParametersArgs, } from "./index.js"; export type InitializeCustomizablePoolParameters = { /** pool fees */ poolFees: PoolFeeParameters; /** sqrt min price */ sqrtMinPrice: bigint; /** sqrt max price */ sqrtMaxPrice: bigint; /** has alpha vault */ hasAlphaVault: boolean; /** initialize liquidity */ liquidity: bigint; /** The init price of the pool as a sqrt(token_b/token_a) Q64.64 value */ sqrtPrice: bigint; /** activation type */ activationType: number; /** collect fee mode */ collectFeeMode: number; /** activation point */ activationPoint: Option; }; export type InitializeCustomizablePoolParametersArgs = { /** pool fees */ poolFees: PoolFeeParametersArgs; /** sqrt min price */ sqrtMinPrice: number | bigint; /** sqrt max price */ sqrtMaxPrice: number | bigint; /** has alpha vault */ hasAlphaVault: boolean; /** initialize liquidity */ liquidity: number | bigint; /** The init price of the pool as a sqrt(token_b/token_a) Q64.64 value */ sqrtPrice: number | bigint; /** activation type */ activationType: number; /** collect fee mode */ collectFeeMode: number; /** activation point */ activationPoint: OptionOrNullable; }; export function getInitializeCustomizablePoolParametersEncoder(): Encoder { return getStructEncoder([ ["poolFees", getPoolFeeParametersEncoder()], ["sqrtMinPrice", getU128Encoder()], ["sqrtMaxPrice", getU128Encoder()], ["hasAlphaVault", getBooleanEncoder()], ["liquidity", getU128Encoder()], ["sqrtPrice", getU128Encoder()], ["activationType", getU8Encoder()], ["collectFeeMode", getU8Encoder()], ["activationPoint", getOptionEncoder(getU64Encoder())], ]); } export function getInitializeCustomizablePoolParametersDecoder(): Decoder { return getStructDecoder([ ["poolFees", getPoolFeeParametersDecoder()], ["sqrtMinPrice", getU128Decoder()], ["sqrtMaxPrice", getU128Decoder()], ["hasAlphaVault", getBooleanDecoder()], ["liquidity", getU128Decoder()], ["sqrtPrice", getU128Decoder()], ["activationType", getU8Decoder()], ["collectFeeMode", getU8Decoder()], ["activationPoint", getOptionDecoder(getU64Decoder())], ]); } export function getInitializeCustomizablePoolParametersCodec(): Codec< InitializeCustomizablePoolParametersArgs, InitializeCustomizablePoolParameters > { return combineCodec( getInitializeCustomizablePoolParametersEncoder(), getInitializeCustomizablePoolParametersDecoder(), ); }