/** * 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, getMapDecoder, getMapEncoder, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, type Codec, type Decoder, type Encoder, } from '@solana/kit'; import { getCargoIdDecoder, getCargoIdEncoder, getStimulantDefinitionDecoder, getStimulantDefinitionEncoder, type CargoId, type CargoIdArgs, type StimulantDefinition, type StimulantDefinitionArgs, } from '.'; export type StimulantDefinitions = { seqId: number; definitions: Map; }; export type StimulantDefinitionsArgs = { seqId: number; definitions: Map; }; export function getStimulantDefinitionsEncoder(): Encoder { return getStructEncoder([ ['seqId', getU32Encoder()], [ 'definitions', getMapEncoder(getCargoIdEncoder(), getStimulantDefinitionEncoder()), ], ]); } export function getStimulantDefinitionsDecoder(): Decoder { return getStructDecoder([ ['seqId', getU32Decoder()], [ 'definitions', getMapDecoder(getCargoIdDecoder(), getStimulantDefinitionDecoder()), ], ]); } export function getStimulantDefinitionsCodec(): Codec< StimulantDefinitionsArgs, StimulantDefinitions > { return combineCodec( getStimulantDefinitionsEncoder(), getStimulantDefinitionsDecoder(), ); }