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

export type AddOperatorEventArgs = AddOperatorEvent;

export function getAddOperatorEventEncoder(): FixedSizeEncoder<AddOperatorEventArgs> {
  return getStructEncoder([
    ["eventDiscriminator", getU8Encoder()],
    ["instanceSeed", getAddressEncoder()],
    ["operator", getAddressEncoder()],
  ]);
}

export function getAddOperatorEventDecoder(): FixedSizeDecoder<AddOperatorEvent> {
  return getStructDecoder([
    ["eventDiscriminator", getU8Decoder()],
    ["instanceSeed", getAddressDecoder()],
    ["operator", getAddressDecoder()],
  ]);
}

export function getAddOperatorEventCodec(): FixedSizeCodec<
  AddOperatorEventArgs,
  AddOperatorEvent
> {
  return combineCodec(
    getAddOperatorEventEncoder(),
    getAddOperatorEventDecoder(),
  );
}
