@blockrun/clawrouter 0.12.265 → 0.12.267
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/README.md +15 -1
- package/dist/cli.js +1389 -417
- package/dist/index.d.ts +52 -23
- package/dist/index.js +1107 -388
- package/docs/clawrouter-cuts-llm-api-costs-500x.md +1 -1
- package/docs/configuration.md +26 -24
- package/docs/troubleshooting.md +6 -2
- package/openclaw.plugin.json +2 -1
- package/package.json +3 -2
- package/scripts/reinstall.sh +181 -77
- package/scripts/uninstall.sh +53 -8
- package/scripts/update.ps1 +215 -33
- package/scripts/update.sh +223 -86
|
@@ -144,7 +144,7 @@ There is no monthly invoice. There is no 3am email. There is a wallet balance, a
|
|
|
144
144
|
**`maxCostPerRun`** — a per-session cost ceiling that stops or downgrades requests once a session exceeds a configured threshold (e.g., `$0.50`). This closes the remaining gap ([#3181](https://github.com/openclaw/openclaw/issues/3181)) where a wallet with sufficient funds can still accumulate within a single run. Two modes: `graceful` (downgrade to cheaper models) and `strict` (hard 429 once the cap is hit).
|
|
145
145
|
|
|
146
146
|
```
|
|
147
|
-
<!-- br:models.chatVisible -->
|
|
147
|
+
<!-- br:models.chatVisible@live -->76<!-- /br:models.chatVisible@live --> models. One wallet. Pay per call.
|
|
148
148
|
```
|
|
149
149
|
|
|
150
150
|
---
|
package/docs/configuration.md
CHANGED
|
@@ -21,7 +21,7 @@ Complete reference for ClawRouter configuration options.
|
|
|
21
21
|
|
|
22
22
|
| Variable | Default | Description |
|
|
23
23
|
| --------------------------- | ------------------------------------- | --------------------------------------------------------------------------------- |
|
|
24
|
-
| `BLOCKRUN_WALLET_KEY` | - |
|
|
24
|
+
| `BLOCKRUN_WALLET_KEY` | - | Explicit Base wallet override (hex, 0x-prefixed). |
|
|
25
25
|
| `BLOCKRUN_PROXY_PORT` | `8402` | Port for the local x402 proxy server. |
|
|
26
26
|
| `CLAWROUTER_SOLANA_RPC_URL` | `https://api.mainnet-beta.solana.com` | Solana RPC endpoint for USDC balance checks. |
|
|
27
27
|
| `CLAWROUTER_DISABLED` | `false` | Set to `true` to disable smart routing (pass requests through as-is). |
|
|
@@ -39,11 +39,12 @@ export BLOCKRUN_WALLET_KEY=0x...your_private_key...
|
|
|
39
39
|
|
|
40
40
|
**Resolution order:**
|
|
41
41
|
|
|
42
|
-
1.
|
|
43
|
-
2.
|
|
44
|
-
3.
|
|
42
|
+
1. `BLOCKRUN_WALLET_KEY` environment variable — explicit override
|
|
43
|
+
2. BlockRun Core wallet (`~/.blockrun/.session` and `~/.blockrun/.solana-session`)
|
|
44
|
+
3. Legacy ClawRouter wallet (`~/.openclaw/blockrun/`) — copied into Core automatically
|
|
45
|
+
4. Auto-generate — creates a Core wallet plus legacy recovery files
|
|
45
46
|
|
|
46
|
-
> **
|
|
47
|
+
> **Migration safety:** Existing Core files are never overwritten. Legacy files are copied, not moved or deleted, so they remain available for rollback and recovery.
|
|
47
48
|
|
|
48
49
|
### BLOCKRUN_PROXY_PORT
|
|
49
50
|
|
|
@@ -162,15 +163,15 @@ Response (dual-chain):
|
|
|
162
163
|
/wallet base # Switch to Base (EVM) USDC payments
|
|
163
164
|
```
|
|
164
165
|
|
|
165
|
-
The selected chain is persisted across gateway restarts
|
|
166
|
+
The selected chain is persisted across gateway restarts in `~/.blockrun/.chain` (and mirrored to the legacy `~/.openclaw/blockrun/payment-chain` file for rollback compatibility). New installs default to **Solana**; 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.
|
|
166
167
|
|
|
167
168
|
### Switch Wallets
|
|
168
169
|
|
|
169
170
|
To use a different wallet:
|
|
170
171
|
|
|
171
172
|
```bash
|
|
172
|
-
# 1.
|
|
173
|
-
|
|
173
|
+
# 1. Back up the current Core wallet
|
|
174
|
+
cp -R ~/.blockrun ~/blockrun-wallet-backup
|
|
174
175
|
|
|
175
176
|
# 2. Set new wallet key
|
|
176
177
|
export BLOCKRUN_WALLET_KEY=0x...
|
|
@@ -182,16 +183,16 @@ openclaw gateway restart
|
|
|
182
183
|
### Backup Wallet
|
|
183
184
|
|
|
184
185
|
```bash
|
|
185
|
-
#
|
|
186
|
-
cp ~/.
|
|
187
|
-
|
|
188
|
-
# View wallet address from key file
|
|
189
|
-
cat ~/.openclaw/blockrun/wallet.key
|
|
186
|
+
# Back up the complete Core wallet directory
|
|
187
|
+
cp -R ~/.blockrun ~/blockrun-wallet-backup
|
|
190
188
|
```
|
|
191
189
|
|
|
190
|
+
Use `/wallet` in OpenClaw chat to view wallet addresses and balances. Never
|
|
191
|
+
print or share `~/.blockrun/.session`—it contains your Base private key.
|
|
192
|
+
|
|
192
193
|
### Wallet Backup & Recovery
|
|
193
194
|
|
|
194
|
-
|
|
195
|
+
BlockRun Core stores the Base private key at `~/.blockrun/.session`, the Solana key at `~/.blockrun/.solana-session`, and the selected chain at `~/.blockrun/.chain`. ClawRouter-generated wallets also retain the recovery mnemonic at `~/.openclaw/blockrun/mnemonic`. **Back up both directories before terminating any VPS or machine.**
|
|
195
196
|
|
|
196
197
|
#### Using the `/wallet` Command
|
|
197
198
|
|
|
@@ -208,31 +209,32 @@ The `/wallet export` command displays your mnemonic and keys so you can copy the
|
|
|
208
209
|
#### Manual Backup
|
|
209
210
|
|
|
210
211
|
```bash
|
|
211
|
-
# Option 1: Copy the
|
|
212
|
-
cp ~/.
|
|
212
|
+
# Option 1: Copy the Core wallet directory
|
|
213
|
+
cp -R ~/.blockrun ~/blockrun-wallet-backup
|
|
213
214
|
|
|
214
215
|
# Option 2: View mnemonic
|
|
215
|
-
cat ~/.openclaw/blockrun/
|
|
216
|
+
cat ~/.openclaw/blockrun/mnemonic
|
|
216
217
|
```
|
|
217
218
|
|
|
218
219
|
#### Restore on a New Machine
|
|
219
220
|
|
|
220
221
|
```bash
|
|
221
|
-
# Option 1:
|
|
222
|
-
|
|
222
|
+
# Option 1: Restore a complete Core backup
|
|
223
|
+
cp -R ~/blockrun-wallet-backup ~/.blockrun
|
|
223
224
|
|
|
224
225
|
# Option 2: Set environment variable (before installing ClawRouter)
|
|
225
226
|
export BLOCKRUN_WALLET_KEY=0x...your_private_key...
|
|
226
227
|
openclaw plugins install @blockrun/clawrouter
|
|
227
228
|
|
|
228
|
-
# Option 3:
|
|
229
|
+
# Option 3: Restore a ClawRouter recovery mnemonic, then migrate on startup
|
|
229
230
|
mkdir -p ~/.openclaw/blockrun
|
|
230
|
-
echo "your
|
|
231
|
-
chmod 600 ~/.openclaw/blockrun/
|
|
231
|
+
echo "your recovery mnemonic here" > ~/.openclaw/blockrun/mnemonic
|
|
232
|
+
chmod 600 ~/.openclaw/blockrun/mnemonic
|
|
233
|
+
npx @blockrun/clawrouter wallet recover
|
|
232
234
|
openclaw plugins install @blockrun/clawrouter
|
|
233
235
|
```
|
|
234
236
|
|
|
235
|
-
**Important:**
|
|
237
|
+
**Important:** `BLOCKRUN_WALLET_KEY` is an explicit Base-wallet override. Back up the existing Core directory before replacing wallet files.
|
|
236
238
|
|
|
237
239
|
#### Lost Key Recovery
|
|
238
240
|
|
|
@@ -241,7 +243,7 @@ If you lose your wallet key, **there is no way to recover it**. The wallet is se
|
|
|
241
243
|
**Prevention tips:**
|
|
242
244
|
|
|
243
245
|
- Run `/wallet export` before terminating any VPS
|
|
244
|
-
- Keep
|
|
246
|
+
- Keep secure backups of `~/.blockrun` and any legacy recovery mnemonic
|
|
245
247
|
- For production use, consider using a hardware wallet or key management system
|
|
246
248
|
|
|
247
249
|
---
|
package/docs/troubleshooting.md
CHANGED
|
@@ -19,7 +19,7 @@ Quick solutions for common ClawRouter issues.
|
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
21
|
# 1. Check your version (should be 0.12+)
|
|
22
|
-
cat ~/.openclaw/extensions/clawrouter/package.json | grep version
|
|
22
|
+
cat ~/.openclaw/extensions/blockrun-clawrouter/package.json | grep version
|
|
23
23
|
|
|
24
24
|
# 2. Check proxy is running
|
|
25
25
|
curl http://localhost:8402/health
|
|
@@ -51,12 +51,16 @@ Auth profile is missing or wasn't created properly.
|
|
|
51
51
|
|
|
52
52
|
**Fix:** See [How to Update](#how-to-update) — the reinstall script automatically injects the auth profile.
|
|
53
53
|
|
|
54
|
-
### "Config validation failed: plugin not found: clawrouter"
|
|
54
|
+
### "Config validation failed: plugin not found: blockrun-clawrouter"
|
|
55
55
|
|
|
56
56
|
Plugin directory was removed but config still references it. This blocks all OpenClaw commands until fixed.
|
|
57
57
|
|
|
58
58
|
**Fix:** See [How to Update](#how-to-update) for complete cleanup steps.
|
|
59
59
|
|
|
60
|
+
If the missing id is the legacy `clawrouter`, first update ClawRouter. The
|
|
61
|
+
migration moves only BlockRun-owned settings to `blockrun-clawrouter` and
|
|
62
|
+
preserves OpenClaw's unrelated official `clawrouter` plugin.
|
|
63
|
+
|
|
60
64
|
### "No USDC balance" / "Insufficient funds"
|
|
61
65
|
|
|
62
66
|
Wallet needs funding. ClawRouter accepts **USDC** (not SOL or ETH) on either chain.
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockrun/clawrouter",
|
|
3
|
-
"version": "0.12.
|
|
4
|
-
"description": "Smart LLM router
|
|
3
|
+
"version": "0.12.267",
|
|
4
|
+
"description": "Smart LLM router — save 84% on inference costs. 76 models (7 free), one wallet, x402 micropayments.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -99,6 +99,7 @@
|
|
|
99
99
|
"@x402/fetch": "^2.9.0",
|
|
100
100
|
"@x402/svm": "^2.9.0",
|
|
101
101
|
"axios": "^1.18.1",
|
|
102
|
+
"bs58": "^6.0.0",
|
|
102
103
|
"https-proxy-agent": "^9.1.0",
|
|
103
104
|
"undici": "^8.10.0",
|
|
104
105
|
"viem": "^2.39.3"
|