/** * Fiat rail — the `arispay-fiat` payment backend, seller side * (docs/specs/fiat-402-v1.md). * * The 402 offers a fiat entry whose `terms` name the merchant, the currency, * and the price in integer cents. The agent (payagent) turns the terms into * a single-use authorization at ArisPay and retries with it in `X-PAYMENT`. * paygate settles that authorization through ArisPay's * `POST /v1/fiat/settle` BEFORE the handler runs — the same settle-first * rule as x402. ArisPay plays the facilitator role: a settle is a ledger * payment from the buyer's funding account to this merchant's payable. * * No chain, no keys, no state here: the authorization is the credential and * ArisPay checks it against this route's requirements. */ export declare const ARISPAY_FIAT_SCHEME = "arispay-fiat"; export declare const FIAT_NETWORK = "arispay"; /** The authorization lifetime at ArisPay; the 402 advertises it. */ export declare const FIAT_MAX_TIMEOUT_SECONDS = 600; export type FiatCurrency = "EUR" | "GBP" | "USD"; export declare const FIAT_CURRENCIES: readonly FiatCurrency[]; export declare function isFiatCurrency(v: unknown): v is FiatCurrency; export interface FiatTerms { backend: typeof ARISPAY_FIAT_SCHEME; merchantId: string; currency: FiatCurrency; amountCents: number; authorizeEndpoint: string; } export interface FiatAccept { scheme: typeof ARISPAY_FIAT_SCHEME; network: typeof FIAT_NETWORK; /** Integer cents as a string — the generic x402 `amount` slot. */ amount: string; /** ISO 4217 code — the generic x402 `asset` slot. */ asset: FiatCurrency; payTo: string; resource: string; maxTimeoutSeconds: number; description?: string; mimeType?: string; terms: FiatTerms; } export declare function buildFiatAccept(args: { apiUrl: string; merchantId: string; currency: FiatCurrency; priceCents: number; resourceUrl: string; description?: string; mimeType?: string; }): FiatAccept; export interface FiatRequirements { merchantId: string; currency: FiatCurrency; amountCents: number; resource: string; } export type FiatSettleResponse = { success: true; paymentId: string; merchantId: string; currency: string; amountCents: number; settledAt: string; replayed?: boolean; } | { success: false; errorReason: string; }; /** The fiat `X-PAYMENT` envelope. Returns the authorization, or null. */ export declare function fiatAuthorizationFromPayload(payload: unknown): string | null; /** * Settle a fiat authorization against this route's requirements. Settle is * idempotent on the authorization at ArisPay, so a timed-out call is * retried once: the retry either settles or replays the first result. */ export declare function settleFiat(apiUrl: string, authorization: string, requirements: FiatRequirements, timeoutMs: number, fetchImpl?: typeof fetch): Promise; /** * Trust a success only when ArisPay echoes this route's terms back (the * fiat analogue of the x402 L7 check). */ export declare function isValidFiatSettlement(settlement: FiatSettleResponse, requirements: FiatRequirements): settlement is Extract; //# sourceMappingURL=fiat.d.ts.map