import type { FiatStepResponse } from '@fun-xyz/fiat-contract/types'; /** * Named rather than numbered: the contract's `screens: number[]` index the FE * doc (the number trailing each member) — useful for tracing a decision back * to its spec, wrong for rendering code to branch on. */ export type FiatScreen = 'AMOUNT_ENTRY' | 'QUOTE_REVIEW' | 'OTP' | 'AUTH_CAPTURE' | 'KYC_FORM' | 'ORDER_REVIEW' | 'PAYMENT_CAPTURE' | 'BANK_INSTRUCTIONS' | 'ORDER_TRACKING' | 'KYC_CAPTURE' | 'KYC_VERIFYING' | 'KYC_ON_HOLD' | 'KYC_REJECTED' | 'ORDER_PENDING' | 'SUCCESS' | 'FAILURE' | 'REFUND' | 'BLOCKED' | 'UNSUPPORTED'; export interface ComputePageOptions { /** * Whether a confirmed delivery ends the order. * * True only where the provider pays the recipient itself: the crypto is * already where it was going, so `CRYPTO_SENT` plus its transaction is the * last thing that happens, and waiting for the server to say `SETTLED` * leaves the user on a spinner over money they have. Where a deposit * address still has to be swept, delivery is the middle of the story and * this stays off. */ settlesOnDelivery?: boolean; } export interface FiatPage { screen: FiatScreen; /** * Two envelopes with equal identity are the *same* state: a re-entry * carrying an error is a banner, not a navigation, and collected form * values survive it. */ identity: string; /** From the table, never inferred from `transitions.length`. */ terminal: boolean; /** * The client called this order done off its delivery, ahead of the server. * Only here is a poll the server still offers worth ignoring: it asks about * an order this client has already finished with. Every other terminal page * keeps whatever poll the response carries — the contract emits one to * recover a failure, and dropping it would strand that recovery. */ settledOnDelivery?: boolean; } /** The screen shown before any envelope exists. Client-local, has no state key. */ export declare const AMOUNT_ENTRY_PAGE: FiatPage; /** * The envelope, not the bare state: the contract leaves `orderId` placement * open (`TODO(open-decision)`), and identity is wrong if the resolver can * only see one of the two documented spots. */ export type FiatPageInput = Pick; /** * Resolves an envelope to the screen that renders it. Total: a kind this * client's table version predates resolves to `UNSUPPORTED`, because the * stale rule lets any call return any state and a shipped client has to * render something. */ export declare function computePage(envelope: FiatPageInput, { settlesOnDelivery }?: ComputePageOptions): FiatPage; //# sourceMappingURL=computePage.d.ts.map