/* 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 LoanReferralForwarder {
  export type AcceptCommitmentArgsStruct = {
    commitmentId: BigNumberish;
    smartCommitmentAddress: AddressLike;
    principalAmount: BigNumberish;
    collateralAmount: BigNumberish;
    collateralTokenId: BigNumberish;
    collateralTokenAddress: AddressLike;
    interestRate: BigNumberish;
    loanDuration: BigNumberish;
    merkleProof: BytesLike[];
  };

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

export interface LoanReferralForwarderInterface extends Interface {
  getFunction(
    nameOrSignature: "TELLER_V2" | "acceptCommitmentWithReferral"
  ): FunctionFragment;

  getEvent(
    nameOrSignatureOrTopic: "CommitmentAcceptedWithReferral"
  ): EventFragment;

  encodeFunctionData(functionFragment: "TELLER_V2", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "acceptCommitmentWithReferral",
    values: [
      AddressLike,
      LoanReferralForwarder.AcceptCommitmentArgsStruct,
      AddressLike,
      BigNumberish,
      AddressLike
    ]
  ): string;

  decodeFunctionResult(functionFragment: "TELLER_V2", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "acceptCommitmentWithReferral",
    data: BytesLike
  ): Result;
}

export namespace CommitmentAcceptedWithReferralEvent {
  export type InputTuple = [
    bidId: BigNumberish,
    recipient: AddressLike,
    fundsRemaining: BigNumberish,
    reward: BigNumberish,
    rewardRecipient: AddressLike
  ];
  export type OutputTuple = [
    bidId: bigint,
    recipient: string,
    fundsRemaining: bigint,
    reward: bigint,
    rewardRecipient: string
  ];
  export interface OutputObject {
    bidId: bigint;
    recipient: string;
    fundsRemaining: bigint;
    reward: bigint;
    rewardRecipient: 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 LoanReferralForwarder extends BaseContract {
  connect(runner?: ContractRunner | null): LoanReferralForwarder;
  waitForDeployment(): Promise<this>;

  interface: LoanReferralForwarderInterface;

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

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

  acceptCommitmentWithReferral: TypedContractMethod<
    [
      _commitmentForwarder: AddressLike,
      _acceptCommitmentArgs: LoanReferralForwarder.AcceptCommitmentArgsStruct,
      _recipient: AddressLike,
      _reward: BigNumberish,
      _rewardRecipient: AddressLike
    ],
    [bigint],
    "nonpayable"
  >;

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

  getFunction(
    nameOrSignature: "TELLER_V2"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "acceptCommitmentWithReferral"
  ): TypedContractMethod<
    [
      _commitmentForwarder: AddressLike,
      _acceptCommitmentArgs: LoanReferralForwarder.AcceptCommitmentArgsStruct,
      _recipient: AddressLike,
      _reward: BigNumberish,
      _rewardRecipient: AddressLike
    ],
    [bigint],
    "nonpayable"
  >;

  getEvent(
    key: "CommitmentAcceptedWithReferral"
  ): TypedContractEvent<
    CommitmentAcceptedWithReferralEvent.InputTuple,
    CommitmentAcceptedWithReferralEvent.OutputTuple,
    CommitmentAcceptedWithReferralEvent.OutputObject
  >;

  filters: {
    "CommitmentAcceptedWithReferral(uint256,address,uint256,uint256,address)": TypedContractEvent<
      CommitmentAcceptedWithReferralEvent.InputTuple,
      CommitmentAcceptedWithReferralEvent.OutputTuple,
      CommitmentAcceptedWithReferralEvent.OutputObject
    >;
    CommitmentAcceptedWithReferral: TypedContractEvent<
      CommitmentAcceptedWithReferralEvent.InputTuple,
      CommitmentAcceptedWithReferralEvent.OutputTuple,
      CommitmentAcceptedWithReferralEvent.OutputObject
    >;
  };
}
