/** * 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, getU8Decoder, getU8Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from "@solana/kit"; export type SwapParameters2 = { /** When it's exact in, partial fill, this will be amount_in. When it's exact out, this will be amount_out */ amount0: bigint; /** When it's exact in, partial fill, this will be minimum_amount_out. When it's exact out, this will be maximum_amount_in */ amount1: bigint; /** Swap mode, refer [SwapMode] */ swapMode: number; }; export type SwapParameters2Args = { /** When it's exact in, partial fill, this will be amount_in. When it's exact out, this will be amount_out */ amount0: number | bigint; /** When it's exact in, partial fill, this will be minimum_amount_out. When it's exact out, this will be maximum_amount_in */ amount1: number | bigint; /** Swap mode, refer [SwapMode] */ swapMode: number; }; export function getSwapParameters2Encoder(): FixedSizeEncoder { return getStructEncoder([ ["amount0", getU64Encoder()], ["amount1", getU64Encoder()], ["swapMode", getU8Encoder()], ]); } export function getSwapParameters2Decoder(): FixedSizeDecoder { return getStructDecoder([ ["amount0", getU64Decoder()], ["amount1", getU64Decoder()], ["swapMode", getU8Decoder()], ]); } export function getSwapParameters2Codec(): FixedSizeCodec< SwapParameters2Args, SwapParameters2 > { return combineCodec(getSwapParameters2Encoder(), getSwapParameters2Decoder()); }