/** * 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, getStructDecoder, getStructEncoder, type Codec, type Decoder, type Encoder, } from '@solana/kit'; import { getI8F56Decoder, getI8F56Encoder, type I8F56, type I8F56Args, } from '../../fixed/codecs'; /** * Axis-Aligned Bounding Box * Meant to store spatial hints for regions to allow cheaper coordinate lookups */ export type BoundingBox = { minX: I8F56; maxX: I8F56; minY: I8F56; maxY: I8F56; }; export type BoundingBoxArgs = { minX: I8F56Args; maxX: I8F56Args; minY: I8F56Args; maxY: I8F56Args; }; export function getBoundingBoxEncoder(): Encoder { return getStructEncoder([ ['minX', getI8F56Encoder()], ['maxX', getI8F56Encoder()], ['minY', getI8F56Encoder()], ['maxY', getI8F56Encoder()], ]); } export function getBoundingBoxDecoder(): Decoder { return getStructDecoder([ ['minX', getI8F56Decoder()], ['maxX', getI8F56Decoder()], ['minY', getI8F56Decoder()], ['maxY', getI8F56Decoder()], ]); } export function getBoundingBoxCodec(): Codec { return combineCodec(getBoundingBoxEncoder(), getBoundingBoxDecoder()); }