Skip to main content
Prepare transaction data for submitting a withdrawal order to the WithdrawQueue contract.
This function replaces the legacy prepareWithdrawTxData() (also known as prepareWithdrawTransactionData()) from SDK versions prior to 0.4.2. If you are migrating, note that the new function uses amountOffer instead of amount, and no longer accepts slippage or deadline parameters. See the Changelog for full migration details.
prepareWithdrawOrderTxData() is a low-level transaction builder and does not perform allowance pre-checks. Use prepareWithdrawalAuthorization when you need approval routing.

Import

Usage


Parameters

ParameterTypeRequiredDescription
vaultNamestringYesAccount name from AmplifyVault.name (e.g. from getVaultsByConfig())
wantAssetAddressYesToken address you want to receive
userAddressAddressYesUser’s wallet address
chainIdnumberYesChain ID
amountOfferstringYesAccount shares to withdraw (decimal string)
Unlike the old Teller-based withdrawal, the WithdrawQueue does not require slippage or deadline parameters. Orders are processed by the protocol at the current exchange rate.

Return Type


Examples


Withdrawal Flow

1

Discover account

2

Authorize Withdrawal

Check and handle account share approval:
3

Submit Withdrawal Order

Submit the order to the WithdrawQueue:
4

Wait for Processing

The WithdrawQueue processes orders. Once processed, funds are sent to your wallet automatically.

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 exists for vaultName/chain
BoringVault contract address not configuredMissing account configCheck account configuration