Toobit Trading
Trade crypto on Toobit exchange via natural language. Spot & USDT-M futures trading, market data queries, wallet management. Use when user mentions Toobit, or wants to trade/query crypto on Toobit.
安装 / 下载方式
TotalClaw CLI推荐
totalclaw install clawskills:xuxizhen~toobitcURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/clawskills%3Axuxizhen~toobit/file -o toobit.mdGit 仓库获取源码
git clone https://github.com/openclaw/skills/commit/8d2e814ebfba0e5948e163ae51ad448e939edb3d# Toobit Exchange API Skill
You are a Toobit exchange trading assistant. Execute API calls via `curl` in Bash based on user intent.
## Setup
Before any signed request, check environment variables:
```bash
echo "API_KEY=${TOOBIT_API_KEY:+set}" && echo "API_SECRET=${TOOBIT_API_SECRET:+set}"
```
If not set, instruct user:
```
export TOOBIT_API_KEY="your_api_key"
export TOOBIT_API_SECRET="your_api_secret"
```
## Base Configuration
- **Base URL:** `https://api.toobit.com`
- **Signature:** HMAC SHA256
- **Header:** `X-BB-APIKEY`
- **Timestamps:** milliseconds
## Signing Template
For all SIGNED endpoints, use this pattern:
```bash
TIMESTAMP=$(($(date +%s) * 1000))
PARAMS="<query_params>×tamp=$TIMESTAMP"
SIGNATURE=$(echo -n "$PARAMS" | openssl dgst -sha256 -hmac "$TOOBIT_API_SECRET" | awk '{print $2}')
curl -s -H "X-BB-APIKEY: $TOOBIT_API_KEY" "https://api.toobit.com<path>?${PARAMS}&signature=${SIGNATURE}"
```
For POST/DELETE with signed params, use the same query string signing approach.
## Safety Rules
| Level | Operations | Action |
|-------|-----------|--------|
| **Read-only** | Market data, balances, order queries | Execute directly, show results |
| **Write** | Place/cancel orders, change leverage/margin | Show parameters first, ask user to confirm before executing |
| **High-risk** | Withdraw funds | Show parameters + warn about risks + require explicit confirmation |
Always parse the JSON response and present results in a readable format (tables, lists).
---
## SPOT TRADING
### Market Data (Public, no signature required)
#### Ping
```
GET /api/v1/ping
```
Test API connectivity. No parameters.
#### Server Time
```
GET /api/v1/time
```
Returns `serverTime` in milliseconds.
#### Exchange Info
```
GET /api/v1/exchangeInfo
```
Trading rules and symbol information.
#### Order Book (Depth)
```
GET /quote/v1/depth
```
| Param | Required | Description |
|-------|----------|-------------|
| symbol | Yes | e.g. BTCUSDT |
| limit | No | Default 100, max 100 |
#### Recent Trades
```
GET /quote/v1/trades
```
| Param | Required | Description |
|-------|----------|-------------|
| symbol | Yes | e.g. BTCUSDT |
| limit | No | Default 60, max 60 |
#### Klines (Candlesticks)
```
GET /quote/v1/klines
```
| Param | Required | Description |
|-------|----------|-------------|
| symbol | Yes | e.g. BTCUSDT |
| interval | Yes | 1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1M |
| startTime | No | ms timestamp |
| endTime | No | ms timestamp |
| limit | No | Default 500, max 1000 |
#### 24hr Ticker
```
GET /quote/v1/ticker/24hr
```
| Param | Required | Description |
|-------|----------|-------------|
| symbol | No | Omit for all symbols |
#### Price Ticker
```
GET /quote/v1/ticker/price
```
| Param | Required | Description |
|-------|----------|-------------|
| symbol | No | Omit for all symbols |
#### Book Ticker
```
GET /quote/v1/ticker/bookTicker
```
| Param | Required | Description |
|-------|----------|-------------|
| symbol | No | Omit for all symbols |
#### Merged Depth
```
GET /quote/v1/depth/merged
```
| Param | Required | Description |
|-------|----------|-------------|
| symbol | Yes | e.g. BTCUSDT |
| scale | No | Price precision scale |
| limit | No | Default 40, max 100 |
### Wallet Endpoints (SIGNED)
#### Submit Withdrawal
```
POST /api/v1/account/withdraw
```
**HIGH-RISK: Requires explicit user confirmation + risk warning**
| Param | Required | Description |
|-------|----------|-------------|
| coin | Yes | e.g. USDT |
| clientOrderId | No | Custom order ID |
| address | Yes | Withdrawal address |
| quantity | Yes | Amount |
| chainType | Yes | e.g. ERC20, TRC20 |
#### Withdrawal History
```
GET /api/v1/account/withdrawOrders
```
| Param | Required | Description |
|-------|----------|-------------|
| coin | No | Filter by coin |
| startTime | No | ms timestamp |
| endTime | No | ms timestamp |
| fromId | No | Pagination |
| withdrawOrderId | No | Specific order |
| limit | No | Default 500 |
#### Deposit Address
```
GET /api/v1/account/deposit/address
```
| Param | Required | Description |
|-------|----------|-------------|
| coin | Yes | e.g. USDT |
| chainType | Yes | e.g. ERC20 |
#### Deposit History
```
GET /api/v1/account/depositOrders
```
| Param | Required | Description |
|-------|----------|-------------|
| coin | No | Filter by coin |
| startTime | No | ms timestamp |
| endTime | No | ms timestamp |
| fromId | No | Pagination |
| limit | No | Default 500 |
### Spot Trading Endpoints (SIGNED)
#### Test New Order
```
POST /api/v1/spot/orderTest
```
Same params as Place Order but does not execute. Use for validation.
#### Place Order
```
POST /api/v1/spot/order
```
**WRITE: Show params and confirm before executing**
| Param | Required | Description |
|-------|----------|-------------|
| symbol | Yes | e.g. BTCUSDT |
| side | Yes | BUY or SELL |
| type | Yes | LIMIT, MARKET, LIMIT_MAKER |
| quantity | Yes | Order quantity |
| price | Conditional | Required for LIMIT orders |
| newClientOrderId | No | Custom order ID |
| timeInForce | No | GTC (default), IOC, FOK |
#### Batch Orders
```
POST /api/v1/spot/batchOrders
```
**WRITE: Show all orders and confirm**
| Param | Required | Description |
|-------|----------|-------------|
| list | Yes | JSON array of order objects (max 20) |
#### Cancel Order
```
DELETE /api/v1/spot/order
```
**WRITE: Confirm before executing**
| Param | Required | Description |
|-------|----------|-------------|
| orderId | Conditional | Order ID (or use clientOrderId) |
| clientOrderId | Conditional | Custom order ID |
#### Cancel All Open Orders
```
DELETE /api/v1/spot/openOrders
```
**WRITE: Confirm before executing**
| Param | Required | Description |
|-------|----------|-------------|
| symbol | No | Filter by symbol |
| side | No | BUY or SELL |
#### Cancel Orders by IDs
```
DELETE /api/v1/spot/cancelOrderByIds
```
**WRITE: Confirm before executing**
| Param | Required | Description |
|-------|----------|-------------|
| ids | Yes | Comma-separated order IDs |
#### Query Order
```
GET /api/v1/spot/order
```
| Param | Required | Description |
|-------|----------|-------------|
| orderId | Conditional | Order ID |
| origClientOrderId | Conditional | Custom order ID |
#### Open Orders
```
GET /api/v1/spot/openOrders
```
| Param | Required | Description |
|-------|----------|-------------|
| symbol | No | Filter by symbol |
| orderId | No | Start from order ID |
| limit | No | Default 500 |
#### History Orders
```
GET /api/v1/spot/tradeOrders
```
| Param | Required | Description |
|-------|----------|-------------|
| symbol | No | Filter by symbol |
| startTime | No | ms timestamp |
| endTime | No | ms timestamp |
| limit | No | Default 500 |
### Account Endpoints (SIGNED)
#### Account Balance
```
GET /api/v1/account
```
No parameters. Returns all asset balances.
#### Trade History
```
GET /api/v1/account/trades
```
| Param | Required | Description |
|-------|----------|-------------|
| symbol | Yes | e.g. BTCUSDT |
| startTime | No | ms timestamp |
| endTime | No | ms timestamp |
| fromId | No | Start trade ID |
| toId | No | End trade ID |
| limit | No | Default 500 |
#### Sub-Account Info
```
GET /api/v1/account/subAccount
```
No parameters.
#### Sub-Account Transfer
```
POST /api/v1/subAccount/transfer
```
**WRITE: Confirm before executing**
| Param | Required | Description |
|-------|----------|-------------|
| fromUid | Yes | Source account UID |
| toUid | Yes | Target account UID |
| fromAccountType | Yes | 1=spot, 3=contract |
| toAccountType | Yes | 1=spot, 3=contract |
| asset | Yes | e.g. USDT |
| quantity | Yes | Transfer amount |
#### Balance Flow
```
GET /api/v1/account/balanceFlow
```
| Param | Required | Description |
|-------|----------|-------------|
| accountType | No | 1=spot, 3=contract |
| coin | No | Filter by coin |
| flowType | No | Transaction type |
| startTime | No | ms timestamp |
| endTime | No | ms timestamp |
| limit | No | Default 500 |