Skip to content

API ReferenceReact provider and hooksFunction

toWorkflowSettlement()

function toWorkflowSettlement(result, queuedOperations): WorkflowSettlement | undefined;

Beta

Maps a core WorkflowExecutionResult onto the settlement it represents, or undefined when the attempt settles nothing.

Several outcomes settle nothing, for one reason: no verdict was reached on the user’s intent. A cancelled result is one. So is an executed result that did not finish — an interrupted run (Rejected operations with no preceding Failed, which is what an account change, an unmount, or StrictMode’s double-invoke cleanup leaves behind), and a run parked on an Indeterminate operation that still carries a transaction hash.

Indeterminate is why success is defined positively here rather than as the absence of failure. A confirmation timeout leaves an operation non-terminal — the transaction may still land — alongside operations still Queued behind it, and nothing in that snapshot is Failed or Rejected. Reporting it as success would tell the user a transaction completed when its outcome is unknown, and would latch the caller’s terminal guard against the remount that is supposed to resolve it by re-checking the recorded receipt. It settles nothing and stays resumable instead.

An Indeterminate operation without a transaction hash is different: its send failed in transit, re-execution leaves it unchanged, and nothing will resolve it, so it settles as wallet-indeterminate.

Parameters

ParameterTypeDescription
resultWorkflowExecutionResultThe exclusive outcome returned by executing the workflow.
queuedOperationsWalletOperation<AnvilWalletOperationType>[]Snapshot to attach to a pre-wallet settlement, where the result carries no operations of its own.

Returns

| WorkflowSettlement | undefined