import { OperationVariables } from '@apollo/client/core/index.js'; import { Maybe } from 'graphql/jsutils/Maybe'; import { Account, Address, Hash, Hex, TransactionReceipt } from 'viem'; import { Auction } from './blockchain'; import { Api, OrderInput, Props as ApiProps } from './clients/api'; import { Contracts, GondiPublicClient, Wallet } from './clients/contracts'; import { CrossCurrencyRenegotiationInput, CrossCurrencyRenegotiationQuote } from './clients/contracts/CrossCurrencyRenegotiation'; import { DealInput, GenerateCollectionOfferHashMutation, LoanOfferPublicationInput, MarketplaceEnum, NftOrderInput, OfferValidatorInput, SingleNftOrderInput, SingleNftSignedOfferInput, TokenStandardType } from './generated/graphql'; import * as model from './model'; import { NftStandard } from './model'; import { BuyWithLoanInput, BuyWithLoanQuote } from './utils/buyWithLoan'; import { CreditPurchaseInput, CreditPurchaseQuote } from './utils/creditPurchase'; import { LoanDelegation } from './utils/delegation'; import { LoanToMslLoanType } from './utils/loan'; import { OptionalNullable } from './utils/types'; /** An offer any NFT of a set, a collection or the NFTs carrying some traits, can borrow against. */ type MakeOfferInput = model.CollectionOfferInput | model.TraitOfferInput; /** The fields `_makeOffer` fills in before asking the API for the offer to sign. */ type MakeOfferDefaults = { lenderAddress: Address; signerAddress: Address; borrowerAddress: Address; requiresLiquidation: boolean; lenderRefinanceDisabled: boolean; contractAddress: Address; offerValidators: OfferValidatorInput[]; }; /** The fields the lender's signature adds to a set offer before it is saved. */ type MakeOfferSignedFields = MakeOfferDefaults & { fee: bigint; offerHash: Hash; offerId: bigint; signature: Hex; }; interface GondiProps { wallet: Wallet; /** * Dedicated public client for read operations: transaction simulations, * receipt polling and contract reads. Must be connected to the same chain as * `wallet`. When omitted, a public client is derived from the wallet's own * transport, so every read goes through the wallet provider's RPC. */ publicClient?: GondiPublicClient; apiClient?: ApiProps['apiClient']; onStepChange?: OnStepChange; /** * Skips the flagged-NFT lookup `emitLoan`, `emitLoans`, `revokeDelegationsAndEmitLoan`, * `refinanceFromOffers`, `efficientRefinanceFromOffers` and * `crossCurrencyRenegotiation` run before * sending, saving an API call. Only for callers that already keep flagged * NFTs out of those flows themselves, such as the GONDI web app. */ skipFlaggedNftCheck?: boolean; } /** Fields every transaction step carries, whatever its status. */ type TransactionStepBase = { type: 'transaction'; to: Address; functionNameOrSelector: string; /** Chain the wallet used to submit this transaction. */ chainId?: number; }; /** A transaction step; narrowing on `status` tells which hashes it carries. */ type TransactionStep = TransactionStepBase & ({ status: 'waiting'; } | { status: 'broadcasted'; /** Hash the wallet broadcast. */ transactionHash: Hash; } | { status: 'success'; /** Hash of the mined receipt: a replacement's when the provider reports one. */ transactionHash: Hash; /** Hash the wallet broadcast; equals `transactionHash` unless it was replaced. */ originalTransactionHash: Hash; }); type Step = { type: 'signature'; primaryType: string; status: 'waiting' | 'success'; } | TransactionStep | { type: 'api'; status: 'waiting' | 'success'; mutationName: string; variables?: OperationVariables; }; export type OnStepChange = (step: Step) => Promise; export declare class Gondi { private pendingSingleNftPublications; private pendingCollectionPublications; private pendingRenegotiationPublications; /** Retains bounded signed payloads while their API save is pending. */ private rememberPublication; /** Binds signed terms and contract; excludes unsigned predecessors. */ private publicationKey; contracts: Contracts; wallet: Wallet; account: Account; bcClient: GondiPublicClient; apiClient: Api; skipFlaggedNftCheck: boolean; constructor({ wallet, publicClient, apiClient, onStepChange, skipFlaggedNftCheck, }: GondiProps); static create(props: GondiProps & { onStepChange: OnStepChange; }): Gondi; static calculateProratedOriginationFee: ({ principal, aprBps, duration, effectiveApr, }: { principal: bigint; aprBps: bigint; duration: bigint; effectiveApr: number; }) => { fee: bigint; actualEaprBps: bigint; }; static buildSiweMessage: ({ domain, address, statement, uri, version, chainId, nonce, issuedAt, }: { domain: string; address: string; statement: string; uri: string; version: string; chainId: number; nonce: string; issuedAt?: string; }) => string; /** * Signs and saves an item offer. * @param publication Optional unsigned admission metadata. Previews before signing * and throws the backend rejection reason. Identical retries after failed saves * reuse the signature; a successful save clears that pending signature. */ makeSingleNftOffer(offer: model.SingleNftOfferInput, publication?: LoanOfferPublicationInput): Promise<{ aprBps: import("./generated/graphql").Scalars["BigInt"]; borrowerAddress: import("./generated/graphql").Scalars["Address"]; capacity: import("./generated/graphql").Scalars["BigInt"]; contractAddress: import("./generated/graphql").Scalars["Address"]; duration: import("./generated/graphql").Scalars["BigInt"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fee: import("./generated/graphql").Scalars["BigInt"]; lenderAddress: import("./generated/graphql").Scalars["Address"]; lenderRefinanceDisabled?: import("./generated/graphql").Scalars["Boolean"]; maxSeniorRepayment?: import("./generated/graphql").InputMaybe; maxTrancheFloor?: import("./generated/graphql").InputMaybe; nftId: import("./generated/graphql").Scalars["Int"]; offerHash: import("./generated/graphql").Scalars["Hash"]; offerId: import("./generated/graphql").Scalars["BigInt"]; offerValidators: Array; principalAddress: import("./generated/graphql").Scalars["Address"]; principalAmount: import("./generated/graphql").Scalars["BigInt"]; requiresLiquidation?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").Scalars["Signature"]; signerAddress?: import("./generated/graphql").InputMaybe; id: string; nftCollateralAddress: `0x${string}`; nftCollateralTokenId: bigint; }>; /** @internal */ _makeSingleNftOffer(offer: model.SingleNftOfferInput, mslContractAddress: Address, skipSave: true, publication?: LoanOfferPublicationInput): Promise; /** @internal */ _makeSingleNftOffer(offer: model.SingleNftOfferInput, mslContractAddress?: Address, skipSave?: false, publication?: LoanOfferPublicationInput): ReturnType; /** * Signs and saves a collection offer without an item preview. * @param publication Optional unsigned admission metadata. Identical retries after * failed saves reuse the signature; a successful save clears that pending signature. * The backend evaluates collection offers independently for each item. */ makeCollectionOffer(offer: model.CollectionOfferInput, publication?: LoanOfferPublicationInput): Promise<{ aprBps: import("./generated/graphql").Scalars["BigInt"]; borrowerAddress: import("./generated/graphql").Scalars["Address"]; capacity: import("./generated/graphql").Scalars["BigInt"]; collectionId: import("./generated/graphql").Scalars["Int"]; contractAddress: import("./generated/graphql").Scalars["Address"]; duration: import("./generated/graphql").Scalars["BigInt"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fee: import("./generated/graphql").Scalars["BigInt"]; lenderAddress: import("./generated/graphql").Scalars["Address"]; lenderRefinanceDisabled?: import("./generated/graphql").Scalars["Boolean"]; maxSeniorRepayment?: import("./generated/graphql").InputMaybe; maxTrancheFloor?: import("./generated/graphql").InputMaybe; offerHash: import("./generated/graphql").Scalars["Hash"]; offerId: import("./generated/graphql").Scalars["BigInt"]; offerValidators: Array; principalAddress: import("./generated/graphql").Scalars["Address"]; principalAmount: import("./generated/graphql").Scalars["BigInt"]; requiresLiquidation?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").Scalars["Signature"]; signerAddress?: import("./generated/graphql").InputMaybe; id: string; nftCollateralAddress: `0x${string}`; nftCollateralTokenId: bigint; }>; /** @internal */ _makeCollectionOffer(offer: model.CollectionOfferInput, mslContractAddress?: Address, publication?: LoanOfferPublicationInput): Promise<{ aprBps: import("./generated/graphql").Scalars["BigInt"]; borrowerAddress: import("./generated/graphql").Scalars["Address"]; capacity: import("./generated/graphql").Scalars["BigInt"]; collectionId: import("./generated/graphql").Scalars["Int"]; contractAddress: import("./generated/graphql").Scalars["Address"]; duration: import("./generated/graphql").Scalars["BigInt"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fee: import("./generated/graphql").Scalars["BigInt"]; lenderAddress: import("./generated/graphql").Scalars["Address"]; lenderRefinanceDisabled?: import("./generated/graphql").Scalars["Boolean"]; maxSeniorRepayment?: import("./generated/graphql").InputMaybe; maxTrancheFloor?: import("./generated/graphql").InputMaybe; offerHash: import("./generated/graphql").Scalars["Hash"]; offerId: import("./generated/graphql").Scalars["BigInt"]; offerValidators: Array; principalAddress: import("./generated/graphql").Scalars["Address"]; principalAmount: import("./generated/graphql").Scalars["BigInt"]; requiresLiquidation?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").Scalars["Signature"]; signerAddress?: import("./generated/graphql").InputMaybe; id: string; nftCollateralAddress: `0x${string}`; nftCollateralTokenId: bigint; }>; /** A loan offer any NFT of the collection carrying every one of `offer.traitIds` can borrow against. */ makeTraitOffer(offer: model.TraitOfferInput): Promise<{ aprBps: import("./generated/graphql").Scalars["BigInt"]; borrowerAddress: import("./generated/graphql").Scalars["Address"]; capacity: import("./generated/graphql").Scalars["BigInt"]; contractAddress: import("./generated/graphql").Scalars["Address"]; duration: import("./generated/graphql").Scalars["BigInt"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fee: import("./generated/graphql").Scalars["BigInt"]; lenderAddress: import("./generated/graphql").Scalars["Address"]; lenderRefinanceDisabled?: import("./generated/graphql").Scalars["Boolean"]; maxSeniorRepayment?: import("./generated/graphql").InputMaybe; maxTrancheFloor?: import("./generated/graphql").InputMaybe; offerHash: import("./generated/graphql").Scalars["Hash"]; offerId: import("./generated/graphql").Scalars["BigInt"]; offerValidators: Array; principalAddress: import("./generated/graphql").Scalars["Address"]; principalAmount: import("./generated/graphql").Scalars["BigInt"]; requiresLiquidation?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").Scalars["Signature"]; signerAddress?: import("./generated/graphql").InputMaybe; traitIds: Array; id: string; nftCollateralAddress: `0x${string}`; nftCollateralTokenId: bigint; }>; /** @internal */ _makeTraitOffer(offer: model.TraitOfferInput, mslContractAddress?: Address): Promise<{ aprBps: import("./generated/graphql").Scalars["BigInt"]; borrowerAddress: import("./generated/graphql").Scalars["Address"]; capacity: import("./generated/graphql").Scalars["BigInt"]; contractAddress: import("./generated/graphql").Scalars["Address"]; duration: import("./generated/graphql").Scalars["BigInt"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fee: import("./generated/graphql").Scalars["BigInt"]; lenderAddress: import("./generated/graphql").Scalars["Address"]; lenderRefinanceDisabled?: import("./generated/graphql").Scalars["Boolean"]; maxSeniorRepayment?: import("./generated/graphql").InputMaybe; maxTrancheFloor?: import("./generated/graphql").InputMaybe; offerHash: import("./generated/graphql").Scalars["Hash"]; offerId: import("./generated/graphql").Scalars["BigInt"]; offerValidators: Array; principalAddress: import("./generated/graphql").Scalars["Address"]; principalAmount: import("./generated/graphql").Scalars["BigInt"]; requiresLiquidation?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").Scalars["Signature"]; signerAddress?: import("./generated/graphql").InputMaybe; traitIds: Array; id: string; nftCollateralAddress: `0x${string}`; nftCollateralTokenId: bigint; }>; /** * Signs and saves an offer any NFT of a set can borrow against, with * `nftCollateralTokenId` 0 in the signed struct. `generateOfferHash` and * `saveOffer` are the set type's two API calls; everything else, the struct * the contract verifies included, is shared by every set type. * @internal */ _makeOffer({ offer, mslContractAddress, generateOfferHash, saveOffer, }: { offer: TOffer; mslContractAddress?: Address; generateOfferHash: (offerInput: TOffer & MakeOfferDefaults) => Promise<{ offer: Omit; }>; saveOffer: (signedOffer: TOffer & MakeOfferSignedFields) => Promise; }): Promise; /** * Publishes a bid or listing, signing the order when the API asks for it. * * The input picks the kind: `tokenId` for one NFT, `traitIds` for a trait bid, * `nftIds` for a set bid that fills with any of the listed NFTs of * `collectionId` (2 to 1,000), and `collectionId` alone for a collection bid. * A trait, set or collection bid fills up to `maxExecutions` times. */ makeOrder(orderInput: OrderInput): Promise<{ amount?: import("./generated/graphql").InputMaybe; contractAddress: import("./generated/graphql").Scalars["Address"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; tokenId: import("./generated/graphql").Scalars["BigInt"]; __typename?: "MultipleTraitOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; collectionId: import("./generated/graphql").Scalars["Int"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; __typename?: "MultipleTraitOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; traitIds: Array; __typename?: "MultipleTraitOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; collectionId: import("./generated/graphql").Scalars["Int"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; nftIds: Array; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; __typename?: "MultipleTraitOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; contractAddress: import("./generated/graphql").Scalars["Address"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; tokenId: import("./generated/graphql").Scalars["BigInt"]; __typename?: "TraitOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; collectionId: import("./generated/graphql").Scalars["Int"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; __typename?: "TraitOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; traitIds: Array; __typename?: "TraitOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; collectionId: import("./generated/graphql").Scalars["Int"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; nftIds: Array; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; __typename?: "TraitOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; contractAddress: import("./generated/graphql").Scalars["Address"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; tokenId: import("./generated/graphql").Scalars["BigInt"]; __typename?: "SingleNFTOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; collectionId: import("./generated/graphql").Scalars["Int"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; __typename?: "SingleNFTOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; traitIds: Array; __typename?: "SingleNFTOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; collectionId: import("./generated/graphql").Scalars["Int"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; nftIds: Array; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; __typename?: "SingleNFTOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; contractAddress: import("./generated/graphql").Scalars["Address"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; tokenId: import("./generated/graphql").Scalars["BigInt"]; __typename?: "SetBidOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; collectionId: import("./generated/graphql").Scalars["Int"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; __typename?: "SetBidOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; traitIds: Array; __typename?: "SetBidOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; collectionId: import("./generated/graphql").Scalars["Int"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; nftIds: Array; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; __typename?: "SetBidOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; contractAddress: import("./generated/graphql").Scalars["Address"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; tokenId: import("./generated/graphql").Scalars["BigInt"]; __typename?: "CollectionOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; collectionId: import("./generated/graphql").Scalars["Int"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; __typename?: "CollectionOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; traitIds: Array; __typename?: "CollectionOrder"; id: string; status: string; marketPlaceAddress: Address; } | { amount?: import("./generated/graphql").InputMaybe; collectionId: import("./generated/graphql").Scalars["Int"]; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; fees?: import("./generated/graphql").InputMaybe>; isAsk?: import("./generated/graphql").InputMaybe; maxExecutions?: import("./generated/graphql").InputMaybe; nftIds: Array; price?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; __typename?: "CollectionOrder"; id: string; status: string; marketPlaceAddress: Address; }>; makeOrders(orders: SingleNftOrderInput[]): Promise<{ __typename?: "SingleNFTOrder"; id: string; price: bigint; fees: bigint; currencyAddress: Address; marketPlace: string; status: string; startTime: Date; expiration: Date; maker: Address; isAsk: boolean; nonce: bigint; taker: Address; signature: Hex; marketPlaceAddress: Address; evmOrder?: object | null; nft: { __typename?: "NFT"; id: string; }; }[]>; makeDeal(dealInput: DealInput): Promise<{ blockchain: import("./generated/graphql").BlockchainEnum; counterOfferForId?: import("./generated/graphql").InputMaybe; expiration: import("./generated/graphql").Scalars["BigInt"]; makerErc20s: Array; makerErc20sAmounts: Array; makerNfts: Array; makerNftsAmounts: Array; signature?: import("./generated/graphql").InputMaybe<`0x${string}`> | undefined; startTime: import("./generated/graphql").Scalars["BigInt"]; taker: import("./generated/graphql").Scalars["Address"]; takerErc20s: Array; takerErc20sAmounts: Array; takerNfts: Array; takerNftsAmounts: Array; __typename?: "Deal"; id: string; status: string; }>; makeSellAndRepayOrder(sellAndRepayOrderInput: NftOrderInput): Promise<{ amount?: import("./generated/graphql").InputMaybe; contractAddress: import("./generated/graphql").Scalars["Address"]; criteriaProof?: import("./generated/graphql").InputMaybe>; currencyAddress: import("./generated/graphql").Scalars["Address"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; extraSeaportData?: import("./generated/graphql").InputMaybe; fees?: import("./generated/graphql").InputMaybe>; isAsk: import("./generated/graphql").Scalars["Boolean"]; orderToFill?: import("./generated/graphql").InputMaybe; orderToFillInt64?: import("./generated/graphql").InputMaybe; price?: import("./generated/graphql").InputMaybe; repaymentSignature?: import("./generated/graphql").InputMaybe; replaceOrderId?: import("./generated/graphql").InputMaybe; replaceOrderIdInt64?: import("./generated/graphql").InputMaybe; signature: import("./generated/graphql").InputMaybe<`0x${string}`>; startTime: import("./generated/graphql").Scalars["BigInt"]; stealth?: import("./generated/graphql").InputMaybe; taker?: import("./generated/graphql").InputMaybe; tokenId: import("./generated/graphql").Scalars["BigInt"]; __typename?: "SellAndRepayOrder"; id: string; status: string; repaymentCalldata: Hex; marketPlaceAddress: Address; }>; buyNowPayLater({ amounts, purchaseBundlerAddress, contractAddress, loanDuration, offers, tokenId, repaymentCalldata, sellAndRepaySwapData, repayFlashLoanSwapParams, creditPurchaseQuote, buyWithLoanQuote, }: { amounts: bigint[]; purchaseBundlerAddress?: Address; contractAddress: Address; loanDuration: bigint; offers: OfferFromExecutionOffer[]; tokenId: bigint; creditPurchaseQuote?: CreditPurchaseQuote; buyWithLoanQuote?: BuyWithLoanQuote; repaymentCalldata?: Hex | null | undefined; sellAndRepaySwapData?: Maybe; repayFlashLoanSwapParams?: Maybe<{ inputCurrency: Address; inputAmount: bigint; swapData: Hex; }>; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise; }>; /** Verifies the confirmed nested purchase independently from legacy BNPL signing. */ private _buyWithCreditPurchase; /** Quotes ordinary, v3.1 flash and v3.2 nested purchases without signing or publishing an active order. */ quoteBuyWithLoan(input: BuyWithLoanInput): Promise; /** Quotes capped buyer funding for v3.1 credit against an Ethereum v3.2 seller. */ quoteCreditPurchase(input: CreditPurchaseInput): Promise; cancelOrder(order: { cancelCalldata: Hex; marketPlaceAddress: Address; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise; }>; /** * Cancels the wallet's trade orders by id, at most 50 per call, with one API call. * * `cancelTradeOrders` cancels the bids that `cancelsOffChain` (restricted to the GONDI signed * zone, so they only fill with a signature the API issues) without a transaction, and returns * the Seaport cancel calldata of the rest, sent as one transaction per marketplace. * * An off-chain cancel is final once the last fill signature already issued for the bid expires, * a few minutes at most. Pass `onChain: true` to cancel every order on-chain instead, final as * soon as the transaction is mined. * * @returns The ids cancelled off-chain, and one `{ txHash, waitTxInBlock }` per on-chain cancel. */ cancelOrders({ orderIds, onChain }: { orderIds: number[]; onChain?: boolean; }): Promise<{ offChainOrderIds: number[]; transactions: { txHash: `0x${string}`; waitTxInBlock: () => Promise; }[]; }>; private cancelOrdersOffChain; cancelOffer({ id, contractAddress }: { id: bigint; contractAddress: Address; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; lender: `0x${string}`; offerId: bigint; } | { blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; lender: `0x${string}`; offerId: bigint; } | { blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; lender: `0x${string}`; offerId: bigint; }>; }>; cancelOffers({ ids, contractAddress }: { ids: bigint[]; contractAddress: Address; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; events: ({ lender: `0x${string}`; offerId: bigint; } | { lender: `0x${string}`; offerId: bigint; } | { lender: `0x${string}`; offerId: bigint; })[]; }>; }>; cancelAllOffers({ minId, contractAddress }: { minId: bigint; contractAddress: Address; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; lender: `0x${string}`; minOfferId: bigint; }>; }>; hideOffer({ id, contractAddress }: { id: bigint; contractAddress: Address; }): Promise; hideOffers({ ids, contractAddress }: { ids: bigint[]; contractAddress: Address; }): Promise; unhideOffer({ id, contractAddress }: { id: bigint; contractAddress: Address; }): Promise; /** * Signs and saves a refinance offer, optionally with a matching fallback. * @param props.publication Optional unsigned admission metadata. Previews before * signing and throws the backend rejection reason. Identical retries after failed * saves reuse both signatures; a successful save clears the pending payloads. * @param props.private Shows the offer only to the loan's borrower and to the lender. * The API accepts it only for a principal worth at least the private minimum in USD * ($50k). It is not part of the signed struct. With `withFallbackOffer`, the fallback * is signed for `props.borrowerAddress`, the loan's borrower, so it stays private too. */ makeRefinanceOffer({ renegotiation, contractAddress, publication, ...props }: MakeRefinanceOfferProps): Promise<{ id: string; loanId: import("./generated/graphql").Scalars["String"]; duration: import("./generated/graphql").Scalars["BigInt"]; principalAmount: import("./generated/graphql").Scalars["BigInt"]; aprBps: import("./generated/graphql").Scalars["BigInt"]; renegotiationId: import("./generated/graphql").Scalars["BigInt"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; targetPrincipal?: import("./generated/graphql").InputMaybe> | undefined; requiresLiquidation?: import("./generated/graphql").InputMaybe | undefined; strictImprovement?: import("./generated/graphql").InputMaybe | undefined; trancheIndex?: import("./generated/graphql").InputMaybe> | undefined; lenderAddress: import("./generated/graphql").Scalars["Address"]; signerAddress?: import("./generated/graphql").InputMaybe; offerHash: import("./generated/graphql").Scalars["Hash"]; feeAmount: import("./generated/graphql").Scalars["BigInt"]; isAddNewTranche?: import("./generated/graphql").InputMaybe | undefined; private?: import("./generated/graphql").Scalars["Boolean"] | undefined; signature: import("./blockchain").Signature; } | { offerHash: `0x${string}`; signature: `0x${string}`; renegotiationId: bigint; targetPrincipal: bigint[]; trancheIndex: bigint[]; lenderAddress: import("./generated/graphql").Scalars["Address"]; signerAddress: import("./generated/graphql").InputMaybe; loanId: import("./generated/graphql").Scalars["String"]; duration: import("./generated/graphql").Scalars["BigInt"]; principalAmount: import("./generated/graphql").Scalars["BigInt"]; aprBps: import("./generated/graphql").Scalars["BigInt"]; expirationTime: import("./generated/graphql").Scalars["BigInt"]; requiresLiquidation?: import("./generated/graphql").InputMaybe | undefined; strictImprovement?: import("./generated/graphql").InputMaybe | undefined; feeAmount: import("./generated/graphql").Scalars["BigInt"]; isAddNewTranche?: import("./generated/graphql").InputMaybe | undefined; }>; cancelRefinanceOffer({ id, contractAddress }: { id: bigint; contractAddress: Address; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; lender: `0x${string}`; renegotiationId: bigint; } | { blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; lender: `0x${string}`; renegotiationId: bigint; } | { blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; lender: `0x${string}`; renegotiationId: bigint; }>; }>; hideRenegotiationOffer({ id, contractAddress }: { id: bigint; contractAddress: Address; }): Promise; unhideRenegotiationOffer({ id, contractAddress, }: { id: bigint; contractAddress: Address; }): Promise; /** * Hides a bid. `isAsk` is required so a listing is rejected here rather than * by the API, which refuses it either way. * * @deprecated Listings can no longer be hidden — cancel one on-chain instead. * Still hides bids. */ hideOrder({ id, isAsk }: { id: number; isAsk: boolean; }): Promise; /** * Unhides a bid. `isAsk` is required so a listing is rejected here rather than * by the API, which refuses it either way. * * @deprecated Listings can no longer be hidden — a listing hidden before that * change stays hidden and is cancelled on-chain. Still unhides bids. */ showOrder({ id, isAsk }: { id: number; isAsk: boolean; }): Promise; cancelAllRenegotiations({ minId, contractAddress, }: { minId: bigint; contractAddress: Address; }): Promise Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; lender: `0x${string}`; minRenegotiationId: bigint; }>; }>; offerExecutionFromOffers(offers: OfferFromExecutionOffer[], amounts?: bigint[]): EmitLoanArgs['offerExecution']; /** * Throws `FlaggedNftError` when the API flags the collateral NFT or an NFT it wraps. * An NFT the API does not know throws `NOT_FOUND`, and an API that does not answer * throws its own error: a loan is only sent once the API confirms the NFT is not flagged. */ private assertNftNotFlagged; emitLoan(args: EmitLoanArgs): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; id: string; } | { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; id: string; } | { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; lenderRefinanceDisabled: boolean; id: string; }; loanId: bigint; offerIds: string[]; }>; } | { txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; source: readonly { loanId: bigint; lender: `0x${string}`; principalAmount: bigint; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; id: string; }; loanId: bigint; offerId: string; }>; }>; /** * Emits several loans in one transaction: either every loan is emitted or none is. * * Every offer of every loan must belong to the same MultiSourceLoan contract, of version 3 or * later, and each NFT goes through the flagged-NFT check `emitLoan` runs before anything is sent. * `waitTxInBlock` resolves to `loans`, one per item and in the same order, each shaped as * `emitLoan` returns it. * * IMPLEMENTATION NOTE: each loan is an encoded `emitLoan` call inside the contract's * `multicall(bytes[])`, which `MultiSourceLoan` inherits from `Multicall` * (florida-contracts `src/lib/loans/MultiSourceLoan.sol`, `src/lib/Multicall.sol`). It * delegatecalls the calls in order, so `msg.sender` stays the borrower, and reverts the whole * transaction with `MulticallFailed(index, reason)` as soon as one of them fails. */ emitLoans(loans: EmitLoanArgs[]): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loans: { loan: { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; id: string; } | { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; id: string; } | { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; lenderRefinanceDisabled: boolean; id: string; }; loanId: bigint; offerIds: string[]; }[]; }>; }>; refinanceFromOffers({ loan, loanId, executionData, }: { loan: LoanToMslLoanType; loanId: bigint; executionData: EmitLoanArgs; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; id: string; } | { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; id: string; } | { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; lenderRefinanceDisabled: boolean; id: string; }; loanId: bigint; offerIds: string[]; }>; }>; efficientRefinanceFromOffers({ contractAddress, loan, loanId, executionData, }: { contractAddress: Address; loan: LoanToMslLoanType; loanId: bigint; executionData: EmitLoanArgs; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise; }>; /** Quotes atomic USDC/WETH loan replacement, including capped borrower spending. */ quoteCrossCurrencyRenegotiation(input: CrossCurrencyRenegotiationInput): Promise>; /** * Prepare old-currency repayment and NFT approvals before obtaining the final quote. * Approve its exact maximumFlashRepayment, then execute that same quote before expiry. */ crossCurrencyRenegotiation(input: CrossCurrencyRenegotiationInput & { quote: CrossCurrencyRenegotiationQuote; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ previousLoanId: bigint; loanId: bigint; loan: { id: string; contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; } | { id: string; contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; } | { id: string; contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; lenderRefinanceDisabled: boolean; }; blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; }>; }>; private _crossCurrencyRenegotiationClient; repayLoan({ loan, loanId, nftReceiver, }: { loan: LoanToMslLoanType; loanId: bigint; nftReceiver?: Address; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loanId: bigint; totalRepayment: bigint; fee: bigint; } | { blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loanId: bigint; totalRepayment: bigint; fee: bigint; } | { blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loanId: bigint; totalRepayment: bigint; fee: bigint; }>; }>; offers({ limit, cursor, sortBy, filterBy, }: model.ListOffersProps): Promise<{ offers: ({ type: "CollectionOffer" | "SetOffer" | "SingleNFTOffer" | "TraitOffer" | undefined; lender: `0x${string}` | null | undefined; borrower: `0x${string}` | null | undefined; signer: `0x${string}` | null | undefined; offerValidators: { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[]; nftCollateralAddress: `0x${string}`; nftCollateralTokenId: bigint; id: string; offerId: bigint; lenderAddress?: Address | null; borrowerAddress?: Address | null; signerAddress?: Address | null; contractAddress: Address; requiresLiquidation?: boolean | null; principalAddress: Address; principalAmount: bigint; aprBps: bigint; fee: bigint; capacity: bigint; expirationTime: bigint; duration: bigint; status: string; offerHash?: Hash | null; signature?: Hex | null; createdDate?: Date | null; repayment: bigint; hidden?: boolean | null; maxSeniorRepayment: bigint; lenderRefinanceDisabled: boolean; collection: { __typename?: "Collection"; id: string; slug: string; contractData: { __typename?: "ContractData"; contractAddress: Address; }; }; currency: { __typename?: "Currency"; symbol: string; decimals: number; address: Address; }; validators: Array<{ __typename?: "OfferValidator"; arguments: Hex; validator: Address; }>; } | { type: "CollectionOffer" | "SetOffer" | "SingleNFTOffer" | "TraitOffer" | undefined; lender: `0x${string}` | null | undefined; borrower: `0x${string}` | null | undefined; signer: `0x${string}` | null | undefined; offerValidators: { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[]; nftCollateralAddress: `0x${string}`; nftCollateralTokenId: bigint; id: string; offerId: bigint; lenderAddress?: Address | null; borrowerAddress?: Address | null; signerAddress?: Address | null; contractAddress: Address; requiresLiquidation?: boolean | null; principalAddress: Address; principalAmount: bigint; aprBps: bigint; fee: bigint; capacity: bigint; expirationTime: bigint; duration: bigint; status: string; offerHash?: Hash | null; signature?: Hex | null; createdDate?: Date | null; repayment: bigint; hidden?: boolean | null; maxSeniorRepayment: bigint; lenderRefinanceDisabled: boolean; nft: { __typename?: "NFT"; id: string; tokenId: bigint; collection?: { __typename?: "Collection"; id: string; slug: string; contractData: { __typename?: "ContractData"; contractAddress: Address; }; } | null; }; currency: { __typename?: "Currency"; symbol: string; decimals: number; address: Address; }; validators: Array<{ __typename?: "OfferValidator"; arguments: Hex; validator: Address; }>; } | { type: "CollectionOffer" | "SetOffer" | "SingleNFTOffer" | "TraitOffer" | undefined; lender: `0x${string}` | null | undefined; borrower: `0x${string}` | null | undefined; signer: `0x${string}` | null | undefined; offerValidators: { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[]; nftCollateralAddress: `0x${string}`; nftCollateralTokenId: bigint; id: string; offerId: bigint; lenderAddress?: Address | null; borrowerAddress?: Address | null; signerAddress?: Address | null; contractAddress: Address; requiresLiquidation?: boolean | null; principalAddress: Address; principalAmount: bigint; aprBps: bigint; fee: bigint; capacity: bigint; expirationTime: bigint; duration: bigint; status: string; offerHash?: Hash | null; signature?: Hex | null; createdDate?: Date | null; repayment: bigint; hidden?: boolean | null; maxSeniorRepayment: bigint; lenderRefinanceDisabled: boolean; collection: { __typename?: "Collection"; id: string; slug: string; contractData: { __typename?: "ContractData"; contractAddress: Address; }; }; traits: Array<{ __typename?: "Trait"; id: string; type: string; value: string; }>; currency: { __typename?: "Currency"; symbol: string; decimals: number; address: Address; }; validators: Array<{ __typename?: "OfferValidator"; arguments: Hex; validator: Address; }>; })[]; hasNextPage: true; cursor: string; } | { offers: ({ type: "CollectionOffer" | "SetOffer" | "SingleNFTOffer" | "TraitOffer" | undefined; lender: `0x${string}` | null | undefined; borrower: `0x${string}` | null | undefined; signer: `0x${string}` | null | undefined; offerValidators: { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[]; nftCollateralAddress: `0x${string}`; nftCollateralTokenId: bigint; id: string; offerId: bigint; lenderAddress?: Address | null; borrowerAddress?: Address | null; signerAddress?: Address | null; contractAddress: Address; requiresLiquidation?: boolean | null; principalAddress: Address; principalAmount: bigint; aprBps: bigint; fee: bigint; capacity: bigint; expirationTime: bigint; duration: bigint; status: string; offerHash?: Hash | null; signature?: Hex | null; createdDate?: Date | null; repayment: bigint; hidden?: boolean | null; maxSeniorRepayment: bigint; lenderRefinanceDisabled: boolean; collection: { __typename?: "Collection"; id: string; slug: string; contractData: { __typename?: "ContractData"; contractAddress: Address; }; }; currency: { __typename?: "Currency"; symbol: string; decimals: number; address: Address; }; validators: Array<{ __typename?: "OfferValidator"; arguments: Hex; validator: Address; }>; } | { type: "CollectionOffer" | "SetOffer" | "SingleNFTOffer" | "TraitOffer" | undefined; lender: `0x${string}` | null | undefined; borrower: `0x${string}` | null | undefined; signer: `0x${string}` | null | undefined; offerValidators: { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[]; nftCollateralAddress: `0x${string}`; nftCollateralTokenId: bigint; id: string; offerId: bigint; lenderAddress?: Address | null; borrowerAddress?: Address | null; signerAddress?: Address | null; contractAddress: Address; requiresLiquidation?: boolean | null; principalAddress: Address; principalAmount: bigint; aprBps: bigint; fee: bigint; capacity: bigint; expirationTime: bigint; duration: bigint; status: string; offerHash?: Hash | null; signature?: Hex | null; createdDate?: Date | null; repayment: bigint; hidden?: boolean | null; maxSeniorRepayment: bigint; lenderRefinanceDisabled: boolean; nft: { __typename?: "NFT"; id: string; tokenId: bigint; collection?: { __typename?: "Collection"; id: string; slug: string; contractData: { __typename?: "ContractData"; contractAddress: Address; }; } | null; }; currency: { __typename?: "Currency"; symbol: string; decimals: number; address: Address; }; validators: Array<{ __typename?: "OfferValidator"; arguments: Hex; validator: Address; }>; } | { type: "CollectionOffer" | "SetOffer" | "SingleNFTOffer" | "TraitOffer" | undefined; lender: `0x${string}` | null | undefined; borrower: `0x${string}` | null | undefined; signer: `0x${string}` | null | undefined; offerValidators: { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[] | { __typename?: "OfferValidator"; arguments: Hex; validator: Address; }[]; nftCollateralAddress: `0x${string}`; nftCollateralTokenId: bigint; id: string; offerId: bigint; lenderAddress?: Address | null; borrowerAddress?: Address | null; signerAddress?: Address | null; contractAddress: Address; requiresLiquidation?: boolean | null; principalAddress: Address; principalAmount: bigint; aprBps: bigint; fee: bigint; capacity: bigint; expirationTime: bigint; duration: bigint; status: string; offerHash?: Hash | null; signature?: Hex | null; createdDate?: Date | null; repayment: bigint; hidden?: boolean | null; maxSeniorRepayment: bigint; lenderRefinanceDisabled: boolean; collection: { __typename?: "Collection"; id: string; slug: string; contractData: { __typename?: "ContractData"; contractAddress: Address; }; }; traits: Array<{ __typename?: "Trait"; id: string; type: string; value: string; }>; currency: { __typename?: "Currency"; symbol: string; decimals: number; address: Address; }; validators: Array<{ __typename?: "OfferValidator"; arguments: Hex; validator: Address; }>; })[]; hasNextPage: false; cursor: null; }>; loans({ limit, cursor, ...rest }: model.ListLoansProps): Promise<{ loans: { type: "MultiSourceLoan" | undefined; contractAddress: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}` | undefined; borrower: `0x${string}`; startTime: bigint; source: { lender: `0x${string}`; loanId: bigint; startTime: bigint; __typename?: "Source"; id: string; originationFee: bigint; principalAmount: bigint; lenderAddress: string; accruedInterest: bigint; aprBps: bigint; }[]; id: string; address: Address; loanId: number; timestamp: Date; txHash: Hash; indexInBlock: number; borrowerAddress: Address; principalAddress: Address; duration: bigint; status: string; principalAmount: bigint; blendedAprBps: number; totalOriginationFee: bigint; protocolFee: bigint; lenderRefinanceDisabled: boolean; offer: { __typename?: "CollectionOffer"; offerId: bigint; signerAddress?: Address | null; } | { __typename?: "SetOffer"; offerId: bigint; signerAddress?: Address | null; } | { __typename?: "SingleNFTOffer"; offerId: bigint; signerAddress?: Address | null; } | { __typename?: "TraitOffer"; offerId: bigint; signerAddress?: Address | null; }; currency: { __typename?: "Currency"; symbol: string; decimals: number; address: Address; }; repaidActivity?: { __typename?: "LoanRepaid"; totalInterest: bigint; timestamp: Date; } | null; nft: { __typename?: "NFT"; id: string; name?: string | null; tokenId: bigint; nftId: string; owner?: Address | null; image?: { __typename?: "Asset"; data: string; cacheUrl?: string | null; contentTypeMime: string; accessTypeName: string; } | null; collection?: { __typename?: "Collection"; id: string; slug: string; name?: string | null; nftsCount?: number | null; contractData: { __typename?: "ContractData"; contractAddress: Address; }; } | null; }; sources: Array<{ __typename?: "Source"; id: string; loanId: string; originationFee: bigint; principalAmount: bigint; lenderAddress: string; accruedInterest: bigint; aprBps: bigint; startTime: Date; }>; }[]; hasNextPage: true; cursor: string; } | { loans: { type: "MultiSourceLoan" | undefined; contractAddress: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}` | undefined; borrower: `0x${string}`; startTime: bigint; source: { lender: `0x${string}`; loanId: bigint; startTime: bigint; __typename?: "Source"; id: string; originationFee: bigint; principalAmount: bigint; lenderAddress: string; accruedInterest: bigint; aprBps: bigint; }[]; id: string; address: Address; loanId: number; timestamp: Date; txHash: Hash; indexInBlock: number; borrowerAddress: Address; principalAddress: Address; duration: bigint; status: string; principalAmount: bigint; blendedAprBps: number; totalOriginationFee: bigint; protocolFee: bigint; lenderRefinanceDisabled: boolean; offer: { __typename?: "CollectionOffer"; offerId: bigint; signerAddress?: Address | null; } | { __typename?: "SetOffer"; offerId: bigint; signerAddress?: Address | null; } | { __typename?: "SingleNFTOffer"; offerId: bigint; signerAddress?: Address | null; } | { __typename?: "TraitOffer"; offerId: bigint; signerAddress?: Address | null; }; currency: { __typename?: "Currency"; symbol: string; decimals: number; address: Address; }; repaidActivity?: { __typename?: "LoanRepaid"; totalInterest: bigint; timestamp: Date; } | null; nft: { __typename?: "NFT"; id: string; name?: string | null; tokenId: bigint; nftId: string; owner?: Address | null; image?: { __typename?: "Asset"; data: string; cacheUrl?: string | null; contentTypeMime: string; accessTypeName: string; } | null; collection?: { __typename?: "Collection"; id: string; slug: string; name?: string | null; nftsCount?: number | null; contractData: { __typename?: "ContractData"; contractAddress: Address; }; } | null; }; sources: Array<{ __typename?: "Source"; id: string; loanId: string; originationFee: bigint; principalAmount: bigint; lenderAddress: string; accruedInterest: bigint; aprBps: bigint; startTime: Date; }>; }[]; hasNextPage: false; cursor: null; }>; list({ nft }: { nft: number; }): Promise; unlist({ nft }: { nft: number; }): Promise; listings({ collections, user, marketPlaces, limit, cursor, }: model.ListListingsProps): Promise<{ listings: { __typename?: "Listing"; id: string; marketplaceName: MarketplaceEnum; createdDate: Date; desiredDuration?: number | null; desiredPrincipalAddress?: Address | null; user: { __typename?: "User"; walletAddress: Address; }; nft: { __typename?: "NFT"; id: string; tokenId: bigint; collection?: { __typename?: "Collection"; id: string; slug: string; contractData: { __typename?: "ContractData"; contractAddress: Address; }; } | null; }; }[]; hasNextPage: true; cursor: string; } | { listings: { __typename?: "Listing"; id: string; marketplaceName: MarketplaceEnum; createdDate: Date; desiredDuration?: number | null; desiredPrincipalAddress?: Address | null; user: { __typename?: "User"; walletAddress: Address; }; nft: { __typename?: "NFT"; id: string; tokenId: bigint; collection?: { __typename?: "Collection"; id: string; slug: string; contractData: { __typename?: "ContractData"; contractAddress: Address; }; } | null; }; }[]; hasNextPage: false; cursor: null; }>; nftId(props: ({ slug: string; contractAddress?: never; } | { slug?: never; contractAddress: Address; }) & { tokenId: bigint; }): Promise; collections(props: { statsCurrency?: Address; standards?: TokenStandardType[]; collections?: number[]; cursor?: string; }): Promise<{ collections: { __typename?: "Collection"; id: string; name?: string | null; slug: string; description?: string | null; discordUrl?: string | null; twitterUsername?: string | null; externalUrl?: string | null; collectionUrl?: string | null; verified: boolean; wrapperCollections: Array<{ __typename?: "Collection"; contractData: { __typename?: "ContractData"; contractAddress: Address; }; }>; image?: { __typename?: "Asset"; cacheUrl?: string | null; } | null; bannerImage?: { __typename?: "Asset"; cacheUrl?: string | null; } | null; contractData: { __typename?: "ContractData"; blockchain: string; contractAddress: Address; createdDate: Date; creatorAddress?: Address | null; }; statistics: { __typename?: "CollectionStatistics"; floorPrice7d?: number | null; floorPrice30d?: number | null; totalVolume?: number | null; totalVolume1y?: number | null; totalVolume3m?: number | null; totalVolume1m?: number | null; totalVolume1w?: number | null; totalLoanVolume: bigint; totalLoanVolume1w: bigint; totalLoanVolume1m: bigint; totalLoanVolume3m: bigint; totalLoanVolume1y: bigint; numberOfPricedNfts: number; nftsCount?: number | null; percentageInOutstandingLoans: number; repaymentRate: number; floorPrice?: { __typename?: "CurrencyAmount"; amount: number; currency: { __typename?: "Currency"; address: Address; decimals: number; }; } | null; bestOffer?: { __typename?: "CurrencyAmount"; amount: number; currency: { __typename?: "Currency"; address: Address; decimals: number; }; } | null; }; }[]; pageInfo: { __typename?: "PageInfo"; endCursor?: string | null; hasNextPage: boolean; }; }>; collectionId(props: { slug: string; contractAddress?: never; }): Promise; collectionId(props: { slug?: never; contractAddress: Address; }): Promise; collectionStepsById(props: { collectionId: number; }): Promise<{ __typename?: "OfferSteps"; aprBpsStep: bigint; origFeeBpsStep: bigint; usdcStep: bigint; wethStep: bigint; }>; ownedNfts(args: Parameters[0]): Promise<{ ownedNfts: { __typename?: "NFT"; id: string; tokenId: bigint; collection?: { __typename?: "Collection"; id: string; contractData: { __typename?: "ContractData"; contractAddress: Address; }; wrapperCollections: Array<{ __typename?: "Collection"; contractData: { __typename?: "ContractData"; contractAddress: Address; }; }>; } | null; activeLoan?: { __typename?: "MultiSourceLoan"; id: string; } | null; statistics: { __typename?: "NftStatistics"; lastSale?: { __typename?: "Sale"; order?: { __typename?: "BuyNowPayLaterOrder"; price: bigint; currency: { __typename?: "Currency"; address: Address; decimals: number; }; } | { __typename?: "CollectionOrder"; price: bigint; currency: { __typename?: "Currency"; address: Address; decimals: number; }; } | { __typename?: "MultipleTraitOrder"; price: bigint; currency: { __typename?: "Currency"; address: Address; decimals: number; }; } | { __typename?: "SellAndRepayOrder"; price: bigint; currency: { __typename?: "Currency"; address: Address; decimals: number; }; } | { __typename?: "SetBidOrder"; price: bigint; currency: { __typename?: "Currency"; address: Address; decimals: number; }; } | { __typename?: "SingleNFTOrder"; price: bigint; currency: { __typename?: "Currency"; address: Address; decimals: number; }; } | { __typename?: "StealthMaskedOrder"; price: bigint; currency: { __typename?: "Currency"; address: Address; decimals: number; }; } | { __typename?: "TraitOrder"; price: bigint; currency: { __typename?: "Currency"; address: Address; decimals: number; }; } | null; } | null; topTraitFloorPrice?: { __typename?: "CurrencyAmount"; amount: number; currency: { __typename?: "Currency"; address: Address; decimals: number; }; } | null; }; }[]; pageInfo: { __typename?: "PageInfo"; endCursor?: string | null; hasNextPage: boolean; }; }>; getRemainingLockupSeconds({ loan }: { loan: LoanToMslLoanType; }): Promise; isEndLockedUp({ loan, }: { loan: LoanToMslLoanType & { durationFromRenegotiationOrStart: bigint; }; }): Promise; private getDefaults; refinanceFullLoan({ offer, loan, loanId, }: { offer: model.RenegotiationOffer; loan: LoanToMslLoanType; loanId: bigint; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; id: string; } | { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; id: string; } | { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; lenderRefinanceDisabled: boolean; id: string; }; loanId: bigint; renegotiationId: string; }>; } | { txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; source: readonly { loanId: bigint; lender: `0x${string}`; principalAmount: bigint; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; id: string; }; loanId: bigint; renegotiationId: string; }>; }>; refinancePartialLoan({ offer, loan, loanId, }: { offer: model.RenegotiationOffer; loan: LoanToMslLoanType; loanId: bigint; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; id: string; } | { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; id: string; } | { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; lenderRefinanceDisabled: boolean; id: string; }; loanId: bigint; renegotiationId: string; }>; } | { txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; source: readonly { loanId: bigint; lender: `0x${string}`; principalAmount: bigint; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; id: string; }; loanId: bigint; renegotiationId: string; }>; }>; addTranche({ offer, loan, loanId, }: { offer: model.RenegotiationOffer; loan: LoanToMslLoanType; loanId: bigint; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; id: string; } | { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; id: string; } | { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; lenderRefinanceDisabled: boolean; id: string; }; loanId: bigint; renegotiationId: string; }>; }>; /** * Delegate Multicall should be used when token is used as collateral for an active loan. * Multicall will be performed to the contract address of the first delegation. */ delegateMulticall(delegations: Parameters[0][]): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ results: { loanId: bigint; delegate: `0x${string}`; value: boolean; }[]; blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; }>; }>; /** Delegate should be used when token is used as collateral for an active loan. */ delegate({ loan, loanId, to, enable, rights, }: { loan: LoanToMslLoanType; loanId: bigint; to: Address; enable: boolean; rights?: Hash; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { loanId: bigint; contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint | (bigint & Date); duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; contractStartTime: Date | bigint; }; value: boolean; }>; } | { txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { loanId: bigint; contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint | (bigint & Date); duration: bigint; source: readonly { loanId: bigint; lender: `0x${string}`; principalAmount: bigint; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; }; value: boolean; }>; }>; /** RevokeDelegate should be used when token is not being used as collateral. */ revokeDelegate({ to, collection, tokenId, contract: externalContract, }: { to: Address; collection: Address; tokenId: bigint; contract?: Address; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; delegate: `0x${string}`; collection: `0x${string}`; tokenId: bigint; }>; }>; /** * RevokeDelegationsAndEmitLoan should be used when token has been delegated without being revoked, * and a new loan wants to be emitted, erasing the delegations provided as argument in the same * transaction as the emit. * * @param delegations The token's delegations, as the API's `Delegation.delegateTo` and * `Delegation.rights` report them: each `{ to, rights }` is revoked with every rights value it * lists, and a bare address with the full-rights `zeroHash`. */ revokeDelegationsAndEmitLoan({ delegations, emit, }: { delegations: readonly LoanDelegation[]; emit: Parameters[0]; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ results: ({ loanId: bigint; offerId: readonly bigint[]; loan: { borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; }; fee: bigint; } | { delegate: `0x${string}`; collection: `0x${string}`; tokenId: bigint; _rights: `0x${string}`; })[]; blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; id: string; } | { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; id: string; } | { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; tranche: readonly { loanId: bigint; floor: bigint; principalAmount: bigint; lender: `0x${string}`; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; protocolFee: bigint; lenderRefinanceDisabled: boolean; id: string; }; loanId: bigint; }>; } | { txHash: `0x${string}`; waitTxInBlock: () => Promise<{ results: ({ loanId: bigint; offerId: bigint; loan: { borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; source: readonly { loanId: bigint; lender: `0x${string}`; principalAmount: bigint; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; }; lender: `0x${string}`; borrower: `0x${string}`; fee: bigint; } | { delegate: `0x${string}`; collection: `0x${string}`; tokenId: bigint; })[]; blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loan: { contractAddress: `0x${string}`; borrower: `0x${string}`; nftCollateralTokenId: bigint; nftCollateralAddress: `0x${string}`; principalAddress: `0x${string}`; principalAmount: bigint; startTime: bigint; duration: bigint; source: readonly { loanId: bigint; lender: `0x${string}`; principalAmount: bigint; accruedInterest: bigint; startTime: bigint; aprBps: bigint; }[]; id: string; }; loanId: bigint; }>; }>; liquidateLoan({ loan, loanId }: { loan: LoanToMslLoanType; loanId: bigint; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loanId: bigint; } | { blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loanId: bigint; } | { blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loanId: bigint; }>; }>; placeBid({ collectionContractAddress, tokenId, bid, auction, }: { collectionContractAddress: Address; tokenId: bigint; bid: bigint; auction: Auction; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; auctionContract: `0x${string}`; tokenId: bigint; newBidder: `0x${string}`; bid: bigint; loanAddress: `0x${string}`; loanId: bigint; }>; } | { txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; collection: `0x${string}`; tokenId: bigint; newBidder: `0x${string}`; bid: bigint; loanAddress: `0x${string}`; loanId: bigint; }>; }>; settleAuction({ loan, auction }: { loan: LoanToMslLoanType; auction: Auction; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loanContract: `0x${string}`; loanId: bigint; collection: `0x${string}`; tokenId: bigint; asset: `0x${string}`; proceeds: bigint; settler: `0x${string}`; triggerFee: bigint; }>; } | { txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loanContract: `0x${string}`; loanId: bigint; auctionContract: `0x${string}`; tokenId: bigint; asset: `0x${string}`; proceeds: bigint; settler: `0x${string}`; triggerFee: bigint; }>; } | { txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loanContract: `0x${string}`; loanId: bigint; auctionContract: `0x${string}`; tokenId: bigint; asset: `0x${string}`; highestBid: bigint; settler: `0x${string}`; triggerFee: bigint; }>; }>; settleAuctionWithBuyout({ loan, auction }: { loan: LoanToMslLoanType; auction: Auction; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; loanAddress: `0x${string}`; loanId: bigint; nftAddress: `0x${string}`; tokenId: bigint; largestTrancheIdx: bigint; }>; }>; getAuctionRemainingLockupSeconds({ auction, }: { auction: Pick; }): Promise; /** * Get the owner of an ERC 721 token. */ getOwner({ nftAddress, tokenId }: { nftAddress: Address; tokenId: bigint; }): Promise<`0x${string}`>; /** * Get the balance of an ERC 1155 token id. */ balanceOf({ nftAddress, tokenId }: { nftAddress: Address; tokenId: bigint; }): Promise; isApprovedNFTForAll({ nftAddress, standard, to: externalTo, }: { nftAddress: Address; standard: Parameters[1]; to?: Address; }): Promise; approveNFTForAll({ nftAddress, standard, to: externalTo, }: { nftAddress: Address; standard: Parameters[1]; to?: Address; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; owner: `0x${string}`; operator: `0x${string}`; approved: boolean; } | { blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; owner: `0x${string}`; operator: `0x${string}`; approved: boolean; }>; }>; /** * Transfer an NFT to another wallet. The sender is the connected wallet account. * Supports ERC721 (default), ERC1155, naked CryptoPunks and old (pre-ERC721) collections. * `amount` only applies to ERC1155 transfers. */ transferNFT({ to, nftAddress, tokenId, standard, amount, }: { to: Address; nftAddress: Address; tokenId: bigint; standard?: model.TransferNftStandard; amount?: bigint; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ from: `0x${string}`; to: `0x${string}`; punkIndex: bigint; } & TransactionReceipt>; } | { txHash: `0x${string}`; waitTxInBlock: () => Promise<{ _from: `0x${string}`; _to: `0x${string}`; _tokenId: bigint; } & TransactionReceipt>; } | { txHash: `0x${string}`; waitTxInBlock: () => Promise<{ from: `0x${string}`; to: `0x${string}`; id: bigint; } & TransactionReceipt>; }>; isApprovedToken({ tokenAddress, amount, to: externalTo, }: { tokenAddress: Address; amount: bigint; to?: Address; }): Promise; approveToken({ tokenAddress, amount, to: externalTo, }: { tokenAddress: Address; amount?: bigint; to?: Address; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; owner: `0x${string}`; spender: `0x${string}`; amount: bigint; }>; }>; currencyAllowance({ tokenAddress, to: externalTo, }: { tokenAddress: Address; to?: Address; }): Promise; currencyBalance({ tokenAddress }: { tokenAddress: Address; }): Promise; createUserVault({ nfts, currencies, }: { nfts: CreateVaultNfts; currencies?: CreateVaultCurrencies; }): Promise<{ vaultId: bigint; receipts: ({ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; vaultId: bigint; collection: `0x${string}`; tokenId: bigint; } | { blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; vaultId: bigint; token: `0x${string}`; amount: bigint; })[]; }>; _createUserVault({ nfts, currencies, userVaultAddress, }: { nfts: CreateVaultNfts; currencies?: CreateVaultCurrencies; userVaultAddress?: Address; }): Promise<{ vaultId: bigint; receipts: ({ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; vaultId: bigint; collection: `0x${string}`; tokenId: bigint; } | { blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; vaultId: bigint; token: `0x${string}`; amount: bigint; })[]; }>; depositUserVaultERC721s({ userVaultAddress, ...data }: { userVaultAddress?: Address; } & DepositERC721sArgs): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; vaultId: bigint; collection: `0x${string}`; tokenId: bigint; }>; }>; depositUserVaultERC1155s({ userVaultAddress, ...data }: { userVaultAddress?: Address; } & DepositERC1155sArgs): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; vaultId: bigint; token: `0x${string}`; tokenId: bigint; amount: bigint; }>; }>; depositUserVaultERC20({ userVaultAddress, ...data }: { userVaultAddress?: Address; } & DepositERC20Args): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; vaultId: bigint; token: `0x${string}`; amount: bigint; }>; }>; burnUserVaultAndWithdraw({ userVaultAddress, ...data }: { userVaultAddress?: Address; } & BurnAndWithdrawArgs): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise<{ blobGasPrice?: bigint | undefined; blobGasUsed?: bigint | undefined; blockHash: Hash; blockNumber: bigint; blockTimestamp?: bigint | undefined; contractAddress: Address | null | undefined; cumulativeGasUsed: bigint; effectiveGasPrice: bigint; from: Address; gasUsed: bigint; logs: import("viem").Log[]; logsBloom: Hex; root?: Hash | undefined; status: "success" | "reverted"; to: Address | null; transactionHash: Hash; transactionIndex: number; type: import("viem").TransactionType; events: { vaultId: bigint; collection: `0x${string}`; tokenId: bigint; }[]; oldEvents: { vaultId: bigint; collection: `0x${string}`; tokenId: bigint; }[]; }>; }>; wrapOldERC721({ collection, tokenId }: wrapOldERC721Args): Promise<{ txHash: `0x${string}`; waitMined: () => Promise; }>; unwrapOldERC721({ collection, tokenId }: wrapOldERC721Args): Promise<{ txHash: `0x${string}`; waitMined: () => Promise; }>; /** * Where the wallet's CryptoPunk `tokenId` stands on its way into CryptoPunks 721, read from * chain: `'wallet'` while the wallet holds it naked, `'stash'` once it sits in the wallet's * Stash waiting for {@link wrapPunk721}, `'wrapped'` once the wallet holds its 721 token, and * `'other'` when none of these holds. * * IMPLEMENTATION NOTE: the punks market's `punkIndexToAddress` names the punk's holder and * `CryptoPunks721.punkProxyForUser` the wallet's Stash, deployed or not yet; a wrapped punk is * held by the 721 contract, which mints its token to the wallet * (https://721.cryptopunks.app, https://etherscan.io/address/0x000000000000003607fce1ac9e043a86675c5c2f#code). */ punk721WrapState({ tokenId }: { tokenId: bigint; }): Promise; /** * Moves the wallet's naked CryptoPunk `tokenId` into its Stash, the first of the two * transactions that wrap it into CryptoPunks 721. Refuses a punk the wallet does not hold. */ transferPunkToStash721({ tokenId }: { tokenId: bigint; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise; }>; /** * Wraps the CryptoPunk `tokenId` waiting in the wallet's Stash into CryptoPunks 721, minting * its 721 token to the wallet. Refuses a punk that is not in the Stash: move it there first * with {@link transferPunkToStash721}. */ wrapPunk721({ tokenId }: { tokenId: bigint; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise; }>; /** The punk's wrap state with the addresses the wrap transactions need. */ private _punk721Holding; /** A sent transaction whose `waitTxInBlock` resolves with its receipt once it succeeds. */ private _minedTransaction; buyWithSellAndRepay({ repaymentCalldata, purchaseBundlerAddress, mslContractAddress, price, swapData, }: { repaymentCalldata: Hex; purchaseBundlerAddress?: Address; mslContractAddress: Address; price: bigint; swapData?: Maybe; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise; }>; sellAndRepay({ purchaseBundlerAddress, mslContractAddress, repaymentCalldata, swapData, }: { purchaseBundlerAddress?: Address; mslContractAddress: Address; repaymentCalldata: Hex; swapData?: Hex; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise; }>; /** * Sells `nft` into `order`, a Native or OpenSea bid. The Gondi API builds the * sale calldata for both marketplaces, so OpenSea bids need no client-side * OpenSea credentials and no approval beyond the collateral's. */ sellNft({ order, nft, }: { order: { id: string; /** * The order's currency as reported by the Gondi API. A native-currency order carries the * zero address on Ethereum, but a synthetic sentinel on other chains (`__HYPE_ADDRESS` on * HyperEVM, `__RETH_ADDRESS` on Robinhood) — check it with `isNativeCurrency`. */ currencyAddress: Address; originalId: string; marketPlace: string; marketPlaceAddress: Address; price: bigint; }; nft: { id: string; tokenId: bigint; collectionAddress: Address; }; }): Promise<{ txHash: `0x${string}`; waitTxInBlock: () => Promise; }>; getProtocolFee({ mslContractAddress }: { mslContractAddress: Address; }): Promise<{ recipient: `0x${string}`; fraction: bigint; } | { recipient: `0x${string}`; fraction: bigint; } | { recipient: `0x${string}`; fraction: bigint; }>; } type MakeOfferType = Omit>, 'nftId'> | Omit>, 'collectionId'> | Omit>, 'traitIds'>; type OfferFromExecutionOffer = OptionalNullable; type MakeRefinanceOfferProps = { publication?: LoanOfferPublicationInput; renegotiation: model.RenegotiationInput; contractAddress: Address; } & ({ skipSignature?: never; withFallbackOffer?: never; principalAddress?: never; nftId?: never; maxSeniorRepayment?: never; private?: boolean; } | { skipSignature: true; withFallbackOffer?: never; principalAddress?: never; nftId?: never; maxSeniorRepayment?: never; private?: boolean; } | { skipSignature?: never; withFallbackOffer: true; principalAddress: Address; nftId: number; maxSeniorRepayment?: bigint; private?: false; borrowerAddress?: never; } | { skipSignature?: never; withFallbackOffer: true; principalAddress: Address; nftId: number; maxSeniorRepayment?: bigint; private: true; /** The loan's borrower: the private fallback is signed for this address only. */ borrowerAddress: Address; }); export type CreateVaultNfts = { collection: Address; tokenIds: bigint[]; amounts: bigint[]; standard: NftStandard; }[]; export type CreateVaultCurrencies = { address: Address; amount: bigint; }[]; export type DepositERC1155sArgs = { vaultId: bigint; collection: Address; tokenIds: bigint[]; amounts: bigint[]; }; export type DepositERC721sArgs = Omit; export type DepositERC20Args = { vaultId: bigint; tokenAddress: Address; amount: bigint; }; export type BurnAndWithdrawArgs = { vaultId: bigint; collections: Address[]; tokenIds: bigint[]; tokens?: Address[]; erc1155Collections?: Address[]; erc1155TokenIds?: bigint[]; }; /** Where a CryptoPunk stands on its way into CryptoPunks 721; see `Gondi.punk721WrapState`. */ export type Punk721WrapState = 'wallet' | 'stash' | 'wrapped' | 'other'; type wrapOldERC721Args = { collection: { contractData: { contractAddress: Address; }; wrapperCollections?: { contractData: { contractAddress: Address; }; }[]; }; tokenId: bigint; }; export interface EmitLoanArgs { offerExecution: { offer: Omit; amount?: bigint; lenderOfferSignature: Hash; }[]; nftCollateralAddress: Address; tokenId: bigint; duration: bigint; principalReceiver?: Address; expirationTime?: bigint; callbackData?: Hex; } export {};