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

export type RemoteTokenMessengerRemoved = {
  domain: number;
  tokenMessenger: Address;
};

export type RemoteTokenMessengerRemovedArgs = RemoteTokenMessengerRemoved;

export function getRemoteTokenMessengerRemovedEncoder(): FixedSizeEncoder<RemoteTokenMessengerRemovedArgs> {
  return getStructEncoder([
    ["domain", getU32Encoder()],
    ["tokenMessenger", getAddressEncoder()],
  ]);
}

export function getRemoteTokenMessengerRemovedDecoder(): FixedSizeDecoder<RemoteTokenMessengerRemoved> {
  return getStructDecoder([
    ["domain", getU32Decoder()],
    ["tokenMessenger", getAddressDecoder()],
  ]);
}

export function getRemoteTokenMessengerRemovedCodec(): FixedSizeCodec<
  RemoteTokenMessengerRemovedArgs,
  RemoteTokenMessengerRemoved
> {
  return combineCodec(
    getRemoteTokenMessengerRemovedEncoder(),
    getRemoteTokenMessengerRemovedDecoder(),
  );
}
