/**
 * 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,
  fixDecoderSize,
  fixEncoderSize,
  getBytesDecoder,
  getBytesEncoder,
  getStructDecoder,
  getStructEncoder,
  type FixedSizeCodec,
  type FixedSizeDecoder,
  type FixedSizeEncoder,
  type ReadonlyUint8Array,
} from "@solana/kit";

export type UsedNonceAccountParams = { nonce: ReadonlyUint8Array };

export type UsedNonceAccountParamsArgs = UsedNonceAccountParams;

export function getUsedNonceAccountParamsEncoder(): FixedSizeEncoder<UsedNonceAccountParamsArgs> {
  return getStructEncoder([["nonce", fixEncoderSize(getBytesEncoder(), 32)]]);
}

export function getUsedNonceAccountParamsDecoder(): FixedSizeDecoder<UsedNonceAccountParams> {
  return getStructDecoder([["nonce", fixDecoderSize(getBytesDecoder(), 32)]]);
}

export function getUsedNonceAccountParamsCodec(): FixedSizeCodec<
  UsedNonceAccountParamsArgs,
  UsedNonceAccountParams
> {
  return combineCodec(
    getUsedNonceAccountParamsEncoder(),
    getUsedNonceAccountParamsDecoder(),
  );
}
