import type { FiatProvider } from '@fun-xyz/fiat-contract/types'; /** Starts a fiat flow before the backend has supplied any transitions. */ export declare const QUOTE_ENDPOINT = "POST /fiat/quote"; export declare const ORDER_ENDPOINT = "POST /fiat/orders"; /** * Authorises the payment method before any order exists — the capture-first * rail's way in, per `TRANSITION_TABLE['QUOTE']`. It returns PAYMENT{CAPTURE} * carrying the surface, so the tap is a payment even though it is not the * order call. */ export declare const PAYMENT_SESSION_ENDPOINT = "POST /fiat/payment-session"; /** Opens a provider session; emitted when there is no valid session token. */ export declare const SESSION_ENDPOINT = "POST /fiat/session"; /** Establishes a Fun identity when the surface carries no ambient one. */ export declare const AUTH_ENDPOINT = "POST /fiat/auth"; /** * The endpoints a paying tap can land on. A session-first provider mints the * order behind its session, so it needs the delivery address too. */ export declare const PAY_ENDPOINTS: readonly string[]; /** * The geo lookup's own answer, forwarded in its field names rather than * remapped — the endpoint takes what the client already holds. */ export interface QuoteGeo { /** ISO 3166-1 alpha-2 of the buyer, e.g. `AU`. */ alpha2: string; /** ISO 3166-2 subdivision without the country prefix, e.g. `TX`. */ region?: string; } /** * Narrows which providers the backend may route this quote to. * * - Test tooling only. Production refuses a quote that carries it, so a * customer app that sets it breaks its own deposits there. * - Omitted means ordinary routing; an empty list allows no provider at all. */ export interface FiatRoutingOverrides { providers: readonly FiatProvider[]; } /** * Stable key fragment for {@link FiatRoutingOverrides}; absent and empty stay * distinct. Sorted here only: the backend reads the list as a set, so a * reordering is the same request and must not cost a round trip. The wire * value is sent as given. */ export declare function routingOverridesKey(overrides: FiatRoutingOverrides | undefined): string; export interface QuoteRequest { /** ISO 4217, e.g. `USD`. */ fiatCurrency: string; /** Plain decimal string, above zero. */ fiatAmount: string; /** Token ticker, e.g. `USDC`. */ cryptoCurrencyCode: string; /** Destination chain id, decimal string. */ chainId: string; /** Payment method category, e.g. `apple_pay`. */ paymentMethodId: string; /** * Where the buyer is. Required: no provider prices without it, and omitting * it returns "geo is required and must be the geo endpoint's response * object." */ geo: QuoteGeo; /** Test tooling; see {@link FiatRoutingOverrides}. */ routingOverrides?: FiatRoutingOverrides; } export interface FiatQuoteMinimum { amount: string; currency: string; } /** * The ceiling a refused quote reported. It is not the corridor's maximum: the * backend narrows it to this buyer's own remaining allowance when a provider * measured one that cannot be raised, so it is the number that actually * refused them and the one an amount below will clear. */ export interface FiatQuoteMaximum { amount: string; currency: string; } /** Extracts the actionable limit from the backend's typed quote refusal. */ export declare function quoteMinimumFromError(error: unknown): FiatQuoteMinimum | undefined; /** * Extracts the actionable ceiling from the backend's typed quote refusal. * * The sibling of {@link quoteMinimumFromError}, and read the same way: the * amount is only actionable because lowering it can clear the refusal, which * is what separates this response from the generic "nobody can price that". */ export declare function quoteMaximumFromError(error: unknown): FiatQuoteMaximum | undefined; /** Compares decimal amounts while allowing formatting differences. */ export declare function sameAmount(a: string, b: string): boolean; /** * Nothing this rail sells costs more — anything larger is a typo or an * injection attempt, and bounding it here keeps junk out of request bodies * rather than letting the server be the first to object. */ export declare const MAX_QUOTE_AMOUNT = 1000000; /** An amount worth quoting: a plain decimal above zero, bounded, ≤ 2dp. */ export declare function isQuotableAmount(amount: string): boolean; /** * A location worth quoting: one that names a country. A US buyer also needs a * state — pricing is per-state licensing — but that is the server's refusal to * give, not ours to pre-empt. Holding the request back instead leaves the * screen on a spinner that never resolves, which is worse than the answer. */ export declare function isQuotableGeo(geo: QuoteGeo | undefined): boolean; /** A quote the server will refuse for want of a state. Worth saying out loud. */ export declare function isUnpriceableUsGeo(geo: QuoteGeo | undefined): boolean; /** Accepts canonical IDs from FunKit's supported-chain registry. */ export declare function isSupportedQuoteChainId(chainId: string): boolean; /** * A submission there is no point replaying: the terms it names are gone. * * - Every `/fiat/*` transition is scoped to a quoteRef, and a retry re-sends * the body its idempotency key was minted with — the same dead reference. * The way out is a new quote, not another send. * - The status alone is not enough. A 404 is also how the backend refuses a * provider that declined, so the server's own sentence is what decides. * - Read off `type` rather than `instanceof`: a host that ends up with two * copies of `@funkit/utils` fails the identity check on the same error. */ export declare function isStaleQuoteFailure(error: unknown): boolean; //# sourceMappingURL=quoteRequest.d.ts.map