Skip to main content
Prepare transaction data to approve account shares for withdrawal via the WithdrawQueue contract.
Before withdrawing, you must approve the WithdrawQueue contract to spend your account shares. Consider using prepareWithdrawalAuthorization for a higher-level API that handles approval checking automatically.

Import

Usage


Parameters


Return Type


Examples


Max vs Specific Approval

Max Approval (Default)

When withdrawAmount is not provided, the SDK approves the maximum amount. This is a one-time approval that covers all future withdrawals:

Specific Amount Approval

For tighter security, approve only the amount you intend to withdraw:

Checking Existing Approval

Before approving, check if approval is already granted:
Consider using prepareWithdrawalAuthorization instead, which combines the approval check and approval preparation into a single call.

Error Handling