Skip to content

Commit 7ed40e3

Browse files
author
1bcMax
committed
feat: new installs default to the Solana payment chain (v0.12.246)
Brand-new wallets persist payment-chain=solana at generation, gated on successful Solana derivation (@solana/kit present). Existing installs, env-var restores, and wallet-recover flows are untouched — absent config still resolves to base, where pre-existing funds live. Also removes the /chain command from docs (never registered; use /wallet solana|base) and documents the new default.
1 parent 6c0f89e commit 7ed40e3

17 files changed

Lines changed: 237 additions & 23 deletions

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ All notable changes to ClawRouter.
44

55
---
66

7+
## v0.12.246 — August 22, 2026
8+
9+
### Changed — new installs default to the Solana payment chain
10+
11+
Brand-new wallets now persist `payment-chain = solana` at generation time (`generateAndSaveWallet` in `src/auth.ts`), so first-run users start on the Solana gateway (`sol.blockrun.ai`). **Existing installs are completely unaffected** — the `loadPaymentChain()` fallback for an absent `~/.openclaw/blockrun/payment-chain` file stays `base`, which is where pre-existing wallets hold their USDC.
12+
13+
- The default is written **only when Solana address derivation succeeds** (it dynamically imports `@solana/kit`, which plugin installers sometimes drop — see the reinstall workaround in `scripts/update.sh`). If derivation fails, the write is skipped and the user stays on the Base fallback rather than being defaulted onto a chain the proxy can't sign for.
14+
- Recovery/import flows deliberately do NOT change the chain: `BLOCKRUN_WALLET_KEY` env restore, `wallet recover`, and the legacy `setupSolana` opt-in path all bypass wallet generation, so a restored wallet keeps resolving to wherever its funds already live.
15+
- `CLAWROUTER_PAYMENT_CHAIN` still overrides the persisted selection in both directions; `/wallet base` switches a new install back at any time.
16+
- New wallet banner now states the Solana default and how to switch back.
17+
- Tests: `src/auth.payment-chain-default.test.ts` (fresh generate → solana; saved/env/explicit-base paths untouched; env override wins) + `src/auth.payment-chain-default-failure.test.ts` (derivation-failure guard), and `test/smoke-wallet-scenarios.ts` now asserts the chain file on real disk.
18+
- Docs: removed the `/chain` command from README and `docs/configuration.md` — it was never a registered slash command (use `/wallet solana` / `/wallet base`); documented the new-install default in README, `docs/configuration.md`, and `skills/clawrouter/SKILL.md`.
19+
20+
---
21+
722
## v0.12.245 — August 12, 2026
823

924
Catch-up sync to blockrun: one free-model EOL (today's), ten model additions that had never been mirrored, and six stale prices. Catalog is now 70 chat-visible / 5 free, matching blockrun exactly.

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,15 +498,14 @@ Request → 402 (price: $0.003) → wallet signs USDC → retry → response
498498

499499
USDC stays in your wallet until spent — non-custodial. Price is visible in the 402 header before signing.
500500

501-
**Dual-chain support:** Pay with **USDC** on **Base (EVM)** or **USDC on Solana**. Both wallets are derived from a single BIP-39 mnemonic on first run.
501+
**Dual-chain support:** Pay with **USDC** on **Base (EVM)** or **USDC on Solana**. Both wallets are derived from a single BIP-39 mnemonic on first run. New installs default to **Solana**; existing installs stay on **Base** unless switched with `/wallet solana`.
502502

503503
```bash
504504
/wallet # Check balance and address (both chains)
505505
/wallet export # Export mnemonic + keys for backup
506506
/wallet recover # Restore wallet from mnemonic on a new machine
507507
/wallet solana # Switch to Solana USDC payments
508-
/wallet base # Switch back to Base (EVM) USDC payments
509-
/chain solana # Alias for /wallet solana
508+
/wallet base # Switch to Base (EVM) USDC payments
510509
/stats # View usage and savings
511510
/stats clear # Reset usage statistics
512511
/exclude # Show excluded models

dist/cli.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57948,6 +57948,14 @@ Then run: npx @blockrun/clawrouter`
5794857948
solanaAddress = await getSolanaAddress(derived.solanaPrivateKeyBytes);
5794957949
} catch {
5795057950
}
57951+
let solanaDefaultSaved = false;
57952+
if (solanaAddress) {
57953+
try {
57954+
await savePaymentChain("solana");
57955+
solanaDefaultSaved = true;
57956+
} catch {
57957+
}
57958+
}
5795157959
console.log(`[ClawRouter]`);
5795257960
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`);
5795357961
console.log(`[ClawRouter] NEW WALLET GENERATED \u2014 BACK UP YOUR KEY NOW`);
@@ -57960,6 +57968,12 @@ Then run: npx @blockrun/clawrouter`
5796057968
console.log(`[ClawRouter] Mnemonic : ${MNEMONIC_FILE}`);
5796157969
console.log(`[ClawRouter]`);
5796257970
console.log(`[ClawRouter] Both EVM (Base) and Solana wallets are ready.`);
57971+
if (solanaDefaultSaved) {
57972+
console.log(
57973+
`[ClawRouter] Default payment chain: Solana \u2014 fund the Solana address above with USDC.`
57974+
);
57975+
console.log(`[ClawRouter] To switch to Base, run in OpenClaw: /wallet base`);
57976+
}
5796357977
console.log(`[ClawRouter] To back up, run in OpenClaw:`);
5796457978
console.log(`[ClawRouter] /wallet export`);
5796557979
console.log(`[ClawRouter]`);

dist/cli.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.d.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,11 @@ type PaymentChain = "base" | "solana";
767767
type ProxyOptions = {
768768
wallet: WalletConfig;
769769
apiBase?: string;
770-
/** Payment chain: "base" (default) or "solana". Can also be set via CLAWROUTER_PAYMENT_CHAIN env var. */
770+
/**
771+
* Payment chain: "base" or "solana". New installs persist "solana" at wallet
772+
* generation; absent config resolves to "base" for pre-existing installs.
773+
* Can also be set via CLAWROUTER_PAYMENT_CHAIN env var.
774+
*/
771775
paymentChain?: PaymentChain;
772776
/** Port to listen on (default: 8402) */
773777
port?: number;
@@ -895,6 +899,8 @@ declare function savePaymentChain(chain: "base" | "solana"): Promise<void>;
895899
/**
896900
* Load the persisted payment chain selection from disk.
897901
* Returns "base" if no file exists or the file is invalid.
902+
* New installs persist "solana" at wallet generation, so an absent file
903+
* means a pre-existing install whose funds live on Base.
898904
*/
899905
declare function loadPaymentChain(): Promise<"base" | "solana">;
900906
/**
@@ -1488,7 +1494,8 @@ declare function buildPartnerTools(proxyBaseUrl: string): PartnerToolDefinition[
14881494
* # Install the plugin
14891495
* openclaw plugins install @blockrun/clawrouter
14901496
*
1491-
* # Fund your wallet with USDC on Base (address printed on install)
1497+
* # Fund your wallet with USDC (Solana for new installs, Base for existing ones;
1498+
* # the funding address is printed on install)
14921499
*
14931500
* # Use smart routing (auto-picks cheapest model)
14941501
* openclaw models set blockrun/auto

dist/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57805,6 +57805,14 @@ Then run: npx @blockrun/clawrouter`
5780557805
solanaAddress = await getSolanaAddress(derived.solanaPrivateKeyBytes);
5780657806
} catch {
5780757807
}
57808+
let solanaDefaultSaved = false;
57809+
if (solanaAddress) {
57810+
try {
57811+
await savePaymentChain("solana");
57812+
solanaDefaultSaved = true;
57813+
} catch {
57814+
}
57815+
}
5780857816
console.log(`[ClawRouter]`);
5780957817
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`);
5781057818
console.log(`[ClawRouter] NEW WALLET GENERATED \u2014 BACK UP YOUR KEY NOW`);
@@ -57817,6 +57825,12 @@ Then run: npx @blockrun/clawrouter`
5781757825
console.log(`[ClawRouter] Mnemonic : ${MNEMONIC_FILE}`);
5781857826
console.log(`[ClawRouter]`);
5781957827
console.log(`[ClawRouter] Both EVM (Base) and Solana wallets are ready.`);
57828+
if (solanaDefaultSaved) {
57829+
console.log(
57830+
`[ClawRouter] Default payment chain: Solana \u2014 fund the Solana address above with USDC.`
57831+
);
57832+
console.log(`[ClawRouter] To switch to Base, run in OpenClaw: /wallet base`);
57833+
}
5782057834
console.log(`[ClawRouter] To back up, run in OpenClaw:`);
5782157835
console.log(`[ClawRouter] /wallet export`);
5782257836
console.log(`[ClawRouter]`);

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/configuration.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,10 @@ Response (dual-chain):
158158

159159
```bash
160160
/wallet solana # Switch to Solana USDC payments
161-
/wallet base # Switch back to Base (EVM) USDC payments
161+
/wallet base # Switch to Base (EVM) USDC payments
162162
```
163163

164-
Or use the `/chain` command:
165-
166-
```bash
167-
/chain solana
168-
/chain base
169-
```
170-
171-
The selected chain is persisted across gateway restarts.
164+
The selected chain is persisted across gateway restarts (in `~/.openclaw/blockrun/payment-chain`). New installs default to **Solana** (persisted when the wallet is first generated); existing installs without a saved selection stay on **Base**, where their funds already live. The `CLAWROUTER_PAYMENT_CHAIN` environment variable (`solana` or `base`) overrides the persisted selection.
172165

173166
### Switch Wallets
174167

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@blockrun/clawrouter",
3-
"version": "0.12.245",
3+
"version": "0.12.246",
44
"description": "Smart LLM router — save 88% on inference costs. 71 models (5 free), one wallet, x402 micropayments.",
55
"type": "module",
66
"main": "dist/index.js",

0 commit comments

Comments
 (0)