API ReferenceReact provider and hooksFunction
describeUnconfirmedSend()
function describeUnconfirmedSend(operation, workflow): UnconfirmedSend;Beta
Names a step whose send outcome is unknown and says what repeating it would do, for a
wallet-indeterminate settlement.
Reach for getUnconfirmedSend when you hold a settlement: it finds the
parked operation and calls this. Call this directly only when you have already picked the operation
out yourself. An absent retryEffect means a repeat is harmless, which is what lets the
unconfirmed-send screen offer an immediate retry instead of a confirmation.
Parameters
| Parameter | Type | Description |
|---|---|---|
operation | WalletOperation<AnvilWalletOperationType> | The operation whose send outcome is unknown. |
workflow | WalletOperation<AnvilWalletOperationType>[] | Every operation in the run, so a step can be read in context: a deposit queued ahead of an LOC step is a top-up that a rebuilt workflow drops once the deposit settles, while a deposit on its own is the user’s intent and would happen twice. |
Returns
The step’s transaction-list label and, when a repeat is not harmless, the effect of repeating it. A
type this SDK version does not know is named this transaction with the generic effect.
Example
import { describeUnconfirmedSend } from '@anvil/sdk';import { isIndeterminateWithoutHash } from '@anvil/sdk/core';import type { AnvilWalletOperationType, WalletOperation,} from '@anvil/sdk/core';
// For a caller that holds the run's operations rather than a settlement,// such as one driving `workflow.execute()` without the React lifecycle.export function nameUnconfirmedStep( operations: WalletOperation<AnvilWalletOperationType>[]): string | undefined { const parked = operations.find(isIndeterminateWithoutHash); return parked && describeUnconfirmedSend(parked, operations).step;}