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

export type SignatureThresholdUpdated = {
  oldSignatureThreshold: number;
  newSignatureThreshold: number;
};

export type SignatureThresholdUpdatedArgs = SignatureThresholdUpdated;

export function getSignatureThresholdUpdatedEncoder(): FixedSizeEncoder<SignatureThresholdUpdatedArgs> {
  return getStructEncoder([
    ["oldSignatureThreshold", getU32Encoder()],
    ["newSignatureThreshold", getU32Encoder()],
  ]);
}

export function getSignatureThresholdUpdatedDecoder(): FixedSizeDecoder<SignatureThresholdUpdated> {
  return getStructDecoder([
    ["oldSignatureThreshold", getU32Decoder()],
    ["newSignatureThreshold", getU32Decoder()],
  ]);
}

export function getSignatureThresholdUpdatedCodec(): FixedSizeCodec<
  SignatureThresholdUpdatedArgs,
  SignatureThresholdUpdated
> {
  return combineCodec(
    getSignatureThresholdUpdatedEncoder(),
    getSignatureThresholdUpdatedDecoder(),
  );
}
