/** * 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, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, getU128Decoder, getU128Encoder, getU64Decoder, getU64Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from "@solana/kit"; export type FundingRateState = { cumulativeInterestRate: bigint; lastUpdate: bigint; hourlyFundingBps: bigint; }; export type FundingRateStateArgs = { cumulativeInterestRate: number | bigint; lastUpdate: number | bigint; hourlyFundingBps: number | bigint; }; export function getFundingRateStateEncoder(): FixedSizeEncoder { return getStructEncoder([ ["cumulativeInterestRate", getU128Encoder()], ["lastUpdate", getI64Encoder()], ["hourlyFundingBps", getU64Encoder()], ]); } export function getFundingRateStateDecoder(): FixedSizeDecoder { return getStructDecoder([ ["cumulativeInterestRate", getU128Decoder()], ["lastUpdate", getI64Decoder()], ["hourlyFundingBps", getU64Decoder()], ]); } export function getFundingRateStateCodec(): FixedSizeCodec< FundingRateStateArgs, FundingRateState > { return combineCodec( getFundingRateStateEncoder(), getFundingRateStateDecoder(), ); }