import { type ConvertQuote } from '../domains/convert/quote'; import type { ConvertResolvedAsset } from '../domains/convert/types'; export declare const CONVERT_QUOTE_REFRESH_MS = 30000; export declare const CONVERT_QUOTE_QUERY_KEY: readonly ['convert', 'quote']; interface UseConvertQuoteParams { /** * Scopes quotes to one checkout, like withdrawal's, so a reopened checkout * never reuses one from before. */ checkoutId: string; sourceAsset: ConvertResolvedAsset | undefined; destinationAsset: ConvertResolvedAsset | undefined; /** Exact amount to spend; no quote for `undefined` or zero. */ amountInBaseUnits: bigint | undefined; /** The source wallet that signs. */ userAddress: string | undefined; recipientAddress: string | undefined; /** * Off stops all fetching and keeps the shown quote. On re-enable TanStack * refetches a quote past its refresh time at once, reporting `isFetching` * from that render, so it's never signed stale. */ enabled?: boolean; /** * Bumped per sent deposit, so the next attempt never reuses a quote whose * Relay request was already sent. */ sentCount?: number; /** Refresh cadence; overridable so tests don't wait 30s. */ refetchIntervalMs?: number; } export interface UseConvertQuoteResult { /** The current quote; `undefined` while loading or after a failed fetch. */ quote: ConvertQuote | undefined; isLoading: boolean; /** A fetch is running, including a timed refresh while a quote is shown. */ isFetching: boolean; isError: boolean; /** As thrown; a Relay rejection stays a `RelayQuoteError`. */ error: Error | null; /** When the shown quote is replaced; seeds the countdown. */ refreshesAtMs: number | undefined; /** Quote again now, e.g. when the user retries a failed quote. Rejects if it fails. */ refetch: () => Promise; } /** * Convert's exact-in quote. Keyed by everything the request carries, so an * edit never shows a quote for the old inputs, and refreshed on a timer while * a quote is shown. A failed fetch hides the quote and stops the timer until * the inputs change or `refetch` is called. */ export declare function useConvertQuote({ checkoutId, sourceAsset, destinationAsset, amountInBaseUnits, userAddress, recipientAddress, enabled: isEnabled, sentCount, refetchIntervalMs, }: UseConvertQuoteParams): UseConvertQuoteResult; export {};