/* 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 type PaymentStruct = { principal: BigNumberish; interest: BigNumberish };

export type PaymentStructOutput = [principal: bigint, interest: bigint] & {
  principal: bigint;
  interest: bigint;
};

export type LoanDetailsStruct = {
  lendingToken: AddressLike;
  principal: BigNumberish;
  totalRepaid: PaymentStruct;
  timestamp: BigNumberish;
  acceptedTimestamp: BigNumberish;
  lastRepaidTimestamp: BigNumberish;
  loanDuration: BigNumberish;
};

export type LoanDetailsStructOutput = [
  lendingToken: string,
  principal: bigint,
  totalRepaid: PaymentStructOutput,
  timestamp: bigint,
  acceptedTimestamp: bigint,
  lastRepaidTimestamp: bigint,
  loanDuration: bigint
] & {
  lendingToken: string;
  principal: bigint;
  totalRepaid: PaymentStructOutput;
  timestamp: bigint;
  acceptedTimestamp: bigint;
  lastRepaidTimestamp: bigint;
  loanDuration: bigint;
};

export type TermsStruct = {
  paymentCycleAmount: BigNumberish;
  paymentCycle: BigNumberish;
  APR: BigNumberish;
};

export type TermsStructOutput = [
  paymentCycleAmount: bigint,
  paymentCycle: bigint,
  APR: bigint
] & { paymentCycleAmount: bigint; paymentCycle: bigint; APR: bigint };

export interface TellerV2ContextInterface extends Interface {
  getFunction(
    nameOrSignature:
      | "__lenderVolumeFilled"
      | "__totalVolumeFilled"
      | "approveMarketForwarder"
      | "bidDefaultDuration"
      | "bidExpirationTime"
      | "bidId"
      | "bidPaymentCycleType"
      | "bids"
      | "borrowerBids"
      | "collateralManager"
      | "escrowVault"
      | "hasApprovedMarketForwarder"
      | "isTrustedForwarder"
      | "isTrustedMarketForwarder"
      | "lenderCommitmentForwarder"
      | "lenderManager"
      | "lenderVolumeFilled"
      | "marketRegistry"
      | "renounceMarketForwarder"
      | "reputationManager"
      | "setTrustedMarketForwarder"
      | "totalVolumeFilled"
      | "uris"
      | "version"
  ): FunctionFragment;

  getEvent(
    nameOrSignatureOrTopic:
      | "Initialized"
      | "MarketForwarderApproved"
      | "MarketForwarderRenounced"
      | "TrustedMarketForwarderSet"
  ): EventFragment;

  encodeFunctionData(
    functionFragment: "__lenderVolumeFilled",
    values: [AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "__totalVolumeFilled",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "approveMarketForwarder",
    values: [BigNumberish, AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "bidDefaultDuration",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "bidExpirationTime",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(functionFragment: "bidId", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "bidPaymentCycleType",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(functionFragment: "bids", values: [BigNumberish]): string;
  encodeFunctionData(
    functionFragment: "borrowerBids",
    values: [AddressLike, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "collateralManager",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "escrowVault",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "hasApprovedMarketForwarder",
    values: [BigNumberish, AddressLike, AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "isTrustedForwarder",
    values: [AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "isTrustedMarketForwarder",
    values: [BigNumberish, AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "lenderCommitmentForwarder",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "lenderManager",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "lenderVolumeFilled",
    values: [AddressLike, AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "marketRegistry",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "renounceMarketForwarder",
    values: [BigNumberish, AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "reputationManager",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "setTrustedMarketForwarder",
    values: [BigNumberish, AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "totalVolumeFilled",
    values: [AddressLike]
  ): string;
  encodeFunctionData(functionFragment: "uris", values: [BigNumberish]): string;
  encodeFunctionData(functionFragment: "version", values?: undefined): string;

  decodeFunctionResult(
    functionFragment: "__lenderVolumeFilled",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "__totalVolumeFilled",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "approveMarketForwarder",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "bidDefaultDuration",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "bidExpirationTime",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "bidId", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "bidPaymentCycleType",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "bids", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "borrowerBids",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "collateralManager",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "escrowVault",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "hasApprovedMarketForwarder",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "isTrustedForwarder",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "isTrustedMarketForwarder",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "lenderCommitmentForwarder",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "lenderManager",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "lenderVolumeFilled",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "marketRegistry",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "renounceMarketForwarder",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "reputationManager",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "setTrustedMarketForwarder",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "totalVolumeFilled",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "uris", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "version", data: BytesLike): Result;
}

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 MarketForwarderApprovedEvent {
  export type InputTuple = [
    marketId: BigNumberish,
    forwarder: AddressLike,
    sender: AddressLike
  ];
  export type OutputTuple = [
    marketId: bigint,
    forwarder: string,
    sender: string
  ];
  export interface OutputObject {
    marketId: bigint;
    forwarder: string;
    sender: 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 MarketForwarderRenouncedEvent {
  export type InputTuple = [
    marketId: BigNumberish,
    forwarder: AddressLike,
    sender: AddressLike
  ];
  export type OutputTuple = [
    marketId: bigint,
    forwarder: string,
    sender: string
  ];
  export interface OutputObject {
    marketId: bigint;
    forwarder: string;
    sender: 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 TrustedMarketForwarderSetEvent {
  export type InputTuple = [
    marketId: BigNumberish,
    forwarder: AddressLike,
    sender: AddressLike
  ];
  export type OutputTuple = [
    marketId: bigint,
    forwarder: string,
    sender: string
  ];
  export interface OutputObject {
    marketId: bigint;
    forwarder: string;
    sender: 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 TellerV2Context extends BaseContract {
  connect(runner?: ContractRunner | null): TellerV2Context;
  waitForDeployment(): Promise<this>;

  interface: TellerV2ContextInterface;

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

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

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

  approveMarketForwarder: TypedContractMethod<
    [_marketId: BigNumberish, _forwarder: AddressLike],
    [void],
    "nonpayable"
  >;

  bidDefaultDuration: TypedContractMethod<
    [arg0: BigNumberish],
    [bigint],
    "view"
  >;

  bidExpirationTime: TypedContractMethod<
    [arg0: BigNumberish],
    [bigint],
    "view"
  >;

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

  bidPaymentCycleType: TypedContractMethod<
    [arg0: BigNumberish],
    [bigint],
    "view"
  >;

  bids: TypedContractMethod<
    [arg0: BigNumberish],
    [
      [
        string,
        string,
        string,
        bigint,
        string,
        LoanDetailsStructOutput,
        TermsStructOutput,
        bigint,
        bigint
      ] & {
        borrower: string;
        receiver: string;
        lender: string;
        marketplaceId: bigint;
        _metadataURI: string;
        loanDetails: LoanDetailsStructOutput;
        terms: TermsStructOutput;
        state: bigint;
        paymentType: bigint;
      }
    ],
    "view"
  >;

  borrowerBids: TypedContractMethod<
    [arg0: AddressLike, arg1: BigNumberish],
    [bigint],
    "view"
  >;

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

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

  hasApprovedMarketForwarder: TypedContractMethod<
    [_marketId: BigNumberish, _forwarder: AddressLike, _account: AddressLike],
    [boolean],
    "view"
  >;

  isTrustedForwarder: TypedContractMethod<
    [forwarder: AddressLike],
    [boolean],
    "view"
  >;

  isTrustedMarketForwarder: TypedContractMethod<
    [_marketId: BigNumberish, _trustedMarketForwarder: AddressLike],
    [boolean],
    "view"
  >;

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

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

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

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

  renounceMarketForwarder: TypedContractMethod<
    [_marketId: BigNumberish, _forwarder: AddressLike],
    [void],
    "nonpayable"
  >;

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

  setTrustedMarketForwarder: TypedContractMethod<
    [_marketId: BigNumberish, _forwarder: AddressLike],
    [void],
    "nonpayable"
  >;

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

  uris: TypedContractMethod<[arg0: BigNumberish], [string], "view">;

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

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

  getFunction(
    nameOrSignature: "__lenderVolumeFilled"
  ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">;
  getFunction(
    nameOrSignature: "__totalVolumeFilled"
  ): TypedContractMethod<[], [bigint], "view">;
  getFunction(
    nameOrSignature: "approveMarketForwarder"
  ): TypedContractMethod<
    [_marketId: BigNumberish, _forwarder: AddressLike],
    [void],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "bidDefaultDuration"
  ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">;
  getFunction(
    nameOrSignature: "bidExpirationTime"
  ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">;
  getFunction(
    nameOrSignature: "bidId"
  ): TypedContractMethod<[], [bigint], "view">;
  getFunction(
    nameOrSignature: "bidPaymentCycleType"
  ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">;
  getFunction(
    nameOrSignature: "bids"
  ): TypedContractMethod<
    [arg0: BigNumberish],
    [
      [
        string,
        string,
        string,
        bigint,
        string,
        LoanDetailsStructOutput,
        TermsStructOutput,
        bigint,
        bigint
      ] & {
        borrower: string;
        receiver: string;
        lender: string;
        marketplaceId: bigint;
        _metadataURI: string;
        loanDetails: LoanDetailsStructOutput;
        terms: TermsStructOutput;
        state: bigint;
        paymentType: bigint;
      }
    ],
    "view"
  >;
  getFunction(
    nameOrSignature: "borrowerBids"
  ): TypedContractMethod<
    [arg0: AddressLike, arg1: BigNumberish],
    [bigint],
    "view"
  >;
  getFunction(
    nameOrSignature: "collateralManager"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "escrowVault"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "hasApprovedMarketForwarder"
  ): TypedContractMethod<
    [_marketId: BigNumberish, _forwarder: AddressLike, _account: AddressLike],
    [boolean],
    "view"
  >;
  getFunction(
    nameOrSignature: "isTrustedForwarder"
  ): TypedContractMethod<[forwarder: AddressLike], [boolean], "view">;
  getFunction(
    nameOrSignature: "isTrustedMarketForwarder"
  ): TypedContractMethod<
    [_marketId: BigNumberish, _trustedMarketForwarder: AddressLike],
    [boolean],
    "view"
  >;
  getFunction(
    nameOrSignature: "lenderCommitmentForwarder"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "lenderManager"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "lenderVolumeFilled"
  ): TypedContractMethod<
    [arg0: AddressLike, arg1: AddressLike],
    [bigint],
    "view"
  >;
  getFunction(
    nameOrSignature: "marketRegistry"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "renounceMarketForwarder"
  ): TypedContractMethod<
    [_marketId: BigNumberish, _forwarder: AddressLike],
    [void],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "reputationManager"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "setTrustedMarketForwarder"
  ): TypedContractMethod<
    [_marketId: BigNumberish, _forwarder: AddressLike],
    [void],
    "nonpayable"
  >;
  getFunction(
    nameOrSignature: "totalVolumeFilled"
  ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">;
  getFunction(
    nameOrSignature: "uris"
  ): TypedContractMethod<[arg0: BigNumberish], [string], "view">;
  getFunction(
    nameOrSignature: "version"
  ): TypedContractMethod<[], [bigint], "view">;

  getEvent(
    key: "Initialized"
  ): TypedContractEvent<
    InitializedEvent.InputTuple,
    InitializedEvent.OutputTuple,
    InitializedEvent.OutputObject
  >;
  getEvent(
    key: "MarketForwarderApproved"
  ): TypedContractEvent<
    MarketForwarderApprovedEvent.InputTuple,
    MarketForwarderApprovedEvent.OutputTuple,
    MarketForwarderApprovedEvent.OutputObject
  >;
  getEvent(
    key: "MarketForwarderRenounced"
  ): TypedContractEvent<
    MarketForwarderRenouncedEvent.InputTuple,
    MarketForwarderRenouncedEvent.OutputTuple,
    MarketForwarderRenouncedEvent.OutputObject
  >;
  getEvent(
    key: "TrustedMarketForwarderSet"
  ): TypedContractEvent<
    TrustedMarketForwarderSetEvent.InputTuple,
    TrustedMarketForwarderSetEvent.OutputTuple,
    TrustedMarketForwarderSetEvent.OutputObject
  >;

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

    "MarketForwarderApproved(uint256,address,address)": TypedContractEvent<
      MarketForwarderApprovedEvent.InputTuple,
      MarketForwarderApprovedEvent.OutputTuple,
      MarketForwarderApprovedEvent.OutputObject
    >;
    MarketForwarderApproved: TypedContractEvent<
      MarketForwarderApprovedEvent.InputTuple,
      MarketForwarderApprovedEvent.OutputTuple,
      MarketForwarderApprovedEvent.OutputObject
    >;

    "MarketForwarderRenounced(uint256,address,address)": TypedContractEvent<
      MarketForwarderRenouncedEvent.InputTuple,
      MarketForwarderRenouncedEvent.OutputTuple,
      MarketForwarderRenouncedEvent.OutputObject
    >;
    MarketForwarderRenounced: TypedContractEvent<
      MarketForwarderRenouncedEvent.InputTuple,
      MarketForwarderRenouncedEvent.OutputTuple,
      MarketForwarderRenouncedEvent.OutputObject
    >;

    "TrustedMarketForwarderSet(uint256,address,address)": TypedContractEvent<
      TrustedMarketForwarderSetEvent.InputTuple,
      TrustedMarketForwarderSetEvent.OutputTuple,
      TrustedMarketForwarderSetEvent.OutputObject
    >;
    TrustedMarketForwarderSet: TypedContractEvent<
      TrustedMarketForwarderSetEvent.InputTuple,
      TrustedMarketForwarderSetEvent.OutputTuple,
      TrustedMarketForwarderSetEvent.OutputObject
    >;
  };
}
