/** * 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, getU32Decoder, getU32Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; /** Ship counts for a fleet. */ export type ShipCounts = { /** The total number of ships in the fleet. */ total: number; /** The number of xx small ships in the fleet. */ xxSmall: number; /** The number of x small ships in the fleet. */ xSmall: number; /** The number of small ships in the fleet. */ small: number; /** The number of medium ships in the fleet. */ medium: number; /** The number of large ships in the fleet. */ large: number; /** The number of capital ships in the fleet. */ capital: number; /** The number of commander ships in the fleet. */ commander: number; /** The number of titan ships in the fleet. */ titan: number; }; export type ShipCountsArgs = ShipCounts; export function getShipCountsEncoder(): FixedSizeEncoder { return getStructEncoder([ ['total', getU32Encoder()], ['xxSmall', getU16Encoder()], ['xSmall', getU16Encoder()], ['small', getU16Encoder()], ['medium', getU16Encoder()], ['large', getU16Encoder()], ['capital', getU16Encoder()], ['commander', getU16Encoder()], ['titan', getU16Encoder()], ]); } export function getShipCountsDecoder(): FixedSizeDecoder { return getStructDecoder([ ['total', getU32Decoder()], ['xxSmall', getU16Decoder()], ['xSmall', getU16Decoder()], ['small', getU16Decoder()], ['medium', getU16Decoder()], ['large', getU16Decoder()], ['capital', getU16Decoder()], ['commander', getU16Decoder()], ['titan', getU16Decoder()], ]); } export function getShipCountsCodec(): FixedSizeCodec< ShipCountsArgs, ShipCounts > { return combineCodec(getShipCountsEncoder(), getShipCountsDecoder()); }