@pionex/pionex-ai-kit 0.2.39 → 0.2.40

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 CHANGED
@@ -1946,7 +1946,7 @@ function registerBotTools() {
1946
1946
  condition: { type: "string" },
1947
1947
  conditionDirection: { type: "string", enum: ["1", "-1"] },
1948
1948
  slippage: { type: "string" },
1949
- adjustParamsSence: { type: "string" }
1949
+ adjustParamsScene: { type: "string" }
1950
1950
  },
1951
1951
  required: ["buOrderId", "type", "extraMargin"]
1952
1952
  },
@@ -1999,7 +1999,7 @@ function registerBotTools() {
1999
1999
  body.conditionDirection = conditionDirection;
2000
2000
  }
2001
2001
  if (args.slippage != null) body.slippage = String(args.slippage);
2002
- if (args.adjustParamsSence != null) body.adjustParamsSence = String(args.adjustParamsSence);
2002
+ if (args.adjustParamsScene != null) body.adjustParamsScene = String(args.adjustParamsScene);
2003
2003
  return (await client.signedPost("/api/v1/bot/orders/futuresGrid/adjustParams", body)).data;
2004
2004
  }
2005
2005
  },
@@ -2040,6 +2040,43 @@ function registerBotTools() {
2040
2040
  return (await client.signedPost("/api/v1/bot/orders/futuresGrid/reduce", body)).data;
2041
2041
  }
2042
2042
  },
2043
+ {
2044
+ name: "pionex_bot_order_list",
2045
+ module: "bot",
2046
+ isWrite: false,
2047
+ description: "List bot orders with optional filters and pagination. status: 'running' (default) or 'canceled'. buOrderTypes: one or more of futures_grid, spot_grid, smart_copy. Endpoint: GET /api/v1/bot/orders",
2048
+ inputSchema: {
2049
+ type: "object",
2050
+ additionalProperties: false,
2051
+ properties: {
2052
+ status: {
2053
+ type: "string",
2054
+ enum: ["running", "canceled"],
2055
+ description: "Filter by order status. Default: 'running'."
2056
+ },
2057
+ base: { type: "string", description: "Base currency filter (e.g. BTC)." },
2058
+ quote: { type: "string", description: "Quote currency filter (e.g. USDT)." },
2059
+ pageToken: { type: "string", description: "Pagination token from a previous response." },
2060
+ buOrderTypes: {
2061
+ type: "array",
2062
+ items: { type: "string", enum: ["futures_grid", "spot_grid", "smart_copy"] },
2063
+ description: "Bot type filter: futures_grid, spot_grid, smart_copy. Omit to return all types."
2064
+ }
2065
+ },
2066
+ required: []
2067
+ },
2068
+ async handler(args, { client }) {
2069
+ const q = {};
2070
+ if (args.status != null) q.status = String(args.status);
2071
+ if (args.base != null) q.base = String(args.base);
2072
+ if (args.quote != null) q.quote = String(args.quote);
2073
+ if (args.pageToken != null) q.pageToken = String(args.pageToken);
2074
+ if (Array.isArray(args.buOrderTypes) && args.buOrderTypes.length > 0) {
2075
+ q.buOrderTypes = args.buOrderTypes.join(",");
2076
+ }
2077
+ return (await client.signedGet("/api/v1/bot/orders", q)).data;
2078
+ }
2079
+ },
2043
2080
  {
2044
2081
  name: "pionex_bot_futures_grid_cancel",
2045
2082
  module: "bot",
@@ -2537,6 +2574,7 @@ Examples:
2537
2574
  pionex-trade-cli orders new --symbol BTC_USDT --side BUY --type MARKET --amount 10
2538
2575
  pionex-trade-cli orders cancel --symbol BTC_USDT --order-id 123
2539
2576
  pionex-trade-cli orders fills_by_order_id --symbol BTC_USDT --order-id 123
2577
+ pionex-trade-cli bot order_list [--status running|canceled] [--base BTC] [--quote USDT] [--page-token <token>] [--bu-order-types futures_grid,spot_grid,smart_copy]
2540
2578
  pionex-trade-cli bot futures_grid get --bu-order-id <id>
2541
2579
  pionex-trade-cli bot futures_grid create --base BTC --quote USDT --bu-order-data-json '{"top":"110000","bottom":"90000","row":100,"grid_type":"arithmetic","trend":"long","leverage":5,"quoteInvestment":"100"}'
2542
2580
  pionex-trade-cli earn dual symbols --base BTC
@@ -2753,9 +2791,26 @@ async function runPionexCommand(argv) {
2753
2791
  }
2754
2792
  if (group === "bot") {
2755
2793
  const botRoute = positionals[1];
2794
+ if (botRoute === "order_list") {
2795
+ const status = typeof flags.status === "string" ? flags.status : void 0;
2796
+ const base = typeof flags.base === "string" ? flags.base : void 0;
2797
+ const quote = typeof flags.quote === "string" ? flags.quote : void 0;
2798
+ const pageToken = typeof flags["page-token"] === "string" ? flags["page-token"] : typeof flags.pageToken === "string" ? flags.pageToken : void 0;
2799
+ const buOrderTypesRaw = typeof flags["bu-order-types"] === "string" ? flags["bu-order-types"] : typeof flags.buOrderTypes === "string" ? flags.buOrderTypes : void 0;
2800
+ const buOrderTypes = buOrderTypesRaw ? buOrderTypesRaw.split(",").map((s) => s.trim()) : void 0;
2801
+ const out = await runTool("pionex_bot_order_list", {
2802
+ status,
2803
+ base,
2804
+ quote,
2805
+ pageToken,
2806
+ buOrderTypes
2807
+ });
2808
+ process.stdout.write(JSON.stringify(out.data, null, 2) + "\n");
2809
+ return;
2810
+ }
2756
2811
  if (!botRoute || botRoute !== "futures_grid") {
2757
2812
  throw new Error(
2758
- `Missing or unknown bot route: ${botRoute ?? "(none)"}. Use: pionex-trade-cli bot futures_grid <get|create|adjust_params|reduce|cancel> ...`
2813
+ `Missing or unknown bot route: ${botRoute ?? "(none)"}. Use: pionex-trade-cli bot order_list [...] or bot futures_grid <get|create|adjust_params|reduce|cancel> ...`
2759
2814
  );
2760
2815
  }
2761
2816
  if (!command) {
@@ -2828,7 +2883,7 @@ async function runPionexCommand(argv) {
2828
2883
  process.stdout.write(JSON.stringify(out.data, null, 2) + "\n");
2829
2884
  return;
2830
2885
  }
2831
- throw new Error(`Unknown futures_grid command: ${command}`);
2886
+ throw new Error(`Unknown futures_grid command: ${command}. Available: get, create, adjust_params, reduce, cancel`);
2832
2887
  }
2833
2888
  if (group === "earn") {
2834
2889
  const earnRoute = positionals[1];