跳到主要内容

提交提现

状态:已实现。 会话 token 接口;钱包出资的现货账户会被以 403 拒绝,它们通过在自己钱包里转移资产出金。

POST /v1/withdrawals

从会话用户的现货钱包提出 amount 单位 asset 到 Canton party dest_user_handle_party。

鉴权:Authorization: Bearer <session_token>(见 下单)。会话必须带有 withdraw 权限且有 Canton party_id。用户取自会话,请求体里没有 user_id 字段。

请求

POST /v1/withdrawals
Authorization: Bearer <session_token>
Content-Type: application/json

{
"asset": "CC",
"amount": "10.0",
"dest_user_handle_party": "alice::1220abc...",
"idempotency_key": "ui-withdraw-1748275200"
}
字段类型必填说明
assetstring是不区分大小写。别名:USDC / USDA / USDC-X → CUSD;AMULET / CANTONCOIN / CANTON_COIN → CC;CETH → cETH;USDCX → USDCx。必须在资产注册表中开启了提现。
amountstring是十进制 > 0,小数位不得超过该资产登记的精度。
dest_user_handle_partystring否省略或为空时默认为会话自己的 party_id。
idempotency_keystring是非空。同一 key 配不同内容重发会被 ledger 拒绝。

提现手续费:由服务端在请求时报价。稳定币(CUSD、USDCx、USX、USDC.B)固定收取 1 个同币种;CBTC / cETH / CC 收取折合 1 USD 的提现币种(按 oracle 价格、向上取整到资产精度;此时响应带 fee_quote_price / fee_quote_ts_ms)。可先用 GET /v1/withdrawals/quote?asset=...(同样鉴权)预览。

响应 — 200

{
"withdrawal_request_id": "8c9a1f2e-7b6d-5c4a-3b2c-1d0e9f8a7b6c",
"withdrawal_id": "8c9a1f2e-7b6d-5c4a-3b2c-1d0e9f8a7b6c",
"status": "submitted",
"asset": "CC",
"amount": "10.0",
"fee_asset": "CC",
"fee_wallet_symbol": "CC",
"fee_amount": "0.0000142858",
"fee_quote_price": "70000",
"fee_quote_ts_ms": 1748275200000,
"destination_party": "alice::1220abc..."
}

withdrawal_request_id 与 withdrawal_id 是同一个带连字符的 UUID。此响应中 status 恒为 "submitted";实时状态请轮询 GET /v1/withdrawals/{wid}。

错误(响应体为纯文本):400 校验失败(asset is required、unsupported withdrawal asset、amount must be positive、amount supports at most N decimal places、withdrawal destination is required、idempotency_key is required、session does not have party_id)、401 缺少 / 无效的 session token、403 withdrawal permission denied 或钱包托管账户(现货提现已禁用)、409 ledger 前置条件不满足(如 insufficient spot balance)、502 其他 ledger / trading 错误(包括同一 idempotency_key 配不同内容重发)、503 手续费报价不可用 / 过期或资格检查不可用、504 请求超时(15 秒)。