Import
Usage
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
vaultName | string | Yes | Vault name from AmplifyVault.name (e.g. from getVaultsByConfig()) |
wantAsset | Address | Yes | Token address to receive as a refund |
chainId | number | Yes | Chain ID where the order exists |
orderIndex | bigint | Yes | Index of the order to cancel in the WithdrawQueue |
Return Type
- Type Definition
- Example Response
Examples
- Viem
- Wagmi
Error Handling
| Error | Description | Resolution |
|---|---|---|
Vault not found | No vault matches vaultName | Verify vault name via getVaultsByConfig() |
Vault chain mismatch | Vault not on requested chain | Verify chainId matches vault deployment |
WithdrawQueue contract address not configured | Missing contract config | Check vault configuration |
Related
- getVaultsByConfig - Discover vault names
- Withdrawals Guide — Complete withdrawal integration guide including cancellation flow
- getWithdrawalRequests — Retrieve withdrawal requests to find the orderIndex
- prepareWithdrawOrderTxData — Submit withdrawal orders
- prepareApproveWithdrawOrderTxData — Approve vault shares for withdrawal