token_withdraw
Withdraw tokens to external blockchain addresses using different protocols.Method Signature
Parameters
WithdrawRequest
Field | Type | Required | Description |
---|---|---|---|
protocol | WithdrawProtocol | Yes | Withdrawal protocol to use |
tokenid | string | Yes | The token identifier to withdraw |
address | string | Yes | Destination address for the withdrawal |
amount | TokenAmount | Yes | Amount of tokens to withdraw (bigint) |
WithdrawProtocol
- btc: Withdraw to Bitcoin network
- ckbtc: Withdraw to Chain-key Bitcoin (ckBTC)
- volt: Withdraw using Volt protocol
Response
WithdrawResponse
- Success:
{ ok: boolean }
- Withdrawal initiated, boolean indicates status - Error:
{ err: string }
- Error message describing what went wrong
Example Usage
Withdraw to Bitcoin
Withdraw using ckBTC
Withdraw using Volt
Common Errors
- Insufficient balance: Not enough tokens for withdrawal
- Invalid address: Destination address is invalid for the selected protocol
- Protocol not supported: Token doesn’t support the selected withdrawal protocol
- Minimum amount: Withdrawal amount below minimum threshold
- Network congestion: Temporary network issues preventing withdrawal