/**
 * 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 AuthorityType {
  MintTokens,
  FreezeAccount,
  AccountOwner,
  CloseAccount,
}

export type AuthorityTypeArgs = AuthorityType;

export function getAuthorityTypeEncoder(): FixedSizeEncoder<AuthorityTypeArgs> {
  return getEnumEncoder(AuthorityType) as FixedSizeEncoder<AuthorityTypeArgs>;
}

export function getAuthorityTypeDecoder(): FixedSizeDecoder<AuthorityType> {
  return getEnumDecoder(AuthorityType) as FixedSizeDecoder<AuthorityType>;
}

export function getAuthorityTypeCodec(): FixedSizeCodec<
  AuthorityTypeArgs,
  AuthorityType
> {
  return combineCodec(
    getAuthorityTypeEncoder(),
    getAuthorityTypeDecoder()
  ) as FixedSizeCodec<AuthorityTypeArgs, AuthorityType>;
}
