/**
 * 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 NonceVersion {
  Legacy,
  Current,
}

export type NonceVersionArgs = NonceVersion;

export function getNonceVersionEncoder(): FixedSizeEncoder<NonceVersionArgs> {
  return getEnumEncoder(NonceVersion, { size: getU32Encoder() });
}

export function getNonceVersionDecoder(): FixedSizeDecoder<NonceVersion> {
  return getEnumDecoder(NonceVersion, { size: getU32Decoder() });
}

export function getNonceVersionCodec(): FixedSizeCodec<
  NonceVersionArgs,
  NonceVersion
> {
  return combineCodec(getNonceVersionEncoder(), getNonceVersionDecoder());
}
