/** * 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, getArrayDecoder, getArrayEncoder, getStructDecoder, getStructEncoder, getU128Decoder, getU128Encoder, getU16Decoder, getU16Encoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from "@solana/kit"; export type DynamicFeeStruct = { initialized: number; padding: Array; maxVolatilityAccumulator: number; variableFeeControl: number; binStep: number; filterPeriod: number; decayPeriod: number; reductionFactor: number; lastUpdateTimestamp: bigint; binStepU128: bigint; sqrtPriceReference: bigint; volatilityAccumulator: bigint; volatilityReference: bigint; }; export type DynamicFeeStructArgs = { initialized: number; padding: Array; maxVolatilityAccumulator: number; variableFeeControl: number; binStep: number; filterPeriod: number; decayPeriod: number; reductionFactor: number; lastUpdateTimestamp: number | bigint; binStepU128: number | bigint; sqrtPriceReference: number | bigint; volatilityAccumulator: number | bigint; volatilityReference: number | bigint; }; export function getDynamicFeeStructEncoder(): FixedSizeEncoder { return getStructEncoder([ ["initialized", getU8Encoder()], ["padding", getArrayEncoder(getU8Encoder(), { size: 7 })], ["maxVolatilityAccumulator", getU32Encoder()], ["variableFeeControl", getU32Encoder()], ["binStep", getU16Encoder()], ["filterPeriod", getU16Encoder()], ["decayPeriod", getU16Encoder()], ["reductionFactor", getU16Encoder()], ["lastUpdateTimestamp", getU64Encoder()], ["binStepU128", getU128Encoder()], ["sqrtPriceReference", getU128Encoder()], ["volatilityAccumulator", getU128Encoder()], ["volatilityReference", getU128Encoder()], ]); } export function getDynamicFeeStructDecoder(): FixedSizeDecoder { return getStructDecoder([ ["initialized", getU8Decoder()], ["padding", getArrayDecoder(getU8Decoder(), { size: 7 })], ["maxVolatilityAccumulator", getU32Decoder()], ["variableFeeControl", getU32Decoder()], ["binStep", getU16Decoder()], ["filterPeriod", getU16Decoder()], ["decayPeriod", getU16Decoder()], ["reductionFactor", getU16Decoder()], ["lastUpdateTimestamp", getU64Decoder()], ["binStepU128", getU128Decoder()], ["sqrtPriceReference", getU128Decoder()], ["volatilityAccumulator", getU128Decoder()], ["volatilityReference", getU128Decoder()], ]); } export function getDynamicFeeStructCodec(): FixedSizeCodec< DynamicFeeStructArgs, DynamicFeeStruct > { return combineCodec( getDynamicFeeStructEncoder(), getDynamicFeeStructDecoder(), ); }