@blockrun/clawrouter 0.12.5 → 0.12.6
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 +43 -6
- package/dist/cli.js.map +1 -1
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3572,6 +3572,11 @@ function deriveAllKeys(mnemonic) {
|
|
|
3572
3572
|
const solanaPrivateKeyBytes = deriveSolanaKeyBytes(mnemonic);
|
|
3573
3573
|
return { mnemonic, evmPrivateKey, evmAddress, solanaPrivateKeyBytes };
|
|
3574
3574
|
}
|
|
3575
|
+
async function getSolanaAddress(privateKeyBytes) {
|
|
3576
|
+
const { createKeyPairSignerFromPrivateKeyBytes } = await import("@solana/kit");
|
|
3577
|
+
const signer = await createKeyPairSignerFromPrivateKeyBytes(privateKeyBytes);
|
|
3578
|
+
return signer.address;
|
|
3579
|
+
}
|
|
3575
3580
|
|
|
3576
3581
|
// src/auth.ts
|
|
3577
3582
|
var WALLET_DIR = join4(homedir3(), ".openclaw", "blockrun");
|
|
@@ -3649,13 +3654,21 @@ async function generateAndSaveWallet() {
|
|
|
3649
3654
|
{ cause: err }
|
|
3650
3655
|
);
|
|
3651
3656
|
}
|
|
3657
|
+
let solanaAddress;
|
|
3658
|
+
try {
|
|
3659
|
+
solanaAddress = await getSolanaAddress(derived.solanaPrivateKeyBytes);
|
|
3660
|
+
} catch {
|
|
3661
|
+
}
|
|
3652
3662
|
console.log(`[ClawRouter]`);
|
|
3653
3663
|
console.log(`[ClawRouter] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`);
|
|
3654
3664
|
console.log(`[ClawRouter] NEW WALLET GENERATED \u2014 BACK UP YOUR KEY NOW`);
|
|
3655
3665
|
console.log(`[ClawRouter] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`);
|
|
3656
|
-
console.log(`[ClawRouter] EVM Address
|
|
3657
|
-
|
|
3658
|
-
|
|
3666
|
+
console.log(`[ClawRouter] EVM Address : ${derived.evmAddress}`);
|
|
3667
|
+
if (solanaAddress) {
|
|
3668
|
+
console.log(`[ClawRouter] Solana Address : ${solanaAddress}`);
|
|
3669
|
+
}
|
|
3670
|
+
console.log(`[ClawRouter] Key file : ${WALLET_FILE}`);
|
|
3671
|
+
console.log(`[ClawRouter] Mnemonic : ${MNEMONIC_FILE}`);
|
|
3659
3672
|
console.log(`[ClawRouter]`);
|
|
3660
3673
|
console.log(`[ClawRouter] Both EVM (Base) and Solana wallets are ready.`);
|
|
3661
3674
|
console.log(`[ClawRouter] To back up, run in OpenClaw:`);
|
|
@@ -7089,18 +7102,26 @@ function collectSystemInfo() {
|
|
|
7089
7102
|
}
|
|
7090
7103
|
async function collectWalletInfo() {
|
|
7091
7104
|
try {
|
|
7092
|
-
const { key, address, source } = await resolveOrGenerateWalletKey();
|
|
7105
|
+
const { key, address, source, solanaPrivateKeyBytes } = await resolveOrGenerateWalletKey();
|
|
7093
7106
|
if (!key || !address) {
|
|
7094
7107
|
return {
|
|
7095
7108
|
exists: false,
|
|
7096
7109
|
valid: false,
|
|
7097
7110
|
address: null,
|
|
7111
|
+
solanaAddress: null,
|
|
7098
7112
|
balance: null,
|
|
7099
7113
|
isLow: false,
|
|
7100
7114
|
isEmpty: true,
|
|
7101
7115
|
source: null
|
|
7102
7116
|
};
|
|
7103
7117
|
}
|
|
7118
|
+
let solanaAddress = null;
|
|
7119
|
+
if (solanaPrivateKeyBytes) {
|
|
7120
|
+
try {
|
|
7121
|
+
solanaAddress = await getSolanaAddress(solanaPrivateKeyBytes);
|
|
7122
|
+
} catch {
|
|
7123
|
+
}
|
|
7124
|
+
}
|
|
7104
7125
|
const monitor = new BalanceMonitor(address);
|
|
7105
7126
|
try {
|
|
7106
7127
|
const balanceInfo = await monitor.checkBalance();
|
|
@@ -7108,6 +7129,7 @@ async function collectWalletInfo() {
|
|
|
7108
7129
|
exists: true,
|
|
7109
7130
|
valid: true,
|
|
7110
7131
|
address,
|
|
7132
|
+
solanaAddress,
|
|
7111
7133
|
balance: balanceInfo.balanceUSD,
|
|
7112
7134
|
isLow: balanceInfo.isLow,
|
|
7113
7135
|
isEmpty: balanceInfo.isEmpty,
|
|
@@ -7118,6 +7140,7 @@ async function collectWalletInfo() {
|
|
|
7118
7140
|
exists: true,
|
|
7119
7141
|
valid: true,
|
|
7120
7142
|
address,
|
|
7143
|
+
solanaAddress,
|
|
7121
7144
|
balance: null,
|
|
7122
7145
|
isLow: false,
|
|
7123
7146
|
isEmpty: false,
|
|
@@ -7129,6 +7152,7 @@ async function collectWalletInfo() {
|
|
|
7129
7152
|
exists: false,
|
|
7130
7153
|
valid: false,
|
|
7131
7154
|
address: null,
|
|
7155
|
+
solanaAddress: null,
|
|
7132
7156
|
balance: null,
|
|
7133
7157
|
isLow: false,
|
|
7134
7158
|
isEmpty: true,
|
|
@@ -7210,7 +7234,10 @@ function printDiagnostics(result) {
|
|
|
7210
7234
|
console.log("\nWallet");
|
|
7211
7235
|
if (result.wallet.exists && result.wallet.valid) {
|
|
7212
7236
|
console.log(` ${green(`Key: ${WALLET_FILE} (${result.wallet.source})`)}`);
|
|
7213
|
-
console.log(` ${green(`Address:
|
|
7237
|
+
console.log(` ${green(`EVM Address: ${result.wallet.address}`)}`);
|
|
7238
|
+
if (result.wallet.solanaAddress) {
|
|
7239
|
+
console.log(` ${green(`Solana Address: ${result.wallet.solanaAddress}`)}`);
|
|
7240
|
+
}
|
|
7214
7241
|
if (result.wallet.isEmpty) {
|
|
7215
7242
|
console.log(` ${red(`Balance: $0.00 - NEED TO FUND!`)}`);
|
|
7216
7243
|
} else if (result.wallet.isLow) {
|
|
@@ -7265,7 +7292,10 @@ var DOCTOR_MODELS = {
|
|
|
7265
7292
|
async function analyzeWithAI(diagnostics, userQuestion, model = "sonnet") {
|
|
7266
7293
|
if (diagnostics.wallet.isEmpty) {
|
|
7267
7294
|
console.log("\n\u{1F4B3} Wallet is empty - cannot call AI for analysis.");
|
|
7268
|
-
console.log(` Fund your wallet with USDC on Base: ${diagnostics.wallet.address}`);
|
|
7295
|
+
console.log(` Fund your EVM wallet with USDC on Base: ${diagnostics.wallet.address}`);
|
|
7296
|
+
if (diagnostics.wallet.solanaAddress) {
|
|
7297
|
+
console.log(` Fund your Solana wallet with USDC: ${diagnostics.wallet.solanaAddress}`);
|
|
7298
|
+
}
|
|
7269
7299
|
console.log(" Get USDC: https://www.coinbase.com/price/usd-coin");
|
|
7270
7300
|
console.log(" Bridge to Base: https://bridge.base.org\n");
|
|
7271
7301
|
return;
|
|
@@ -7557,6 +7587,13 @@ ClawRouter Partner APIs (v${VERSION})
|
|
|
7557
7587
|
} else {
|
|
7558
7588
|
console.log(`[ClawRouter] Using wallet from BLOCKRUN_WALLET_KEY: ${wallet.address}`);
|
|
7559
7589
|
}
|
|
7590
|
+
if (wallet.solanaPrivateKeyBytes) {
|
|
7591
|
+
try {
|
|
7592
|
+
const solAddr = await getSolanaAddress(wallet.solanaPrivateKeyBytes);
|
|
7593
|
+
console.log(`[ClawRouter] Solana address: ${solAddr}`);
|
|
7594
|
+
} catch {
|
|
7595
|
+
}
|
|
7596
|
+
}
|
|
7560
7597
|
const proxy = await startProxy({
|
|
7561
7598
|
wallet,
|
|
7562
7599
|
port: args.port,
|