/** * 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, getAddressDecoder, getAddressEncoder, getArrayDecoder, getArrayEncoder, getStructDecoder, getStructEncoder, type Address, type Codec, type Decoder, type Encoder, } from '@solana/kit'; import { getCargoIdDecoder, getCargoIdEncoder, type CargoId, type CargoIdArgs, } from '.'; import { getU16F16Decoder, getU16F16Encoder, type U16F16, type U16F16Args, } from '../../fixed/codecs'; export type MineAsteroid = { /** The `Asteroid` the `Fleet` is mining */ asteroid: Address; /** The XP modifier for the region the `Fleet` is mining in */ regionXpModifier: U16F16; /** Canonical ascending list of selected resource ids. */ resources: Array; }; export type MineAsteroidArgs = { /** The `Asteroid` the `Fleet` is mining */ asteroid: Address; /** The XP modifier for the region the `Fleet` is mining in */ regionXpModifier: U16F16Args; /** Canonical ascending list of selected resource ids. */ resources: Array; }; export function getMineAsteroidEncoder(): Encoder { return getStructEncoder([ ['asteroid', getAddressEncoder()], ['regionXpModifier', getU16F16Encoder()], ['resources', getArrayEncoder(getCargoIdEncoder())], ]); } export function getMineAsteroidDecoder(): Decoder { return getStructDecoder([ ['asteroid', getAddressDecoder()], ['regionXpModifier', getU16F16Decoder()], ['resources', getArrayDecoder(getCargoIdDecoder())], ]); } export function getMineAsteroidCodec(): Codec { return combineCodec(getMineAsteroidEncoder(), getMineAsteroidDecoder()); }