Method Signature
Description
Polls the withdrawal status at regular intervals until the agent reachesdeactivated status. Useful for waiting until a full withdrawal completes.
Parameters
Smart account wallet address.
Optional polling configuration:
interval- Polling interval in milliseconds (default: 5000ms)timeout- Maximum wait time in milliseconds (default: 300000ms / 5 minutes)onUpdate- Callback function called on each status update
Return Value
ReturnsPromise<WithdrawalStatusResponse> when the agent status becomes deactivated.
Final status (will be
deactivated on success).Smart account wallet address.
When the agent was activated.
When the agent was deactivated.
Example
Error Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
TimeoutError | Withdrawal didn’t complete within timeout | Increase timeout or check status manually |
ValidationError: Polling interval must be greater than 0 | Invalid interval value | Use a positive interval |
ValidationError: Polling timeout must be greater than 0 | Invalid timeout value | Use a positive timeout |
Notes
Timeout Handling
Timeout Handling
If the timeout is reached before the agent is deactivated, a
TimeoutError is thrown. The withdrawal is still in progress and can be monitored with getWithdrawalStatus().Progress Updates
Progress Updates
Use the
onUpdate callback to provide visual feedback to users during the withdrawal process.