/** * The one tag that says a failed write was definitively NOT applied. * * A thrown write is otherwise ambiguous to its caller: a lost response to a * committed write and a wallet that declined to sign both arrive as an Error. * Treating every throw as "maybe landed" wedges money flows on a pending state * that can never resolve; treating every throw as "did not land" invites a * second transfer beside one that did. So the SDK marks, at the exact point it * knows, the throws where nothing was or ever can be applied, and leaves every * other throw unmarked (ambiguous: reconcile by reading, never by resubmitting). * * - `before_broadcast`: failed before any bytes were sent (response validation, * blockhash refresh, the wallet declining or failing to sign, a caller's * `onBroadcast` hook refusing). Nothing was sent. * - `broadcast_rejected`: the RPC definitively refused the signed bytes * (preflight simulation, invalid transaction). They never entered the network. * On poofnet, the realtime worker answering the signed commit with a 4xx. * - `failed_onchain`: the transaction landed and failed, so the write reverted. * * The tag is plain data on the thrown object (`writeOutcome` + `writePhase`), * so it survives bundling, duplicated SDK copies and structured cloning, and * the thrown error keeps its own class (e.g. `BoundedOnchainRuleRejection`). */ export type WriteNotAppliedPhase = 'before_broadcast' | 'broadcast_rejected' | 'failed_onchain'; export type WriteNotAppliedTag = { writeOutcome: 'not_applied'; writePhase: WriteNotAppliedPhase; }; /** Tag `error` as definitively not applied. An already-tagged error keeps its (earlier, more precise) phase. */ export declare function markWriteNotApplied(error: T, phase: WriteNotAppliedPhase): T | (Error & WriteNotAppliedTag); /** The phase a write stopped at when it was definitively not applied, else `null` (ambiguous or not a write error). */ export declare function writeNotAppliedPhase(error: unknown): WriteNotAppliedPhase | null; export declare function isWriteNotApplied(error: unknown): boolean;