SDK signer HMAC-signs the request with the client-held API key, and the backend relays it to POST /v1/withdraw. The wallet is not prompted for the withdrawal itself. The API key needs the transfer scope. See Signing Model — The API key.
Withdrawal setup
Ondo sends a withdrawal only to an address in its address book. The SDK offers one destination: the address that logged in. CallgetWithdrawFlow() to see if a setup step is outstanding.
addWithdrawalAddress takes no params. It is a session step with signer USER. The venue issues a challenge and the user’s wallet signs it, so a wallet prompt appears. The SDK adds the address with the label LI.FI. See Signing Model.
Discover the withdrawable balance
CallgetWithdrawableBalances() before you show a withdrawal form.
route: 'perps' and the USDC asset. The available field is the withdrawableMargin value of the venue balance. Ondo returns no row when withdrawableMargin is zero. Without a session, the read returns an empty array.
The withdrawalFee field is the withdrawalFeeUSD value of the venue account. Ondo charges the fee in USD. The collateral is USDC, so the SDK reports the fee as the same number in the units of the row. An amount at or below the fee delivers nothing.
Submit a withdrawal
amount is a human-readable USDC string. The SDK reads your Ondo accountId from the stored session and adds it to the request. You do not pass it. The backend rejects any other destination, asset, or route with a validation error. The network is always Ethereum.
Withdrawal history
getActivity() returns a WITHDRAWAL item for each withdrawal that the venue did not fail or cancel. The item has no status field. It carries the amount, the asset, and the fee in USD when the venue reports one. It has an explorerLink when the venue reports a transaction.
The SDK includes a withdrawal row when the venue status is WITHDRAWAL_PENDING, WITHDRAWAL_SUCCESS, complete, pending, or unknown. The SDK omits a row with status failure or cancelled, because no value left the account.
Errors
See Error Codes for the full code list.