/** * Verbs the `/fiat/*` surface uses. Mirrors the contract's `HTTP_VERBS`. * Deliberately not imported from `@fun-xyz/fiat-contract`: this package is a * transport and stays free of the contract so it never inherits its * dependencies or its release cadence. */ export declare const FIAT_HTTP_VERBS: readonly ['GET', 'POST']; export type FiatHttpVerb = (typeof FIAT_HTTP_VERBS)[number]; /** A read: nothing to de-duplicate, so no idempotency key. */ export type FiatReadEndpoint = `GET /fiat/${string}`; /** A write: retries can double-charge, so a key is mandatory. */ export type FiatWriteEndpoint = `POST /fiat/${string}`; /** * A transition's endpoint, verb included: `"POST /fiat/quote"`, * `"GET /fiat/orders/o_31c"`. Envelopes carry the whole string, so the * transport takes it whole rather than making every caller split it. */ export type FiatEndpointString = FiatReadEndpoint | FiatWriteEndpoint; /** Narrows a server-supplied endpoint to the write arm of the params union. */ export declare function isFiatWriteEndpoint(endpoint: string): endpoint is FiatWriteEndpoint; export interface FiatEndpointParts { method: FiatHttpVerb; /** Leading-slash path plus any query string, `getApiBaseUrl()` not included. */ path: string; } /** `{...transition.params, ...collected inputs, ...injected expects}`. */ type FiatRequestBody = object; /** * Split by verb so the type carries the rule the transport enforces: a write * cannot be expressed without an idempotency key. The endpoint arrives off a * server-supplied envelope, so a dynamic caller narrows it first with * {@link isFiatWriteEndpoint} — that branch is the price of the guarantee. */ export type SendFiatTransitionParams = { endpoint: FiatReadEndpoint; body?: FiatRequestBody; /** Reads are not de-duplicated; passing one is a mistake, not an option. */ idempotencyKey?: never; } | { endpoint: FiatWriteEndpoint; body?: FiatRequestBody; /** * One key per transition-fire, reused across retries of that same fire * and rotated on a new one, so a retried POST cannot double-charge. */ idempotencyKey: string; }; /** * A client feature the server may only use once a request declares it, sent as * `X-Fun-Client-Capabilities`. An older client never names a newer one. * - `payment_sheet_first`: opens Stripe's Apple Pay sheet before an l0 round whose params ask for it * - `payment_sheet_first_flag`: on `/fiat/next` too, opens it first only when the Stripe `kyc` action's * `paymentSheetFirst` says so, so the server may decide it per buyer * - `provider_flow:`: runs that provider's own checkout, so the server may route to it * - `account_email`: on `/fiat/next`, Stripe's checkout asks for the email the buyer's Link account is under * - `alchemypay_google_pay`: AlchemyPay's checkout draws Google Pay, so the server may route Google Pay to it * - `moonpay_guest_google_pay`: MoonPay's guest checkout draws Google Pay's button, so the server may route * Google Pay to it */ export type FiatClientCapability = 'payment_sheet_first' | 'payment_sheet_first_flag' | 'account_email' | 'alchemypay_google_pay' | 'moonpay_guest_google_pay' | `provider_flow:${FiatProviderName}`; /** * Mirrors the contract's `FiatProvider`, for the reason {@link FIAT_HTTP_VERBS} * gives. connect-rn builds `provider_flow:` from the contract's type, so a * provider missing here fails its typecheck. */ type FiatProviderName = 'TRANSAK' | 'SWAPPED' | 'BANXA' | 'MOONPAY' | 'MOONPAY_GUEST' | 'STRIPE' | 'COINBASE' | 'CROSSMINT' | 'ALCHEMYPAY' | 'PAYWARD'; export {}; //# sourceMappingURL=types.d.ts.map