import { Address, Hex } from 'viem'; import { ExecutionDataV7 } from '../blockchain'; import { GondiPublicClient, Wallet } from '../clients/contracts'; import { MslV6 } from '../clients/contracts/MslV6'; /** Fixed listing-currency contribution and signed settlement for v3.1 credit against a v3.2 seller. */ export type CreditPurchaseQuote = Readonly<{ orderId: number; price: bigint; buyer: Address; sellerContract: Address; sellerBundler: Address; buyerBundler: Address; loanCurrency: Address; purchaseCurrency: Address; netPrincipal: bigint; inputAmount: bigint; initialPayment: bigint; deadline: bigint; loanId: bigint; nftCollateralAddress: Address; tokenId: bigint; loanHash: Hex; repaymentHash: Hex; repaymentSwapData: Hex; loanSwapData: Hex; callbackData: Hex; }>; /** Decodes the purchase bundler's `executionInfo` callback carried by an execution or a seller repayment. */ export declare const decodePurchaseCallback: (data: Hex) => { reservoirExecutionInfo: { module: `0x${string}`; data: `0x${string}`; value: bigint; }; contractMustBeOwner: boolean; purchaseCurrency: `0x${string}`; amount: bigint; swapData: `0x${string}`; swapValue: bigint; maxSlippage: bigint; }; /** The callback's purchase currency, with every native spelling (including the ETH sentinel) as `zeroAddress`. */ export declare const callbackPurchaseCurrency: (callback: ReturnType) => Address; /** Compares every ABI field against the confirmed terms before signing or submitting an API execution. */ export declare const assertCreditPurchaseExecution: (expected: ExecutionDataV7, received: unknown) => void; /** Rechecks activation, zero additional taxes and router funding before buyer signing. */ export declare const assertCreditPurchaseRoute: (client: GondiPublicClient, quote: Pick) => Promise; export type CreditPurchaseInput = { orderId: number; price: bigint; sellerContract: Address; repaymentCalldata: Hex; repaymentSwapData?: Hex; loanCurrency: Address; netPrincipal: bigint; minimumInitialPayment?: bigint; offerExpirations: bigint[]; slippageBps?: bigint; }; /** * Funds the purchase bundler in listing currency, with capped spend or minimum output. * * IMPLEMENTATION NOTE: Universal Router's address 0x1 is its caller, the buyer bundler. * Exact-output paths are reversed; native output unwraps WETH to that caller. * https://developers.uniswap.org/docs/protocols/universal-router/technical-reference */ export declare const buildCreditPurchaseSwap: ({ loanCurrency, purchaseCurrency, amount, limit, exactInput, deadline, }: { loanCurrency: Address; purchaseCurrency: Address; amount: bigint; limit: bigint; exactInput: boolean; deadline: bigint; }) => Hex; /** Quotes gross buyer funding; signed seller callbacks record net proceeds after marketplace fees. */ export declare const quoteCreditPurchase: ({ input, wallet, client, sellerMsl, }: { input: CreditPurchaseInput; wallet: Wallet; client: GondiPublicClient; sellerMsl: MslV6; }) => Promise; /** Quotes each amount in its token units and includes route-specific flash settlement. */ export declare const quotePurchaseFunding: ({ client, loanCurrency, purchaseCurrency, price, netPrincipal, deadline, slippageBps, minimumInitialPayment, route, premiumBps, }: { client: GondiPublicClient; loanCurrency: Address; purchaseCurrency: Address; price: bigint; netPrincipal: bigint; deadline: bigint; slippageBps: bigint; minimumInitialPayment: bigint; route: "ordinary" | "flash" | "nested"; premiumBps?: bigint; }) => Promise<{ initialPayment: bigint; inputAmount: bigint; funded: bigint; loanSwapData: Hex; }>;