/** * 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, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from "@solana/kit"; export type PricingParams = { tradeSpreadLong: bigint; tradeSpreadShort: bigint; swapSpread: bigint; maxLeverage: bigint; maxGlobalLongSizes: bigint; maxGlobalShortSizes: bigint; }; export type PricingParamsArgs = { tradeSpreadLong: number | bigint; tradeSpreadShort: number | bigint; swapSpread: number | bigint; maxLeverage: number | bigint; maxGlobalLongSizes: number | bigint; maxGlobalShortSizes: number | bigint; }; export function getPricingParamsEncoder(): FixedSizeEncoder { return getStructEncoder([ ["tradeSpreadLong", getU64Encoder()], ["tradeSpreadShort", getU64Encoder()], ["swapSpread", getU64Encoder()], ["maxLeverage", getU64Encoder()], ["maxGlobalLongSizes", getU64Encoder()], ["maxGlobalShortSizes", getU64Encoder()], ]); } export function getPricingParamsDecoder(): FixedSizeDecoder { return getStructDecoder([ ["tradeSpreadLong", getU64Decoder()], ["tradeSpreadShort", getU64Decoder()], ["swapSpread", getU64Decoder()], ["maxLeverage", getU64Decoder()], ["maxGlobalLongSizes", getU64Decoder()], ["maxGlobalShortSizes", getU64Decoder()], ]); } export function getPricingParamsCodec(): FixedSizeCodec< PricingParamsArgs, PricingParams > { return combineCodec(getPricingParamsEncoder(), getPricingParamsDecoder()); }