/**
 * 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,
  getU64Decoder,
  getU64Encoder,
  type Address,
  type FixedSizeCodec,
  type FixedSizeDecoder,
  type FixedSizeEncoder,
} from "@solana/kit";

export type SetBurnLimitPerMessage = {
  token: Address;
  burnLimitPerMessage: bigint;
};

export type SetBurnLimitPerMessageArgs = {
  token: Address;
  burnLimitPerMessage: number | bigint;
};

export function getSetBurnLimitPerMessageEncoder(): FixedSizeEncoder<SetBurnLimitPerMessageArgs> {
  return getStructEncoder([
    ["token", getAddressEncoder()],
    ["burnLimitPerMessage", getU64Encoder()],
  ]);
}

export function getSetBurnLimitPerMessageDecoder(): FixedSizeDecoder<SetBurnLimitPerMessage> {
  return getStructDecoder([
    ["token", getAddressDecoder()],
    ["burnLimitPerMessage", getU64Decoder()],
  ]);
}

export function getSetBurnLimitPerMessageCodec(): FixedSizeCodec<
  SetBurnLimitPerMessageArgs,
  SetBurnLimitPerMessage
> {
  return combineCodec(
    getSetBurnLimitPerMessageEncoder(),
    getSetBurnLimitPerMessageDecoder(),
  );
}
