Withdraw
POST/withdraw
Withdraws collateral to the account wallet only. Sign the EIP-712 struct WithdrawIntent(address account,uint256 amount,uint64 nonce,uint64 deadline), with account set to your account and amount in USD × 1e6, in the domain with name CRX, version rulebook-1.0, and the chain_id and core from GET /health. Withdrawal approval time: 60 minutes. Follow withdraw.last on GET /balance until final is true.
Authentication
x-crx-addressx-crx-tsx-crx-sigx-crx-addressx-crx-signerx-crx-tsx-crx-sigx-crx-session
Request body
| Field | Type | Description |
|---|---|---|
chain required | string | A |
amount required | string | USD amount from 1 to |
nonce required | string |
|
deadline required | integer | Intent expiry, in Unix time (seconds). More than 120 seconds and at most 23 hours ahead. |
sig required | string | Your account key's EIP-712 signature of the intent: 65 bytes as 0x hex. |
Responses
200
The same intent was already sent.
| Field | Type | Description |
|---|---|---|
item required | string | Withdrawal ID; matches |
status required | string sending | |
chain required | string | |
account required | string | |
amount required | string | Amount in USD, as a decimal string. |
nonce required | string | |
deadline required | integer | Intent expiry, in Unix time (seconds). |
202
Withdrawal accepted.
| Field | Type | Description |
|---|---|---|
item required | string | Withdrawal ID; matches |
status required | string sending | |
chain required | string | |
account required | string | |
amount required | string | Amount in USD, as a decimal string. |
nonce required | string | |
deadline required | integer | Intent expiry, in Unix time (seconds). |
400
bad_request, invalid_signature.
code bad_request invalid_signature
401
unauthorized: a header is missing or malformed, x-crx-ts is out of range, the call was already used, the signature does not match, or the caller lacks access.
code unauthorized
403
not_whitelisted: the account is not approved for this call.
code not_whitelisted
408
timeout: no answer within 30 seconds. Resend the same body with a new x-crx-ts; it never sends a second withdrawal.
code timeout
409
withdraw_in_progress: another withdrawal is pending. conflict: withdrawals are unavailable now; outcome is platform_paused, unavailable, price_unavailable or account_not_active.
code withdraw_in_progress conflict
413
payload_too_large: the body is over 2 MiB.
code payload_too_large
415
unsupported_media_type: send content-type: application/json.
code unsupported_media_type
422
unprocessable_entity: wrong nonce, amount above free collateral, amount under 1 USD, or deadline out of range.
code unprocessable_entity
429
rate_limited: retry after Retry-After seconds.
code rate_limited
| Header | Type | Description |
|---|---|---|
Retry-After | integer | Seconds until the next call is accepted. |
ratelimit-limit | integer | Maximum calls in a burst. |
ratelimit-remaining | integer | Calls remaining before the limit. |
ratelimit-reset | integer | Seconds until the full limit is restored. |
ratelimit-refill | integer | Calls restored per minute. |
500
internal: the withdrawal was not queued or sent.
code internal
502
upstream: a chain read failed. Retry shortly.
code upstream
503
service_unavailable: CRX cannot accept a withdrawal now; nothing was sent.
code service_unavailable