/** * 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, getU128Decoder, getU128Encoder, getU64Decoder, getU64Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from "@solana/kit"; /** Encodes all results of swapping */ export type SwapResult = { outputAmount: bigint; nextSqrtPrice: bigint; lpFee: bigint; protocolFee: bigint; partnerFee: bigint; referralFee: bigint; }; export type SwapResultArgs = { outputAmount: number | bigint; nextSqrtPrice: number | bigint; lpFee: number | bigint; protocolFee: number | bigint; partnerFee: number | bigint; referralFee: number | bigint; }; export function getSwapResultEncoder(): FixedSizeEncoder { return getStructEncoder([ ["outputAmount", getU64Encoder()], ["nextSqrtPrice", getU128Encoder()], ["lpFee", getU64Encoder()], ["protocolFee", getU64Encoder()], ["partnerFee", getU64Encoder()], ["referralFee", getU64Encoder()], ]); } export function getSwapResultDecoder(): FixedSizeDecoder { return getStructDecoder([ ["outputAmount", getU64Decoder()], ["nextSqrtPrice", getU128Decoder()], ["lpFee", getU64Decoder()], ["protocolFee", getU64Decoder()], ["partnerFee", getU64Decoder()], ["referralFee", getU64Decoder()], ]); } export function getSwapResultCodec(): FixedSizeCodec< SwapResultArgs, SwapResult > { return combineCodec(getSwapResultEncoder(), getSwapResultDecoder()); }