/** * 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, getBooleanDecoder, getBooleanEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from "@solana/kit"; import { getSwapParameters2Decoder, getSwapParameters2Encoder, getSwapResult2Decoder, getSwapResult2Encoder, type SwapParameters2, type SwapParameters2Args, type SwapResult2, type SwapResult2Args, } from "./index.js"; export type EvtSwap2 = { pool: Address; tradeDirection: number; collectFeeMode: number; hasReferral: boolean; params: SwapParameters2; swapResult: SwapResult2; includedTransferFeeAmountIn: bigint; includedTransferFeeAmountOut: bigint; excludedTransferFeeAmountOut: bigint; currentTimestamp: bigint; reserveAAmount: bigint; reserveBAmount: bigint; }; export type EvtSwap2Args = { pool: Address; tradeDirection: number; collectFeeMode: number; hasReferral: boolean; params: SwapParameters2Args; swapResult: SwapResult2Args; includedTransferFeeAmountIn: number | bigint; includedTransferFeeAmountOut: number | bigint; excludedTransferFeeAmountOut: number | bigint; currentTimestamp: number | bigint; reserveAAmount: number | bigint; reserveBAmount: number | bigint; }; export function getEvtSwap2Encoder(): FixedSizeEncoder { return getStructEncoder([ ["pool", getAddressEncoder()], ["tradeDirection", getU8Encoder()], ["collectFeeMode", getU8Encoder()], ["hasReferral", getBooleanEncoder()], ["params", getSwapParameters2Encoder()], ["swapResult", getSwapResult2Encoder()], ["includedTransferFeeAmountIn", getU64Encoder()], ["includedTransferFeeAmountOut", getU64Encoder()], ["excludedTransferFeeAmountOut", getU64Encoder()], ["currentTimestamp", getU64Encoder()], ["reserveAAmount", getU64Encoder()], ["reserveBAmount", getU64Encoder()], ]); } export function getEvtSwap2Decoder(): FixedSizeDecoder { return getStructDecoder([ ["pool", getAddressDecoder()], ["tradeDirection", getU8Decoder()], ["collectFeeMode", getU8Decoder()], ["hasReferral", getBooleanDecoder()], ["params", getSwapParameters2Decoder()], ["swapResult", getSwapResult2Decoder()], ["includedTransferFeeAmountIn", getU64Decoder()], ["includedTransferFeeAmountOut", getU64Decoder()], ["excludedTransferFeeAmountOut", getU64Decoder()], ["currentTimestamp", getU64Decoder()], ["reserveAAmount", getU64Decoder()], ["reserveBAmount", getU64Decoder()], ]); } export function getEvtSwap2Codec(): FixedSizeCodec { return combineCodec(getEvtSwap2Encoder(), getEvtSwap2Decoder()); }