@123456btc/123456btc-cli 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +182 -39
- package/README.zh-CN.md +78 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# 123456btc-cli
|
|
2
2
|
|
|
3
|
-
CLI
|
|
3
|
+
> Official CLI for 123456btc.com — Strategy subscription, signal streaming, and Provider management.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
7
|
+
- **Strategy Plaza** — Browse, filter, and subscribe to strategies (tiered by BBT holdings)
|
|
8
|
+
- **Real-time Signals** — WebSocket streaming with auto-ACK and automatic reconnection
|
|
9
|
+
- **Signal Management** — History lookup, manual ACK, and execution detail reporting
|
|
10
|
+
- **Provider Tools** — Apply as a Provider, create strategies, submit for review, push signals, and withdraw earnings
|
|
11
|
+
- **API Key Auth** — Long-lived `sk-bbt-xxx` keys with short-lived `at-bbt-xxx` access tokens
|
|
12
|
+
- **Wallet Login** — Solana wallet QR-code scan with automatic API Key generation
|
|
12
13
|
|
|
13
14
|
## Installation
|
|
14
15
|
|
|
@@ -21,63 +22,205 @@ npm install -g @123456btc/123456btc-cli
|
|
|
21
22
|
### 1. Authenticate
|
|
22
23
|
|
|
23
24
|
```bash
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
# Option 1: Wallet QR-code scan (recommended)
|
|
26
|
+
123456btc-cli auth wallet-login
|
|
27
|
+
|
|
28
|
+
# Option 2: Enter API Key directly
|
|
29
|
+
123456btc-cli auth login -k sk-bbt-your_key
|
|
27
30
|
```
|
|
28
31
|
|
|
29
|
-
### 2.
|
|
32
|
+
### 2. Browse & Subscribe to Strategies
|
|
30
33
|
|
|
31
34
|
```bash
|
|
32
|
-
|
|
33
|
-
123456btc-cli
|
|
35
|
+
# List available strategies (filtered by your BBT balance)
|
|
36
|
+
123456btc-cli strategy list
|
|
37
|
+
|
|
38
|
+
# Subscribe with daily billing (default)
|
|
39
|
+
123456btc-cli strategy subscribe strat-xxx
|
|
40
|
+
|
|
41
|
+
# Subscribe with per-signal billing
|
|
42
|
+
123456btc-cli strategy subscribe strat-xxx --billing-model per_signal_bbt
|
|
43
|
+
|
|
44
|
+
# View my subscriptions
|
|
45
|
+
123456btc-cli strategy my
|
|
34
46
|
```
|
|
35
47
|
|
|
36
|
-
### 3.
|
|
48
|
+
### 3. Stream Signals in Real-time
|
|
37
49
|
|
|
38
50
|
```bash
|
|
39
|
-
#
|
|
40
|
-
123456btc-cli strategy
|
|
51
|
+
# WebSocket stream with auto-ACK (default)
|
|
52
|
+
123456btc-cli strategy stream strat-xxx
|
|
41
53
|
|
|
42
|
-
#
|
|
43
|
-
123456btc-cli strategy
|
|
54
|
+
# Disable auto-ACK (manual confirmation)
|
|
55
|
+
123456btc-cli strategy stream strat-xxx --no-ack
|
|
56
|
+
```
|
|
44
57
|
|
|
45
|
-
|
|
46
|
-
|
|
58
|
+
### 4. Acknowledge Signals
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Simple ACK
|
|
62
|
+
123456btc-cli signals ack sig-xxx
|
|
63
|
+
|
|
64
|
+
# ACK with execution details
|
|
65
|
+
123456btc-cli signals ack sig-xxx --action execute --quantity 0.5
|
|
47
66
|
```
|
|
48
67
|
|
|
49
|
-
|
|
68
|
+
## Provider (Strategy Developer)
|
|
69
|
+
|
|
70
|
+
### Apply as a Provider
|
|
50
71
|
|
|
51
72
|
```bash
|
|
52
|
-
123456btc-cli
|
|
73
|
+
123456btc-cli provider apply \
|
|
74
|
+
--name "My Quant Studio" \
|
|
75
|
+
--description "BTC trend-following strategies" \
|
|
76
|
+
--email "contact@example.com"
|
|
53
77
|
```
|
|
54
78
|
|
|
55
|
-
|
|
79
|
+
> Requirement: on-chain BBT balance ≥ 1,000,000
|
|
80
|
+
|
|
81
|
+
### Save Your Provider Key
|
|
56
82
|
|
|
57
83
|
```bash
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
84
|
+
export PROVIDER_API_KEY=pk-bbt-your_provider_key
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Create & Launch a Strategy
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Create a strategy (draft status)
|
|
91
|
+
123456btc-cli provider create-strategy \
|
|
92
|
+
--name "EMA Trend V1" \
|
|
93
|
+
--symbol "BTC,ETH" \
|
|
94
|
+
--market crypto \
|
|
95
|
+
--pricing daily_bbt \
|
|
96
|
+
--price-day 50 \
|
|
97
|
+
--min-bbt 500000
|
|
98
|
+
|
|
99
|
+
# Submit for platform review
|
|
100
|
+
123456btc-cli provider submit strat-xxx
|
|
101
|
+
# → Waits for super_admin approval to go live
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Push Signals
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
123456btc-cli provider push-signal \
|
|
108
|
+
--strategy-id strat-xxx \
|
|
109
|
+
--symbol BTCUSDT \
|
|
110
|
+
--decision long \
|
|
111
|
+
--price 65000 \
|
|
112
|
+
--confidence 0.92 \
|
|
113
|
+
--stop-loss 62000 \
|
|
114
|
+
--take-profit 72000 \
|
|
115
|
+
--reasoning "EMA14 golden cross, volume surge"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Earnings & Withdrawals
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# View earnings summary
|
|
122
|
+
123456btc-cli provider earnings
|
|
123
|
+
|
|
124
|
+
# Request withdrawal
|
|
125
|
+
123456btc-cli provider withdraw \
|
|
126
|
+
--amount 100 \
|
|
127
|
+
--sol-address "YourSolanaAddress..."
|
|
128
|
+
|
|
129
|
+
# View withdrawal history
|
|
130
|
+
123456btc-cli provider withdrawals
|
|
62
131
|
```
|
|
63
132
|
|
|
64
|
-
##
|
|
133
|
+
## Command Reference
|
|
134
|
+
|
|
135
|
+
### Authentication
|
|
136
|
+
| Command | Description |
|
|
137
|
+
|---------|-------------|
|
|
138
|
+
| `auth login` | Authenticate with API Key |
|
|
139
|
+
| `auth wallet-login` | Solana wallet QR-code login |
|
|
140
|
+
| `auth status` | Check login status |
|
|
141
|
+
| `auth verify` | Verify API Key and show permissions |
|
|
142
|
+
| `auth logout` | Log out |
|
|
65
143
|
|
|
144
|
+
### Strategy (Subscriber)
|
|
66
145
|
| Command | Description |
|
|
67
146
|
|---------|-------------|
|
|
68
|
-
| `auth login` | Authenticate with API |
|
|
69
|
-
| `auth status` | Check auth status |
|
|
70
|
-
| `auth logout` | Clear auth |
|
|
71
147
|
| `strategy list` | List available strategies |
|
|
72
|
-
| `strategy
|
|
73
|
-
| `strategy
|
|
74
|
-
| `strategy
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
|
80
|
-
|
|
148
|
+
| `strategy show <id>` | Show strategy details |
|
|
149
|
+
| `strategy subscribe <id>` | Subscribe to a strategy |
|
|
150
|
+
| `strategy unsubscribe <id>` | Cancel subscription |
|
|
151
|
+
| `strategy my` | My active subscriptions |
|
|
152
|
+
| `strategy stream <id>` | WebSocket real-time signals |
|
|
153
|
+
|
|
154
|
+
### Signals (Subscriber)
|
|
155
|
+
| Command | Description |
|
|
156
|
+
|---------|-------------|
|
|
157
|
+
| `signals latest` | Get latest signals |
|
|
158
|
+
| `signals history` | Signal history |
|
|
159
|
+
| `signals ack <id>` | Acknowledge a signal |
|
|
160
|
+
|
|
161
|
+
### Provider (Strategy Developer)
|
|
162
|
+
| Command | Description |
|
|
163
|
+
|---------|-------------|
|
|
164
|
+
| `provider apply` | Apply to become a Provider |
|
|
165
|
+
| `provider me` | Provider info & stats |
|
|
166
|
+
| `provider earnings` | Earnings summary |
|
|
167
|
+
| `provider withdraw` | Request withdrawal |
|
|
168
|
+
| `provider withdrawals` | Withdrawal history |
|
|
169
|
+
| `provider strategies` | My strategies |
|
|
170
|
+
| `provider create-strategy` | Create a strategy |
|
|
171
|
+
| `provider submit <id>` | Submit for review |
|
|
172
|
+
| `provider pause/resume/delete <id>` | Strategy lifecycle |
|
|
173
|
+
| `provider push-signal` | Push a trading signal |
|
|
174
|
+
| `provider stats` | Provider statistics |
|
|
175
|
+
|
|
176
|
+
## Environment Variables
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
# Required
|
|
180
|
+
export API_KEY=sk-bbt-your_key
|
|
181
|
+
|
|
182
|
+
# Required for signal pushing
|
|
183
|
+
export PROVIDER_API_KEY=pk-bbt-your_provider_key
|
|
184
|
+
|
|
185
|
+
# Optional
|
|
186
|
+
export API_BASE_URL=https://platform.123456btc.com/ext-api
|
|
187
|
+
export SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Signal Decisions
|
|
191
|
+
|
|
192
|
+
| Decision | Meaning |
|
|
193
|
+
|----------|---------|
|
|
194
|
+
| `long` | Open long position |
|
|
195
|
+
| `short` | Open short position |
|
|
196
|
+
| `close_long` | Close long position |
|
|
197
|
+
| `close_short` | Close short position |
|
|
198
|
+
| `tp` | Take-profit close |
|
|
199
|
+
| `sl` | Stop-loss close |
|
|
200
|
+
| `partial_close` | Partial position close |
|
|
201
|
+
| `cancel` | Cancel signal |
|
|
202
|
+
|
|
203
|
+
## Billing Models
|
|
204
|
+
|
|
205
|
+
| Model | Charge Timing | Revenue Split |
|
|
206
|
+
|-------|--------------|---------------|
|
|
207
|
+
| `daily_bbt` | First charge on subscribe + every 24h renewal | 70% platform burn / 30% Provider |
|
|
208
|
+
| `per_signal_bbt` | On user ACK | 70% platform burn / 30% Provider |
|
|
209
|
+
| `free` | No charge | — |
|
|
210
|
+
|
|
211
|
+
## Architecture
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
|
215
|
+
│ Provider │────▶│ Platform │────▶│ Subscriber │
|
|
216
|
+
│ (CLI push) │ │ (Broadcast) │ │ (CLI stream)│
|
|
217
|
+
└─────────────┘ └─────────────┘ └─────────────┘
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
1. **Provider** pushes signals via `POST /provider/provider-api/signals` (`pk-bbt` auth)
|
|
221
|
+
2. **Platform** persists to DB and broadcasts via WebSocket Durable Object
|
|
222
|
+
3. **Subscriber** receives via WebSocket (`strategy stream`) or REST polling (`signals latest`)
|
|
223
|
+
4. **Subscriber** ACKs via `POST /ext-api/signals/ack` (`sk-bbt` auth), triggering per-signal billing
|
|
81
224
|
|
|
82
225
|
## Development
|
|
83
226
|
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# 123456btc-cli
|
|
2
|
+
|
|
3
|
+
> 123456btc 平台官方 CLI — 策略订阅、信号接收、Provider 管理一站式工具
|
|
4
|
+
|
|
5
|
+
完整中文文档请参见 [README.zh-CN.md](./README.zh-CN.md)
|
|
6
|
+
|
|
7
|
+
## 功能特性
|
|
8
|
+
|
|
9
|
+
- **策略广场** — 浏览、筛选、订阅平台策略(按 BBT 持仓分级)
|
|
10
|
+
- **实时信号** — WebSocket 接收交易信号,支持自动 ACK + 断线重连
|
|
11
|
+
- **信号管理** — 历史查询、手动 ACK、执行详情上报
|
|
12
|
+
- **Provider 管理** — 申请入驻、创建策略、提交审核、推送信号、收益提现
|
|
13
|
+
- **API Key 认证** — `sk-bbt-xxx` 长期密钥 + `at-bbt-xxx` 短期访问令牌
|
|
14
|
+
- **钱包扫码登录** — Solana 钱包扫码,自动生成 API Key
|
|
15
|
+
|
|
16
|
+
## 安装
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g @123456btc/123456btc-cli
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 快速开始
|
|
23
|
+
|
|
24
|
+
### 1. 登录
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# 方式一: 钱包扫码(推荐)
|
|
28
|
+
123456btc-cli auth wallet-login
|
|
29
|
+
|
|
30
|
+
# 方式二: 直接输入 API Key
|
|
31
|
+
123456btc-cli auth login -k sk-bbt-your_key
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 2. 浏览并订阅策略
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
123456btc-cli strategy list
|
|
38
|
+
123456btc-cli strategy subscribe strat-xxx
|
|
39
|
+
123456btc-cli strategy my
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 3. 实时接收信号
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
123456btc-cli strategy stream strat-xxx
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 4. Provider 推送信号
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
export PROVIDER_API_KEY=pk-bbt-your_provider_key
|
|
52
|
+
123456btc-cli provider push-signal \
|
|
53
|
+
--strategy-id strat-xxx \
|
|
54
|
+
--symbol BTCUSDT \
|
|
55
|
+
--decision long \
|
|
56
|
+
--price 65000
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 命令速查
|
|
60
|
+
|
|
61
|
+
| 分类 | 命令 |
|
|
62
|
+
|------|------|
|
|
63
|
+
| 认证 | `auth login` / `auth wallet-login` / `auth status` / `auth verify` / `auth logout` |
|
|
64
|
+
| 策略 | `strategy list` / `strategy show` / `strategy subscribe` / `strategy unsubscribe` / `strategy my` / `strategy stream` |
|
|
65
|
+
| 信号 | `signals latest` / `signals history` / `signals ack` |
|
|
66
|
+
| Provider | `provider apply` / `provider me` / `provider earnings` / `provider withdraw` / `provider strategies` / `provider create-strategy` / `provider submit` / `provider push-signal` / `provider stats` |
|
|
67
|
+
|
|
68
|
+
## 计费模式
|
|
69
|
+
|
|
70
|
+
| 模式 | 扣费时机 | 分账比例 |
|
|
71
|
+
|------|----------|----------|
|
|
72
|
+
| `daily_bbt` | 订阅首扣 + 每24h续费 | 70% 平台销毁 / 30% Provider |
|
|
73
|
+
| `per_signal_bbt` | 用户 ACK 信号时 | 70% 平台销毁 / 30% Provider |
|
|
74
|
+
| `free` | 不扣费 | — |
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
Apache-2.0
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@123456btc/123456btc-cli",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "123456btc CLI -
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "123456btc CLI - 策略订阅、信号接收、Provider 管理一站式工具",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"bin": {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"dist",
|
|
23
23
|
"bin",
|
|
24
24
|
"README.md",
|
|
25
|
+
"README.zh-CN.md",
|
|
25
26
|
"LICENSE"
|
|
26
27
|
],
|
|
27
28
|
"keywords": [
|