/**
 * 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,
  getAddressDecoder,
  getAddressEncoder,
  getStructDecoder,
  getStructEncoder,
  getU8Decoder,
  getU8Encoder,
  type Address,
  type FixedSizeCodec,
  type FixedSizeDecoder,
  type FixedSizeEncoder,
} from "@solana/kit";

export type AllowMintEvent = {
  eventDiscriminator: number;
  instanceSeed: Address;
  mint: Address;
  decimals: number;
};

export type AllowMintEventArgs = AllowMintEvent;

export function getAllowMintEventEncoder(): FixedSizeEncoder<AllowMintEventArgs> {
  return getStructEncoder([
    ["eventDiscriminator", getU8Encoder()],
    ["instanceSeed", getAddressEncoder()],
    ["mint", getAddressEncoder()],
    ["decimals", getU8Encoder()],
  ]);
}

export function getAllowMintEventDecoder(): FixedSizeDecoder<AllowMintEvent> {
  return getStructDecoder([
    ["eventDiscriminator", getU8Decoder()],
    ["instanceSeed", getAddressDecoder()],
    ["mint", getAddressDecoder()],
    ["decimals", getU8Decoder()],
  ]);
}

export function getAllowMintEventCodec(): FixedSizeCodec<
  AllowMintEventArgs,
  AllowMintEvent
> {
  return combineCodec(getAllowMintEventEncoder(), getAllowMintEventDecoder());
}
