/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */

import { Contract, Interface, type ContractRunner } from "ethers";
import type {
  ITellerV2,
  ITellerV2Interface,
} from "../../../contracts/interfaces/ITellerV2";

const _abi = [
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
      {
        internalType: "uint256",
        name: "_timestamp",
        type: "uint256",
      },
    ],
    name: "calculateAmountDue",
    outputs: [
      {
        components: [
          {
            internalType: "uint256",
            name: "principal",
            type: "uint256",
          },
          {
            internalType: "uint256",
            name: "interest",
            type: "uint256",
          },
        ],
        internalType: "struct Payment",
        name: "due",
        type: "tuple",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
      {
        internalType: "uint256",
        name: "_timestamp",
        type: "uint256",
      },
    ],
    name: "calculateAmountOwed",
    outputs: [
      {
        components: [
          {
            internalType: "uint256",
            name: "principal",
            type: "uint256",
          },
          {
            internalType: "uint256",
            name: "interest",
            type: "uint256",
          },
        ],
        internalType: "struct Payment",
        name: "owed",
        type: "tuple",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
    ],
    name: "getBidState",
    outputs: [
      {
        internalType: "enum BidState",
        name: "",
        type: "uint8",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "address",
        name: "_borrower",
        type: "address",
      },
    ],
    name: "getBorrowerActiveLoanIds",
    outputs: [
      {
        internalType: "uint256[]",
        name: "",
        type: "uint256[]",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
    ],
    name: "getLoanBorrower",
    outputs: [
      {
        internalType: "address",
        name: "borrower_",
        type: "address",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
    ],
    name: "getLoanLender",
    outputs: [
      {
        internalType: "address",
        name: "lender_",
        type: "address",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
    ],
    name: "getLoanLendingToken",
    outputs: [
      {
        internalType: "address",
        name: "token_",
        type: "address",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
    ],
    name: "getLoanMarketId",
    outputs: [
      {
        internalType: "uint256",
        name: "",
        type: "uint256",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
    ],
    name: "getLoanSummary",
    outputs: [
      {
        internalType: "address",
        name: "borrower",
        type: "address",
      },
      {
        internalType: "address",
        name: "lender",
        type: "address",
      },
      {
        internalType: "uint256",
        name: "marketId",
        type: "uint256",
      },
      {
        internalType: "address",
        name: "principalTokenAddress",
        type: "address",
      },
      {
        internalType: "uint256",
        name: "principalAmount",
        type: "uint256",
      },
      {
        internalType: "uint32",
        name: "acceptedTimestamp",
        type: "uint32",
      },
      {
        internalType: "uint32",
        name: "lastRepaidTimestamp",
        type: "uint32",
      },
      {
        internalType: "enum BidState",
        name: "bidState",
        type: "uint8",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
    ],
    name: "isLoanDefaulted",
    outputs: [
      {
        internalType: "bool",
        name: "",
        type: "bool",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
    ],
    name: "isLoanLiquidateable",
    outputs: [
      {
        internalType: "bool",
        name: "",
        type: "bool",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
    ],
    name: "isPaymentLate",
    outputs: [
      {
        internalType: "bool",
        name: "",
        type: "bool",
      },
    ],
    stateMutability: "view",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
    ],
    name: "lenderAcceptBid",
    outputs: [
      {
        internalType: "uint256",
        name: "amountToProtocol",
        type: "uint256",
      },
      {
        internalType: "uint256",
        name: "amountToMarketplace",
        type: "uint256",
      },
      {
        internalType: "uint256",
        name: "amountToBorrower",
        type: "uint256",
      },
    ],
    stateMutability: "nonpayable",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
      {
        internalType: "uint256",
        name: "_amount",
        type: "uint256",
      },
    ],
    name: "repayLoan",
    outputs: [],
    stateMutability: "nonpayable",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
    ],
    name: "repayLoanFull",
    outputs: [],
    stateMutability: "nonpayable",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "uint256",
        name: "_bidId",
        type: "uint256",
      },
    ],
    name: "repayLoanMinimum",
    outputs: [],
    stateMutability: "nonpayable",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "address",
        name: "_lendingToken",
        type: "address",
      },
      {
        internalType: "uint256",
        name: "_marketplaceId",
        type: "uint256",
      },
      {
        internalType: "uint256",
        name: "_principal",
        type: "uint256",
      },
      {
        internalType: "uint32",
        name: "_duration",
        type: "uint32",
      },
      {
        internalType: "uint16",
        name: "_APR",
        type: "uint16",
      },
      {
        internalType: "string",
        name: "_metadataURI",
        type: "string",
      },
      {
        internalType: "address",
        name: "_receiver",
        type: "address",
      },
    ],
    name: "submitBid",
    outputs: [
      {
        internalType: "uint256",
        name: "bidId_",
        type: "uint256",
      },
    ],
    stateMutability: "nonpayable",
    type: "function",
  },
  {
    inputs: [
      {
        internalType: "address",
        name: "_lendingToken",
        type: "address",
      },
      {
        internalType: "uint256",
        name: "_marketplaceId",
        type: "uint256",
      },
      {
        internalType: "uint256",
        name: "_principal",
        type: "uint256",
      },
      {
        internalType: "uint32",
        name: "_duration",
        type: "uint32",
      },
      {
        internalType: "uint16",
        name: "_APR",
        type: "uint16",
      },
      {
        internalType: "string",
        name: "_metadataURI",
        type: "string",
      },
      {
        internalType: "address",
        name: "_receiver",
        type: "address",
      },
      {
        components: [
          {
            internalType: "enum CollateralType",
            name: "_collateralType",
            type: "uint8",
          },
          {
            internalType: "uint256",
            name: "_amount",
            type: "uint256",
          },
          {
            internalType: "uint256",
            name: "_tokenId",
            type: "uint256",
          },
          {
            internalType: "address",
            name: "_collateralAddress",
            type: "address",
          },
        ],
        internalType: "struct Collateral[]",
        name: "_collateralInfo",
        type: "tuple[]",
      },
    ],
    name: "submitBid",
    outputs: [
      {
        internalType: "uint256",
        name: "bidId_",
        type: "uint256",
      },
    ],
    stateMutability: "nonpayable",
    type: "function",
  },
] as const;

export class ITellerV2__factory {
  static readonly abi = _abi;
  static createInterface(): ITellerV2Interface {
    return new Interface(_abi) as ITellerV2Interface;
  }
  static connect(address: string, runner?: ContractRunner | null): ITellerV2 {
    return new Contract(address, _abi, runner) as unknown as ITellerV2;
  }
}
