/**
 * 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,
  getEnumDecoder,
  getEnumEncoder,
  type FixedSizeCodec,
  type FixedSizeDecoder,
  type FixedSizeEncoder,
} from "@solana/kit";

export enum MathError {
  MathOverflow,
  MathUnderflow,
  ErrorInDivision,
}

export type MathErrorArgs = MathError;

export function getMathErrorEncoder(): FixedSizeEncoder<MathErrorArgs> {
  return getEnumEncoder(MathError);
}

export function getMathErrorDecoder(): FixedSizeDecoder<MathError> {
  return getEnumDecoder(MathError);
}

export function getMathErrorCodec(): FixedSizeCodec<MathErrorArgs, MathError> {
  return combineCodec(getMathErrorEncoder(), getMathErrorDecoder());
}
