/* 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 ILenderCommitmentForwarder_U1 {
  export type CommitmentStruct = {
    maxPrincipal: BigNumberish;
    expiration: BigNumberish;
    maxDuration: BigNumberish;
    minInterestRate: BigNumberish;
    collateralTokenAddress: AddressLike;
    collateralTokenId: BigNumberish;
    maxPrincipalPerCollateralAmount: BigNumberish;
    collateralTokenType: BigNumberish;
    lender: AddressLike;
    marketId: BigNumberish;
    principalTokenAddress: AddressLike;
  };

  export type CommitmentStructOutput = [
    maxPrincipal: bigint,
    expiration: bigint,
    maxDuration: bigint,
    minInterestRate: bigint,
    collateralTokenAddress: string,
    collateralTokenId: bigint,
    maxPrincipalPerCollateralAmount: bigint,
    collateralTokenType: bigint,
    lender: string,
    marketId: bigint,
    principalTokenAddress: string
  ] & {
    maxPrincipal: bigint;
    expiration: bigint;
    maxDuration: bigint;
    minInterestRate: bigint;
    collateralTokenAddress: string;
    collateralTokenId: bigint;
    maxPrincipalPerCollateralAmount: bigint;
    collateralTokenType: bigint;
    lender: string;
    marketId: bigint;
    principalTokenAddress: string;
  };

  export type PoolRouteConfigStruct = {
    pool: AddressLike;
    zeroForOne: boolean;
    twapInterval: BigNumberish;
    token0Decimals: BigNumberish;
    token1Decimals: BigNumberish;
  };

  export type PoolRouteConfigStructOutput = [
    pool: string,
    zeroForOne: boolean,
    twapInterval: bigint,
    token0Decimals: bigint,
    token1Decimals: bigint
  ] & {
    pool: string;
    zeroForOne: boolean;
    twapInterval: bigint;
    token0Decimals: bigint;
    token1Decimals: bigint;
  };
}

export interface ILenderCommitmentForwarder_U1Interface extends Interface {
  getFunction(
    nameOrSignature:
      | "acceptCommitmentWithRecipient"
      | "acceptCommitmentWithRecipientAndProof"
      | "createCommitmentWithUniswap"
      | "getCommitmentAcceptedPrincipal"
      | "getCommitmentCollateralTokenAddress"
      | "getCommitmentLender"
      | "getCommitmentMarketId"
      | "getCommitmentMaxPrincipal"
      | "getCommitmentPrincipalTokenAddress"
  ): FunctionFragment;

  encodeFunctionData(
    functionFragment: "acceptCommitmentWithRecipient",
    values: [
      BigNumberish,
      BigNumberish,
      BigNumberish,
      BigNumberish,
      AddressLike,
      AddressLike,
      BigNumberish,
      BigNumberish
    ]
  ): string;
  encodeFunctionData(
    functionFragment: "acceptCommitmentWithRecipientAndProof",
    values: [
      BigNumberish,
      BigNumberish,
      BigNumberish,
      BigNumberish,
      AddressLike,
      AddressLike,
      BigNumberish,
      BigNumberish,
      BytesLike[]
    ]
  ): string;
  encodeFunctionData(
    functionFragment: "createCommitmentWithUniswap",
    values: [
      ILenderCommitmentForwarder_U1.CommitmentStruct,
      AddressLike[],
      ILenderCommitmentForwarder_U1.PoolRouteConfigStruct[],
      BigNumberish
    ]
  ): string;
  encodeFunctionData(
    functionFragment: "getCommitmentAcceptedPrincipal",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getCommitmentCollateralTokenAddress",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getCommitmentLender",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getCommitmentMarketId",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getCommitmentMaxPrincipal",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getCommitmentPrincipalTokenAddress",
    values: [BigNumberish]
  ): string;

  decodeFunctionResult(
    functionFragment: "acceptCommitmentWithRecipient",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "acceptCommitmentWithRecipientAndProof",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "createCommitmentWithUniswap",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getCommitmentAcceptedPrincipal",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getCommitmentCollateralTokenAddress",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getCommitmentLender",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getCommitmentMarketId",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getCommitmentMaxPrincipal",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getCommitmentPrincipalTokenAddress",
    data: BytesLike
  ): Result;
}

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

  interface: ILenderCommitmentForwarder_U1Interface;

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

  acceptCommitmentWithRecipient: TypedContractMethod<
    [
      _commitmentId: BigNumberish,
      _principalAmount: BigNumberish,
      _collateralAmount: BigNumberish,
      _collateralTokenId: BigNumberish,
      _collateralTokenAddress: AddressLike,
      _recipient: AddressLike,
      _interestRate: BigNumberish,
      _loanDuration: BigNumberish
    ],
    [bigint],
    "nonpayable"
  >;

  acceptCommitmentWithRecipientAndProof: TypedContractMethod<
    [
      _commitmentId: BigNumberish,
      _principalAmount: BigNumberish,
      _collateralAmount: BigNumberish,
      _collateralTokenId: BigNumberish,
      _collateralTokenAddress: AddressLike,
      _recipient: AddressLike,
      _interestRate: BigNumberish,
      _loanDuration: BigNumberish,
      _merkleProof: BytesLike[]
    ],
    [bigint],
    "nonpayable"
  >;

  createCommitmentWithUniswap: TypedContractMethod<
    [
      _commitment: ILenderCommitmentForwarder_U1.CommitmentStruct,
      _borrowerAddressList: AddressLike[],
      _poolRoutes: ILenderCommitmentForwarder_U1.PoolRouteConfigStruct[],
      _poolOracleLtvRatio: BigNumberish
    ],
    [bigint],
    "nonpayable"
  >;

  getCommitmentAcceptedPrincipal: TypedContractMethod<
    [_commitmentId: BigNumberish],
    [bigint],
    "view"
  >;

  getCommitmentCollateralTokenAddress: TypedContractMethod<
    [_commitmentId: BigNumberish],
    [string],
    "view"
  >;

  getCommitmentLender: TypedContractMethod<
    [_commitmentId: BigNumberish],
    [string],
    "view"
  >;

  getCommitmentMarketId: TypedContractMethod<
    [_commitmentId: BigNumberish],
    [bigint],
    "view"
  >;

  getCommitmentMaxPrincipal: TypedContractMethod<
    [_commitmentId: BigNumberish],
    [bigint],
    "view"
  >;

  getCommitmentPrincipalTokenAddress: TypedContractMethod<
    [_commitmentId: BigNumberish],
    [string],
    "view"
  >;

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

  getFunction(
    nameOrSignature: "acceptCommitmentWithRecipient"
  ): TypedContractMethod<
    [
      _commitmentId: BigNumberish,
      _principalAmount: BigNumberish,
      _collateralAmount: BigNumberish,
      _collateralTokenId: BigNumberish,
      _collateralTokenAddress: AddressLike,
      _recipient: AddressLike,
      _interestRate: BigNumberish,
      _loanDuration: BigNumberish
    ],
    [bigint],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "acceptCommitmentWithRecipientAndProof"
  ): TypedContractMethod<
    [
      _commitmentId: BigNumberish,
      _principalAmount: BigNumberish,
      _collateralAmount: BigNumberish,
      _collateralTokenId: BigNumberish,
      _collateralTokenAddress: AddressLike,
      _recipient: AddressLike,
      _interestRate: BigNumberish,
      _loanDuration: BigNumberish,
      _merkleProof: BytesLike[]
    ],
    [bigint],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "createCommitmentWithUniswap"
  ): TypedContractMethod<
    [
      _commitment: ILenderCommitmentForwarder_U1.CommitmentStruct,
      _borrowerAddressList: AddressLike[],
      _poolRoutes: ILenderCommitmentForwarder_U1.PoolRouteConfigStruct[],
      _poolOracleLtvRatio: BigNumberish
    ],
    [bigint],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "getCommitmentAcceptedPrincipal"
  ): TypedContractMethod<[_commitmentId: BigNumberish], [bigint], "view">;
  getFunction(
    nameOrSignature: "getCommitmentCollateralTokenAddress"
  ): TypedContractMethod<[_commitmentId: BigNumberish], [string], "view">;
  getFunction(
    nameOrSignature: "getCommitmentLender"
  ): TypedContractMethod<[_commitmentId: BigNumberish], [string], "view">;
  getFunction(
    nameOrSignature: "getCommitmentMarketId"
  ): TypedContractMethod<[_commitmentId: BigNumberish], [bigint], "view">;
  getFunction(
    nameOrSignature: "getCommitmentMaxPrincipal"
  ): TypedContractMethod<[_commitmentId: BigNumberish], [bigint], "view">;
  getFunction(
    nameOrSignature: "getCommitmentPrincipalTokenAddress"
  ): TypedContractMethod<[_commitmentId: BigNumberish], [string], "view">;

  filters: {};
}
