/** * 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, getBooleanDecoder, getBooleanEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from "@solana/kit"; export type DecreasePositionInfo = { price: bigint; liquidationPrice: bigint; feeUsd: bigint; collateralUsd: bigint; hasProfit: boolean; pnlDelta: bigint; transferAmountUsd: bigint; transferToken: bigint; }; export type DecreasePositionInfoArgs = { price: number | bigint; liquidationPrice: number | bigint; feeUsd: number | bigint; collateralUsd: number | bigint; hasProfit: boolean; pnlDelta: number | bigint; transferAmountUsd: number | bigint; transferToken: number | bigint; }; export function getDecreasePositionInfoEncoder(): FixedSizeEncoder { return getStructEncoder([ ["price", getU64Encoder()], ["liquidationPrice", getU64Encoder()], ["feeUsd", getU64Encoder()], ["collateralUsd", getU64Encoder()], ["hasProfit", getBooleanEncoder()], ["pnlDelta", getU64Encoder()], ["transferAmountUsd", getU64Encoder()], ["transferToken", getU64Encoder()], ]); } export function getDecreasePositionInfoDecoder(): FixedSizeDecoder { return getStructDecoder([ ["price", getU64Decoder()], ["liquidationPrice", getU64Decoder()], ["feeUsd", getU64Decoder()], ["collateralUsd", getU64Decoder()], ["hasProfit", getBooleanDecoder()], ["pnlDelta", getU64Decoder()], ["transferAmountUsd", getU64Decoder()], ["transferToken", getU64Decoder()], ]); } export function getDecreasePositionInfoCodec(): FixedSizeCodec< DecreasePositionInfoArgs, DecreasePositionInfo > { return combineCodec( getDecreasePositionInfoEncoder(), getDecreasePositionInfoDecoder(), ); }