/* 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 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 TellerV2Storage_G1Interface extends Interface {
  getFunction(
    nameOrSignature:
      | "__lenderVolumeFilled"
      | "__totalVolumeFilled"
      | "bidDefaultDuration"
      | "bidExpirationTime"
      | "bidId"
      | "bids"
      | "borrowerBids"
      | "lenderVolumeFilled"
      | "marketRegistry"
      | "reputationManager"
      | "totalVolumeFilled"
      | "uris"
      | "version"
  ): FunctionFragment;

  encodeFunctionData(
    functionFragment: "__lenderVolumeFilled",
    values: [AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "__totalVolumeFilled",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "bidDefaultDuration",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "bidExpirationTime",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(functionFragment: "bidId", values?: undefined): string;
  encodeFunctionData(functionFragment: "bids", values: [BigNumberish]): string;
  encodeFunctionData(
    functionFragment: "borrowerBids",
    values: [AddressLike, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "lenderVolumeFilled",
    values: [AddressLike, AddressLike]
  ): string;
  encodeFunctionData(
    functionFragment: "marketRegistry",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "reputationManager",
    values?: undefined
  ): 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: "bidDefaultDuration",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "bidExpirationTime",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "bidId", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "bids", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "borrowerBids",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "lenderVolumeFilled",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "marketRegistry",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "reputationManager",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "totalVolumeFilled",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "uris", data: BytesLike): Result;
  decodeFunctionResult(functionFragment: "version", data: BytesLike): Result;
}

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

  interface: TellerV2Storage_G1Interface;

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

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

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

  bidId: TypedContractMethod<[], [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"
  >;

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

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

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

  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: "bidDefaultDuration"
  ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">;
  getFunction(
    nameOrSignature: "bidExpirationTime"
  ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">;
  getFunction(
    nameOrSignature: "bidId"
  ): TypedContractMethod<[], [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: "lenderVolumeFilled"
  ): TypedContractMethod<
    [arg0: AddressLike, arg1: AddressLike],
    [bigint],
    "view"
  >;
  getFunction(
    nameOrSignature: "marketRegistry"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "reputationManager"
  ): TypedContractMethod<[], [string], "view">;
  getFunction(
    nameOrSignature: "totalVolumeFilled"
  ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">;
  getFunction(
    nameOrSignature: "uris"
  ): TypedContractMethod<[arg0: BigNumberish], [string], "view">;
  getFunction(
    nameOrSignature: "version"
  ): TypedContractMethod<[], [bigint], "view">;

  filters: {};
}
