/** * 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, getU16Decoder, getU16Encoder, getU64Decoder, getU64Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; export type UpgradeState = { /** amount of resource needed */ needed: bigint; /** amount of resource deposited */ deposited: bigint; /** crew required to process a single unit of the upgrade resource */ crew: number; /** duration to process a single unit of the upgrade resource */ duration: number; }; export type UpgradeStateArgs = { /** amount of resource needed */ needed: number | bigint; /** amount of resource deposited */ deposited: number | bigint; /** crew required to process a single unit of the upgrade resource */ crew: number; /** duration to process a single unit of the upgrade resource */ duration: number; }; export function getUpgradeStateEncoder(): FixedSizeEncoder { return getStructEncoder([ ['needed', getU64Encoder()], ['deposited', getU64Encoder()], ['crew', getU16Encoder()], ['duration', getU16Encoder()], ]); } export function getUpgradeStateDecoder(): FixedSizeDecoder { return getStructDecoder([ ['needed', getU64Decoder()], ['deposited', getU64Decoder()], ['crew', getU16Decoder()], ['duration', getU16Decoder()], ]); } export function getUpgradeStateCodec(): FixedSizeCodec< UpgradeStateArgs, UpgradeState > { return combineCodec(getUpgradeStateEncoder(), getUpgradeStateDecoder()); }