traderclaw-v1 1.0.4 → 1.0.5
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/bin/openclaw-trader.mjs +11 -9
- package/package.json +1 -1
package/bin/openclaw-trader.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { join } from "path";
|
|
|
6
6
|
import { homedir } from "os";
|
|
7
7
|
import { randomUUID, createPrivateKey, sign as cryptoSign } from "crypto";
|
|
8
8
|
|
|
9
|
-
const VERSION = "1.0.
|
|
9
|
+
const VERSION = "1.0.5";
|
|
10
10
|
const PLUGIN_ID = "solana-trader";
|
|
11
11
|
const CONFIG_DIR = join(homedir(), ".openclaw");
|
|
12
12
|
const CONFIG_FILE = join(CONFIG_DIR, "openclaw.json");
|
|
@@ -536,12 +536,14 @@ async function cmdSetup(args) {
|
|
|
536
536
|
walletLabel = wallets[idx].label || "Unnamed";
|
|
537
537
|
const keys = extractWalletKeys(wallets[idx]);
|
|
538
538
|
if (keys.publicKey) pluginConfig.walletPublicKey = keys.publicKey;
|
|
539
|
+
if (keys.privateKey && !pluginConfig.walletPrivateKey) pluginConfig.walletPrivateKey = keys.privateKey;
|
|
539
540
|
printSuccess(` Using wallet: ${walletLabel} (ID: ${walletId})`);
|
|
540
541
|
} else {
|
|
541
542
|
walletId = extractWalletId(wallets[0]) || String(wallets[0].id);
|
|
542
543
|
walletLabel = wallets[0].label || "Unnamed";
|
|
543
544
|
const keys = extractWalletKeys(wallets[0]);
|
|
544
545
|
if (keys.publicKey) pluginConfig.walletPublicKey = keys.publicKey;
|
|
546
|
+
if (keys.privateKey && !pluginConfig.walletPrivateKey) pluginConfig.walletPrivateKey = keys.privateKey;
|
|
545
547
|
printSuccess(` Using wallet: ${walletLabel} (ID: ${walletId})`);
|
|
546
548
|
}
|
|
547
549
|
}
|
|
@@ -575,16 +577,8 @@ async function cmdSetup(args) {
|
|
|
575
577
|
process.exit(1);
|
|
576
578
|
}
|
|
577
579
|
|
|
578
|
-
print("\nWriting configuration...\n");
|
|
579
|
-
|
|
580
580
|
pluginConfig.walletId = walletId;
|
|
581
581
|
|
|
582
|
-
const existingConfig = readConfig();
|
|
583
|
-
setPluginConfig(existingConfig, pluginConfig);
|
|
584
|
-
writeConfig(existingConfig);
|
|
585
|
-
|
|
586
|
-
printSuccess(` Config written to ${CONFIG_FILE}`);
|
|
587
|
-
|
|
588
582
|
if (createdNewWallet) {
|
|
589
583
|
print("\n" + "=".repeat(60));
|
|
590
584
|
printWarn(" IMPORTANT: New wallet credentials");
|
|
@@ -609,6 +603,14 @@ async function cmdSetup(args) {
|
|
|
609
603
|
}
|
|
610
604
|
}
|
|
611
605
|
|
|
606
|
+
print("\nWriting configuration...\n");
|
|
607
|
+
|
|
608
|
+
const existingConfig = readConfig();
|
|
609
|
+
setPluginConfig(existingConfig, pluginConfig);
|
|
610
|
+
writeConfig(existingConfig);
|
|
611
|
+
|
|
612
|
+
printSuccess(` Config written to ${CONFIG_FILE}`);
|
|
613
|
+
|
|
612
614
|
print("\n" + "=".repeat(60));
|
|
613
615
|
printSuccess("\n Setup complete!\n");
|
|
614
616
|
print("=".repeat(60));
|