> ## Documentation Index
> Fetch the complete documentation index at: https://docs.endstate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# wallet.cancelUnvault

> Sends the owner's cancel of a waiting unvault from this wallet, so the item stays vaulted. The customer never pays for it.

```ts theme={null}
cancelUnvault(requestId: string): Promise<WalletSubmission>
```

Sends the owner's cancel of the unvault that
[`requestUnvault()`](https://docs.endstate.io/sdks/web/reference/wallet/requestUnvault) started, named
by the vault request's id. The wallet fetches the prepared cancel, sends it
with the cost covered by Endstate, and resolves once the network has included
it. The vault request reads `active` again once Endstate sees it, and the item
stays vaulted. Only a wallet that holds the item now can send it.

The owner can cancel while the unvault waits, including while it is on hold.
Once the item is ready to ship the call rejects with
`submission.not_executable`, and `error.details.cancellable_at` is the time a
cancel opens again if the vault has not dispatched the item: 7 days after the
waiting period ended. It is present only while the item is ready to ship and
not dispatched. After the vault's dispatch the unvault can no longer be
cancelled, and the error carries no `cancellable_at`.

Also rejects with `submission.not_executable` when no unvault is waiting,
with `vault.request_not_found` when the id names no vaulted item, with
`auth.forbidden` when this wallet does not hold the item, with
`wallet.sponsorship_unavailable` when the send cannot be covered right now
(nothing was sent), and with `wallet.destroyed` if the wallet has been
destroyed.

Rejects with `wallet.unsupported_operation` when the wallet frame Endstate
runs is older than this SDK and does not know the operation yet. Nothing was
sent. The error's message says to upgrade the SDK, which does not apply here:
the SDK is already the newer side, so retry once the frame is updated.

## Returns

```ts theme={null}
interface WalletSubmission {
  transactionHash: string; // the network transaction that carried it
  address: string;         // the wallet address that sent it
  resourceId: string;      // the vault request id
}
```

## Example

```ts theme={null}
import { EndstateWalletError } from "@endstate-sdk/web";

try {
  await wallet.cancelUnvault(requestId);
} catch (error) {
  if (
    error instanceof EndstateWalletError &&
    error.code === "submission.not_executable"
  ) {
    // When a cancel opens again; present only while ready to ship and not dispatched.
    const cancellableAt = error.details?.cancellable_at;
  }
}
```

See [Unvault an item](https://docs.endstate.io/sdks/web/unvault.md) for the whole flow.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.