@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/index.js CHANGED
@@ -658,6 +658,7 @@ __export(wallet_exports, {
658
658
  deriveSolanaKeyBytes: () => deriveSolanaKeyBytes,
659
659
  deriveSolanaKeyBytesLegacy: () => deriveSolanaKeyBytesLegacy,
660
660
  generateWalletMnemonic: () => generateWalletMnemonic,
661
+ getSolanaAddress: () => getSolanaAddress,
661
662
  isValidMnemonic: () => isValidMnemonic
662
663
  });
663
664
  import { HDKey } from "@scure/bip32";
@@ -710,6 +711,11 @@ function deriveAllKeys(mnemonic) {
710
711
  const solanaPrivateKeyBytes = deriveSolanaKeyBytes(mnemonic);
711
712
  return { mnemonic, evmPrivateKey, evmAddress, solanaPrivateKeyBytes };
712
713
  }
714
+ async function getSolanaAddress(privateKeyBytes) {
715
+ const { createKeyPairSignerFromPrivateKeyBytes: createKeyPairSignerFromPrivateKeyBytes2 } = await import("@solana/kit");
716
+ const signer = await createKeyPairSignerFromPrivateKeyBytes2(privateKeyBytes);
717
+ return signer.address;
718
+ }
713
719
  var ETH_DERIVATION_PATH, SOLANA_HARDENED_INDICES;
714
720
  var init_wallet = __esm({
715
721
  "src/wallet.ts"() {
@@ -4116,13 +4122,21 @@ async function generateAndSaveWallet() {
4116
4122
  { cause: err }
4117
4123
  );
4118
4124
  }
4125
+ let solanaAddress;
4126
+ try {
4127
+ solanaAddress = await getSolanaAddress(derived.solanaPrivateKeyBytes);
4128
+ } catch {
4129
+ }
4119
4130
  console.log(`[ClawRouter]`);
4120
4131
  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`);
4121
4132
  console.log(`[ClawRouter] NEW WALLET GENERATED \u2014 BACK UP YOUR KEY NOW`);
4122
4133
  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`);
4123
- console.log(`[ClawRouter] EVM Address : ${derived.evmAddress}`);
4124
- console.log(`[ClawRouter] Key file : ${WALLET_FILE}`);
4125
- console.log(`[ClawRouter] Mnemonic : ${MNEMONIC_FILE}`);
4134
+ console.log(`[ClawRouter] EVM Address : ${derived.evmAddress}`);
4135
+ if (solanaAddress) {
4136
+ console.log(`[ClawRouter] Solana Address : ${solanaAddress}`);
4137
+ }
4138
+ console.log(`[ClawRouter] Key file : ${WALLET_FILE}`);
4139
+ console.log(`[ClawRouter] Mnemonic : ${MNEMONIC_FILE}`);
4126
4140
  console.log(`[ClawRouter]`);
4127
4141
  console.log(`[ClawRouter] Both EVM (Base) and Solana wallets are ready.`);
4128
4142
  console.log(`[ClawRouter] To back up, run in OpenClaw:`);