Skip to main content
requestUnvault({ requestId }) waits for the wallet and sends the owner’s request to unvault from it, with the cost covered by Endstate. It resolves once the network included the send. It needs no tap session, only a wallet that holds the item now: the vault holds the item, so its owner cannot tap it. requestId is the id of the vault request useVault opened, which your server kept. The waiting period starts once Endstate sees the send. Nothing else is asked of the owner: the vault records the item’s dispatch with its own tap and Endstate completes the unvault.

Example

Outcome

The hook holds the outcome of its latest call, and data.resourceId names the vault request that outcome is for. On a page that shows several vaulted items, render one component per item with key={requestId}, so each item has its own outcome. The outcome belongs to the wallet that sent it and to the sign-in. Another wallet, a sign-out, a sign-in or reset() returns the hook to "idle". A new tap does not, because an unvault takes no tap.

Returns

(args: { requestId: string }) => Promise<WalletSubmission>
Resolves with { transactionHash, address, resourceId }. Rejects with submission.not_executable when an unvault is already under way or finished, with unvault.in_progress while an earlier unvault is still settling (retry after error.details.retry_at), and with auth.forbidden when this wallet does not hold the item.
"idle" | "pending" | "success" | "error"
The outcome of the latest call for the current wallet and sign-in.
WalletSubmission | null
The latest request the wallet sent. data.resourceId is the vault request it was sent for.
Error | null
The failure that moved status to "error". A refusal is an EndstateWalletError with the API’s code and details.
() => void
Returns the hook to "idle".