/* 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 TellerV0Storage {
  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: TellerV0Storage.PaymentStruct;
    timestamp: BigNumberish;
    acceptedTimestamp: BigNumberish;
    lastRepaidTimestamp: BigNumberish;
    loanDuration: BigNumberish;
  };

  export type LoanDetailsStructOutput = [
    lendingToken: string,
    principal: bigint,
    totalRepaid: TellerV0Storage.PaymentStructOutput,
    timestamp: bigint,
    acceptedTimestamp: bigint,
    lastRepaidTimestamp: bigint,
    loanDuration: bigint
  ] & {
    lendingToken: string;
    principal: bigint;
    totalRepaid: TellerV0Storage.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 TellerV0StorageInterface extends Interface {
  getFunction(nameOrSignature: "bids"): FunctionFragment;

  encodeFunctionData(functionFragment: "bids", values: [BigNumberish]): string;

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

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

  interface: TellerV0StorageInterface;

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

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

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

  getFunction(
    nameOrSignature: "bids"
  ): TypedContractMethod<
    [arg0: BigNumberish],
    [
      [
        string,
        string,
        string,
        bigint,
        string,
        TellerV0Storage.LoanDetailsStructOutput,
        TellerV0Storage.TermsStructOutput,
        bigint
      ] & {
        borrower: string;
        receiver: string;
        _lender: string;
        marketplaceId: bigint;
        _metadataURI: string;
        loanDetails: TellerV0Storage.LoanDetailsStructOutput;
        terms: TellerV0Storage.TermsStructOutput;
        state: bigint;
      }
    ],
    "view"
  >;

  filters: {};
}
