@bithumb-official/bithumb-cli 0.1.16

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.
Files changed (44) hide show
  1. package/dist/account-UVDNQRB7.js +78 -0
  2. package/dist/account-UVDNQRB7.js.map +1 -0
  3. package/dist/account-YNPFEHQT.js +90 -0
  4. package/dist/account-YNPFEHQT.js.map +1 -0
  5. package/dist/chunk-AUQ7MB6O.js +143 -0
  6. package/dist/chunk-AUQ7MB6O.js.map +1 -0
  7. package/dist/chunk-FYO6WLZI.js +72 -0
  8. package/dist/chunk-FYO6WLZI.js.map +1 -0
  9. package/dist/chunk-YXIFBNEQ.js +3488 -0
  10. package/dist/chunk-YXIFBNEQ.js.map +1 -0
  11. package/dist/config-2P3Y3TQH.js +182 -0
  12. package/dist/config-2P3Y3TQH.js.map +1 -0
  13. package/dist/config-6BIS2PLC.js +154 -0
  14. package/dist/config-6BIS2PLC.js.map +1 -0
  15. package/dist/deposit-HNUSMKX5.js +161 -0
  16. package/dist/deposit-HNUSMKX5.js.map +1 -0
  17. package/dist/deposit-TCMLJ7MI.js +169 -0
  18. package/dist/deposit-TCMLJ7MI.js.map +1 -0
  19. package/dist/index.d.ts +2 -0
  20. package/dist/index.js +211 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/market-EEF3KI4T.js +219 -0
  23. package/dist/market-EEF3KI4T.js.map +1 -0
  24. package/dist/market-GLU62BWO.js +304 -0
  25. package/dist/market-GLU62BWO.js.map +1 -0
  26. package/dist/setup-LAAVO63H.js +21 -0
  27. package/dist/setup-LAAVO63H.js.map +1 -0
  28. package/dist/system-BRZY7PTZ.js +98 -0
  29. package/dist/system-BRZY7PTZ.js.map +1 -0
  30. package/dist/system-XRZ2KHXL.js +69 -0
  31. package/dist/system-XRZ2KHXL.js.map +1 -0
  32. package/dist/trade-FERR47DJ.js +233 -0
  33. package/dist/trade-FERR47DJ.js.map +1 -0
  34. package/dist/trade-H4G5P2W2.js +159 -0
  35. package/dist/trade-H4G5P2W2.js.map +1 -0
  36. package/dist/twap-44UCVSIR.js +91 -0
  37. package/dist/twap-44UCVSIR.js.map +1 -0
  38. package/dist/twap-4LRBUMTG.js +82 -0
  39. package/dist/twap-4LRBUMTG.js.map +1 -0
  40. package/dist/withdraw-IRMICBD2.js +203 -0
  41. package/dist/withdraw-IRMICBD2.js.map +1 -0
  42. package/dist/withdraw-TLGVRUBS.js +161 -0
  43. package/dist/withdraw-TLGVRUBS.js.map +1 -0
  44. package/package.json +25 -0
@@ -0,0 +1,203 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/help/withdraw.ts
4
+ var MODULE_HELP = `
5
+ Usage: bithumb withdraw <command> [options]
6
+
7
+ Commands:
8
+ chance Get withdrawal availability info
9
+ get Get specific withdrawal
10
+ list List coin withdrawals
11
+ list-krw List KRW withdrawals
12
+ coin Withdraw cryptocurrency (CAUTION)
13
+ krw Withdraw KRW (CAUTION)
14
+ cancel Cancel coin withdrawal
15
+ addresses List allowed withdrawal addresses
16
+
17
+ Run bithumb withdraw <command> --help for command-specific options.
18
+
19
+ Examples:
20
+ bithumb withdraw chance --currency BTC --net-type BTC
21
+ bithumb withdraw list --currency BTC
22
+ bithumb withdraw addresses
23
+ `;
24
+ var CHANCE_HELP = `
25
+ Usage: bithumb withdraw chance [options]
26
+
27
+ Get withdrawal availability info (limits, fee, network status) for a currency.
28
+
29
+ Required:
30
+ --currency <code> Currency code (e.g., BTC)
31
+ --net-type <type> Network type (e.g., BTC)
32
+
33
+ Options:
34
+ (none)
35
+
36
+ Examples:
37
+ bithumb withdraw chance --currency BTC --net-type BTC
38
+ bithumb withdraw chance --currency USDT --net-type TRX
39
+ `;
40
+ var GET_HELP = `
41
+ Usage: bithumb withdraw get [options]
42
+
43
+ Get details of a single withdrawal by UUID or txid for a specific currency.
44
+
45
+ Required:
46
+ --currency <code> Currency code (e.g., BTC)
47
+
48
+ Options (provide one of):
49
+ --uuid <uuid> Withdrawal UUID
50
+ --txids <txid> Transaction ID
51
+
52
+ Examples:
53
+ bithumb withdraw get --currency BTC --uuid abc-123
54
+ bithumb withdraw get --currency BTC --txids 0xabcdef
55
+ `;
56
+ var LIST_HELP = `
57
+ Usage: bithumb withdraw list [options]
58
+
59
+ List coin withdrawals, optionally filtered by currency, state, or identifiers.
60
+
61
+ Required:
62
+ (none \u2014 all filters are optional)
63
+
64
+ Options:
65
+ --currency <code> Currency code (e.g., BTC)
66
+ --state <state> State filter (e.g., done / processing)
67
+ --uuids <uuids> Filter by UUIDs (comma-separated)
68
+ --txids <txids> Filter by transaction IDs (comma-separated)
69
+ --limit <n> Results per page (max 100) (default: 100)
70
+ --page <n> Page number (default: 1)
71
+ --order-by <order> Sort order: asc / desc (default: desc)
72
+
73
+ Examples:
74
+ bithumb withdraw list --currency BTC
75
+ bithumb withdraw list --state done --limit 50 --order-by desc
76
+ `;
77
+ var LIST_KRW_HELP = `
78
+ Usage: bithumb withdraw list-krw [options]
79
+
80
+ List KRW withdrawals, optionally filtered by state or identifiers.
81
+
82
+ Required:
83
+ (none \u2014 all filters are optional)
84
+
85
+ Options:
86
+ --state <state> State filter (e.g., done / processing)
87
+ --uuids <uuids> Filter by UUIDs (comma-separated)
88
+ --txids <txids> Filter by transaction IDs (comma-separated)
89
+ --limit <n> Results per page (max 100) (default: 100)
90
+ --page <n> Page number (default: 1)
91
+ --order-by <order> Sort order: asc / desc (default: desc)
92
+
93
+ Examples:
94
+ bithumb withdraw list-krw
95
+ bithumb withdraw list-krw --state done --limit 50
96
+ `;
97
+ var COIN_HELP = `
98
+ Usage: bithumb withdraw coin [options]
99
+
100
+ Withdraw cryptocurrency to an external address. Initiates a real, irreversible
101
+ funds movement.
102
+
103
+ Required:
104
+ --currency <code> Currency code (e.g., BTC)
105
+ --net-type <type> Network type (e.g., BTC)
106
+ --amount <amount> Withdrawal amount
107
+ --address <addr> Withdrawal address
108
+
109
+ Options:
110
+ --secondary-address <addr> Secondary address (tag/memo) \u2014 required for
111
+ networks that need a destination tag
112
+ --exchange-name <name> Destination exchange name (travel rule)
113
+ --receiver-type <type> Receiver type: personal / corporation
114
+ --receiver-ko-name <name> Receiver Korean name (personal)
115
+ --receiver-en-name <name> Receiver English name (personal)
116
+ --receiver-corp-ko-name <name> Corporation Korean name (corporation)
117
+ --receiver-corp-en-name <name> Corporation English name (corporation)
118
+
119
+ Examples:
120
+ bithumb withdraw coin --currency BTC --net-type BTC --amount 0.01 \\
121
+ --address bc1q...
122
+ bithumb withdraw coin --currency XRP --net-type XRP --amount 10 \\
123
+ --address rXXXX --secondary-address 12345
124
+
125
+ Caution:
126
+ - Cryptocurrency withdrawals are IRREVERSIBLE. Once broadcast on-chain, funds
127
+ cannot be recalled \u2014 verify the destination --address (and --secondary-address
128
+ where applicable) character-by-character before submitting.
129
+ - Strongly recommended: pre-register the destination as an allowed address
130
+ (see 'bithumb withdraw addresses') and dry-run with 'bithumb withdraw chance'
131
+ to confirm fees, limits, and network status before initiating.
132
+ - Travel-rule fields (--exchange-name, --receiver-*) may be required by Bithumb
133
+ depending on amount/destination; missing fields will surface as API errors.
134
+ `;
135
+ var KRW_HELP = `
136
+ Usage: bithumb withdraw krw [options]
137
+
138
+ Withdraw KRW to your registered bank account. Initiates a real, irreversible
139
+ funds movement.
140
+
141
+ Required:
142
+ --amount <amount> Withdrawal amount (KRW)
143
+ --two-factor-type <type> 2FA type (e.g., kakao)
144
+
145
+ Options:
146
+ (none)
147
+
148
+ Examples:
149
+ bithumb withdraw krw --amount 1000000 --two-factor-type kakao
150
+
151
+ Caution:
152
+ - KRW withdrawal is IRREVERSIBLE once submitted \u2014 funds are sent to the bank
153
+ account registered under your Bithumb identity. Confirm the registered
154
+ bank/account information on the Bithumb site BEFORE invoking this command.
155
+ - 2FA (--two-factor-type) is mandatory. The request will fail without it.
156
+ - The destination account cannot be overridden via CLI flags by design \u2014 to
157
+ change it, update the registered account through Bithumb's official channels.
158
+ `;
159
+ var CANCEL_HELP = `
160
+ Usage: bithumb withdraw cancel [options]
161
+
162
+ Cancel a pending coin withdrawal by withdrawal ID. Only effective while the
163
+ withdrawal is still cancellable (not yet broadcast).
164
+
165
+ Required:
166
+ --withdrawal-id <id> Withdrawal ID to cancel
167
+
168
+ Options:
169
+ (none)
170
+
171
+ Examples:
172
+ bithumb withdraw cancel --withdrawal-id abc-123
173
+ `;
174
+ var ADDRESSES_HELP = `
175
+ Usage: bithumb withdraw addresses [options]
176
+
177
+ List the withdrawal addresses pre-registered (allow-listed) on your Bithumb
178
+ account. Pre-registration is recommended before invoking 'bithumb withdraw coin'.
179
+
180
+ Required:
181
+ (none)
182
+
183
+ Options:
184
+ (none)
185
+
186
+ Examples:
187
+ bithumb withdraw addresses
188
+ `;
189
+ var ACTION_HELP = {
190
+ chance: CHANCE_HELP,
191
+ get: GET_HELP,
192
+ list: LIST_HELP,
193
+ "list-krw": LIST_KRW_HELP,
194
+ coin: COIN_HELP,
195
+ krw: KRW_HELP,
196
+ cancel: CANCEL_HELP,
197
+ addresses: ADDRESSES_HELP
198
+ };
199
+ export {
200
+ ACTION_HELP,
201
+ MODULE_HELP
202
+ };
203
+ //# sourceMappingURL=withdraw-IRMICBD2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/help/withdraw.ts"],"sourcesContent":["export const MODULE_HELP = `\nUsage: bithumb 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\nRun bithumb withdraw <command> --help for command-specific options.\n\nExamples:\n bithumb withdraw chance --currency BTC --net-type BTC\n bithumb withdraw list --currency BTC\n bithumb withdraw addresses\n`;\n\nconst CHANCE_HELP = `\nUsage: bithumb withdraw chance [options]\n\nGet withdrawal availability info (limits, fee, network status) for a currency.\n\nRequired:\n --currency <code> Currency code (e.g., BTC)\n --net-type <type> Network type (e.g., BTC)\n\nOptions:\n (none)\n\nExamples:\n bithumb withdraw chance --currency BTC --net-type BTC\n bithumb withdraw chance --currency USDT --net-type TRX\n`;\n\nconst GET_HELP = `\nUsage: bithumb withdraw get [options]\n\nGet details of a single withdrawal by UUID or txid for a specific currency.\n\nRequired:\n --currency <code> Currency code (e.g., BTC)\n\nOptions (provide one of):\n --uuid <uuid> Withdrawal UUID\n --txids <txid> Transaction ID\n\nExamples:\n bithumb withdraw get --currency BTC --uuid abc-123\n bithumb withdraw get --currency BTC --txids 0xabcdef\n`;\n\nconst LIST_HELP = `\nUsage: bithumb withdraw list [options]\n\nList coin withdrawals, optionally filtered by currency, state, or identifiers.\n\nRequired:\n (none — all filters are optional)\n\nOptions:\n --currency <code> Currency code (e.g., BTC)\n --state <state> State filter (e.g., done / processing)\n --uuids <uuids> Filter by UUIDs (comma-separated)\n --txids <txids> Filter by transaction IDs (comma-separated)\n --limit <n> Results per page (max 100) (default: 100)\n --page <n> Page number (default: 1)\n --order-by <order> Sort order: asc / desc (default: desc)\n\nExamples:\n bithumb withdraw list --currency BTC\n bithumb withdraw list --state done --limit 50 --order-by desc\n`;\n\nconst LIST_KRW_HELP = `\nUsage: bithumb withdraw list-krw [options]\n\nList KRW withdrawals, optionally filtered by state or identifiers.\n\nRequired:\n (none — all filters are optional)\n\nOptions:\n --state <state> State filter (e.g., done / processing)\n --uuids <uuids> Filter by UUIDs (comma-separated)\n --txids <txids> Filter by transaction IDs (comma-separated)\n --limit <n> Results per page (max 100) (default: 100)\n --page <n> Page number (default: 1)\n --order-by <order> Sort order: asc / desc (default: desc)\n\nExamples:\n bithumb withdraw list-krw\n bithumb withdraw list-krw --state done --limit 50\n`;\n\nconst COIN_HELP = `\nUsage: bithumb withdraw coin [options]\n\nWithdraw cryptocurrency to an external address. Initiates a real, irreversible\nfunds movement.\n\nRequired:\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\nOptions:\n --secondary-address <addr> Secondary address (tag/memo) — required for\n networks that need a destination tag\n --exchange-name <name> Destination exchange name (travel rule)\n --receiver-type <type> Receiver type: personal / corporation\n --receiver-ko-name <name> Receiver Korean name (personal)\n --receiver-en-name <name> Receiver English name (personal)\n --receiver-corp-ko-name <name> Corporation Korean name (corporation)\n --receiver-corp-en-name <name> Corporation English name (corporation)\n\nExamples:\n bithumb withdraw coin --currency BTC --net-type BTC --amount 0.01 \\\\\n --address bc1q...\n bithumb withdraw coin --currency XRP --net-type XRP --amount 10 \\\\\n --address rXXXX --secondary-address 12345\n\nCaution:\n - Cryptocurrency withdrawals are IRREVERSIBLE. Once broadcast on-chain, funds\n cannot be recalled — verify the destination --address (and --secondary-address\n where applicable) character-by-character before submitting.\n - Strongly recommended: pre-register the destination as an allowed address\n (see 'bithumb withdraw addresses') and dry-run with 'bithumb withdraw chance'\n to confirm fees, limits, and network status before initiating.\n - Travel-rule fields (--exchange-name, --receiver-*) may be required by Bithumb\n depending on amount/destination; missing fields will surface as API errors.\n`;\n\nconst KRW_HELP = `\nUsage: bithumb withdraw krw [options]\n\nWithdraw KRW to your registered bank account. Initiates a real, irreversible\nfunds movement.\n\nRequired:\n --amount <amount> Withdrawal amount (KRW)\n --two-factor-type <type> 2FA type (e.g., kakao)\n\nOptions:\n (none)\n\nExamples:\n bithumb withdraw krw --amount 1000000 --two-factor-type kakao\n\nCaution:\n - KRW withdrawal is IRREVERSIBLE once submitted — funds are sent to the bank\n account registered under your Bithumb identity. Confirm the registered\n bank/account information on the Bithumb site BEFORE invoking this command.\n - 2FA (--two-factor-type) is mandatory. The request will fail without it.\n - The destination account cannot be overridden via CLI flags by design — to\n change it, update the registered account through Bithumb's official channels.\n`;\n\nconst CANCEL_HELP = `\nUsage: bithumb withdraw cancel [options]\n\nCancel a pending coin withdrawal by withdrawal ID. Only effective while the\nwithdrawal is still cancellable (not yet broadcast).\n\nRequired:\n --withdrawal-id <id> Withdrawal ID to cancel\n\nOptions:\n (none)\n\nExamples:\n bithumb withdraw cancel --withdrawal-id abc-123\n`;\n\nconst ADDRESSES_HELP = `\nUsage: bithumb withdraw addresses [options]\n\nList the withdrawal addresses pre-registered (allow-listed) on your Bithumb\naccount. Pre-registration is recommended before invoking 'bithumb withdraw coin'.\n\nRequired:\n (none)\n\nOptions:\n (none)\n\nExamples:\n bithumb withdraw addresses\n`;\n\nexport const ACTION_HELP: Record<string, string> = {\n chance: CHANCE_HELP,\n get: GET_HELP,\n list: LIST_HELP,\n \"list-krw\": LIST_KRW_HELP,\n coin: COIN_HELP,\n krw: KRW_HELP,\n cancel: CANCEL_HELP,\n addresses: ADDRESSES_HELP,\n};\n"],"mappings":";;;AAAO,IAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqB3B,IAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBpB,IAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBjB,IAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBlB,IAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBtB,IAAM,YAAY;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuClB,IAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBjB,IAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBpB,IAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBhB,IAAM,cAAsC;AAAA,EACjD,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,WAAW;AACb;","names":[]}
@@ -0,0 +1,161 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ toArray,
4
+ toNumber
5
+ } from "./chunk-AUQ7MB6O.js";
6
+ import {
7
+ errorLine,
8
+ outputLine,
9
+ printJson,
10
+ printKv,
11
+ printTable
12
+ } from "./chunk-FYO6WLZI.js";
13
+
14
+ // src/commands/withdraw.ts
15
+ async function handleWithdrawCommand(run, action, v, json) {
16
+ switch (action) {
17
+ case "chance":
18
+ return cmdChance(run, v, json);
19
+ case "get":
20
+ return cmdGet(run, v, json);
21
+ case "list":
22
+ return cmdList(run, v, json);
23
+ case "list-krw":
24
+ return cmdListKrw(run, v, json);
25
+ case "coin":
26
+ return cmdCoin(run, v, json);
27
+ case "krw":
28
+ return cmdKrw(run, v, json);
29
+ case "cancel":
30
+ return cmdCancel(run, v, json);
31
+ case "addresses":
32
+ return cmdAddresses(run, json);
33
+ default:
34
+ errorLine(`Unknown withdraw command: ${action}. Run 'bithumb withdraw --help' for usage.`);
35
+ process.exitCode = 1;
36
+ }
37
+ }
38
+ async function cmdChance(run, v, json) {
39
+ if (!v.currency || !v.netType) {
40
+ errorLine("Error: --currency and --net-type required. Example: bithumb withdraw chance --currency BTC --net-type BTC");
41
+ process.exitCode = 1;
42
+ return;
43
+ }
44
+ const result = await run("withdraw_get_chance", { currency: v.currency, net_type: v.netType });
45
+ const data = result.data;
46
+ if (json) return printJson(data);
47
+ printKv(data);
48
+ }
49
+ async function cmdGet(run, v, json) {
50
+ if (!v.currency) {
51
+ errorLine("Error: --currency required. Example: bithumb withdraw get --currency BTC --uuid abc-123");
52
+ process.exitCode = 1;
53
+ return;
54
+ }
55
+ const args = { currency: v.currency };
56
+ if (v.uuid) args.uuid = v.uuid;
57
+ if (v.txids) args.txid = v.txids;
58
+ const result = await run("withdraw_get", args);
59
+ const data = result.data;
60
+ if (json) return printJson(data);
61
+ printKv(data);
62
+ }
63
+ async function cmdList(run, v, json) {
64
+ const args = {};
65
+ if (v.currency) args.currency = v.currency;
66
+ if (v.state) args.state = v.state;
67
+ if (v.uuids) args.uuids = toArray(v.uuids);
68
+ if (v.txids) args.txids = toArray(v.txids);
69
+ if (v.limit) args.limit = toNumber(v.limit);
70
+ if (v.page) args.page = toNumber(v.page);
71
+ if (v.orderBy) args.order_by = v.orderBy;
72
+ const result = await run("withdraw_get_list", args);
73
+ const items = result.data;
74
+ if (json) return printJson(items);
75
+ if (!items?.length) {
76
+ outputLine("No withdrawals found");
77
+ return;
78
+ }
79
+ printTable(items);
80
+ }
81
+ async function cmdListKrw(run, v, json) {
82
+ const args = {};
83
+ if (v.state) args.state = v.state;
84
+ if (v.uuids) args.uuids = toArray(v.uuids);
85
+ if (v.txids) args.txids = toArray(v.txids);
86
+ if (v.limit) args.limit = toNumber(v.limit);
87
+ if (v.page) args.page = toNumber(v.page);
88
+ if (v.orderBy) args.order_by = v.orderBy;
89
+ const result = await run("withdraw_get_list_krw", args);
90
+ const items = result.data;
91
+ if (json) return printJson(items);
92
+ if (!items?.length) {
93
+ outputLine("No KRW withdrawals found");
94
+ return;
95
+ }
96
+ printTable(items);
97
+ }
98
+ async function cmdCoin(run, v, json) {
99
+ if (!v.currency || !v.netType || !v.amount || !v.address) {
100
+ errorLine("Error: --currency, --net-type, --amount, --address required.");
101
+ errorLine("CAUTION: This will initiate a real cryptocurrency withdrawal!");
102
+ process.exitCode = 1;
103
+ return;
104
+ }
105
+ outputLine("WARNING: Initiating cryptocurrency withdrawal. This action is irreversible.");
106
+ const args = {
107
+ currency: v.currency,
108
+ net_type: v.netType,
109
+ amount: v.amount,
110
+ address: v.address
111
+ };
112
+ if (v.secondaryAddress) args.secondary_address = v.secondaryAddress;
113
+ if (v.exchangeName) args.exchange_name = v.exchangeName;
114
+ if (v.receiverType) args.receiver_type = v.receiverType;
115
+ if (v.receiverKoName) args.receiver_ko_name = v.receiverKoName;
116
+ if (v.receiverEnName) args.receiver_en_name = v.receiverEnName;
117
+ if (v.receiverCorpKoName) args.receiver_corp_ko_name = v.receiverCorpKoName;
118
+ if (v.receiverCorpEnName) args.receiver_corp_en_name = v.receiverCorpEnName;
119
+ const result = await run("withdraw_coin", args);
120
+ const data = result.data;
121
+ if (json) return printJson(data);
122
+ printKv(data);
123
+ }
124
+ async function cmdKrw(run, v, json) {
125
+ if (!v.amount || !v.twoFactorType) {
126
+ errorLine("Error: --amount and --two-factor-type required.");
127
+ errorLine("CAUTION: This will initiate a real KRW withdrawal!");
128
+ process.exitCode = 1;
129
+ return;
130
+ }
131
+ outputLine("WARNING: Initiating KRW withdrawal. This action is irreversible.");
132
+ const result = await run("withdraw_krw", { amount: v.amount, two_factor_type: v.twoFactorType });
133
+ const data = result.data;
134
+ if (json) return printJson(data);
135
+ printKv(data);
136
+ }
137
+ async function cmdCancel(run, v, json) {
138
+ if (!v.withdrawalId) {
139
+ errorLine("Error: --withdrawal-id required. Example: bithumb withdraw cancel --withdrawal-id abc-123");
140
+ process.exitCode = 1;
141
+ return;
142
+ }
143
+ const result = await run("withdraw_cancel_coin", { withdrawal_id: v.withdrawalId });
144
+ const data = result.data;
145
+ if (json) return printJson(data);
146
+ printKv(data);
147
+ }
148
+ async function cmdAddresses(run, json) {
149
+ const result = await run("withdraw_get_addresses", {});
150
+ const items = result.data;
151
+ if (json) return printJson(items);
152
+ if (!items?.length) {
153
+ outputLine("No withdrawal addresses found");
154
+ return;
155
+ }
156
+ printTable(items);
157
+ }
158
+ export {
159
+ handleWithdrawCommand
160
+ };
161
+ //# sourceMappingURL=withdraw-TLGVRUBS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/withdraw.ts"],"sourcesContent":["import type { ToolRunner } from \"@bithumb-official/bithumb-core\";\nimport type { CliValues } from \"../parser.js\";\nimport { toNumber, toArray } from \"../parser.js\";\nimport { outputLine, errorLine, printJson, printTable, printKv } from \"../formatter.js\";\n\nexport async function handleWithdrawCommand(\n run: ToolRunner,\n action: string,\n v: CliValues,\n json: boolean,\n): Promise<void> {\n switch (action) {\n case \"chance\":\n return cmdChance(run, v, json);\n case \"get\":\n return cmdGet(run, v, json);\n case \"list\":\n return cmdList(run, v, json);\n case \"list-krw\":\n return cmdListKrw(run, v, json);\n case \"coin\":\n return cmdCoin(run, v, json);\n case \"krw\":\n return cmdKrw(run, v, json);\n case \"cancel\":\n return cmdCancel(run, v, json);\n case \"addresses\":\n return cmdAddresses(run, json);\n default:\n errorLine(`Unknown withdraw command: ${action}. Run 'bithumb withdraw --help' for usage.`);\n process.exitCode = 1;\n }\n}\n\nasync function cmdChance(run: ToolRunner, v: CliValues, json: boolean): Promise<void> {\n if (!v.currency || !v.netType) {\n errorLine(\"Error: --currency and --net-type required. Example: bithumb withdraw chance --currency BTC --net-type BTC\");\n process.exitCode = 1;\n return;\n }\n const result = await run(\"withdraw_get_chance\", { currency: v.currency, net_type: v.netType });\n const data = result.data as Record<string, unknown>;\n if (json) return printJson(data);\n printKv(data);\n}\n\nasync function cmdGet(run: ToolRunner, v: CliValues, json: boolean): Promise<void> {\n if (!v.currency) {\n errorLine(\"Error: --currency required. Example: bithumb withdraw get --currency BTC --uuid abc-123\");\n process.exitCode = 1;\n return;\n }\n const args: Record<string, unknown> = { currency: v.currency };\n if (v.uuid) args.uuid = v.uuid;\n if (v.txids) args.txid = v.txids;\n const result = await run(\"withdraw_get\", args);\n const data = result.data as Record<string, unknown>;\n if (json) return printJson(data);\n printKv(data);\n}\n\nasync function cmdList(run: ToolRunner, v: CliValues, json: boolean): Promise<void> {\n const args: Record<string, unknown> = {};\n if (v.currency) args.currency = v.currency;\n if (v.state) args.state = v.state;\n if (v.uuids) args.uuids = toArray(v.uuids);\n if (v.txids) args.txids = toArray(v.txids);\n if (v.limit) args.limit = toNumber(v.limit);\n if (v.page) args.page = toNumber(v.page);\n if (v.orderBy) args.order_by = v.orderBy;\n const result = await run(\"withdraw_get_list\", args);\n const items = result.data as Record<string, unknown>[];\n if (json) return printJson(items);\n if (!items?.length) { outputLine(\"No withdrawals found\"); return; }\n printTable(items);\n}\n\nasync function cmdListKrw(run: ToolRunner, v: CliValues, json: boolean): Promise<void> {\n const args: Record<string, unknown> = {};\n if (v.state) args.state = v.state;\n if (v.uuids) args.uuids = toArray(v.uuids);\n if (v.txids) args.txids = toArray(v.txids);\n if (v.limit) args.limit = toNumber(v.limit);\n if (v.page) args.page = toNumber(v.page);\n if (v.orderBy) args.order_by = v.orderBy;\n const result = await run(\"withdraw_get_list_krw\", args);\n const items = result.data as Record<string, unknown>[];\n if (json) return printJson(items);\n if (!items?.length) { outputLine(\"No KRW withdrawals found\"); return; }\n printTable(items);\n}\n\nasync function cmdCoin(run: ToolRunner, v: CliValues, json: boolean): Promise<void> {\n if (!v.currency || !v.netType || !v.amount || !v.address) {\n errorLine(\"Error: --currency, --net-type, --amount, --address required.\");\n errorLine(\"CAUTION: This will initiate a real cryptocurrency withdrawal!\");\n process.exitCode = 1;\n return;\n }\n outputLine(\"WARNING: Initiating cryptocurrency withdrawal. This action is irreversible.\");\n const args: Record<string, unknown> = {\n currency: v.currency,\n net_type: v.netType,\n amount: v.amount,\n address: v.address,\n };\n if (v.secondaryAddress) args.secondary_address = v.secondaryAddress;\n if (v.exchangeName) args.exchange_name = v.exchangeName;\n if (v.receiverType) args.receiver_type = v.receiverType;\n if (v.receiverKoName) args.receiver_ko_name = v.receiverKoName;\n if (v.receiverEnName) args.receiver_en_name = v.receiverEnName;\n if (v.receiverCorpKoName) args.receiver_corp_ko_name = v.receiverCorpKoName;\n if (v.receiverCorpEnName) args.receiver_corp_en_name = v.receiverCorpEnName;\n const result = await run(\"withdraw_coin\", args);\n const data = result.data as Record<string, unknown>;\n if (json) return printJson(data);\n printKv(data);\n}\n\nasync function cmdKrw(run: ToolRunner, v: CliValues, json: boolean): Promise<void> {\n if (!v.amount || !v.twoFactorType) {\n errorLine(\"Error: --amount and --two-factor-type required.\");\n errorLine(\"CAUTION: This will initiate a real KRW withdrawal!\");\n process.exitCode = 1;\n return;\n }\n outputLine(\"WARNING: Initiating KRW withdrawal. This action is irreversible.\");\n const result = await run(\"withdraw_krw\", { amount: v.amount, two_factor_type: v.twoFactorType });\n const data = result.data as Record<string, unknown>;\n if (json) return printJson(data);\n printKv(data);\n}\n\nasync function cmdCancel(run: ToolRunner, v: CliValues, json: boolean): Promise<void> {\n if (!v.withdrawalId) {\n errorLine(\"Error: --withdrawal-id required. Example: bithumb withdraw cancel --withdrawal-id abc-123\");\n process.exitCode = 1;\n return;\n }\n const result = await run(\"withdraw_cancel_coin\", { withdrawal_id: v.withdrawalId });\n const data = result.data as Record<string, unknown>;\n if (json) return printJson(data);\n printKv(data);\n}\n\nasync function cmdAddresses(run: ToolRunner, json: boolean): Promise<void> {\n const result = await run(\"withdraw_get_addresses\", {});\n const items = result.data as Record<string, unknown>[];\n if (json) return printJson(items);\n if (!items?.length) { outputLine(\"No withdrawal addresses found\"); return; }\n printTable(items);\n}\n"],"mappings":";;;;;;;;;;;;;;AAKA,eAAsB,sBACpB,KACA,QACA,GACA,MACe;AACf,UAAQ,QAAQ;AAAA,IAC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M,SAAS,MAAM,IAAI,wBAAwB,EAAE,eAAe,EAAE,aAAa,CAAC;AAClF,QAAM,OAAO,OAAO;AACpB,MAAI,KAAM,QAAO,UAAU,IAAI;AAC/B,UAAQ,IAAI;AACd;AAEA,eAAe,aAAa,KAAiB,MAA8B;AACzE,QAAM,SAAS,MAAM,IAAI,0BAA0B,CAAC,CAAC;AACrD,QAAM,QAAQ,OAAO;AACrB,MAAI,KAAM,QAAO,UAAU,KAAK;AAChC,MAAI,CAAC,OAAO,QAAQ;AAAE,eAAW,+BAA+B;AAAG;AAAA,EAAQ;AAC3E,aAAW,KAAK;AAClB;","names":[]}
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@bithumb-official/bithumb-cli",
3
+ "version": "0.1.16",
4
+ "description": "Bithumb Trade CLI",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "bin": { "bithumb": "dist/index.js" },
10
+ "files": ["dist"],
11
+ "scripts": {
12
+ "build": "tsup",
13
+ "typecheck": "tsc --noEmit",
14
+ "clean": "rm -rf dist",
15
+ "test:unit": "node --import tsx/esm --test --test-reporter=spec test/*.test.ts"
16
+ },
17
+ "engines": { "node": ">=18" },
18
+ "devDependencies": {
19
+ "@bithumb-official/bithumb-core": "file:../core",
20
+ "@types/node": "^22.0.0",
21
+ "tsup": "^8.5.1",
22
+ "tsx": "^4.19.3",
23
+ "typescript": "^5.9.3"
24
+ }
25
+ }