/* 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 ILenderCommitmentGroup_V2 {
  export type CommitmentGroupConfigStruct = {
    principalTokenAddress: AddressLike;
    collateralTokenAddress: AddressLike;
    marketId: BigNumberish;
    maxLoanDuration: BigNumberish;
    interestRateLowerBound: BigNumberish;
    interestRateUpperBound: BigNumberish;
    liquidityThresholdPercent: BigNumberish;
    collateralRatio: BigNumberish;
  };

  export type CommitmentGroupConfigStructOutput = [
    principalTokenAddress: string,
    collateralTokenAddress: string,
    marketId: bigint,
    maxLoanDuration: bigint,
    interestRateLowerBound: bigint,
    interestRateUpperBound: bigint,
    liquidityThresholdPercent: bigint,
    collateralRatio: bigint
  ] & {
    principalTokenAddress: string;
    collateralTokenAddress: string;
    marketId: bigint;
    maxLoanDuration: bigint;
    interestRateLowerBound: bigint;
    interestRateUpperBound: bigint;
    liquidityThresholdPercent: bigint;
    collateralRatio: bigint;
  };
}

export declare namespace IUniswapPricingLibrary {
  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 LenderCommitmentGroupFactory_V2Interface extends Interface {
  getFunction(
    nameOrSignature:
      | "deployLenderCommitmentGroupPool"
      | "deployedLenderGroupContracts"
      | "initialize"
      | "lenderGroupBeacon"
      | "owner"
      | "renounceOwnership"
      | "transferOwnership"
  ): FunctionFragment;

  getEvent(
    nameOrSignatureOrTopic:
      | "DeployedLenderGroupContract"
      | "Initialized"
      | "OwnershipTransferred"
  ): EventFragment;

  encodeFunctionData(
    functionFragment: "deployLenderCommitmentGroupPool",
    values: [
      BigNumberish,
      ILenderCommitmentGroup_V2.CommitmentGroupConfigStruct,
      IUniswapPricingLibrary.PoolRouteConfigStruct[]
    ]
  ): string;
  encodeFunctionData(
    functionFragment: "deployedLenderGroupContracts",
    values: [AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "initialize",
    values: [AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "lenderGroupBeacon",
    values?: undefined
  ): string;
  encodeFunctionData(functionFragment: "owner", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "renounceOwnership",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "transferOwnership",
    values: [AddressLike]
  ): string;

  decodeFunctionResult(
    functionFragment: "deployLenderCommitmentGroupPool",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "deployedLenderGroupContracts",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "lenderGroupBeacon",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "renounceOwnership",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "transferOwnership",
    data: BytesLike
  ): Result;
}

export namespace DeployedLenderGroupContractEvent {
  export type InputTuple = [groupContract: AddressLike];
  export type OutputTuple = [groupContract: string];
  export interface OutputObject {
    groupContract: string;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

export namespace InitializedEvent {
  export type InputTuple = [version: BigNumberish];
  export type OutputTuple = [version: bigint];
  export interface OutputObject {
    version: 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 OwnershipTransferredEvent {
  export type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike];
  export type OutputTuple = [previousOwner: string, newOwner: string];
  export interface OutputObject {
    previousOwner: string;
    newOwner: string;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

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

  interface: LenderCommitmentGroupFactory_V2Interface;

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

  deployLenderCommitmentGroupPool: TypedContractMethod<
    [
      _initialPrincipalAmount: BigNumberish,
      _commitmentGroupConfig: ILenderCommitmentGroup_V2.CommitmentGroupConfigStruct,
      _poolOracleRoutes: IUniswapPricingLibrary.PoolRouteConfigStruct[]
    ],
    [string],
    "nonpayable"
  >;

  deployedLenderGroupContracts: TypedContractMethod<
    [arg0: AddressLike],
    [bigint],
    "view"
  >;

  initialize: TypedContractMethod<
    [_lenderGroupBeacon: AddressLike],
    [void],
    "nonpayable"
  >;

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

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

  renounceOwnership: TypedContractMethod<[], [void], "nonpayable">;

  transferOwnership: TypedContractMethod<
    [newOwner: AddressLike],
    [void],
    "nonpayable"
  >;

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

  getFunction(
    nameOrSignature: "deployLenderCommitmentGroupPool"
  ): TypedContractMethod<
    [
      _initialPrincipalAmount: BigNumberish,
      _commitmentGroupConfig: ILenderCommitmentGroup_V2.CommitmentGroupConfigStruct,
      _poolOracleRoutes: IUniswapPricingLibrary.PoolRouteConfigStruct[]
    ],
    [string],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "deployedLenderGroupContracts"
  ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">;
  getFunction(
    nameOrSignature: "initialize"
  ): TypedContractMethod<
    [_lenderGroupBeacon: AddressLike],
    [void],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "lenderGroupBeacon"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "owner"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "renounceOwnership"
  ): TypedContractMethod<[], [void], "nonpayable">;
  getFunction(
    nameOrSignature: "transferOwnership"
  ): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">;

  getEvent(
    key: "DeployedLenderGroupContract"
  ): TypedContractEvent<
    DeployedLenderGroupContractEvent.InputTuple,
    DeployedLenderGroupContractEvent.OutputTuple,
    DeployedLenderGroupContractEvent.OutputObject
  >;
  getEvent(
    key: "Initialized"
  ): TypedContractEvent<
    InitializedEvent.InputTuple,
    InitializedEvent.OutputTuple,
    InitializedEvent.OutputObject
  >;
  getEvent(
    key: "OwnershipTransferred"
  ): TypedContractEvent<
    OwnershipTransferredEvent.InputTuple,
    OwnershipTransferredEvent.OutputTuple,
    OwnershipTransferredEvent.OutputObject
  >;

  filters: {
    "DeployedLenderGroupContract(address)": TypedContractEvent<
      DeployedLenderGroupContractEvent.InputTuple,
      DeployedLenderGroupContractEvent.OutputTuple,
      DeployedLenderGroupContractEvent.OutputObject
    >;
    DeployedLenderGroupContract: TypedContractEvent<
      DeployedLenderGroupContractEvent.InputTuple,
      DeployedLenderGroupContractEvent.OutputTuple,
      DeployedLenderGroupContractEvent.OutputObject
    >;

    "Initialized(uint8)": TypedContractEvent<
      InitializedEvent.InputTuple,
      InitializedEvent.OutputTuple,
      InitializedEvent.OutputObject
    >;
    Initialized: TypedContractEvent<
      InitializedEvent.InputTuple,
      InitializedEvent.OutputTuple,
      InitializedEvent.OutputObject
    >;

    "OwnershipTransferred(address,address)": TypedContractEvent<
      OwnershipTransferredEvent.InputTuple,
      OwnershipTransferredEvent.OutputTuple,
      OwnershipTransferredEvent.OutputObject
    >;
    OwnershipTransferred: TypedContractEvent<
      OwnershipTransferredEvent.InputTuple,
      OwnershipTransferredEvent.OutputTuple,
      OwnershipTransferredEvent.OutputObject
    >;
  };
}
