/**
 * 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,
  getU64Decoder,
  getU64Encoder,
  type Codec,
  type Decoder,
  type Encoder,
} from "@solana/kit";
import {
  getRelayDataDecoder,
  getRelayDataEncoder,
  type RelayData,
  type RelayDataArgs,
} from ".";

export type SlowFill = {
  relayData: RelayData;
  chainId: bigint;
  updatedOutputAmount: bigint;
};

export type SlowFillArgs = {
  relayData: RelayDataArgs;
  chainId: number | bigint;
  updatedOutputAmount: number | bigint;
};

export function getSlowFillEncoder(): Encoder<SlowFillArgs> {
  return getStructEncoder([
    ["relayData", getRelayDataEncoder()],
    ["chainId", getU64Encoder()],
    ["updatedOutputAmount", getU64Encoder()],
  ]);
}

export function getSlowFillDecoder(): Decoder<SlowFill> {
  return getStructDecoder([
    ["relayData", getRelayDataDecoder()],
    ["chainId", getU64Decoder()],
    ["updatedOutputAmount", getU64Decoder()],
  ]);
}

export function getSlowFillCodec(): Codec<SlowFillArgs, SlowFill> {
  return combineCodec(getSlowFillEncoder(), getSlowFillDecoder());
}
