/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type {
  BaseContract,
  BigNumberish,
  BytesLike,
  FunctionFragment,
  Result,
  Interface,
  EventFragment,
  AddressLike,
  ContractRunner,
  ContractMethod,
  Listener,
} from "ethers";
import type {
  TypedContractEvent,
  TypedDeferredTopicFilter,
  TypedEventLog,
  TypedLogDescription,
  TypedListener,
  TypedContractMethod,
} from "../../../common";

export declare namespace MockSwapRolloverLoan {
  export type FlashSwapArgsStruct = {
    token0: AddressLike;
    token1: AddressLike;
    fee: BigNumberish;
    flashAmount: BigNumberish;
    borrowToken1: boolean;
  };

  export type FlashSwapArgsStructOutput = [
    token0: string,
    token1: string,
    fee: bigint,
    flashAmount: bigint,
    borrowToken1: boolean
  ] & {
    token0: string;
    token1: string;
    fee: bigint;
    flashAmount: bigint;
    borrowToken1: boolean;
  };

  export type AcceptCommitmentArgsStruct = {
    commitmentId: BigNumberish;
    smartCommitmentAddress: AddressLike;
    principalAmount: BigNumberish;
    collateralAmount: BigNumberish;
    collateralTokenId: BigNumberish;
    collateralTokenAddress: AddressLike;
    interestRate: BigNumberish;
    loanDuration: BigNumberish;
    merkleProof: BytesLike[];
  };

  export type AcceptCommitmentArgsStructOutput = [
    commitmentId: bigint,
    smartCommitmentAddress: string,
    principalAmount: bigint,
    collateralAmount: bigint,
    collateralTokenId: bigint,
    collateralTokenAddress: string,
    interestRate: bigint,
    loanDuration: bigint,
    merkleProof: string[]
  ] & {
    commitmentId: bigint;
    smartCommitmentAddress: string;
    principalAmount: bigint;
    collateralAmount: bigint;
    collateralTokenId: bigint;
    collateralTokenAddress: string;
    interestRate: bigint;
    loanDuration: bigint;
    merkleProof: string[];
  };
}

export interface MockSwapRolloverLoanInterface extends Interface {
  getFunction(
    nameOrSignature:
      | "TELLER_V2"
      | "WETH9"
      | "calculateRolloverAmount"
      | "factory"
      | "getMarketFeePct"
      | "getMarketIdForCommitment"
      | "getUniswapPoolAddress"
      | "refundETH"
      | "rolloverLoanWithFlashSwap"
      | "rolloverLoanWithFlashSwapRewards"
      | "sweepToken"
      | "uniswapV3FlashCallback"
      | "unwrapWETH9"
  ): FunctionFragment;

  getEvent(
    nameOrSignatureOrTopic: "RolloverLoanComplete" | "RolloverWithReferral"
  ): EventFragment;

  encodeFunctionData(functionFragment: "TELLER_V2", values?: undefined): string;
  encodeFunctionData(functionFragment: "WETH9", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "calculateRolloverAmount",
    values: [
      BigNumberish,
      BigNumberish,
      BigNumberish,
      BigNumberish,
      BigNumberish,
      BigNumberish,
      BigNumberish
    ]
  ): string;
  encodeFunctionData(functionFragment: "factory", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "getMarketFeePct",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getMarketIdForCommitment",
    values: [AddressLike, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getUniswapPoolAddress",
    values: [AddressLike, AddressLike, BigNumberish]
  ): string;
  encodeFunctionData(functionFragment: "refundETH", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "rolloverLoanWithFlashSwap",
    values: [
      AddressLike,
      BigNumberish,
      BigNumberish,
      MockSwapRolloverLoan.FlashSwapArgsStruct,
      MockSwapRolloverLoan.AcceptCommitmentArgsStruct
    ]
  ): string;
  encodeFunctionData(
    functionFragment: "rolloverLoanWithFlashSwapRewards",
    values: [
      AddressLike,
      BigNumberish,
      BigNumberish,
      BigNumberish,
      AddressLike,
      BigNumberish,
      MockSwapRolloverLoan.FlashSwapArgsStruct,
      MockSwapRolloverLoan.AcceptCommitmentArgsStruct
    ]
  ): string;
  encodeFunctionData(
    functionFragment: "sweepToken",
    values: [AddressLike, BigNumberish, AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "uniswapV3FlashCallback",
    values: [BigNumberish, BigNumberish, BytesLike]
  ): string;
  encodeFunctionData(
    functionFragment: "unwrapWETH9",
    values: [BigNumberish, AddressLike]
  ): string;

  decodeFunctionResult(functionFragment: "TELLER_V2", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "WETH9", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "calculateRolloverAmount",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "factory", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "getMarketFeePct",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getMarketIdForCommitment",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getUniswapPoolAddress",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "refundETH", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "rolloverLoanWithFlashSwap",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "rolloverLoanWithFlashSwapRewards",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "sweepToken", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "uniswapV3FlashCallback",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "unwrapWETH9",
    data: BytesLike
  ): Result;
}

export namespace RolloverLoanCompleteEvent {
  export type InputTuple = [
    borrower: AddressLike,
    originalLoanId: BigNumberish,
    newLoanId: BigNumberish,
    fundsRemaining: BigNumberish
  ];
  export type OutputTuple = [
    borrower: string,
    originalLoanId: bigint,
    newLoanId: bigint,
    fundsRemaining: bigint
  ];
  export interface OutputObject {
    borrower: string;
    originalLoanId: bigint;
    newLoanId: bigint;
    fundsRemaining: bigint;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

export namespace RolloverWithReferralEvent {
  export type InputTuple = [
    newLoanId: BigNumberish,
    flashToken: AddressLike,
    rewardRecipient: AddressLike,
    rewardAmount: BigNumberish,
    atmId: BigNumberish
  ];
  export type OutputTuple = [
    newLoanId: bigint,
    flashToken: string,
    rewardRecipient: string,
    rewardAmount: bigint,
    atmId: bigint
  ];
  export interface OutputObject {
    newLoanId: bigint;
    flashToken: string;
    rewardRecipient: string;
    rewardAmount: bigint;
    atmId: bigint;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

export interface MockSwapRolloverLoan extends BaseContract {
  connect(runner?: ContractRunner | null): MockSwapRolloverLoan;
  waitForDeployment(): Promise<this>;

  interface: MockSwapRolloverLoanInterface;

  queryFilter<TCEvent extends TypedContractEvent>(
    event: TCEvent,
    fromBlockOrBlockhash?: string | number | undefined,
    toBlock?: string | number | undefined
  ): Promise<Array<TypedEventLog<TCEvent>>>;
  queryFilter<TCEvent extends TypedContractEvent>(
    filter: TypedDeferredTopicFilter<TCEvent>,
    fromBlockOrBlockhash?: string | number | undefined,
    toBlock?: string | number | undefined
  ): Promise<Array<TypedEventLog<TCEvent>>>;

  on<TCEvent extends TypedContractEvent>(
    event: TCEvent,
    listener: TypedListener<TCEvent>
  ): Promise<this>;
  on<TCEvent extends TypedContractEvent>(
    filter: TypedDeferredTopicFilter<TCEvent>,
    listener: TypedListener<TCEvent>
  ): Promise<this>;

  once<TCEvent extends TypedContractEvent>(
    event: TCEvent,
    listener: TypedListener<TCEvent>
  ): Promise<this>;
  once<TCEvent extends TypedContractEvent>(
    filter: TypedDeferredTopicFilter<TCEvent>,
    listener: TypedListener<TCEvent>
  ): Promise<this>;

  listeners<TCEvent extends TypedContractEvent>(
    event: TCEvent
  ): Promise<Array<TypedListener<TCEvent>>>;
  listeners(eventName?: string): Promise<Array<Listener>>;
  removeAllListeners<TCEvent extends TypedContractEvent>(
    event?: TCEvent
  ): Promise<this>;

  TELLER_V2: TypedContractMethod<[], [string], "view">;

  WETH9: TypedContractMethod<[], [string], "view">;

  calculateRolloverAmount: TypedContractMethod<
    [
      marketFeePct: BigNumberish,
      protocolFeePct: BigNumberish,
      _loanId: BigNumberish,
      principalAmount: BigNumberish,
      _rewardAmount: BigNumberish,
      _flashloanFeePct: BigNumberish,
      _timestamp: BigNumberish
    ],
    [[bigint, bigint] & { _flashAmount: bigint; _borrowerAmount: bigint }],
    "view"
  >;

  factory: TypedContractMethod<[], [string], "view">;

  getMarketFeePct: TypedContractMethod<
    [_marketId: BigNumberish],
    [bigint],
    "view"
  >;

  getMarketIdForCommitment: TypedContractMethod<
    [_lenderCommitmentForwarder: AddressLike, _commitmentId: BigNumberish],
    [bigint],
    "view"
  >;

  getUniswapPoolAddress: TypedContractMethod<
    [token0: AddressLike, token1: AddressLike, fee: BigNumberish],
    [string],
    "view"
  >;

  refundETH: TypedContractMethod<[], [void], "payable">;

  rolloverLoanWithFlashSwap: TypedContractMethod<
    [
      _lenderCommitmentForwarder: AddressLike,
      _loanId: BigNumberish,
      _borrowerAmount: BigNumberish,
      _flashSwapArgs: MockSwapRolloverLoan.FlashSwapArgsStruct,
      _acceptCommitmentArgs: MockSwapRolloverLoan.AcceptCommitmentArgsStruct
    ],
    [void],
    "nonpayable"
  >;

  rolloverLoanWithFlashSwapRewards: TypedContractMethod<
    [
      _lenderCommitmentForwarder: AddressLike,
      _loanId: BigNumberish,
      _borrowerAmount: BigNumberish,
      _rewardAmount: BigNumberish,
      _rewardRecipient: AddressLike,
      _atmId: BigNumberish,
      _flashSwapArgs: MockSwapRolloverLoan.FlashSwapArgsStruct,
      _acceptCommitmentArgs: MockSwapRolloverLoan.AcceptCommitmentArgsStruct
    ],
    [void],
    "nonpayable"
  >;

  sweepToken: TypedContractMethod<
    [token: AddressLike, amountMinimum: BigNumberish, recipient: AddressLike],
    [void],
    "payable"
  >;

  uniswapV3FlashCallback: TypedContractMethod<
    [fee0: BigNumberish, fee1: BigNumberish, data: BytesLike],
    [void],
    "nonpayable"
  >;

  unwrapWETH9: TypedContractMethod<
    [amountMinimum: BigNumberish, recipient: AddressLike],
    [void],
    "payable"
  >;

  getFunction<T extends ContractMethod = ContractMethod>(
    key: string | FunctionFragment
  ): T;

  getFunction(
    nameOrSignature: "TELLER_V2"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "WETH9"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "calculateRolloverAmount"
  ): TypedContractMethod<
    [
      marketFeePct: BigNumberish,
      protocolFeePct: BigNumberish,
      _loanId: BigNumberish,
      principalAmount: BigNumberish,
      _rewardAmount: BigNumberish,
      _flashloanFeePct: BigNumberish,
      _timestamp: BigNumberish
    ],
    [[bigint, bigint] & { _flashAmount: bigint; _borrowerAmount: bigint }],
    "view"
  >;
  getFunction(
    nameOrSignature: "factory"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "getMarketFeePct"
  ): TypedContractMethod<[_marketId: BigNumberish], [bigint], "view">;
  getFunction(
    nameOrSignature: "getMarketIdForCommitment"
  ): TypedContractMethod<
    [_lenderCommitmentForwarder: AddressLike, _commitmentId: BigNumberish],
    [bigint],
    "view"
  >;
  getFunction(
    nameOrSignature: "getUniswapPoolAddress"
  ): TypedContractMethod<
    [token0: AddressLike, token1: AddressLike, fee: BigNumberish],
    [string],
    "view"
  >;
  getFunction(
    nameOrSignature: "refundETH"
  ): TypedContractMethod<[], [void], "payable">;
  getFunction(
    nameOrSignature: "rolloverLoanWithFlashSwap"
  ): TypedContractMethod<
    [
      _lenderCommitmentForwarder: AddressLike,
      _loanId: BigNumberish,
      _borrowerAmount: BigNumberish,
      _flashSwapArgs: MockSwapRolloverLoan.FlashSwapArgsStruct,
      _acceptCommitmentArgs: MockSwapRolloverLoan.AcceptCommitmentArgsStruct
    ],
    [void],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "rolloverLoanWithFlashSwapRewards"
  ): TypedContractMethod<
    [
      _lenderCommitmentForwarder: AddressLike,
      _loanId: BigNumberish,
      _borrowerAmount: BigNumberish,
      _rewardAmount: BigNumberish,
      _rewardRecipient: AddressLike,
      _atmId: BigNumberish,
      _flashSwapArgs: MockSwapRolloverLoan.FlashSwapArgsStruct,
      _acceptCommitmentArgs: MockSwapRolloverLoan.AcceptCommitmentArgsStruct
    ],
    [void],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "sweepToken"
  ): TypedContractMethod<
    [token: AddressLike, amountMinimum: BigNumberish, recipient: AddressLike],
    [void],
    "payable"
  >;
  getFunction(
    nameOrSignature: "uniswapV3FlashCallback"
  ): TypedContractMethod<
    [fee0: BigNumberish, fee1: BigNumberish, data: BytesLike],
    [void],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "unwrapWETH9"
  ): TypedContractMethod<
    [amountMinimum: BigNumberish, recipient: AddressLike],
    [void],
    "payable"
  >;

  getEvent(
    key: "RolloverLoanComplete"
  ): TypedContractEvent<
    RolloverLoanCompleteEvent.InputTuple,
    RolloverLoanCompleteEvent.OutputTuple,
    RolloverLoanCompleteEvent.OutputObject
  >;
  getEvent(
    key: "RolloverWithReferral"
  ): TypedContractEvent<
    RolloverWithReferralEvent.InputTuple,
    RolloverWithReferralEvent.OutputTuple,
    RolloverWithReferralEvent.OutputObject
  >;

  filters: {
    "RolloverLoanComplete(address,uint256,uint256,uint256)": TypedContractEvent<
      RolloverLoanCompleteEvent.InputTuple,
      RolloverLoanCompleteEvent.OutputTuple,
      RolloverLoanCompleteEvent.OutputObject
    >;
    RolloverLoanComplete: TypedContractEvent<
      RolloverLoanCompleteEvent.InputTuple,
      RolloverLoanCompleteEvent.OutputTuple,
      RolloverLoanCompleteEvent.OutputObject
    >;

    "RolloverWithReferral(uint256,address,address,uint256,uint256)": TypedContractEvent<
      RolloverWithReferralEvent.InputTuple,
      RolloverWithReferralEvent.OutputTuple,
      RolloverWithReferralEvent.OutputObject
    >;
    RolloverWithReferral: TypedContractEvent<
      RolloverWithReferralEvent.InputTuple,
      RolloverWithReferralEvent.OutputTuple,
      RolloverWithReferralEvent.OutputObject
    >;
  };
}
