/** * 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, getArrayDecoder, getArrayEncoder, getBooleanDecoder, getBooleanEncoder, getOptionDecoder, getOptionEncoder, getStructDecoder, getStructEncoder, getTupleDecoder, getTupleEncoder, getU64Decoder, getU64Encoder, type Codec, type Decoder, type Encoder, type Option, type OptionOrNullable, } from '@solana/kit'; import { getCargoIdDecoder, getCargoIdEncoder, getMinMaxDecoder, getMinMaxEncoder, getNameDecoder, getNameEncoder, getRecipeFeeRecipientDecoder, getRecipeFeeRecipientEncoder, getRecipeIdDecoder, getRecipeIdEncoder, getResearchTagDecoder, getResearchTagEncoder, getStarbaseLevelDecoder, getStarbaseLevelEncoder, type CargoId, type CargoIdArgs, type MinMax, type MinMaxArgs, type Name, type NameArgs, type RecipeFeeRecipient, type RecipeFeeRecipientArgs, type RecipeId, type RecipeIdArgs, type ResearchTag, type ResearchTagArgs, type StarbaseLevel, type StarbaseLevelArgs, } from '.'; import { getU32F32Decoder, getU32F32Encoder, type U32F32, type U32F32Args, } from '../../fixed/codecs'; export type UpdateRecipeInputData = { recipeId: Option; duration: Option; minDuration: Option; name: Option; feeAmount: Option; feeRecipient: Option; usageLimit: Option; minStarbaseLevel: Option; value: U32F32; craftingEfficiencyMinmax: MinMax; craftingSpeedMinmax: MinMax; craftingCrewCountMinmax: MinMax; craftingFeeMinmax: MinMax; habRequired: Option; researchRequirements: Option>; inputs: Option>; outputs: Option>; }; export type UpdateRecipeInputDataArgs = { recipeId: OptionOrNullable; duration: OptionOrNullable; minDuration: OptionOrNullable; name: OptionOrNullable; feeAmount: OptionOrNullable; feeRecipient: OptionOrNullable; usageLimit: OptionOrNullable; minStarbaseLevel: OptionOrNullable; value: U32F32Args; craftingEfficiencyMinmax: MinMaxArgs; craftingSpeedMinmax: MinMaxArgs; craftingCrewCountMinmax: MinMaxArgs; craftingFeeMinmax: MinMaxArgs; habRequired: OptionOrNullable; researchRequirements: OptionOrNullable>; inputs: OptionOrNullable>; outputs: OptionOrNullable>; }; export function getUpdateRecipeInputDataEncoder(): Encoder { return getStructEncoder([ ['recipeId', getOptionEncoder(getRecipeIdEncoder())], ['duration', getOptionEncoder(getU64Encoder())], ['minDuration', getOptionEncoder(getU64Encoder())], ['name', getOptionEncoder(getNameEncoder())], ['feeAmount', getOptionEncoder(getU64Encoder())], ['feeRecipient', getOptionEncoder(getRecipeFeeRecipientEncoder())], ['usageLimit', getOptionEncoder(getU64Encoder())], ['minStarbaseLevel', getOptionEncoder(getStarbaseLevelEncoder())], ['value', getU32F32Encoder()], ['craftingEfficiencyMinmax', getMinMaxEncoder()], ['craftingSpeedMinmax', getMinMaxEncoder()], ['craftingCrewCountMinmax', getMinMaxEncoder()], ['craftingFeeMinmax', getMinMaxEncoder()], ['habRequired', getOptionEncoder(getBooleanEncoder())], [ 'researchRequirements', getOptionEncoder(getArrayEncoder(getResearchTagEncoder())), ], [ 'inputs', getOptionEncoder( getArrayEncoder( getTupleEncoder([getCargoIdEncoder(), getU64Encoder()]), ), ), ], [ 'outputs', getOptionEncoder( getArrayEncoder( getTupleEncoder([getCargoIdEncoder(), getU64Encoder()]), ), ), ], ]); } export function getUpdateRecipeInputDataDecoder(): Decoder { return getStructDecoder([ ['recipeId', getOptionDecoder(getRecipeIdDecoder())], ['duration', getOptionDecoder(getU64Decoder())], ['minDuration', getOptionDecoder(getU64Decoder())], ['name', getOptionDecoder(getNameDecoder())], ['feeAmount', getOptionDecoder(getU64Decoder())], ['feeRecipient', getOptionDecoder(getRecipeFeeRecipientDecoder())], ['usageLimit', getOptionDecoder(getU64Decoder())], ['minStarbaseLevel', getOptionDecoder(getStarbaseLevelDecoder())], ['value', getU32F32Decoder()], ['craftingEfficiencyMinmax', getMinMaxDecoder()], ['craftingSpeedMinmax', getMinMaxDecoder()], ['craftingCrewCountMinmax', getMinMaxDecoder()], ['craftingFeeMinmax', getMinMaxDecoder()], ['habRequired', getOptionDecoder(getBooleanDecoder())], [ 'researchRequirements', getOptionDecoder(getArrayDecoder(getResearchTagDecoder())), ], [ 'inputs', getOptionDecoder( getArrayDecoder( getTupleDecoder([getCargoIdDecoder(), getU64Decoder()]), ), ), ], [ 'outputs', getOptionDecoder( getArrayDecoder( getTupleDecoder([getCargoIdDecoder(), getU64Decoder()]), ), ), ], ]); } export function getUpdateRecipeInputDataCodec(): Codec< UpdateRecipeInputDataArgs, UpdateRecipeInputData > { return combineCodec( getUpdateRecipeInputDataEncoder(), getUpdateRecipeInputDataDecoder(), ); }