/** * 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, getOptionDecoder, getOptionEncoder, getStructDecoder, getStructEncoder, type Codec, type Decoder, type Encoder, type Option, type OptionOrNullable, } from '@solana/kit'; import { getCargoIdDecoder, getCargoIdEncoder, type CargoId, type CargoIdArgs, } from '.'; export type ResourcesPartial = { /** ammunition */ ammo: Option; /** food */ food: Option; /** fuel */ fuel: Option; /** repair kit */ repairKit: Option; }; export type ResourcesPartialArgs = { /** ammunition */ ammo: OptionOrNullable; /** food */ food: OptionOrNullable; /** fuel */ fuel: OptionOrNullable; /** repair kit */ repairKit: OptionOrNullable; }; export function getResourcesPartialEncoder(): Encoder { return getStructEncoder([ ['ammo', getOptionEncoder(getCargoIdEncoder())], ['food', getOptionEncoder(getCargoIdEncoder())], ['fuel', getOptionEncoder(getCargoIdEncoder())], ['repairKit', getOptionEncoder(getCargoIdEncoder())], ]); } export function getResourcesPartialDecoder(): Decoder { return getStructDecoder([ ['ammo', getOptionDecoder(getCargoIdDecoder())], ['food', getOptionDecoder(getCargoIdDecoder())], ['fuel', getOptionDecoder(getCargoIdDecoder())], ['repairKit', getOptionDecoder(getCargoIdDecoder())], ]); } export function getResourcesPartialCodec(): Codec< ResourcesPartialArgs, ResourcesPartial > { return combineCodec( getResourcesPartialEncoder(), getResourcesPartialDecoder(), ); }