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

export type MaxMessageBodySizeUpdated = { newMaxMessageBodySize: bigint };

export type MaxMessageBodySizeUpdatedArgs = {
  newMaxMessageBodySize: number | bigint;
};

export function getMaxMessageBodySizeUpdatedEncoder(): FixedSizeEncoder<MaxMessageBodySizeUpdatedArgs> {
  return getStructEncoder([["newMaxMessageBodySize", getU64Encoder()]]);
}

export function getMaxMessageBodySizeUpdatedDecoder(): FixedSizeDecoder<MaxMessageBodySizeUpdated> {
  return getStructDecoder([["newMaxMessageBodySize", getU64Decoder()]]);
}

export function getMaxMessageBodySizeUpdatedCodec(): FixedSizeCodec<
  MaxMessageBodySizeUpdatedArgs,
  MaxMessageBodySizeUpdated
> {
  return combineCodec(
    getMaxMessageBodySizeUpdatedEncoder(),
    getMaxMessageBodySizeUpdatedDecoder(),
  );
}
