/**
 * 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 RemoteTokenMessengerAdded = {
  domain: number;
  tokenMessenger: Address;
};

export type RemoteTokenMessengerAddedArgs = RemoteTokenMessengerAdded;

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

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

export function getRemoteTokenMessengerAddedCodec(): FixedSizeCodec<
  RemoteTokenMessengerAddedArgs,
  RemoteTokenMessengerAdded
> {
  return combineCodec(
    getRemoteTokenMessengerAddedEncoder(),
    getRemoteTokenMessengerAddedDecoder(),
  );
}
