@nuno1026/bithumb-cli 0.1.0
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/dist/account-QQC3UZDP.js +110 -0
- package/dist/account-QQC3UZDP.js.map +1 -0
- package/dist/chunk-6NIRYFQU.js +3482 -0
- package/dist/chunk-6NIRYFQU.js.map +1 -0
- package/dist/chunk-FYO6WLZI.js +72 -0
- package/dist/chunk-FYO6WLZI.js.map +1 -0
- package/dist/chunk-XOKGESZ3.js +139 -0
- package/dist/chunk-XOKGESZ3.js.map +1 -0
- package/dist/config-5T2Z7X5D.js +172 -0
- package/dist/config-5T2Z7X5D.js.map +1 -0
- package/dist/deposit-PBP2KDXP.js +169 -0
- package/dist/deposit-PBP2KDXP.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +455 -0
- package/dist/index.js.map +1 -0
- package/dist/market-B32IKWHH.js +304 -0
- package/dist/market-B32IKWHH.js.map +1 -0
- package/dist/trade-ZZU6PXJL.js +233 -0
- package/dist/trade-ZZU6PXJL.js.map +1 -0
- package/dist/twap-U3LDHACU.js +78 -0
- package/dist/twap-U3LDHACU.js.map +1 -0
- package/dist/withdraw-7C657PEC.js +161 -0
- package/dist/withdraw-7C657PEC.js.map +1 -0
- package/package.json +25 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
BithumbRestClient,
|
|
4
|
+
SUPPORTED_CLIENTS,
|
|
5
|
+
TradeLogger,
|
|
6
|
+
checkForUpdates,
|
|
7
|
+
createToolRunner,
|
|
8
|
+
loadConfig,
|
|
9
|
+
printSetupUsage,
|
|
10
|
+
runSetup
|
|
11
|
+
} from "./chunk-6NIRYFQU.js";
|
|
12
|
+
import {
|
|
13
|
+
parseCli
|
|
14
|
+
} from "./chunk-XOKGESZ3.js";
|
|
15
|
+
import {
|
|
16
|
+
errorLine,
|
|
17
|
+
outputLine,
|
|
18
|
+
printJson,
|
|
19
|
+
printKv
|
|
20
|
+
} from "./chunk-FYO6WLZI.js";
|
|
21
|
+
|
|
22
|
+
// src/constants.ts
|
|
23
|
+
var CLI_VERSION = "0.1.0";
|
|
24
|
+
|
|
25
|
+
// src/help.ts
|
|
26
|
+
var GLOBAL_HELP = `
|
|
27
|
+
bithumb-trade v${CLI_VERSION} \u2014 Bithumb Trade CLI
|
|
28
|
+
|
|
29
|
+
Usage: bithumb-trade <module> <command> [options]
|
|
30
|
+
|
|
31
|
+
Modules:
|
|
32
|
+
market Market data (ticker, orderbook, candles, trades)
|
|
33
|
+
account Account balance, wallet status, API keys
|
|
34
|
+
trade Order management (list, place, cancel, batch)
|
|
35
|
+
twap TWAP (Time-Weighted Average Price) orders
|
|
36
|
+
withdraw Cryptocurrency and KRW withdrawals
|
|
37
|
+
deposit Cryptocurrency and KRW deposits
|
|
38
|
+
system Server capabilities and module availability for agent planning
|
|
39
|
+
|
|
40
|
+
Utility:
|
|
41
|
+
setup Configure MCP client integration
|
|
42
|
+
config Manage CLI configuration profiles
|
|
43
|
+
diagnose Run connectivity diagnostics
|
|
44
|
+
|
|
45
|
+
Global Options:
|
|
46
|
+
--profile <name> Config profile (default: "default")
|
|
47
|
+
--json Output as JSON
|
|
48
|
+
--verbose Enable verbose logging
|
|
49
|
+
--read-only Read-only mode (setup only, disables write operations)
|
|
50
|
+
-h, --help Show help
|
|
51
|
+
-v, --version Show version
|
|
52
|
+
|
|
53
|
+
Run 'bithumb-trade <module> --help' for module-specific commands.
|
|
54
|
+
`;
|
|
55
|
+
var MARKET_HELP = `
|
|
56
|
+
Usage: bithumb-trade market <command> [options]
|
|
57
|
+
|
|
58
|
+
Commands:
|
|
59
|
+
markets List all available markets
|
|
60
|
+
ticker <market> Get ticker for market(s) (comma-separated)
|
|
61
|
+
orderbook <market> Get orderbook for market(s) (comma-separated)
|
|
62
|
+
trades <market> Get recent trades
|
|
63
|
+
candles-minutes <market> Get minute candles
|
|
64
|
+
candles-days <market> Get daily candles
|
|
65
|
+
candles-weeks <market> Get weekly candles
|
|
66
|
+
candles-months <market> Get monthly candles
|
|
67
|
+
warnings Get virtual asset warning markets
|
|
68
|
+
notices Get notice list
|
|
69
|
+
fee-inout <currency> Get deposit/withdrawal fees
|
|
70
|
+
|
|
71
|
+
Market Options:
|
|
72
|
+
--is-details Include detailed market info (markets only)
|
|
73
|
+
--count <n> Number of results to return
|
|
74
|
+
--to <timestamp> Return results before this timestamp
|
|
75
|
+
--unit <n> Minute unit: 1,3,5,10,15,30,60,240 (candles-minutes only)
|
|
76
|
+
--cursor <cursor> Pagination cursor (trades only)
|
|
77
|
+
--days-ago <n> Filter trades by days ago (trades only)
|
|
78
|
+
--converting-price-unit <unit> Price unit: KRW (candles-days only)
|
|
79
|
+
|
|
80
|
+
Examples:
|
|
81
|
+
bithumb-trade market markets
|
|
82
|
+
bithumb-trade market ticker KRW-BTC
|
|
83
|
+
bithumb-trade market orderbook KRW-BTC --json
|
|
84
|
+
bithumb-trade market candles-minutes KRW-BTC --unit 5 --count 10
|
|
85
|
+
`;
|
|
86
|
+
var ACCOUNT_HELP = `
|
|
87
|
+
Usage: bithumb-trade account <command> [options]
|
|
88
|
+
|
|
89
|
+
Commands:
|
|
90
|
+
balance Get account balances
|
|
91
|
+
order-chance --market <market> Get order chance for a market
|
|
92
|
+
audit View trade audit log
|
|
93
|
+
wallet-status Get wallet deposit/withdrawal status
|
|
94
|
+
api-keys Get API key list
|
|
95
|
+
capabilities (alias) Server capabilities for agent planning (same as 'system capabilities')
|
|
96
|
+
|
|
97
|
+
Account Options:
|
|
98
|
+
--market <market> Market identifier (e.g., KRW-BTC)
|
|
99
|
+
|
|
100
|
+
Audit Options:
|
|
101
|
+
--limit <n> Number of log entries (default: 20)
|
|
102
|
+
--tool <name> Filter by tool name
|
|
103
|
+
--since <date> Show entries since date (ISO format)
|
|
104
|
+
--level <level> Filter by log level (INFO, WARN, ERROR, DEBUG)
|
|
105
|
+
|
|
106
|
+
Examples:
|
|
107
|
+
bithumb-trade account balance
|
|
108
|
+
bithumb-trade account order-chance --market KRW-BTC
|
|
109
|
+
bithumb-trade account audit --limit 10
|
|
110
|
+
`;
|
|
111
|
+
var TRADE_HELP = `
|
|
112
|
+
Usage: bithumb-trade trade <command> [options]
|
|
113
|
+
|
|
114
|
+
Commands:
|
|
115
|
+
orders List orders
|
|
116
|
+
get Get order details
|
|
117
|
+
place Place a new order
|
|
118
|
+
cancel Cancel an order
|
|
119
|
+
batch-place --file <path> Place multiple orders from JSON file (max 20)
|
|
120
|
+
batch-cancel Cancel multiple orders (max 30)
|
|
121
|
+
|
|
122
|
+
Trade Options:
|
|
123
|
+
--market <market> Market identifier (e.g., KRW-BTC)
|
|
124
|
+
--uuid <uuid> Order UUID
|
|
125
|
+
--client-order-id <id> Client-assigned order ID
|
|
126
|
+
--side <side> Order side: bid (buy) / ask (sell)
|
|
127
|
+
--order-type <type> Order type: limit / price / market (canonical)
|
|
128
|
+
--ord-type <type> (deprecated alias of --order-type)
|
|
129
|
+
--price <price> Order price
|
|
130
|
+
--volume <volume> Order volume
|
|
131
|
+
--state <state> Filter by state: wait / watch / done / cancel
|
|
132
|
+
--states <states> Filter by multiple states (comma-separated)
|
|
133
|
+
--uuids <uuids> Filter by multiple UUIDs (comma-separated)
|
|
134
|
+
--client-order-ids <ids> Filter by multiple client order IDs (comma-separated)
|
|
135
|
+
--order-by <order> Sort order: asc / desc
|
|
136
|
+
--page <n> Page number
|
|
137
|
+
--limit <n> Results per page
|
|
138
|
+
--file <path> JSON file path (batch-place only)
|
|
139
|
+
|
|
140
|
+
Examples:
|
|
141
|
+
bithumb-trade trade orders --market KRW-BTC --state wait
|
|
142
|
+
bithumb-trade trade get --uuid abc-123
|
|
143
|
+
bithumb-trade trade place --market KRW-BTC --side bid --order-type limit --price 50000000 --volume 0.01
|
|
144
|
+
bithumb-trade trade cancel --uuid abc-123
|
|
145
|
+
bithumb-trade trade batch-place --file orders.json
|
|
146
|
+
`;
|
|
147
|
+
var SETUP_HELP = `
|
|
148
|
+
Usage: bithumb-trade setup --client <client> [--profile <name>] [--modules <list>]
|
|
149
|
+
|
|
150
|
+
Configure MCP client integration for supported AI coding tools.
|
|
151
|
+
|
|
152
|
+
Options:
|
|
153
|
+
--client <client> Target client: claude-desktop, cursor, windsurf, vscode, claude-code
|
|
154
|
+
--profile <name> Config profile to use (default: "default")
|
|
155
|
+
--modules <list> Comma-separated modules to enable
|
|
156
|
+
|
|
157
|
+
Examples:
|
|
158
|
+
bithumb-trade setup --client claude-desktop
|
|
159
|
+
bithumb-trade setup --client cursor --modules market,account
|
|
160
|
+
`;
|
|
161
|
+
var TWAP_HELP = `
|
|
162
|
+
Usage: bithumb-trade twap <command> [options]
|
|
163
|
+
|
|
164
|
+
Commands:
|
|
165
|
+
place Place a TWAP order
|
|
166
|
+
orders List TWAP orders
|
|
167
|
+
cancel Cancel a TWAP order
|
|
168
|
+
|
|
169
|
+
TWAP Options:
|
|
170
|
+
--market <market> Market identifier (e.g., KRW-BTC)
|
|
171
|
+
--side <side> Order side: bid / ask
|
|
172
|
+
--duration <seconds> Duration in seconds (300-43200)
|
|
173
|
+
--frequency <seconds> Frequency: 5,15,20,30,60,120
|
|
174
|
+
--price <price> Order price (required for bid)
|
|
175
|
+
--volume <volume> Order volume (required for ask)
|
|
176
|
+
--algo-order-id <id> TWAP order ID (for cancel)
|
|
177
|
+
--state <state> Order state filter
|
|
178
|
+
--next-key <key> Pagination cursor
|
|
179
|
+
--limit <n> Results per page
|
|
180
|
+
--uuids <uuids> Filter by TWAP order IDs (comma-separated)
|
|
181
|
+
--order-by <order> Sort order: asc / desc
|
|
182
|
+
|
|
183
|
+
Examples:
|
|
184
|
+
bithumb-trade twap place --market KRW-BTC --side bid --duration 3600 --frequency 60 --price 50000000
|
|
185
|
+
bithumb-trade twap orders --market KRW-BTC
|
|
186
|
+
bithumb-trade twap cancel --algo-order-id abc-123
|
|
187
|
+
`;
|
|
188
|
+
var WITHDRAW_HELP = `
|
|
189
|
+
Usage: bithumb-trade withdraw <command> [options]
|
|
190
|
+
|
|
191
|
+
Commands:
|
|
192
|
+
chance Get withdrawal availability info
|
|
193
|
+
get Get specific withdrawal
|
|
194
|
+
list List coin withdrawals
|
|
195
|
+
list-krw List KRW withdrawals
|
|
196
|
+
coin Withdraw cryptocurrency (CAUTION)
|
|
197
|
+
krw Withdraw KRW (CAUTION)
|
|
198
|
+
cancel Cancel coin withdrawal
|
|
199
|
+
addresses List allowed withdrawal addresses
|
|
200
|
+
|
|
201
|
+
Withdraw Options:
|
|
202
|
+
--currency <code> Currency code (e.g., BTC)
|
|
203
|
+
--net-type <type> Network type (e.g., BTC)
|
|
204
|
+
--amount <amount> Withdrawal amount
|
|
205
|
+
--address <addr> Withdrawal address
|
|
206
|
+
--secondary-address <addr> Secondary address (tag/memo)
|
|
207
|
+
--exchange-name <name> Exchange name
|
|
208
|
+
--receiver-type <type> Receiver type: personal / corporation
|
|
209
|
+
--receiver-ko-name <name> Receiver Korean name
|
|
210
|
+
--receiver-en-name <name> Receiver English name
|
|
211
|
+
--receiver-corp-ko-name <name> Corporation Korean name
|
|
212
|
+
--receiver-corp-en-name <name> Corporation English name
|
|
213
|
+
--two-factor-type <type> 2FA type (kakao)
|
|
214
|
+
--uuid <uuid> Withdrawal UUID
|
|
215
|
+
--txids <txids> Transaction ID(s) (comma-separated for list)
|
|
216
|
+
--uuids <uuids> Filter by UUIDs (comma-separated, for list)
|
|
217
|
+
--withdrawal-id <id> Withdrawal ID (for cancel)
|
|
218
|
+
--state <state> State filter (for list)
|
|
219
|
+
--limit <n> Results per page (max 100)
|
|
220
|
+
--page <n> Page number
|
|
221
|
+
--order-by <order> Sort order: asc / desc
|
|
222
|
+
|
|
223
|
+
Examples:
|
|
224
|
+
bithumb-trade withdraw chance --currency BTC --net-type BTC
|
|
225
|
+
bithumb-trade withdraw list --currency BTC
|
|
226
|
+
bithumb-trade withdraw addresses
|
|
227
|
+
`;
|
|
228
|
+
var DEPOSIT_HELP = `
|
|
229
|
+
Usage: bithumb-trade deposit <command> [options]
|
|
230
|
+
|
|
231
|
+
Commands:
|
|
232
|
+
get Get specific deposit
|
|
233
|
+
list List coin deposits
|
|
234
|
+
list-krw List KRW deposits
|
|
235
|
+
krw Request KRW deposit (CAUTION)
|
|
236
|
+
generate-address Generate deposit address
|
|
237
|
+
addresses List all deposit addresses
|
|
238
|
+
address Get specific deposit address
|
|
239
|
+
|
|
240
|
+
Deposit Options:
|
|
241
|
+
--currency <code> Currency code (e.g., BTC)
|
|
242
|
+
--net-type <type> Network type (e.g., BTC)
|
|
243
|
+
--amount <amount> Deposit amount
|
|
244
|
+
--two-factor-type <type> 2FA type (kakao)
|
|
245
|
+
--uuid <uuid> Deposit UUID
|
|
246
|
+
--txids <txids> Transaction ID(s) (comma-separated for list)
|
|
247
|
+
--uuids <uuids> Filter by UUIDs (comma-separated, for list)
|
|
248
|
+
--state <state> State filter (for list)
|
|
249
|
+
--limit <n> Results per page (max 100)
|
|
250
|
+
--page <n> Page number
|
|
251
|
+
--order-by <order> Sort order: asc / desc
|
|
252
|
+
|
|
253
|
+
Examples:
|
|
254
|
+
bithumb-trade deposit list --currency BTC
|
|
255
|
+
bithumb-trade deposit address --currency BTC --net-type BTC
|
|
256
|
+
bithumb-trade deposit addresses
|
|
257
|
+
`;
|
|
258
|
+
var SYSTEM_HELP = `
|
|
259
|
+
Usage: bithumb-trade system <command> [options]
|
|
260
|
+
|
|
261
|
+
Commands:
|
|
262
|
+
capabilities Server capabilities and module availability for agent planning
|
|
263
|
+
|
|
264
|
+
System Options:
|
|
265
|
+
--json Output as JSON
|
|
266
|
+
|
|
267
|
+
Examples:
|
|
268
|
+
bithumb-trade system capabilities
|
|
269
|
+
bithumb-trade system capabilities --json
|
|
270
|
+
|
|
271
|
+
Notes:
|
|
272
|
+
- 'bithumb-trade account capabilities' is an alias for 'bithumb-trade system capabilities'.
|
|
273
|
+
- Use this command to discover which modules are enabled and which require auth.
|
|
274
|
+
`;
|
|
275
|
+
var CONFIG_HELP = `
|
|
276
|
+
Usage: bithumb-trade config <command> [options]
|
|
277
|
+
|
|
278
|
+
Commands:
|
|
279
|
+
show Show current configuration
|
|
280
|
+
init Create config file
|
|
281
|
+
set <key> <value> Set a config value (access_key, secret_key, base_url, timeout_ms)
|
|
282
|
+
add-profile <name> Add a new profile
|
|
283
|
+
list-profiles List all profiles
|
|
284
|
+
use <name> Set default profile
|
|
285
|
+
path Show config file path
|
|
286
|
+
|
|
287
|
+
Options:
|
|
288
|
+
--profile <name> Target profile (default: current default)
|
|
289
|
+
|
|
290
|
+
Examples:
|
|
291
|
+
bithumb-trade config init
|
|
292
|
+
bithumb-trade config set access_key your_key --profile trading
|
|
293
|
+
bithumb-trade config use trading
|
|
294
|
+
bithumb-trade config list-profiles
|
|
295
|
+
`;
|
|
296
|
+
function printHelp(positionals) {
|
|
297
|
+
const module = positionals[0];
|
|
298
|
+
switch (module) {
|
|
299
|
+
case "market":
|
|
300
|
+
outputLine(MARKET_HELP.trim());
|
|
301
|
+
break;
|
|
302
|
+
case "account":
|
|
303
|
+
outputLine(ACCOUNT_HELP.trim());
|
|
304
|
+
break;
|
|
305
|
+
case "trade":
|
|
306
|
+
outputLine(TRADE_HELP.trim());
|
|
307
|
+
break;
|
|
308
|
+
case "twap":
|
|
309
|
+
outputLine(TWAP_HELP.trim());
|
|
310
|
+
break;
|
|
311
|
+
case "withdraw":
|
|
312
|
+
outputLine(WITHDRAW_HELP.trim());
|
|
313
|
+
break;
|
|
314
|
+
case "deposit":
|
|
315
|
+
outputLine(DEPOSIT_HELP.trim());
|
|
316
|
+
break;
|
|
317
|
+
case "system":
|
|
318
|
+
outputLine(SYSTEM_HELP.trim());
|
|
319
|
+
break;
|
|
320
|
+
case "setup":
|
|
321
|
+
outputLine(SETUP_HELP.trim());
|
|
322
|
+
break;
|
|
323
|
+
case "config":
|
|
324
|
+
outputLine(CONFIG_HELP.trim());
|
|
325
|
+
break;
|
|
326
|
+
default:
|
|
327
|
+
outputLine(GLOBAL_HELP.trim());
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// src/index.ts
|
|
333
|
+
function wrapRunnerWithLogger(baseRunner, logger) {
|
|
334
|
+
return async (toolName, args) => {
|
|
335
|
+
const start = Date.now();
|
|
336
|
+
try {
|
|
337
|
+
const result = await baseRunner(toolName, args);
|
|
338
|
+
logger.logTool("info", toolName, args, { status: "ok" }, Date.now() - start);
|
|
339
|
+
return result;
|
|
340
|
+
} catch (error) {
|
|
341
|
+
logger.logTool("error", toolName, args, error, Date.now() - start);
|
|
342
|
+
throw error;
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
function handleSetup(argv) {
|
|
347
|
+
const idx = argv.indexOf("setup");
|
|
348
|
+
const rest = argv.slice(idx + 1);
|
|
349
|
+
let client;
|
|
350
|
+
let profile;
|
|
351
|
+
let modules;
|
|
352
|
+
for (let i = 0; i < rest.length; i++) {
|
|
353
|
+
if (rest[i] === "--client" && rest[i + 1]) {
|
|
354
|
+
client = rest[++i];
|
|
355
|
+
} else if (rest[i] === "--profile" && rest[i + 1]) {
|
|
356
|
+
profile = rest[++i];
|
|
357
|
+
} else if (rest[i] === "--modules" && rest[i + 1]) {
|
|
358
|
+
modules = rest[++i];
|
|
359
|
+
} else if (rest[i] === "--help" || rest[i] === "-h") {
|
|
360
|
+
printSetupUsage();
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
if (!client || !SUPPORTED_CLIENTS.includes(client)) {
|
|
365
|
+
errorLine(`Error: --client is required. Supported: ${SUPPORTED_CLIENTS.join(", ")}`);
|
|
366
|
+
process.exitCode = 1;
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
runSetup({ client, profile, modules });
|
|
370
|
+
}
|
|
371
|
+
async function main() {
|
|
372
|
+
checkForUpdates("@bithumb-tradekit/cli", CLI_VERSION);
|
|
373
|
+
if (process.argv[2] === "setup") {
|
|
374
|
+
handleSetup(process.argv);
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
const { values: v, positionals } = parseCli(process.argv.slice(2));
|
|
378
|
+
if (v.version) {
|
|
379
|
+
outputLine(CLI_VERSION);
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
if (v.help || positionals.length === 0) {
|
|
383
|
+
printHelp(positionals);
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
const [module, action, ...rest] = positionals;
|
|
387
|
+
const json = v.json ?? false;
|
|
388
|
+
if (module === "config") {
|
|
389
|
+
const { handleConfigCommand } = await import("./config-5T2Z7X5D.js");
|
|
390
|
+
return handleConfigCommand(action, rest, v);
|
|
391
|
+
}
|
|
392
|
+
const config = loadConfig({
|
|
393
|
+
modules: v.modules,
|
|
394
|
+
readOnly: v.readOnly,
|
|
395
|
+
verbose: v.verbose,
|
|
396
|
+
profile: v.profile
|
|
397
|
+
});
|
|
398
|
+
const client = new BithumbRestClient(config);
|
|
399
|
+
const baseRunner = createToolRunner(client, config);
|
|
400
|
+
const logger = new TradeLogger(v.verbose ? "debug" : "info");
|
|
401
|
+
const run = wrapRunnerWithLogger(baseRunner, logger);
|
|
402
|
+
if (module === "diagnose") {
|
|
403
|
+
const result = await run("system_diagnose", {});
|
|
404
|
+
const data = result.data ?? result;
|
|
405
|
+
if (json) return printJson(data);
|
|
406
|
+
printKv(data);
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
if (module === "system" && action === "capabilities" || module === "account" && action === "capabilities") {
|
|
410
|
+
const result = await run("system_get_capabilities", {});
|
|
411
|
+
const data = result.data ?? result;
|
|
412
|
+
if (json) return printJson(data);
|
|
413
|
+
printKv(data);
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
const privateModules = /* @__PURE__ */ new Set(["account", "trade", "twap", "withdraw", "deposit"]);
|
|
417
|
+
if (privateModules.has(module) && !config.hasAuth) {
|
|
418
|
+
errorLine(
|
|
419
|
+
"Error: API credentials required. Run 'bithumb-trade setup' or configure ~/.bithumb/config.toml"
|
|
420
|
+
);
|
|
421
|
+
process.exitCode = 1;
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
if (module === "market") {
|
|
425
|
+
const { handleMarketCommand } = await import("./market-B32IKWHH.js");
|
|
426
|
+
return handleMarketCommand(run, action, rest, v, json);
|
|
427
|
+
}
|
|
428
|
+
if (module === "account") {
|
|
429
|
+
const { handleAccountCommand } = await import("./account-QQC3UZDP.js");
|
|
430
|
+
return handleAccountCommand(run, action, v, json);
|
|
431
|
+
}
|
|
432
|
+
if (module === "trade") {
|
|
433
|
+
const { handleTradeCommand } = await import("./trade-ZZU6PXJL.js");
|
|
434
|
+
return handleTradeCommand(run, action, v, json);
|
|
435
|
+
}
|
|
436
|
+
if (module === "twap") {
|
|
437
|
+
const { handleTwapCommand } = await import("./twap-U3LDHACU.js");
|
|
438
|
+
return handleTwapCommand(run, action, v, json);
|
|
439
|
+
}
|
|
440
|
+
if (module === "withdraw") {
|
|
441
|
+
const { handleWithdrawCommand } = await import("./withdraw-7C657PEC.js");
|
|
442
|
+
return handleWithdrawCommand(run, action, v, json);
|
|
443
|
+
}
|
|
444
|
+
if (module === "deposit") {
|
|
445
|
+
const { handleDepositCommand } = await import("./deposit-PBP2KDXP.js");
|
|
446
|
+
return handleDepositCommand(run, action, v, json);
|
|
447
|
+
}
|
|
448
|
+
errorLine(`Unknown command: ${module}. Run 'bithumb-trade --help' for usage.`);
|
|
449
|
+
process.exitCode = 1;
|
|
450
|
+
}
|
|
451
|
+
main().catch((err) => {
|
|
452
|
+
errorLine(`Fatal: ${err instanceof Error ? err.message : String(err)}`);
|
|
453
|
+
process.exitCode = 1;
|
|
454
|
+
});
|
|
455
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/constants.ts","../src/help.ts","../src/index.ts"],"sourcesContent":["export const CLI_VERSION = \"0.1.0\";\n","import { outputLine } from \"./formatter.js\";\nimport { CLI_VERSION } from \"./constants.js\";\n\nconst GLOBAL_HELP = `\nbithumb-trade v${CLI_VERSION} — Bithumb Trade CLI\n\nUsage: bithumb-trade <module> <command> [options]\n\nModules:\n market Market data (ticker, orderbook, candles, trades)\n account Account balance, wallet status, API keys\n trade Order management (list, place, cancel, batch)\n twap TWAP (Time-Weighted Average Price) orders\n withdraw Cryptocurrency and KRW withdrawals\n deposit Cryptocurrency and KRW deposits\n system Server capabilities and module availability for agent planning\n\nUtility:\n setup Configure MCP client integration\n config Manage CLI configuration profiles\n diagnose Run connectivity diagnostics\n\nGlobal Options:\n --profile <name> Config profile (default: \"default\")\n --json Output as JSON\n --verbose Enable verbose logging\n --read-only Read-only mode (setup only, disables write operations)\n -h, --help Show help\n -v, --version Show version\n\nRun 'bithumb-trade <module> --help' for module-specific commands.\n`;\n\nconst MARKET_HELP = `\nUsage: bithumb-trade market <command> [options]\n\nCommands:\n markets List all available markets\n ticker <market> Get ticker for market(s) (comma-separated)\n orderbook <market> Get orderbook for market(s) (comma-separated)\n trades <market> Get recent trades\n candles-minutes <market> Get minute candles\n candles-days <market> Get daily candles\n candles-weeks <market> Get weekly candles\n candles-months <market> Get monthly candles\n warnings Get virtual asset warning markets\n notices Get notice list\n fee-inout <currency> Get deposit/withdrawal fees\n\nMarket Options:\n --is-details Include detailed market info (markets only)\n --count <n> Number of results to return\n --to <timestamp> Return results before this timestamp\n --unit <n> Minute unit: 1,3,5,10,15,30,60,240 (candles-minutes only)\n --cursor <cursor> Pagination cursor (trades only)\n --days-ago <n> Filter trades by days ago (trades only)\n --converting-price-unit <unit> Price unit: KRW (candles-days only)\n\nExamples:\n bithumb-trade market markets\n bithumb-trade market ticker KRW-BTC\n bithumb-trade market orderbook KRW-BTC --json\n bithumb-trade market candles-minutes KRW-BTC --unit 5 --count 10\n`;\n\nconst ACCOUNT_HELP = `\nUsage: bithumb-trade account <command> [options]\n\nCommands:\n balance Get account balances\n order-chance --market <market> Get order chance for a market\n audit View trade audit log\n wallet-status Get wallet deposit/withdrawal status\n api-keys Get API key list\n capabilities (alias) Server capabilities for agent planning (same as 'system capabilities')\n\nAccount Options:\n --market <market> Market identifier (e.g., KRW-BTC)\n\nAudit Options:\n --limit <n> Number of log entries (default: 20)\n --tool <name> Filter by tool name\n --since <date> Show entries since date (ISO format)\n --level <level> Filter by log level (INFO, WARN, ERROR, DEBUG)\n\nExamples:\n bithumb-trade account balance\n bithumb-trade account order-chance --market KRW-BTC\n bithumb-trade account audit --limit 10\n`;\n\nconst TRADE_HELP = `\nUsage: bithumb-trade trade <command> [options]\n\nCommands:\n orders List orders\n get Get order details\n place Place a new order\n cancel Cancel an order\n batch-place --file <path> Place multiple orders from JSON file (max 20)\n batch-cancel Cancel multiple orders (max 30)\n\nTrade Options:\n --market <market> Market identifier (e.g., KRW-BTC)\n --uuid <uuid> Order UUID\n --client-order-id <id> Client-assigned order ID\n --side <side> Order side: bid (buy) / ask (sell)\n --order-type <type> Order type: limit / price / market (canonical)\n --ord-type <type> (deprecated alias of --order-type)\n --price <price> Order price\n --volume <volume> Order volume\n --state <state> Filter by state: wait / watch / done / cancel\n --states <states> Filter by multiple states (comma-separated)\n --uuids <uuids> Filter by multiple UUIDs (comma-separated)\n --client-order-ids <ids> Filter by multiple client order IDs (comma-separated)\n --order-by <order> Sort order: asc / desc\n --page <n> Page number\n --limit <n> Results per page\n --file <path> JSON file path (batch-place only)\n\nExamples:\n bithumb-trade trade orders --market KRW-BTC --state wait\n bithumb-trade trade get --uuid abc-123\n bithumb-trade trade place --market KRW-BTC --side bid --order-type limit --price 50000000 --volume 0.01\n bithumb-trade trade cancel --uuid abc-123\n bithumb-trade trade batch-place --file orders.json\n`;\n\nconst SETUP_HELP = `\nUsage: bithumb-trade setup --client <client> [--profile <name>] [--modules <list>]\n\nConfigure MCP client integration for supported AI coding tools.\n\nOptions:\n --client <client> Target client: claude-desktop, cursor, windsurf, vscode, claude-code\n --profile <name> Config profile to use (default: \"default\")\n --modules <list> Comma-separated modules to enable\n\nExamples:\n bithumb-trade setup --client claude-desktop\n bithumb-trade setup --client cursor --modules market,account\n`;\n\nconst TWAP_HELP = `\nUsage: bithumb-trade twap <command> [options]\n\nCommands:\n place Place a TWAP order\n orders List TWAP orders\n cancel Cancel a TWAP order\n\nTWAP Options:\n --market <market> Market identifier (e.g., KRW-BTC)\n --side <side> Order side: bid / ask\n --duration <seconds> Duration in seconds (300-43200)\n --frequency <seconds> Frequency: 5,15,20,30,60,120\n --price <price> Order price (required for bid)\n --volume <volume> Order volume (required for ask)\n --algo-order-id <id> TWAP order ID (for cancel)\n --state <state> Order state filter\n --next-key <key> Pagination cursor\n --limit <n> Results per page\n --uuids <uuids> Filter by TWAP order IDs (comma-separated)\n --order-by <order> Sort order: asc / desc\n\nExamples:\n bithumb-trade twap place --market KRW-BTC --side bid --duration 3600 --frequency 60 --price 50000000\n bithumb-trade twap orders --market KRW-BTC\n bithumb-trade twap cancel --algo-order-id abc-123\n`;\n\nconst WITHDRAW_HELP = `\nUsage: bithumb-trade withdraw <command> [options]\n\nCommands:\n chance Get withdrawal availability info\n get Get specific withdrawal\n list List coin withdrawals\n list-krw List KRW withdrawals\n coin Withdraw cryptocurrency (CAUTION)\n krw Withdraw KRW (CAUTION)\n cancel Cancel coin withdrawal\n addresses List allowed withdrawal addresses\n\nWithdraw Options:\n --currency <code> Currency code (e.g., BTC)\n --net-type <type> Network type (e.g., BTC)\n --amount <amount> Withdrawal amount\n --address <addr> Withdrawal address\n --secondary-address <addr> Secondary address (tag/memo)\n --exchange-name <name> Exchange name\n --receiver-type <type> Receiver type: personal / corporation\n --receiver-ko-name <name> Receiver Korean name\n --receiver-en-name <name> Receiver English name\n --receiver-corp-ko-name <name> Corporation Korean name\n --receiver-corp-en-name <name> Corporation English name\n --two-factor-type <type> 2FA type (kakao)\n --uuid <uuid> Withdrawal UUID\n --txids <txids> Transaction ID(s) (comma-separated for list)\n --uuids <uuids> Filter by UUIDs (comma-separated, for list)\n --withdrawal-id <id> Withdrawal ID (for cancel)\n --state <state> State filter (for list)\n --limit <n> Results per page (max 100)\n --page <n> Page number\n --order-by <order> Sort order: asc / desc\n\nExamples:\n bithumb-trade withdraw chance --currency BTC --net-type BTC\n bithumb-trade withdraw list --currency BTC\n bithumb-trade withdraw addresses\n`;\n\nconst DEPOSIT_HELP = `\nUsage: bithumb-trade deposit <command> [options]\n\nCommands:\n get Get specific deposit\n list List coin deposits\n list-krw List KRW deposits\n krw Request KRW deposit (CAUTION)\n generate-address Generate deposit address\n addresses List all deposit addresses\n address Get specific deposit address\n\nDeposit Options:\n --currency <code> Currency code (e.g., BTC)\n --net-type <type> Network type (e.g., BTC)\n --amount <amount> Deposit amount\n --two-factor-type <type> 2FA type (kakao)\n --uuid <uuid> Deposit UUID\n --txids <txids> Transaction ID(s) (comma-separated for list)\n --uuids <uuids> Filter by UUIDs (comma-separated, for list)\n --state <state> State filter (for list)\n --limit <n> Results per page (max 100)\n --page <n> Page number\n --order-by <order> Sort order: asc / desc\n\nExamples:\n bithumb-trade deposit list --currency BTC\n bithumb-trade deposit address --currency BTC --net-type BTC\n bithumb-trade deposit addresses\n`;\n\nconst SYSTEM_HELP = `\nUsage: bithumb-trade system <command> [options]\n\nCommands:\n capabilities Server capabilities and module availability for agent planning\n\nSystem Options:\n --json Output as JSON\n\nExamples:\n bithumb-trade system capabilities\n bithumb-trade system capabilities --json\n\nNotes:\n - 'bithumb-trade account capabilities' is an alias for 'bithumb-trade system capabilities'.\n - Use this command to discover which modules are enabled and which require auth.\n`;\n\nconst CONFIG_HELP = `\nUsage: bithumb-trade config <command> [options]\n\nCommands:\n show Show current configuration\n init Create config file\n set <key> <value> Set a config value (access_key, secret_key, base_url, timeout_ms)\n add-profile <name> Add a new profile\n list-profiles List all profiles\n use <name> Set default profile\n path Show config file path\n\nOptions:\n --profile <name> Target profile (default: current default)\n\nExamples:\n bithumb-trade config init\n bithumb-trade config set access_key your_key --profile trading\n bithumb-trade config use trading\n bithumb-trade config list-profiles\n`;\n\nexport function printHelp(positionals: string[]): void {\n const module = positionals[0];\n switch (module) {\n case \"market\":\n outputLine(MARKET_HELP.trim());\n break;\n case \"account\":\n outputLine(ACCOUNT_HELP.trim());\n break;\n case \"trade\":\n outputLine(TRADE_HELP.trim());\n break;\n case \"twap\":\n outputLine(TWAP_HELP.trim());\n break;\n case \"withdraw\":\n outputLine(WITHDRAW_HELP.trim());\n break;\n case \"deposit\":\n outputLine(DEPOSIT_HELP.trim());\n break;\n case \"system\":\n outputLine(SYSTEM_HELP.trim());\n break;\n case \"setup\":\n outputLine(SETUP_HELP.trim());\n break;\n case \"config\":\n outputLine(CONFIG_HELP.trim());\n break;\n default:\n outputLine(GLOBAL_HELP.trim());\n break;\n }\n}\n","import {\n loadConfig,\n BithumbRestClient,\n createToolRunner,\n TradeLogger,\n checkForUpdates,\n runSetup,\n printSetupUsage,\n SUPPORTED_CLIENTS,\n} from \"@bithumb-tradekit/core\";\nimport type { ToolRunner, ClientId } from \"@bithumb-tradekit/core\";\nimport { parseCli } from \"./parser.js\";\nimport type { CliValues } from \"./parser.js\";\nimport { outputLine, errorLine, printJson, printKv } from \"./formatter.js\";\nimport { printHelp } from \"./help.js\";\nimport { CLI_VERSION } from \"./constants.js\";\n\nfunction wrapRunnerWithLogger(\n baseRunner: ToolRunner,\n logger: TradeLogger,\n): ToolRunner {\n return async (toolName, args) => {\n const start = Date.now();\n try {\n const result = await baseRunner(toolName, args);\n logger.logTool(\"info\", toolName, args, { status: \"ok\" }, Date.now() - start);\n return result;\n } catch (error) {\n logger.logTool(\"error\", toolName, args, error, Date.now() - start);\n throw error;\n }\n };\n}\n\nfunction handleSetup(argv: string[]): void {\n const idx = argv.indexOf(\"setup\");\n const rest = argv.slice(idx + 1);\n\n let client: string | undefined;\n let profile: string | undefined;\n let modules: string | undefined;\n\n for (let i = 0; i < rest.length; i++) {\n if (rest[i] === \"--client\" && rest[i + 1]) {\n client = rest[++i];\n } else if (rest[i] === \"--profile\" && rest[i + 1]) {\n profile = rest[++i];\n } else if (rest[i] === \"--modules\" && rest[i + 1]) {\n modules = rest[++i];\n } else if (rest[i] === \"--help\" || rest[i] === \"-h\") {\n printSetupUsage();\n return;\n }\n }\n\n if (!client || !SUPPORTED_CLIENTS.includes(client as ClientId)) {\n errorLine(`Error: --client is required. Supported: ${SUPPORTED_CLIENTS.join(\", \")}`);\n process.exitCode = 1;\n return;\n }\n\n runSetup({ client: client as ClientId, profile, modules });\n}\n\nasync function main(): Promise<void> {\n checkForUpdates(\"@bithumb-tradekit/cli\", CLI_VERSION);\n\n // 1. Setup subcommand (before parseCli)\n if (process.argv[2] === \"setup\") {\n handleSetup(process.argv);\n return;\n }\n\n // 2. Parse arguments\n const { values: v, positionals } = parseCli(process.argv.slice(2));\n\n if (v.version) {\n outputLine(CLI_VERSION);\n return;\n }\n\n if (v.help || positionals.length === 0) {\n printHelp(positionals);\n return;\n }\n\n const [module, action, ...rest] = positionals;\n const json = v.json ?? false;\n\n // 3. Config command (no auth needed, no runner needed)\n if (module === \"config\") {\n const { handleConfigCommand } = await import(\"./commands/config.js\");\n return handleConfigCommand(action, rest, v);\n }\n\n // 4. Load config + create runner\n const config = loadConfig({\n modules: v.modules,\n readOnly: v.readOnly,\n verbose: v.verbose,\n profile: v.profile,\n });\n const client = new BithumbRestClient(config);\n const baseRunner = createToolRunner(client, config);\n const logger = new TradeLogger(v.verbose ? \"debug\" : \"info\");\n const run = wrapRunnerWithLogger(baseRunner, logger);\n\n // 5. Diagnose (needs config but no auth)\n if (module === \"diagnose\") {\n const result = await run(\"system_diagnose\", {});\n const data = result.data ?? result;\n if (json) return printJson(data);\n printKv(data as Record<string, unknown>);\n return;\n }\n\n // 5b. System capabilities (no auth needed)\n // Accept both `system capabilities` (canonical) and `account capabilities` (alias)\n if (\n (module === \"system\" && action === \"capabilities\") ||\n (module === \"account\" && action === \"capabilities\")\n ) {\n const result = await run(\"system_get_capabilities\", {});\n const data = result.data ?? result;\n if (json) return printJson(data);\n printKv(data as Record<string, unknown>);\n return;\n }\n\n // 6. Private API auth guard\n const privateModules = new Set([\"account\", \"trade\", \"twap\", \"withdraw\", \"deposit\"]);\n if (privateModules.has(module) && !config.hasAuth) {\n errorLine(\n \"Error: API credentials required. Run 'bithumb-trade setup' or configure ~/.bithumb/config.toml\",\n );\n process.exitCode = 1;\n return;\n }\n\n // 7. Module routing\n if (module === \"market\") {\n const { handleMarketCommand } = await import(\"./commands/market.js\");\n return handleMarketCommand(run, action, rest, v, json);\n }\n if (module === \"account\") {\n const { handleAccountCommand } = await import(\"./commands/account.js\");\n return handleAccountCommand(run, action, v, json);\n }\n if (module === \"trade\") {\n const { handleTradeCommand } = await import(\"./commands/trade.js\");\n return handleTradeCommand(run, action, v, json);\n }\n if (module === \"twap\") {\n const { handleTwapCommand } = await import(\"./commands/twap.js\");\n return handleTwapCommand(run, action, v, json);\n }\n if (module === \"withdraw\") {\n const { handleWithdrawCommand } = await import(\"./commands/withdraw.js\");\n return handleWithdrawCommand(run, action, v, json);\n }\n if (module === \"deposit\") {\n const { handleDepositCommand } = await import(\"./commands/deposit.js\");\n return handleDepositCommand(run, action, v, json);\n }\n\n errorLine(`Unknown command: ${module}. Run 'bithumb-trade --help' for usage.`);\n process.exitCode = 1;\n}\n\nmain().catch((err) => {\n errorLine(`Fatal: ${err instanceof Error ? err.message : String(err)}`);\n process.exitCode = 1;\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAO,IAAM,cAAc;;;ACG3B,IAAM,cAAc;AAAA,iBACH,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6B5B,IAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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