/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type {
  BaseContract,
  BigNumber,
  BigNumberish,
  BytesLike,
  CallOverrides,
  ContractTransaction,
  Overrides,
  PopulatedTransaction,
  Signer,
  utils,
} from "ethers";
import type { FunctionFragment, Result } from "@ethersproject/abi";
import type { Listener, Provider } from "@ethersproject/providers";
import type {
  TypedEventFilter,
  TypedEvent,
  TypedListener,
  OnEvent,
} from "./common";

export type FinalTokenInfoStruct = {
  spotIndex: BigNumberish;
  isBuy: boolean;
  feePpm: BigNumberish;
  suggestedDiscountBps: BigNumberish;
  swapHandler: string;
};

export type FinalTokenInfoStructOutput = [
  number,
  boolean,
  number,
  number,
  string
] & {
  spotIndex: number;
  isBuy: boolean;
  feePpm: number;
  suggestedDiscountBps: number;
  swapHandler: string;
};

export interface SwapHandlerInterface extends utils.Interface {
  functions: {
    "cancelOrderByCloid(uint32,uint128)": FunctionFragment;
    "parentHandler()": FunctionFragment;
    "submitSpotLimitOrder((uint32,bool,uint32,uint32,address),uint64,uint64,uint128)": FunctionFragment;
    "sweepErc20(address,uint256)": FunctionFragment;
    "transferFundsToSelfOnCore(address,uint64,uint256,int8)": FunctionFragment;
    "transferFundsToUserOnCore(uint64,address,uint64,uint32)": FunctionFragment;
  };

  getFunction(
    nameOrSignatureOrTopic:
      | "cancelOrderByCloid"
      | "parentHandler"
      | "submitSpotLimitOrder"
      | "sweepErc20"
      | "transferFundsToSelfOnCore"
      | "transferFundsToUserOnCore"
  ): FunctionFragment;

  encodeFunctionData(
    functionFragment: "cancelOrderByCloid",
    values: [BigNumberish, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "parentHandler",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "submitSpotLimitOrder",
    values: [FinalTokenInfoStruct, BigNumberish, BigNumberish, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "sweepErc20",
    values: [string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "transferFundsToSelfOnCore",
    values: [string, BigNumberish, BigNumberish, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "transferFundsToUserOnCore",
    values: [BigNumberish, string, BigNumberish, BigNumberish]
  ): string;

  decodeFunctionResult(
    functionFragment: "cancelOrderByCloid",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "parentHandler",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "submitSpotLimitOrder",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "sweepErc20", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "transferFundsToSelfOnCore",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "transferFundsToUserOnCore",
    data: BytesLike
  ): Result;

  events: {};
}

export interface SwapHandler extends BaseContract {
  connect(signerOrProvider: Signer | Provider | string): this;
  attach(addressOrName: string): this;
  deployed(): Promise<this>;

  interface: SwapHandlerInterface;

  queryFilter<TEvent extends TypedEvent>(
    event: TypedEventFilter<TEvent>,
    fromBlockOrBlockhash?: string | number | undefined,
    toBlock?: string | number | undefined
  ): Promise<Array<TEvent>>;

  listeners<TEvent extends TypedEvent>(
    eventFilter?: TypedEventFilter<TEvent>
  ): Array<TypedListener<TEvent>>;
  listeners(eventName?: string): Array<Listener>;
  removeAllListeners<TEvent extends TypedEvent>(
    eventFilter: TypedEventFilter<TEvent>
  ): this;
  removeAllListeners(eventName?: string): this;
  off: OnEvent<this>;
  on: OnEvent<this>;
  once: OnEvent<this>;
  removeListener: OnEvent<this>;

  functions: {
    cancelOrderByCloid(
      spotIndex: BigNumberish,
      cloid: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<ContractTransaction>;

    parentHandler(overrides?: CallOverrides): Promise<[string]>;

    submitSpotLimitOrder(
      finalTokenInfo: FinalTokenInfoStruct,
      limitPriceX1e8: BigNumberish,
      sizeX1e8: BigNumberish,
      cloid: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<ContractTransaction>;

    sweepErc20(
      token: string,
      amount: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<ContractTransaction>;

    transferFundsToSelfOnCore(
      erc20EVMAddress: string,
      erc20CoreIndex: BigNumberish,
      amountEVM: BigNumberish,
      decimalDiff: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<ContractTransaction>;

    transferFundsToUserOnCore(
      erc20CoreIndex: BigNumberish,
      to: string,
      amountCore: BigNumberish,
      destinationDex: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<ContractTransaction>;
  };

  cancelOrderByCloid(
    spotIndex: BigNumberish,
    cloid: BigNumberish,
    overrides?: Overrides & { from?: string }
  ): Promise<ContractTransaction>;

  parentHandler(overrides?: CallOverrides): Promise<string>;

  submitSpotLimitOrder(
    finalTokenInfo: FinalTokenInfoStruct,
    limitPriceX1e8: BigNumberish,
    sizeX1e8: BigNumberish,
    cloid: BigNumberish,
    overrides?: Overrides & { from?: string }
  ): Promise<ContractTransaction>;

  sweepErc20(
    token: string,
    amount: BigNumberish,
    overrides?: Overrides & { from?: string }
  ): Promise<ContractTransaction>;

  transferFundsToSelfOnCore(
    erc20EVMAddress: string,
    erc20CoreIndex: BigNumberish,
    amountEVM: BigNumberish,
    decimalDiff: BigNumberish,
    overrides?: Overrides & { from?: string }
  ): Promise<ContractTransaction>;

  transferFundsToUserOnCore(
    erc20CoreIndex: BigNumberish,
    to: string,
    amountCore: BigNumberish,
    destinationDex: BigNumberish,
    overrides?: Overrides & { from?: string }
  ): Promise<ContractTransaction>;

  callStatic: {
    cancelOrderByCloid(
      spotIndex: BigNumberish,
      cloid: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;

    parentHandler(overrides?: CallOverrides): Promise<string>;

    submitSpotLimitOrder(
      finalTokenInfo: FinalTokenInfoStruct,
      limitPriceX1e8: BigNumberish,
      sizeX1e8: BigNumberish,
      cloid: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;

    sweepErc20(
      token: string,
      amount: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;

    transferFundsToSelfOnCore(
      erc20EVMAddress: string,
      erc20CoreIndex: BigNumberish,
      amountEVM: BigNumberish,
      decimalDiff: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;

    transferFundsToUserOnCore(
      erc20CoreIndex: BigNumberish,
      to: string,
      amountCore: BigNumberish,
      destinationDex: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;
  };

  filters: {};

  estimateGas: {
    cancelOrderByCloid(
      spotIndex: BigNumberish,
      cloid: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<BigNumber>;

    parentHandler(overrides?: CallOverrides): Promise<BigNumber>;

    submitSpotLimitOrder(
      finalTokenInfo: FinalTokenInfoStruct,
      limitPriceX1e8: BigNumberish,
      sizeX1e8: BigNumberish,
      cloid: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<BigNumber>;

    sweepErc20(
      token: string,
      amount: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<BigNumber>;

    transferFundsToSelfOnCore(
      erc20EVMAddress: string,
      erc20CoreIndex: BigNumberish,
      amountEVM: BigNumberish,
      decimalDiff: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<BigNumber>;

    transferFundsToUserOnCore(
      erc20CoreIndex: BigNumberish,
      to: string,
      amountCore: BigNumberish,
      destinationDex: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<BigNumber>;
  };

  populateTransaction: {
    cancelOrderByCloid(
      spotIndex: BigNumberish,
      cloid: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<PopulatedTransaction>;

    parentHandler(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    submitSpotLimitOrder(
      finalTokenInfo: FinalTokenInfoStruct,
      limitPriceX1e8: BigNumberish,
      sizeX1e8: BigNumberish,
      cloid: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<PopulatedTransaction>;

    sweepErc20(
      token: string,
      amount: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<PopulatedTransaction>;

    transferFundsToSelfOnCore(
      erc20EVMAddress: string,
      erc20CoreIndex: BigNumberish,
      amountEVM: BigNumberish,
      decimalDiff: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<PopulatedTransaction>;

    transferFundsToUserOnCore(
      erc20CoreIndex: BigNumberish,
      to: string,
      amountCore: BigNumberish,
      destinationDex: BigNumberish,
      overrides?: Overrides & { from?: string }
    ): Promise<PopulatedTransaction>;
  };
}
