blofin-cli 0.1.0 → 0.2.1
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/index.js +12 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
// src/index.ts
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
8
|
import { resolve } from "path";
|
|
9
|
-
import { readFileSync } from "fs";
|
|
9
|
+
import { readFileSync, realpathSync } from "fs";
|
|
10
10
|
import { parseArgs } from "util";
|
|
11
11
|
import {
|
|
12
12
|
ALL_MODULES,
|
|
@@ -33,7 +33,8 @@ var COMMAND_GROUPS = /* @__PURE__ */ new Map([
|
|
|
33
33
|
["trades", "get_market_trades", "Get recent trades", "read"],
|
|
34
34
|
["candles", "get_candlesticks", "Get candlestick/kline data", "read"],
|
|
35
35
|
["mark-price", "get_mark_price", "Get mark price", "read"],
|
|
36
|
-
["funding-rate", "get_funding_rate", "Get funding rate", "read"]
|
|
36
|
+
["funding-rate", "get_funding_rate", "Get funding rate", "read"],
|
|
37
|
+
["position-tiers", "get_position_tiers", "Get position tier info (leverage/margin per tier)", "read"]
|
|
37
38
|
])
|
|
38
39
|
],
|
|
39
40
|
[
|
|
@@ -71,13 +72,17 @@ var COMMAND_GROUPS = /* @__PURE__ */ new Map([
|
|
|
71
72
|
["bills", "get_transfer_history", "Get transfer history", "read"],
|
|
72
73
|
["deposits", "get_deposit_history", "Get deposit history", "read"],
|
|
73
74
|
["withdrawals", "get_withdrawal_history", "Get withdrawal history", "read"],
|
|
74
|
-
["apikey-info", "get_apikey_info", "Get API key info", "read"]
|
|
75
|
+
["apikey-info", "get_apikey_info", "Get API key info", "read"],
|
|
76
|
+
["currencies", "get_currencies", "Get supported currencies info", "read"]
|
|
75
77
|
])
|
|
76
78
|
]
|
|
77
79
|
]);
|
|
78
80
|
function resolveCommand(groupName, subcommand) {
|
|
79
81
|
return COMMAND_GROUPS.get(groupName)?.commands.get(subcommand);
|
|
80
82
|
}
|
|
83
|
+
function groupNames() {
|
|
84
|
+
return [...COMMAND_GROUPS.keys()];
|
|
85
|
+
}
|
|
81
86
|
|
|
82
87
|
// src/output.ts
|
|
83
88
|
import Table from "cli-table3";
|
|
@@ -342,7 +347,7 @@ function isMainModule() {
|
|
|
342
347
|
return false;
|
|
343
348
|
}
|
|
344
349
|
const self = fileURLToPath(import.meta.url);
|
|
345
|
-
const invoked = resolve(process.argv[1]);
|
|
350
|
+
const invoked = realpathSync(resolve(process.argv[1]));
|
|
346
351
|
return self === invoked;
|
|
347
352
|
}
|
|
348
353
|
if (isMainModule()) {
|
|
@@ -355,5 +360,8 @@ if (isMainModule()) {
|
|
|
355
360
|
});
|
|
356
361
|
}
|
|
357
362
|
export {
|
|
363
|
+
COMMAND_GROUPS,
|
|
364
|
+
groupNames,
|
|
365
|
+
resolveCommand,
|
|
358
366
|
runCli
|
|
359
367
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blofin-cli",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test": "vitest run"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"blofin-core": "^0.
|
|
15
|
+
"blofin-core": "^0.3.0",
|
|
16
16
|
"cli-table3": "^0.6.5"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|