/* 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 ILenderCommitmentGroup {
  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 ILenderCommitmentGroupInterface extends Interface {
  getFunction(
    nameOrSignature:
      | "addPrincipalToCommitmentGroup"
      | "burnSharesToWithdrawEarnings"
      | "getTokenDifferenceFromLiquidations"
      | "initialize"
      | "liquidateDefaultedLoanWithIncentive"
      | "prepareSharesForBurn"
  ): FunctionFragment;

  encodeFunctionData(
    functionFragment: "addPrincipalToCommitmentGroup",
    values: [BigNumberish, AddressLike, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "burnSharesToWithdrawEarnings",
    values: [BigNumberish, AddressLike, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getTokenDifferenceFromLiquidations",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "initialize",
    values: [
      ILenderCommitmentGroup.CommitmentGroupConfigStruct,
      IUniswapPricingLibrary.PoolRouteConfigStruct[]
    ]
  ): string;
  encodeFunctionData(
    functionFragment: "liquidateDefaultedLoanWithIncentive",
    values: [BigNumberish, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "prepareSharesForBurn",
    values: [BigNumberish]
  ): string;

  decodeFunctionResult(
    functionFragment: "addPrincipalToCommitmentGroup",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "burnSharesToWithdrawEarnings",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "getTokenDifferenceFromLiquidations",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "liquidateDefaultedLoanWithIncentive",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "prepareSharesForBurn",
    data: BytesLike
  ): Result;
}

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

  interface: ILenderCommitmentGroupInterface;

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

  addPrincipalToCommitmentGroup: TypedContractMethod<
    [
      _amount: BigNumberish,
      _sharesRecipient: AddressLike,
      _minAmountOut: BigNumberish
    ],
    [bigint],
    "nonpayable"
  >;

  burnSharesToWithdrawEarnings: TypedContractMethod<
    [
      _amountPoolSharesTokens: BigNumberish,
      _recipient: AddressLike,
      _minAmountOut: BigNumberish
    ],
    [bigint],
    "nonpayable"
  >;

  getTokenDifferenceFromLiquidations: TypedContractMethod<[], [bigint], "view">;

  initialize: TypedContractMethod<
    [
      _commitmentGroupConfig: ILenderCommitmentGroup.CommitmentGroupConfigStruct,
      _poolOracleRoutes: IUniswapPricingLibrary.PoolRouteConfigStruct[]
    ],
    [string],
    "nonpayable"
  >;

  liquidateDefaultedLoanWithIncentive: TypedContractMethod<
    [_bidId: BigNumberish, _tokenAmountDifference: BigNumberish],
    [void],
    "nonpayable"
  >;

  prepareSharesForBurn: TypedContractMethod<
    [_amountPoolSharesTokens: BigNumberish],
    [boolean],
    "nonpayable"
  >;

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

  getFunction(
    nameOrSignature: "addPrincipalToCommitmentGroup"
  ): TypedContractMethod<
    [
      _amount: BigNumberish,
      _sharesRecipient: AddressLike,
      _minAmountOut: BigNumberish
    ],
    [bigint],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "burnSharesToWithdrawEarnings"
  ): TypedContractMethod<
    [
      _amountPoolSharesTokens: BigNumberish,
      _recipient: AddressLike,
      _minAmountOut: BigNumberish
    ],
    [bigint],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "getTokenDifferenceFromLiquidations"
  ): TypedContractMethod<[], [bigint], "view">;
  getFunction(
    nameOrSignature: "initialize"
  ): TypedContractMethod<
    [
      _commitmentGroupConfig: ILenderCommitmentGroup.CommitmentGroupConfigStruct,
      _poolOracleRoutes: IUniswapPricingLibrary.PoolRouteConfigStruct[]
    ],
    [string],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "liquidateDefaultedLoanWithIncentive"
  ): TypedContractMethod<
    [_bidId: BigNumberish, _tokenAmountDifference: BigNumberish],
    [void],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "prepareSharesForBurn"
  ): TypedContractMethod<
    [_amountPoolSharesTokens: BigNumberish],
    [boolean],
    "nonpayable"
  >;

  filters: {};
}
