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

export type SignerSet = { oldSigner: Address; newSigner: Address };

export type SignerSetArgs = SignerSet;

export function getSignerSetEncoder(): FixedSizeEncoder<SignerSetArgs> {
  return getStructEncoder([
    ["oldSigner", getAddressEncoder()],
    ["newSigner", getAddressEncoder()],
  ]);
}

export function getSignerSetDecoder(): FixedSizeDecoder<SignerSet> {
  return getStructDecoder([
    ["oldSigner", getAddressDecoder()],
    ["newSigner", getAddressDecoder()],
  ]);
}

export function getSignerSetCodec(): FixedSizeCodec<SignerSetArgs, SignerSet> {
  return combineCodec(getSignerSetEncoder(), getSignerSetDecoder());
}
