/** * 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 { getSwapParametersDecoder, getSwapParametersEncoder, getSwapResultDecoder, getSwapResultEncoder, type SwapParameters, type SwapParametersArgs, type SwapResult, type SwapResultArgs, } from "./index.js"; export type EvtSwap = { pool: Address; tradeDirection: number; hasReferral: boolean; params: SwapParameters; swapResult: SwapResult; actualAmountIn: bigint; currentTimestamp: bigint; }; export type EvtSwapArgs = { pool: Address; tradeDirection: number; hasReferral: boolean; params: SwapParametersArgs; swapResult: SwapResultArgs; actualAmountIn: number | bigint; currentTimestamp: number | bigint; }; export function getEvtSwapEncoder(): FixedSizeEncoder { return getStructEncoder([ ["pool", getAddressEncoder()], ["tradeDirection", getU8Encoder()], ["hasReferral", getBooleanEncoder()], ["params", getSwapParametersEncoder()], ["swapResult", getSwapResultEncoder()], ["actualAmountIn", getU64Encoder()], ["currentTimestamp", getU64Encoder()], ]); } export function getEvtSwapDecoder(): FixedSizeDecoder { return getStructDecoder([ ["pool", getAddressDecoder()], ["tradeDirection", getU8Decoder()], ["hasReferral", getBooleanDecoder()], ["params", getSwapParametersDecoder()], ["swapResult", getSwapResultDecoder()], ["actualAmountIn", getU64Decoder()], ["currentTimestamp", getU64Decoder()], ]); } export function getEvtSwapCodec(): FixedSizeCodec { return combineCodec(getEvtSwapEncoder(), getEvtSwapDecoder()); }