/** * 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, getI32Decoder, getI32Encoder, getStructDecoder, getStructEncoder, getU16Decoder, getU16Encoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, } from '@solana/kit'; /** A ship's miscellaneous stats */ export type MiscStats = { /** Number of crew required to operate the ship */ requiredCrew: number; /** Number of crew that the ship can carry as passengers */ passengerCapacity: number; /** the time it takes the ship to respawn without paying a respawn fee */ respawnTimeWithoutFee: number; /** the time it takes the ship to respawn after paying a respawn fee */ respawnTimeWithFee: number; /** * Recovery fee (canonical terminology; formerly `respawn_fee`), charged in ATLAS * Since ATLAS has 8 decimal places, units are in the smallest value of ATLAS possible. */ recoveryFee: bigint; /** the time it takes the ship to be able to scan again after scanning */ scanCoolDown: number; /** The power of the ship's scanner, multiplies scan results */ scanPower: number; /** the amount of resource required to do a scan */ scanCost: number; /** Added bonus or penalty to the scan results */ scanBonus: number; /** the LP value of the ship */ lpValue: number; /** the medallion accounting value of the ship */ medallionValue: number; /** * The XP value of the ship * TODO: Units should be XP */ xpValue: number; }; export type MiscStatsArgs = { /** Number of crew required to operate the ship */ requiredCrew: number; /** Number of crew that the ship can carry as passengers */ passengerCapacity: number; /** the time it takes the ship to respawn without paying a respawn fee */ respawnTimeWithoutFee: number; /** the time it takes the ship to respawn after paying a respawn fee */ respawnTimeWithFee: number; /** * Recovery fee (canonical terminology; formerly `respawn_fee`), charged in ATLAS * Since ATLAS has 8 decimal places, units are in the smallest value of ATLAS possible. */ recoveryFee: number | bigint; /** the time it takes the ship to be able to scan again after scanning */ scanCoolDown: number; /** The power of the ship's scanner, multiplies scan results */ scanPower: number; /** the amount of resource required to do a scan */ scanCost: number; /** Added bonus or penalty to the scan results */ scanBonus: number; /** the LP value of the ship */ lpValue: number; /** the medallion accounting value of the ship */ medallionValue: number; /** * The XP value of the ship * TODO: Units should be XP */ xpValue: number; }; export function getMiscStatsEncoder(): FixedSizeEncoder { return getStructEncoder([ ['requiredCrew', getU16Encoder()], ['passengerCapacity', getU16Encoder()], ['respawnTimeWithoutFee', getU16Encoder()], ['respawnTimeWithFee', getU16Encoder()], ['recoveryFee', getU64Encoder()], ['scanCoolDown', getU32Encoder()], ['scanPower', getU32Encoder()], ['scanCost', getU32Encoder()], ['scanBonus', getI32Encoder()], ['lpValue', getU32Encoder()], ['medallionValue', getU32Encoder()], ['xpValue', getU32Encoder()], ]); } export function getMiscStatsDecoder(): FixedSizeDecoder { return getStructDecoder([ ['requiredCrew', getU16Decoder()], ['passengerCapacity', getU16Decoder()], ['respawnTimeWithoutFee', getU16Decoder()], ['respawnTimeWithFee', getU16Decoder()], ['recoveryFee', getU64Decoder()], ['scanCoolDown', getU32Decoder()], ['scanPower', getU32Decoder()], ['scanCost', getU32Decoder()], ['scanBonus', getI32Decoder()], ['lpValue', getU32Decoder()], ['medallionValue', getU32Decoder()], ['xpValue', getU32Decoder()], ]); } export function getMiscStatsCodec(): FixedSizeCodec { return combineCodec(getMiscStatsEncoder(), getMiscStatsDecoder()); }