/** * 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, getU64Decoder, getU64Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; export type CargoTypeCache = { /** The current withdrawal epoch */ currentEpoch: bigint; /** The total amount withdrawn since last reset */ totalWithdrawn: bigint; }; export type CargoTypeCacheArgs = { /** The current withdrawal epoch */ currentEpoch: number | bigint; /** The total amount withdrawn since last reset */ totalWithdrawn: number | bigint; }; export function getCargoTypeCacheEncoder(): FixedSizeEncoder { return getStructEncoder([ ['currentEpoch', getU64Encoder()], ['totalWithdrawn', getU64Encoder()], ]); } export function getCargoTypeCacheDecoder(): FixedSizeDecoder { return getStructDecoder([ ['currentEpoch', getU64Decoder()], ['totalWithdrawn', getU64Decoder()], ]); } export function getCargoTypeCacheCodec(): FixedSizeCodec< CargoTypeCacheArgs, CargoTypeCache > { return combineCodec(getCargoTypeCacheEncoder(), getCargoTypeCacheDecoder()); }