/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */

import {
  ethers,
  EventFilter,
  Signer,
  BigNumber,
  BigNumberish,
  PopulatedTransaction,
  BaseContract,
  ContractTransaction,
  Overrides,
  PayableOverrides,
  CallOverrides,
} from "ethers";
import { BytesLike } from "@ethersproject/bytes";
import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import type { TypedEventFilter, TypedEvent, TypedListener } from "./common";

interface VariableBorrowRouterInterface extends ethers.utils.Interface {
  functions: {
    "borrow(address,uint256,tuple[],address)": FunctionFragment;
    "getReward(address)": FunctionFragment;
    "getWETHAddress()": FunctionFragment;
    "initRewardInfo(address,address,uint256,uint256,uint256,address[])": FunctionFragment;
    "liquidate(address,address,uint256,address)": FunctionFragment;
    "oracle()": FunctionFragment;
    "owner()": FunctionFragment;
    "positions(address)": FunctionFragment;
    "renounceOwnership()": FunctionFragment;
    "repay(address,uint256,tuple[],address)": FunctionFragment;
    "rewardBorrowAssets(uint256)": FunctionFragment;
    "rewardInfo()": FunctionFragment;
    "transferOwnership(address)": FunctionFragment;
    "updateApprover(address)": FunctionFragment;
    "updateRewardBorrowAssets(address[])": FunctionFragment;
    "updateRewardInfo(uint256,uint256,uint256)": FunctionFragment;
    "withdrawReward()": FunctionFragment;
  };

  encodeFunctionData(
    functionFragment: "borrow",
    values: [
      string,
      BigNumberish,
      { token: string; amount: BigNumberish }[],
      string
    ]
  ): string;
  encodeFunctionData(functionFragment: "getReward", values: [string]): string;
  encodeFunctionData(
    functionFragment: "getWETHAddress",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "initRewardInfo",
    values: [string, string, BigNumberish, BigNumberish, BigNumberish, string[]]
  ): string;
  encodeFunctionData(
    functionFragment: "liquidate",
    values: [string, string, BigNumberish, string]
  ): string;
  encodeFunctionData(functionFragment: "oracle", values?: undefined): string;
  encodeFunctionData(functionFragment: "owner", values?: undefined): string;
  encodeFunctionData(functionFragment: "positions", values: [string]): string;
  encodeFunctionData(
    functionFragment: "renounceOwnership",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "repay",
    values: [
      string,
      BigNumberish,
      { token: string; amount: BigNumberish }[],
      string
    ]
  ): string;
  encodeFunctionData(
    functionFragment: "rewardBorrowAssets",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "rewardInfo",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "transferOwnership",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "updateApprover",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "updateRewardBorrowAssets",
    values: [string[]]
  ): string;
  encodeFunctionData(
    functionFragment: "updateRewardInfo",
    values: [BigNumberish, BigNumberish, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "withdrawReward",
    values?: undefined
  ): string;

  decodeFunctionResult(functionFragment: "borrow", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "getReward", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "getWETHAddress",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "initRewardInfo",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "liquidate", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "oracle", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "positions", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "renounceOwnership",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "repay", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "rewardBorrowAssets",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "rewardInfo", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "transferOwnership",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "updateApprover",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "updateRewardBorrowAssets",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "updateRewardInfo",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "withdrawReward",
    data: BytesLike
  ): Result;

  events: {
    "OwnershipTransferred(address,address)": EventFragment;
  };

  getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
}

export type OwnershipTransferredEvent = TypedEvent<
  [string, string] & { previousOwner: string; newOwner: string }
>;

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

  listeners<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject>
  ): Array<TypedListener<EventArgsArray, EventArgsObject>>;
  off<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  on<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  once<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  removeListener<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>
  ): this;

  listeners(eventName?: string): Array<Listener>;
  off(eventName: string, listener: Listener): this;
  on(eventName: string, listener: Listener): this;
  once(eventName: string, listener: Listener): this;
  removeListener(eventName: string, listener: Listener): this;
  removeAllListeners(eventName?: string): this;

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

  interface: VariableBorrowRouterInterface;

  functions: {
    borrow(
      _asset: string,
      amount: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: PayableOverrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    getReward(
      _account: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, BigNumber, string] & {
        _pendingAmount: BigNumber;
        _dayAmount: BigNumber;
        _rewardToken: string;
      }
    >;

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

    initRewardInfo(
      _rewardToken: string,
      _approver: string,
      _rewardPerSecond: BigNumberish,
      _startTime: BigNumberish,
      _deltaTime: BigNumberish,
      _rewardBorrowAssets: string[],
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    liquidate(
      _asset: string,
      account: string,
      amount: BigNumberish,
      to: string,
      overrides?: PayableOverrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

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

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

    positions(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, BigNumber, BigNumber] & {
        rewardDebt: BigNumber;
        lastUpdateAt: BigNumber;
        unWithdrawAmount: BigNumber;
      }
    >;

    renounceOwnership(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    repay(
      _asset: string,
      amountMax: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: PayableOverrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    rewardBorrowAssets(
      arg0: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[string]>;

    rewardInfo(
      overrides?: CallOverrides
    ): Promise<
      [
        string,
        string,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber
      ] & {
        rewardToken: string;
        approver: string;
        accERC20PerShare: BigNumber;
        paidOut: BigNumber;
        startTime: BigNumber;
        endTime: BigNumber;
        lastRewardTime: BigNumber;
        rewardPerSecond: BigNumber;
        totalReward: BigNumber;
      }
    >;

    transferOwnership(
      newOwner: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    updateApprover(
      _approver: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    updateRewardBorrowAssets(
      _rewardBorrowAssets: string[],
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    updateRewardInfo(
      _rewardPerSecond: BigNumberish,
      _startTime: BigNumberish,
      _deltaTime: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    withdrawReward(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;
  };

  borrow(
    _asset: string,
    amount: BigNumberish,
    collaterals: { token: string; amount: BigNumberish }[],
    to: string,
    overrides?: PayableOverrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  getReward(
    _account: string,
    overrides?: CallOverrides
  ): Promise<
    [BigNumber, BigNumber, string] & {
      _pendingAmount: BigNumber;
      _dayAmount: BigNumber;
      _rewardToken: string;
    }
  >;

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

  initRewardInfo(
    _rewardToken: string,
    _approver: string,
    _rewardPerSecond: BigNumberish,
    _startTime: BigNumberish,
    _deltaTime: BigNumberish,
    _rewardBorrowAssets: string[],
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  liquidate(
    _asset: string,
    account: string,
    amount: BigNumberish,
    to: string,
    overrides?: PayableOverrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

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

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

  positions(
    arg0: string,
    overrides?: CallOverrides
  ): Promise<
    [BigNumber, BigNumber, BigNumber] & {
      rewardDebt: BigNumber;
      lastUpdateAt: BigNumber;
      unWithdrawAmount: BigNumber;
    }
  >;

  renounceOwnership(
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  repay(
    _asset: string,
    amountMax: BigNumberish,
    collaterals: { token: string; amount: BigNumberish }[],
    to: string,
    overrides?: PayableOverrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  rewardBorrowAssets(
    arg0: BigNumberish,
    overrides?: CallOverrides
  ): Promise<string>;

  rewardInfo(
    overrides?: CallOverrides
  ): Promise<
    [
      string,
      string,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber
    ] & {
      rewardToken: string;
      approver: string;
      accERC20PerShare: BigNumber;
      paidOut: BigNumber;
      startTime: BigNumber;
      endTime: BigNumber;
      lastRewardTime: BigNumber;
      rewardPerSecond: BigNumber;
      totalReward: BigNumber;
    }
  >;

  transferOwnership(
    newOwner: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  updateApprover(
    _approver: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  updateRewardBorrowAssets(
    _rewardBorrowAssets: string[],
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  updateRewardInfo(
    _rewardPerSecond: BigNumberish,
    _startTime: BigNumberish,
    _deltaTime: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  withdrawReward(
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  callStatic: {
    borrow(
      _asset: string,
      amount: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: CallOverrides
    ): Promise<void>;

    getReward(
      _account: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, BigNumber, string] & {
        _pendingAmount: BigNumber;
        _dayAmount: BigNumber;
        _rewardToken: string;
      }
    >;

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

    initRewardInfo(
      _rewardToken: string,
      _approver: string,
      _rewardPerSecond: BigNumberish,
      _startTime: BigNumberish,
      _deltaTime: BigNumberish,
      _rewardBorrowAssets: string[],
      overrides?: CallOverrides
    ): Promise<void>;

    liquidate(
      _asset: string,
      account: string,
      amount: BigNumberish,
      to: string,
      overrides?: CallOverrides
    ): Promise<void>;

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

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

    positions(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, BigNumber, BigNumber] & {
        rewardDebt: BigNumber;
        lastUpdateAt: BigNumber;
        unWithdrawAmount: BigNumber;
      }
    >;

    renounceOwnership(overrides?: CallOverrides): Promise<void>;

    repay(
      _asset: string,
      amountMax: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: CallOverrides
    ): Promise<void>;

    rewardBorrowAssets(
      arg0: BigNumberish,
      overrides?: CallOverrides
    ): Promise<string>;

    rewardInfo(
      overrides?: CallOverrides
    ): Promise<
      [
        string,
        string,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber
      ] & {
        rewardToken: string;
        approver: string;
        accERC20PerShare: BigNumber;
        paidOut: BigNumber;
        startTime: BigNumber;
        endTime: BigNumber;
        lastRewardTime: BigNumber;
        rewardPerSecond: BigNumber;
        totalReward: BigNumber;
      }
    >;

    transferOwnership(
      newOwner: string,
      overrides?: CallOverrides
    ): Promise<void>;

    updateApprover(_approver: string, overrides?: CallOverrides): Promise<void>;

    updateRewardBorrowAssets(
      _rewardBorrowAssets: string[],
      overrides?: CallOverrides
    ): Promise<void>;

    updateRewardInfo(
      _rewardPerSecond: BigNumberish,
      _startTime: BigNumberish,
      _deltaTime: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;

    withdrawReward(overrides?: CallOverrides): Promise<void>;
  };

  filters: {
    "OwnershipTransferred(address,address)"(
      previousOwner?: string | null,
      newOwner?: string | null
    ): TypedEventFilter<
      [string, string],
      { previousOwner: string; newOwner: string }
    >;

    OwnershipTransferred(
      previousOwner?: string | null,
      newOwner?: string | null
    ): TypedEventFilter<
      [string, string],
      { previousOwner: string; newOwner: string }
    >;
  };

  estimateGas: {
    borrow(
      _asset: string,
      amount: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: PayableOverrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    getReward(_account: string, overrides?: CallOverrides): Promise<BigNumber>;

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

    initRewardInfo(
      _rewardToken: string,
      _approver: string,
      _rewardPerSecond: BigNumberish,
      _startTime: BigNumberish,
      _deltaTime: BigNumberish,
      _rewardBorrowAssets: string[],
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    liquidate(
      _asset: string,
      account: string,
      amount: BigNumberish,
      to: string,
      overrides?: PayableOverrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

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

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

    positions(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;

    renounceOwnership(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    repay(
      _asset: string,
      amountMax: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: PayableOverrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    rewardBorrowAssets(
      arg0: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

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

    transferOwnership(
      newOwner: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    updateApprover(
      _approver: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    updateRewardBorrowAssets(
      _rewardBorrowAssets: string[],
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    updateRewardInfo(
      _rewardPerSecond: BigNumberish,
      _startTime: BigNumberish,
      _deltaTime: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    withdrawReward(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;
  };

  populateTransaction: {
    borrow(
      _asset: string,
      amount: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: PayableOverrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    getReward(
      _account: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

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

    initRewardInfo(
      _rewardToken: string,
      _approver: string,
      _rewardPerSecond: BigNumberish,
      _startTime: BigNumberish,
      _deltaTime: BigNumberish,
      _rewardBorrowAssets: string[],
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    liquidate(
      _asset: string,
      account: string,
      amount: BigNumberish,
      to: string,
      overrides?: PayableOverrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

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

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

    positions(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    renounceOwnership(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    repay(
      _asset: string,
      amountMax: BigNumberish,
      collaterals: { token: string; amount: BigNumberish }[],
      to: string,
      overrides?: PayableOverrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    rewardBorrowAssets(
      arg0: BigNumberish,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

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

    transferOwnership(
      newOwner: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    updateApprover(
      _approver: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    updateRewardBorrowAssets(
      _rewardBorrowAssets: string[],
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    updateRewardInfo(
      _rewardPerSecond: BigNumberish,
      _startTime: BigNumberish,
      _deltaTime: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    withdrawReward(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;
  };
}
