omnitrade-mcp 0.7.1 → 0.7.2
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/cli.js +23 -11
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -431,13 +431,17 @@ async function runSetupWizard() {
|
|
|
431
431
|
const testnetAnswer = await question(` ${c.yellow}?${c.reset} Use testnet? ${c.dim}(y/N)${c.reset}: `);
|
|
432
432
|
testnet = testnetAnswer.toLowerCase() === "y";
|
|
433
433
|
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
434
|
+
if (apiKey.trim() && secret.trim()) {
|
|
435
|
+
config.exchanges[exchange] = {
|
|
436
|
+
apiKey: apiKey.trim(),
|
|
437
|
+
secret: secret.trim(),
|
|
438
|
+
...password.trim() ? { password: password.trim() } : {},
|
|
439
|
+
testnet
|
|
440
|
+
};
|
|
441
|
+
console.log(` ${c.green}\u2713${c.reset} ${displayName} configured!`);
|
|
442
|
+
} else {
|
|
443
|
+
console.log(` ${c.yellow}\u26A0${c.reset} ${displayName} skipped (no keys provided)`);
|
|
444
|
+
}
|
|
441
445
|
}
|
|
442
446
|
rl.close();
|
|
443
447
|
let existingConfig = {};
|
|
@@ -447,13 +451,21 @@ async function runSetupWizard() {
|
|
|
447
451
|
} catch {
|
|
448
452
|
}
|
|
449
453
|
}
|
|
454
|
+
const allExchanges = {
|
|
455
|
+
...existingConfig.exchanges || {},
|
|
456
|
+
...config.exchanges || {}
|
|
457
|
+
};
|
|
458
|
+
const validExchanges = {};
|
|
459
|
+
for (const [name, cfg] of Object.entries(allExchanges)) {
|
|
460
|
+
const exchCfg = cfg;
|
|
461
|
+
if (exchCfg.apiKey?.trim() && exchCfg.secret?.trim()) {
|
|
462
|
+
validExchanges[name] = cfg;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
450
465
|
const mergedConfig = {
|
|
451
466
|
...existingConfig,
|
|
452
467
|
...config,
|
|
453
|
-
exchanges:
|
|
454
|
-
...existingConfig.exchanges || {},
|
|
455
|
-
...config.exchanges || {}
|
|
456
|
-
}
|
|
468
|
+
exchanges: validExchanges
|
|
457
469
|
};
|
|
458
470
|
const configDir = join(homedir(), ".omnitrade");
|
|
459
471
|
if (!existsSync(configDir)) {
|