Skip to main content
Prepare transaction data for canceling a pending withdrawal order on the WithdrawQueue contract. Only the order owner can cancel their order.
prepareCancelWithdrawOrderTxData() is a low-level transaction builder. Use getWithdrawalRequests to retrieve the orderIndex for a pending withdrawal before calling this function.

Import

Usage


Parameters

ParameterTypeRequiredDescription
vaultNamestringYesAccount name from AmplifyVault.name (e.g. from getVaultsByConfig())
wantAssetAddressYesToken address to receive as a refund
chainIdnumberYesChain ID where the order exists
orderIndexbigintYesIndex of the order to cancel in the WithdrawQueue

Return Type


Examples


Error Handling

ErrorDescriptionResolution
Vault not foundNo account matches vaultNameVerify account name via getVaultsByConfig()
Vault chain mismatchAccount not on requested chainVerify chainId matches account deployment
WithdrawQueue contract address not configuredMissing contract configCheck account configuration