/** * Why a managed flow ended short of its outcome. One shape for deposits and * withdrawals, so a host branches on `code` and the two flags rather than on * message text. */ export type FunkitFlowErrorCode = /** The user dismissed the flow before anything was submitted. */ 'cancelled' /** Fun will not serve this user, region, asset or amount. */ | 'blocked' /** The host's identity minter failed for a reason a retry may fix. */ | 'identity_assertion_failed' /** The host's session lapsed; it must sign the user in again, then reopen. */ | 'session_expired' /** The wallet refused to sign. */ | 'signer_rejected' /** The config cannot open a flow; fix the integration. */ | 'misconfigured' /** Every provider, or the payment instrument, declined. */ | 'payment_declined' | 'unknown'; export interface FunkitFlowError { code: FunkitFlowErrorCode; /** Trying again, unchanged, has a chance. */ isRetryable: boolean; /** Nothing the user does in this flow recovers it. */ isFatal: boolean; /** Fit to show the user. */ message: string; } /** Builds an error with the code's usual flags; a caller that knows better overrides them. */ export declare function flowError(code: FunkitFlowErrorCode, message: string, flags?: Partial>): FunkitFlowError; /** Thrown by `beginDeposit` when the config cannot open a flow. */ export declare class FunkitMisconfiguredError extends Error implements FunkitFlowError { readonly code = "misconfigured"; readonly isRetryable = false; readonly isFatal = true; constructor(message: string); } /** * The codes a host's identity minter rejects with, per the identity * assertion contract: 401 → `SESSION_EXPIRED`, 403 → `ACCOUNT_INELIGIBLE`, * network or 5xx → `TRANSIENT`. */ export type IdentityAssertionErrorCode = 'SESSION_EXPIRED' | 'ACCOUNT_INELIGIBLE' | 'TRANSIENT'; /** Reads the contract code off whatever the host's minter threw, if it named one. */ export declare function identityAssertionErrorCode(error: unknown): IdentityAssertionErrorCode | undefined; //# sourceMappingURL=flowError.d.ts.map