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

import {
  ethers,
  EventFilter,
  Signer,
  BigNumber,
  BigNumberish,
  PopulatedTransaction,
  BaseContract,
  ContractTransaction,
  Overrides,
  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 IVariableBorrowInterface extends ethers.utils.Interface {
  functions: {
    "assets(address)": FunctionFragment;
    "borrow(address,uint256,tuple[],address)": FunctionFragment;
    "getAccountDebt(address,address,uint256)": FunctionFragment;
    "getDebt(address)": FunctionFragment;
    "getPositionsView(address,address)": FunctionFragment;
    "liquidate(address,address,uint256,address)": FunctionFragment;
    "oracle()": FunctionFragment;
    "repay(address,uint256,tuple[],address)": FunctionFragment;
    "swap()": FunctionFragment;
  };

  encodeFunctionData(functionFragment: "assets", values: [string]): string;
  encodeFunctionData(
    functionFragment: "borrow",
    values: [
      string,
      BigNumberish,
      { token: string; amount: BigNumberish }[],
      string
    ]
  ): string;
  encodeFunctionData(
    functionFragment: "getAccountDebt",
    values: [string, string, BigNumberish]
  ): string;
  encodeFunctionData(functionFragment: "getDebt", values: [string]): string;
  encodeFunctionData(
    functionFragment: "getPositionsView",
    values: [string, string]
  ): string;
  encodeFunctionData(
    functionFragment: "liquidate",
    values: [string, string, BigNumberish, string]
  ): string;
  encodeFunctionData(functionFragment: "oracle", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "repay",
    values: [
      string,
      BigNumberish,
      { token: string; amount: BigNumberish }[],
      string
    ]
  ): string;
  encodeFunctionData(functionFragment: "swap", values?: undefined): string;

  decodeFunctionResult(functionFragment: "assets", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "borrow", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "getAccountDebt",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "getDebt", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "getPositionsView",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "liquidate", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "oracle", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "repay", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "swap", data: BytesLike): Result;

  events: {};
}

export class IVariableBorrow 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: IVariableBorrowInterface;

  functions: {
    assets(
      asset: string,
      overrides?: CallOverrides
    ): Promise<
      [
        [
          BigNumber,
          BigNumber,
          BigNumber,
          BigNumber,
          BigNumber,
          BigNumber,
          number,
          number,
          number,
          number,
          number,
          number,
          number,
          number
        ] & {
          debt: BigNumber;
          protocolRevenueAmount: BigNumber;
          protocolRevenueAmountExtract: BigNumber;
          r0: BigNumber;
          relativeInterest: BigNumber;
          updatedAt: BigNumber;
          interestRate: number;
          base: number;
          optimal: number;
          slope1: number;
          slope2: number;
          borrowCredit: number;
          collateralCredit: number;
          penaltyRate: number;
        }
      ]
    >;

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

    getAccountDebt(
      _asset: string,
      _account: string,
      delaySeconds: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[BigNumber]>;

    getDebt(
      _asset: string,
      overrides?: CallOverrides
    ): Promise<[BigNumber, BigNumber, BigNumber]>;

    getPositionsView(
      _asset: string,
      _account: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, BigNumber, string[], BigNumber[]] & {
        debt: BigNumber;
        r0: BigNumber;
        collateralTokens: string[];
        collateralAmounts: BigNumber[];
      }
    >;

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

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

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

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

  assets(
    asset: string,
    overrides?: CallOverrides
  ): Promise<
    [
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      number,
      number,
      number,
      number,
      number,
      number,
      number,
      number
    ] & {
      debt: BigNumber;
      protocolRevenueAmount: BigNumber;
      protocolRevenueAmountExtract: BigNumber;
      r0: BigNumber;
      relativeInterest: BigNumber;
      updatedAt: BigNumber;
      interestRate: number;
      base: number;
      optimal: number;
      slope1: number;
      slope2: number;
      borrowCredit: number;
      collateralCredit: number;
      penaltyRate: number;
    }
  >;

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

  getAccountDebt(
    _asset: string,
    _account: string,
    delaySeconds: BigNumberish,
    overrides?: CallOverrides
  ): Promise<BigNumber>;

  getDebt(
    _asset: string,
    overrides?: CallOverrides
  ): Promise<[BigNumber, BigNumber, BigNumber]>;

  getPositionsView(
    _asset: string,
    _account: string,
    overrides?: CallOverrides
  ): Promise<
    [BigNumber, BigNumber, string[], BigNumber[]] & {
      debt: BigNumber;
      r0: BigNumber;
      collateralTokens: string[];
      collateralAmounts: BigNumber[];
    }
  >;

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

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

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

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

  callStatic: {
    assets(
      asset: string,
      overrides?: CallOverrides
    ): Promise<
      [
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        number,
        number,
        number,
        number,
        number,
        number,
        number,
        number
      ] & {
        debt: BigNumber;
        protocolRevenueAmount: BigNumber;
        protocolRevenueAmountExtract: BigNumber;
        r0: BigNumber;
        relativeInterest: BigNumber;
        updatedAt: BigNumber;
        interestRate: number;
        base: number;
        optimal: number;
        slope1: number;
        slope2: number;
        borrowCredit: number;
        collateralCredit: number;
        penaltyRate: number;
      }
    >;

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

    getAccountDebt(
      _asset: string,
      _account: string,
      delaySeconds: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getDebt(
      _asset: string,
      overrides?: CallOverrides
    ): Promise<[BigNumber, BigNumber, BigNumber]>;

    getPositionsView(
      _asset: string,
      _account: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, BigNumber, string[], BigNumber[]] & {
        debt: BigNumber;
        r0: BigNumber;
        collateralTokens: string[];
        collateralAmounts: BigNumber[];
      }
    >;

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

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

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

    swap(overrides?: CallOverrides): Promise<string>;
  };

  filters: {};

  estimateGas: {
    assets(asset: string, overrides?: CallOverrides): Promise<BigNumber>;

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

    getAccountDebt(
      _asset: string,
      _account: string,
      delaySeconds: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    getDebt(_asset: string, overrides?: CallOverrides): Promise<BigNumber>;

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

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

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

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

    swap(overrides?: CallOverrides): Promise<BigNumber>;
  };

  populateTransaction: {
    assets(
      asset: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

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

    getAccountDebt(
      _asset: string,
      _account: string,
      delaySeconds: BigNumberish,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    getDebt(
      _asset: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

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

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

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

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

    swap(overrides?: CallOverrides): Promise<PopulatedTransaction>;
  };
}
