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

export declare namespace ICommitmentRolloverLoan {
  export type AcceptCommitmentArgsStruct = {
    commitmentId: BigNumberish;
    principalAmount: BigNumberish;
    collateralAmount: BigNumberish;
    collateralTokenId: BigNumberish;
    collateralTokenAddress: AddressLike;
    interestRate: BigNumberish;
    loanDuration: BigNumberish;
  };

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

export interface CommitmentRolloverLoanInterface extends Interface {
  getFunction(
    nameOrSignature:
      | "LENDER_COMMITMENT_FORWARDER"
      | "TELLER_V2"
      | "calculateRolloverAmount"
      | "rolloverLoan"
  ): FunctionFragment;

  encodeFunctionData(
    functionFragment: "LENDER_COMMITMENT_FORWARDER",
    values?: undefined
  ): string;
  encodeFunctionData(functionFragment: "TELLER_V2", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "calculateRolloverAmount",
    values: [
      BigNumberish,
      ICommitmentRolloverLoan.AcceptCommitmentArgsStruct,
      BigNumberish
    ]
  ): string;
  encodeFunctionData(
    functionFragment: "rolloverLoan",
    values: [
      BigNumberish,
      BigNumberish,
      ICommitmentRolloverLoan.AcceptCommitmentArgsStruct
    ]
  ): string;

  decodeFunctionResult(
    functionFragment: "LENDER_COMMITMENT_FORWARDER",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "TELLER_V2", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "calculateRolloverAmount",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "rolloverLoan",
    data: BytesLike
  ): Result;
}

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

  interface: CommitmentRolloverLoanInterface;

  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>;

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

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

  calculateRolloverAmount: TypedContractMethod<
    [
      _loanId: BigNumberish,
      _commitmentArgs: ICommitmentRolloverLoan.AcceptCommitmentArgsStruct,
      _timestamp: BigNumberish
    ],
    [bigint],
    "view"
  >;

  rolloverLoan: TypedContractMethod<
    [
      _loanId: BigNumberish,
      _rolloverAmount: BigNumberish,
      _commitmentArgs: ICommitmentRolloverLoan.AcceptCommitmentArgsStruct
    ],
    [bigint],
    "nonpayable"
  >;

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

  getFunction(
    nameOrSignature: "LENDER_COMMITMENT_FORWARDER"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "TELLER_V2"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "calculateRolloverAmount"
  ): TypedContractMethod<
    [
      _loanId: BigNumberish,
      _commitmentArgs: ICommitmentRolloverLoan.AcceptCommitmentArgsStruct,
      _timestamp: BigNumberish
    ],
    [bigint],
    "view"
  >;
  getFunction(
    nameOrSignature: "rolloverLoan"
  ): TypedContractMethod<
    [
      _loanId: BigNumberish,
      _rolloverAmount: BigNumberish,
      _commitmentArgs: ICommitmentRolloverLoan.AcceptCommitmentArgsStruct
    ],
    [bigint],
    "nonpayable"
  >;

  filters: {};
}
