htx-spot-account
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHTX Spot Account
HTX现货账户
Spot account and asset management for HTX. Requires API key with read permission. Transfer endpoints (4 of 9) are writes but funds stay inside HTX — low risk.
适用于HTX平台的现货账户与资产管理工具。需要具备读取权限的API密钥。划转接口(9个接口中的4个)为写入操作,但资金仅在HTX内部流转——风险较低。
When to use this skill
何时使用该技能
- "How much USDT do I have?"
- "What's my total asset valuation in USD?"
- "Show my account history / flow records"
- "Transfer 1000 USDT from spot to futures"
- "Check my HTX points balance"
- "我有多少USDT?"
- "我的总资产估值是多少美元?"
- "展示我的账户历史/流水记录"
- "划转1000 USDT从现货账户到期货账户"
- "查询我的HTX积分余额"
Underlying tool
底层工具
Drives . Binary must be on or at . Always use .
htx-cli$PATH$HTX_CLI_BIN--json基于驱动。二进制文件必须位于路径下或指定位置。请始终使用参数。
htx-cli$PATH$HTX_CLI_BIN--jsonConfigure credentials (one-time)
配置凭证(一次性操作)
bash
htx-cli config set-key <AccessKeyId>
htx-cli config set-secret <SecretKey>
htx-cli config showSee for signing details.
references/authentication.mdbash
htx-cli config set-key <AccessKeyId>
htx-cli config set-secret <SecretKey>
htx-cli config show签名细节请查看。
references/authentication.mdEndpoint catalog (10)
接口目录(共10个)
Account queries — read (5)
账户查询——读取操作(5个)
| # | Method | Endpoint | CLI invocation | Description |
|---|---|---|---|---|
| 1 | GET | | | All accounts for the user |
| 2 | GET | | | Balance detail |
| 3 | GET | | | Total valuation of all accounts |
| 4 | GET | | | Per-account asset valuation |
| 5 | GET | | | Account flow / ledger |
| # | 请求方法 | 接口地址 | CLI调用命令 | 描述 |
|---|---|---|---|---|
| 1 | GET | | | 用户名下所有账户 |
| 2 | GET | | | 余额详情 |
| 3 | GET | | | 所有账户的总估值 |
| 4 | GET | | | 单账户资产估值 |
| 5 | GET | | | 账户流水/账本 |
Fund transfers — write (5)
资金划转——写入操作(5个)
| # | Method | Endpoint | CLI invocation | Description |
|---|---|---|---|---|
| 1 | POST | | | Transfer between user's own spot/margin/otc accounts |
| 2 | POST | | | Spot ↔ COIN-M (币本位交割) futures transfer ONLY. Does NOT work for USDT-M. |
| 3 | POST | | | Spot ↔ USDT-M linear swap / cross-margin / super-margin, etc. Use for any USDT-M futures transfer. |
| 4 | GET | | | HTX points balance |
| 5 | POST | | | Transfer points |
Important: For USDT-M perpetual swap (线性永续), you MUST usewith/v2/account/transfer/from=to↔spotandlinear-swap=margin-account(cross) orUSDT(isolated, e.g.USDT-<symbol>). TheUSDT-BTCendpoint is reserved for COIN-M delivery contracts and will return/v1/futures/transferif misused.Transfer service is temporarily suspended for USDT account
| # | 请求方法 | 接口地址 | CLI调用命令 | 描述 |
|---|---|---|---|---|
| 1 | POST | | | 用户自有现货/杠杆/OTC账户间划转 |
| 2 | POST | | | 仅支持现货与**COIN-M(币本位交割)**期货账户间划转,不适用于USDT-M合约。 |
| 3 | POST | | | 现货与USDT-M线性永续合约/全仓杠杆/超级杠杆等账户间划转,适用于所有USDT-M期货划转场景。 |
| 4 | GET | | | HTX积分余额 |
| 5 | POST | | | 划转积分 |
重要提示:对于USDT-M永续合约(线性永续),必须使用接口,其中/v2/account/transfer/from参数设置为to与spot,linear-swap参数设置为margin-account(全仓)或USDT(逐仓,例如USDT-<交易对>)。USDT-BTC接口仅适用于COIN-M交割合约,若误用会返回/v1/futures/transfer错误。Transfer service is temporarily suspended for USDT account
Workflow patterns
工作流示例
Show total balance
查询总余额
bash
htx-cli spot account list --json # find account id with type=spot
htx-cli spot account balance <id> --json # detailed per-currency balance
htx-cli spot account valuation --json # single USD totalbash
htx-cli spot account list --json # 找到类型为spot的账户ID
htx-cli spot account balance <id> --json # 查看各币种的详细余额
htx-cli spot account valuation --json # 查看以美元计价的总估值Spot → USDT-M futures transfer (most common)
现货账户转USDT-M期货账户(最常用场景)
Use :
/v2/account/transferbash
htx-cli spot call /v2/account/transfer --method POST --auth \
--body '{"from":"spot","to":"linear-swap","currency":"usdt","amount":"5","margin-account":"USDT"}' --json- /
from:to,spot,linear-swap,margin, etc. Reverse them to transfer back.super-margin - :
margin-accountfor cross-margin,USDT(etc.) for isolated margin.USDT-BTC
使用接口:
/v2/account/transferbash
htx-cli spot call /v2/account/transfer --method POST --auth \
--body '{"from":"spot","to":"linear-swap","currency":"usdt","amount":"5","margin-account":"USDT"}' --json- /
from:可选值包括to、spot、linear-swap、margin等。反向设置即可实现资金转回。super-margin - :
margin-account代表全仓杠杆,USDT(等)代表逐仓杠杆。USDT-BTC
Spot → COIN-M (币本位) futures transfer
现货账户转COIN-M(币本位)期货账户
Use with = or (currency is the coin symbol, e.g. , ).
/v1/futures/transfertypepro-to-futuresfutures-to-probtcethBefore calling any transfer endpoint, display to the user source, destination, currency, amount, direction. Only proceed after explicit user confirmation.
使用接口,设置参数为(现货转期货)或(期货转现货),币种参数为对应代币符号,例如、。
/v1/futures/transfertypepro-to-futuresfutures-to-probtceth调用任何划转接口前,必须向用户展示资金来源、目标账户、币种、金额及划转方向。仅在用户明确确认后才可执行操作。
Safety
安全注意事项
- Read endpoints: safe to call without confirmation.
- Transfer endpoints: must confirm with the user first — show source, destination, currency, amount.
- Never log the secret key. Never pass it as a CLI argument; use so it's stored once.
htx-cli config set-secret
- 读取接口:无需确认即可安全调用。
- 划转接口:必须先获得用户确认——展示来源、目标、币种、金额。
- 切勿记录密钥。切勿将密钥作为CLI参数传递;请使用命令一次性存储密钥。
htx-cli config set-secret
References
参考资料
- — HMAC-SHA256 signing and key management
references/authentication.md
- — HMAC-SHA256签名与密钥管理
references/authentication.md