/* 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 LoanReferralForwarderV2 {
  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 LoanReferralForwarderV2Interface extends Interface {
  getFunction(
    nameOrSignature: "TELLER_V2" | "acceptCommitmentWithReferral"
  ): FunctionFragment;

  getEvent(
    nameOrSignatureOrTopic: "CommitmentAcceptedWithReward"
  ): EventFragment;

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

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

export namespace CommitmentAcceptedWithRewardEvent {
  export type InputTuple = [
    bidId: BigNumberish,
    recipient: AddressLike,
    principalTokenAddress: AddressLike,
    fundsRemaining: BigNumberish,
    reward: BigNumberish,
    rewardRecipient: AddressLike,
    atmId: BigNumberish
  ];
  export type OutputTuple = [
    bidId: bigint,
    recipient: string,
    principalTokenAddress: string,
    fundsRemaining: bigint,
    reward: bigint,
    rewardRecipient: string,
    atmId: bigint
  ];
  export interface OutputObject {
    bidId: bigint;
    recipient: string;
    principalTokenAddress: string;
    fundsRemaining: bigint;
    reward: bigint;
    rewardRecipient: string;
    atmId: bigint;
  }
  export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
  export type Filter = TypedDeferredTopicFilter<Event>;
  export type Log = TypedEventLog<Event>;
  export type LogDescription = TypedLogDescription<Event>;
}

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

  interface: LoanReferralForwarderV2Interface;

  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: LoanReferralForwarderV2.AcceptCommitmentArgsStruct,
      _atmId: BigNumberish,
      _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: LoanReferralForwarderV2.AcceptCommitmentArgsStruct,
      _atmId: BigNumberish,
      _recipient: AddressLike,
      _reward: BigNumberish,
      _rewardRecipient: AddressLike
    ],
    [bigint],
    "nonpayable"
  >;

  getEvent(
    key: "CommitmentAcceptedWithReward"
  ): TypedContractEvent<
    CommitmentAcceptedWithRewardEvent.InputTuple,
    CommitmentAcceptedWithRewardEvent.OutputTuple,
    CommitmentAcceptedWithRewardEvent.OutputObject
  >;

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