@okx_ai/okx-trade-cli 1.3.1-beta.13 → 1.3.1-beta.14

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
@@ -10261,6 +10261,7 @@ function getPlatformDir() {
10261
10261
  "darwin-arm64": "darwin-arm64",
10262
10262
  "darwin-x64": "darwin-x64",
10263
10263
  "linux-x64": "linux-x64",
10264
+ "linux-arm64": "linux-x64",
10264
10265
  "win32-x64": "win32-x64"
10265
10266
  };
10266
10267
  return map[`${p}-${a}`] ?? null;
@@ -10905,12 +10906,34 @@ function runOkxAuthCapture(args) {
10905
10906
  });
10906
10907
  }
10907
10908
  async function cmdAuthLogin(args) {
10909
+ let site = args.site?.trim();
10910
+ if (!site) site = process.env.OKX_SITE?.trim();
10911
+ if (!site) {
10912
+ try {
10913
+ const cfg = readFullConfig();
10914
+ const profileName = cfg.default_profile ?? "default";
10915
+ site = cfg.profiles?.[profileName]?.site?.trim();
10916
+ } catch {
10917
+ }
10918
+ }
10908
10919
  const cliArgs = ["login"];
10909
- if (args.site) cliArgs.push("--site", args.site);
10920
+ if (site) cliArgs.push("--site", site);
10910
10921
  if (args.manual) cliArgs.push("--manual");
10911
10922
  const code = await runOkxAuth(cliArgs);
10912
10923
  if (code !== 0) {
10913
10924
  process.exitCode = code;
10925
+ return;
10926
+ }
10927
+ const explicit = args.site?.trim();
10928
+ if (explicit) {
10929
+ try {
10930
+ const cfg = readFullConfig();
10931
+ const profileName = cfg.default_profile ?? "default";
10932
+ const profiles = { ...cfg.profiles ?? {} };
10933
+ profiles[profileName] = { ...profiles[profileName] ?? {}, site: explicit };
10934
+ writeFullConfig({ ...cfg, default_profile: profileName, profiles });
10935
+ } catch {
10936
+ }
10914
10937
  }
10915
10938
  }
10916
10939
  async function cmdAuthLogout() {