/** * 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, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, type Codec, type Decoder, type Encoder, type Option, type OptionOrNullable, } from '@solana/kit'; import { getCargoCategoryIdDecoder, getCargoCategoryIdEncoder, getCargoIdDecoder, getCargoIdEncoder, getNameDecoder, getNameEncoder, type CargoCategoryId, type CargoCategoryIdArgs, type CargoId, type CargoIdArgs, type Name, type NameArgs, } from '.'; export type CargoTypeUpdate = { /** The id of this cargo type */ id: CargoId; /** The name of this cargo type */ name: Option; /** The storage cost of this cargo type */ storageCost: Option; /** The category id of this cargo type */ category: Option; /** The duration of a withdrawal epoch in seconds */ withdrawEpochDuration: Option; /** The max withdrawable amount each epoch */ circuitBreaker: Option; }; export type CargoTypeUpdateArgs = { /** The id of this cargo type */ id: CargoIdArgs; /** The name of this cargo type */ name: OptionOrNullable; /** The storage cost of this cargo type */ storageCost: OptionOrNullable; /** The category id of this cargo type */ category: OptionOrNullable; /** The duration of a withdrawal epoch in seconds */ withdrawEpochDuration: OptionOrNullable; /** The max withdrawable amount each epoch */ circuitBreaker: OptionOrNullable; }; export function getCargoTypeUpdateEncoder(): Encoder { return getStructEncoder([ ['id', getCargoIdEncoder()], ['name', getOptionEncoder(getNameEncoder())], ['storageCost', getOptionEncoder(getU32Encoder())], ['category', getOptionEncoder(getCargoCategoryIdEncoder())], ['withdrawEpochDuration', getOptionEncoder(getU32Encoder())], ['circuitBreaker', getOptionEncoder(getU64Encoder())], ]); } export function getCargoTypeUpdateDecoder(): Decoder { return getStructDecoder([ ['id', getCargoIdDecoder()], ['name', getOptionDecoder(getNameDecoder())], ['storageCost', getOptionDecoder(getU32Decoder())], ['category', getOptionDecoder(getCargoCategoryIdDecoder())], ['withdrawEpochDuration', getOptionDecoder(getU32Decoder())], ['circuitBreaker', getOptionDecoder(getU64Decoder())], ]); } export function getCargoTypeUpdateCodec(): Codec< CargoTypeUpdateArgs, CargoTypeUpdate > { return combineCodec(getCargoTypeUpdateEncoder(), getCargoTypeUpdateDecoder()); }