/** * 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, getStructDecoder, getStructEncoder, getTupleDecoder, getTupleEncoder, getU64Decoder, getU64Encoder, type Codec, type Decoder, type Encoder, } 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 CreateRecipeInputData = { recipeId: RecipeId; duration: bigint; minDuration: bigint; name: Name; feeAmount: bigint; feeRecipient: RecipeFeeRecipient; usageLimit: bigint; minStarbaseLevel: StarbaseLevel; value: U32F32; craftingEfficiencyMinmax: MinMax; craftingSpeedMinmax: MinMax; craftingCrewCountMinmax: MinMax; craftingFeeMinmax: MinMax; habRequired: boolean; researchRequirements: Array; inputs: Array; outputs: Array; }; export type CreateRecipeInputDataArgs = { recipeId: RecipeIdArgs; duration: number | bigint; minDuration: number | bigint; name: NameArgs; feeAmount: number | bigint; feeRecipient: RecipeFeeRecipientArgs; usageLimit: number | bigint; minStarbaseLevel: StarbaseLevelArgs; value: U32F32Args; craftingEfficiencyMinmax: MinMaxArgs; craftingSpeedMinmax: MinMaxArgs; craftingCrewCountMinmax: MinMaxArgs; craftingFeeMinmax: MinMaxArgs; habRequired: boolean; researchRequirements: Array; inputs: Array; outputs: Array; }; export function getCreateRecipeInputDataEncoder(): Encoder { return getStructEncoder([ ['recipeId', getRecipeIdEncoder()], ['duration', getU64Encoder()], ['minDuration', getU64Encoder()], ['name', getNameEncoder()], ['feeAmount', getU64Encoder()], ['feeRecipient', getRecipeFeeRecipientEncoder()], ['usageLimit', getU64Encoder()], ['minStarbaseLevel', getStarbaseLevelEncoder()], ['value', getU32F32Encoder()], ['craftingEfficiencyMinmax', getMinMaxEncoder()], ['craftingSpeedMinmax', getMinMaxEncoder()], ['craftingCrewCountMinmax', getMinMaxEncoder()], ['craftingFeeMinmax', getMinMaxEncoder()], ['habRequired', getBooleanEncoder()], ['researchRequirements', getArrayEncoder(getResearchTagEncoder())], [ 'inputs', getArrayEncoder(getTupleEncoder([getCargoIdEncoder(), getU64Encoder()])), ], [ 'outputs', getArrayEncoder(getTupleEncoder([getCargoIdEncoder(), getU64Encoder()])), ], ]); } export function getCreateRecipeInputDataDecoder(): Decoder { return getStructDecoder([ ['recipeId', getRecipeIdDecoder()], ['duration', getU64Decoder()], ['minDuration', getU64Decoder()], ['name', getNameDecoder()], ['feeAmount', getU64Decoder()], ['feeRecipient', getRecipeFeeRecipientDecoder()], ['usageLimit', getU64Decoder()], ['minStarbaseLevel', getStarbaseLevelDecoder()], ['value', getU32F32Decoder()], ['craftingEfficiencyMinmax', getMinMaxDecoder()], ['craftingSpeedMinmax', getMinMaxDecoder()], ['craftingCrewCountMinmax', getMinMaxDecoder()], ['craftingFeeMinmax', getMinMaxDecoder()], ['habRequired', getBooleanDecoder()], ['researchRequirements', getArrayDecoder(getResearchTagDecoder())], [ 'inputs', getArrayDecoder(getTupleDecoder([getCargoIdDecoder(), getU64Decoder()])), ], [ 'outputs', getArrayDecoder(getTupleDecoder([getCargoIdDecoder(), getU64Decoder()])), ], ]); } export function getCreateRecipeInputDataCodec(): Codec< CreateRecipeInputDataArgs, CreateRecipeInputData > { return combineCodec( getCreateRecipeInputDataEncoder(), getCreateRecipeInputDataDecoder(), ); }