/**
 * 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,
  getU32Decoder,
  getU32Encoder,
  type FixedSizeCodec,
  type FixedSizeDecoder,
  type FixedSizeEncoder,
} from '@solana/kit';

export enum NonceState {
  Uninitialized,
  Initialized,
}

export type NonceStateArgs = NonceState;

export function getNonceStateEncoder(): FixedSizeEncoder<NonceStateArgs> {
  return getEnumEncoder(NonceState, {
    size: getU32Encoder(),
  }) as FixedSizeEncoder<NonceStateArgs>;
}

export function getNonceStateDecoder(): FixedSizeDecoder<NonceState> {
  return getEnumDecoder(NonceState, {
    size: getU32Decoder(),
  }) as FixedSizeDecoder<NonceState>;
}

export function getNonceStateCodec(): FixedSizeCodec<
  NonceStateArgs,
  NonceState
> {
  return combineCodec(
    getNonceStateEncoder(),
    getNonceStateDecoder()
  ) as FixedSizeCodec<NonceStateArgs, NonceState>;
}
