import type { QueryClient } from '@tanstack/react-query'; import { type FiatRoutingOverrides } from './quoteRequest'; /** * What this session has learned about a route, held under a key that names the * route rather than the amount asked for. A maximum does not depend on the * amount, so learning it once answers every later amount on the same route. * * The record is deliberately open: the provider chosen for a route belongs here * too once that mapping exists, and it is keyed the same way. Adding it should * be a field, not a second cache. */ export interface RouteLimits { /** The most this buyer may spend on this route, as the server last said. */ max: string; /** The currency `max` is quoted in; a figure under another symbol is not it. */ currency: string; } export declare const ROUTE_LIMITS_SCOPE: readonly ["fiat", "route-limits"]; export interface RouteIdentity { apiKey: string; userId: string; currency: string | undefined; paymentMethod: string; cryptoCurrencyCode: string; chainId: string; geo: { alpha2?: string; region?: string; } | undefined; routingOverrides?: FiatRoutingOverrides | undefined; } /** * The quote key without the amount or the per-mount scope — those are what make * a quote one-shot, and neither describes the route. */ export declare function routeLimitsKey(route: RouteIdentity): readonly unknown[]; export declare function readRouteLimits(client: QueryClient, route: RouteIdentity): RouteLimits | undefined; /** * Only ever narrows within a session. Two answers can be in flight for one * route — a corridor maximum from a priced quote and the buyer's own remaining * allowance from a refusal — and the lower is the one they meet first. A wider * figure arriving late would otherwise raise a ceiling the server still holds. * * Whatever really widened it — a completed step-up, a spent deposit, a new * window — clears the route instead, so the next quote teaches it afresh. */ export declare function recordRouteLimits(client: QueryClient, route: RouteIdentity, observed: RouteLimits): void; /** Every route this session had learned. The next quote teaches them again. */ export declare function forgetRouteLimits(client: QueryClient): void; //# sourceMappingURL=routeLimits.d.ts.map