/** * 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, type Codec, type Decoder, type Encoder, type Option, type OptionOrNullable, } from '@solana/kit'; import { getConnectionCostDecoder, getConnectionCostEncoder, getNameDecoder, getNameEncoder, getRegionIdDecoder, getRegionIdEncoder, getSystemIdDecoder, getSystemIdEncoder, type ConnectionCost, type ConnectionCostArgs, type Name, type NameArgs, type RegionId, type RegionIdArgs, type SystemId, type SystemIdArgs, } from '.'; import { getI8F56Decoder, getI8F56Encoder, type I8F56, type I8F56Args, } from '../../fixed/codecs'; export type UpdateStarSystemArgs = { /** New spatial coordinates for the star system [x, y] */ coordinates: Option>; /** New name for the star system (fixed length array) */ name: Option; /** If some sets the optional region of the system and the core status. */ regionId: Option>; /** New list of connections for this system */ connections: Option>; }; export type UpdateStarSystemArgsArgs = { /** New spatial coordinates for the star system [x, y] */ coordinates: OptionOrNullable>; /** New name for the star system (fixed length array) */ name: OptionOrNullable; /** If some sets the optional region of the system and the core status. */ regionId: OptionOrNullable< OptionOrNullable >; /** New list of connections for this system */ connections: OptionOrNullable< Array >; }; export function getUpdateStarSystemArgsEncoder(): Encoder { return getStructEncoder([ [ 'coordinates', getOptionEncoder(getArrayEncoder(getI8F56Encoder(), { size: 2 })), ], ['name', getOptionEncoder(getNameEncoder())], [ 'regionId', getOptionEncoder( getOptionEncoder( getTupleEncoder([getRegionIdEncoder(), getBooleanEncoder()]), ), ), ], [ 'connections', getOptionEncoder( getArrayEncoder( getTupleEncoder([getSystemIdEncoder(), getConnectionCostEncoder()]), ), ), ], ]); } export function getUpdateStarSystemArgsDecoder(): Decoder { return getStructDecoder([ [ 'coordinates', getOptionDecoder(getArrayDecoder(getI8F56Decoder(), { size: 2 })), ], ['name', getOptionDecoder(getNameDecoder())], [ 'regionId', getOptionDecoder( getOptionDecoder( getTupleDecoder([getRegionIdDecoder(), getBooleanDecoder()]), ), ), ], [ 'connections', getOptionDecoder( getArrayDecoder( getTupleDecoder([getSystemIdDecoder(), getConnectionCostDecoder()]), ), ), ], ]); } export function getUpdateStarSystemArgsCodec(): Codec< UpdateStarSystemArgsArgs, UpdateStarSystemArgs > { return combineCodec( getUpdateStarSystemArgsEncoder(), getUpdateStarSystemArgsDecoder(), ); }