import type { ConvertSubmitPreparation } from './submit'; import type { ConvertConfig, ConvertErrorResult } from './types'; /** Why the source leg failed, for copy and for whether to retry. */ export type ConvertSourceErrorReason = 'userRejected' | 'switchChain' | 'insufficientGas' /** The transaction outlived its blockhash; it never landed, so re-sign. */ | 'blockhashExpired' /** The wallet or RPC simulated the transaction and it would fail. */ | 'simulationFailed' | 'insufficientSol' | 'generic'; /** * The shared wallet mapping, plus the Solana failures it doesn't know. Meant * for failures before funds moved, after which the user can convert again. */ export declare function getConvertSourceErrorReason(error: unknown): ConvertSourceErrorReason; /** Every way a conversion can stop, from the pre-sign check to settlement. */ export type ConvertFailure = { stage: 'preSign'; preparation: Extract; } | { stage: 'source'; error: unknown; } /** Funds may have moved but the deposit could not be tracked. */ | { stage: 'unknown'; error: unknown; } | { stage: 'settlement'; error: unknown; }; /** * The host's `onError` payload for a failure, or `undefined` for a block the * user fixes on screen (balance, fee reserve), which the host never needs to * hear about. */ export declare function toConvertErrorResult(failure: ConvertFailure): ConvertErrorResult | undefined; export declare function reportConvertError(failure: ConvertFailure, onError: ConvertConfig['onError']): void;