/**
 * 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 OwnershipTransferStarted = {
  previousOwner: Address;
  newOwner: Address;
};

export type OwnershipTransferStartedArgs = OwnershipTransferStarted;

export function getOwnershipTransferStartedEncoder(): FixedSizeEncoder<OwnershipTransferStartedArgs> {
  return getStructEncoder([
    ["previousOwner", getAddressEncoder()],
    ["newOwner", getAddressEncoder()],
  ]);
}

export function getOwnershipTransferStartedDecoder(): FixedSizeDecoder<OwnershipTransferStarted> {
  return getStructDecoder([
    ["previousOwner", getAddressDecoder()],
    ["newOwner", getAddressDecoder()],
  ]);
}

export function getOwnershipTransferStartedCodec(): FixedSizeCodec<
  OwnershipTransferStartedArgs,
  OwnershipTransferStarted
> {
  return combineCodec(
    getOwnershipTransferStartedEncoder(),
    getOwnershipTransferStartedDecoder(),
  );
}
