/**
 * 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 BlockMintEvent = {
  eventDiscriminator: number;
  instanceSeed: Address;
  mint: Address;
};

export type BlockMintEventArgs = BlockMintEvent;

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

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

export function getBlockMintEventCodec(): FixedSizeCodec<
  BlockMintEventArgs,
  BlockMintEvent
> {
  return combineCodec(getBlockMintEventEncoder(), getBlockMintEventDecoder());
}
