@onebullex-group/cli 1.2.0 → 1.3.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.
@@ -332,6 +332,14 @@ var REGISTRY = [
332
332
  needsAuth: true,
333
333
  implFile: "src/commands/position/confs.ts"
334
334
  },
335
+ {
336
+ command: "position history",
337
+ method: "GET",
338
+ path: "/v2/position/history/detail",
339
+ isWrite: false,
340
+ needsAuth: true,
341
+ implFile: "src/commands/position/history.ts"
342
+ },
335
343
  // ───── Phase 2: write operations ─────
336
344
  {
337
345
  command: "order create",
package/dist/index.js CHANGED
@@ -922,6 +922,24 @@ function registerPositionConfs(parent, ctx) {
922
922
  });
923
923
  }
924
924
 
925
+ // src/commands/position/history.ts
926
+ function registerPositionHistory(parent, ctx) {
927
+ parent.command("history").description("Get historical position detail (GET /v2/position/history/detail)").requiredOption("--symbol <symbol>", "trading pair").requiredOption("--position-id <id>", "position id").action(async (opts) => {
928
+ const c = ctx.http({ requireAuth: true });
929
+ const data = await c.getPrivate("/v2/position/history/detail", {
930
+ symbol: opts.symbol,
931
+ positionId: opts.positionId
932
+ });
933
+ const { render: render2, effectiveFormat: effectiveFormat2 } = await import("./output-UIZGG7EU.js");
934
+ ctx.stdout(
935
+ render2(data, {
936
+ format: effectiveFormat2(ctx.outputFormat, ctx.isTTY),
937
+ isTTY: ctx.isTTY
938
+ })
939
+ );
940
+ });
941
+ }
942
+
925
943
  // src/commands/config/init.ts
926
944
  import * as readline from "readline/promises";
927
945
  var TEST_BASE_URL = "https://futures-openapi.1bullex.com";
@@ -1490,7 +1508,7 @@ function buildProgram(opts) {
1490
1508
  return new HttpClient(cfg, opts?.fetch);
1491
1509
  }
1492
1510
  };
1493
- const program = new Command("onebullex").version(true ? "1.2.0" : "0.0.0-dev").description("OneBullEx exchange CLI").option("-p, --profile <name>", "config profile to use").option("-o, --output <format>", "output format: table | json").option("--debug", "enable debug logging").option("--timeout <ms>", "request timeout in milliseconds", parseInt).option("--confirm", "confirm write operations (required for non-dry-run writes)").option("--base-url <url>", "override base URL").option("--api-key <key>", "override api key (env: ONEBULLEX_API_KEY)").option("--secret <s>", "override secret (env: ONEBULLEX_SECRET; CLI flag discouraged for security)").exitOverride();
1511
+ const program = new Command("onebullex").version(true ? "1.3.0" : "0.0.0-dev").description("OneBullEx exchange CLI").option("-p, --profile <name>", "config profile to use").option("-o, --output <format>", "output format: table | json").option("--debug", "enable debug logging").option("--timeout <ms>", "request timeout in milliseconds", parseInt).option("--confirm", "confirm write operations (required for non-dry-run writes)").option("--base-url <url>", "override base URL").option("--api-key <key>", "override api key (env: ONEBULLEX_API_KEY)").option("--secret <s>", "override secret (env: ONEBULLEX_SECRET; CLI flag discouraged for security)").exitOverride();
1494
1512
  program.hook("preAction", (thisCommand, _actionCommand) => {
1495
1513
  const flags = thisCommand.opts();
1496
1514
  if (flags.output === "table" || flags.output === "json") {
@@ -1580,6 +1598,7 @@ function buildProgram(opts) {
1580
1598
  const position = program.command("position").description("Positions");
1581
1599
  registerPositionList(position, ctx);
1582
1600
  registerPositionConfs(position, ctx);
1601
+ registerPositionHistory(position, ctx);
1583
1602
  registerPositionAdjustLeverage(position, ctx);
1584
1603
  registerPositionMargin(position, ctx);
1585
1604
  registerPositionAutoMargin(position, ctx);
package/dist/lint-api.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  REGISTRY
4
- } from "./chunk-YX4634ML.js";
4
+ } from "./chunk-PEVZEMJG.js";
5
5
 
6
6
  // scripts/check-cli-coverage.ts
7
7
  import { readFileSync } from "fs";
package/dist/registry.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  REGISTRY
4
- } from "./chunk-YX4634ML.js";
4
+ } from "./chunk-PEVZEMJG.js";
5
5
  export {
6
6
  REGISTRY
7
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onebullex-group/cli",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "OneBullEx Open API V2 command-line interface",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,16 +26,6 @@
26
26
  "engines": {
27
27
  "node": ">=18"
28
28
  },
29
- "scripts": {
30
- "build": "tsup",
31
- "dev": "tsx src/index.ts",
32
- "test": "vitest run",
33
- "test:e2e": "vitest run tests/e2e",
34
- "lint": "biome lint src tests",
35
- "format": "biome format --write src tests",
36
- "check-coverage": "tsx scripts/check-cli-coverage.ts",
37
- "typecheck": "tsc --noEmit"
38
- },
39
29
  "dependencies": {
40
30
  "cli-table3": "^0.6.5",
41
31
  "commander": "^12.1.0",
@@ -50,5 +40,15 @@
50
40
  "typescript": "^5.5.0",
51
41
  "undici": "^8.3.0",
52
42
  "vitest": "^2.1.0"
43
+ },
44
+ "scripts": {
45
+ "build": "tsup",
46
+ "dev": "tsx src/index.ts",
47
+ "test": "vitest run",
48
+ "test:e2e": "vitest run tests/e2e",
49
+ "lint": "biome lint src tests",
50
+ "format": "biome format --write src tests",
51
+ "check-coverage": "tsx scripts/check-cli-coverage.ts",
52
+ "typecheck": "tsc --noEmit"
53
53
  }
54
- }
54
+ }