@blockrun/franklin 3.28.0 → 3.28.2

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 CHANGED
@@ -56,6 +56,8 @@ Built by the [BlockRun](https://blockrun.ai) team. Apache-2.0. TypeScript. Ships
56
56
 
57
57
  ## Quick start
58
58
 
59
+ > **Requires Node.js 20.18+ (Node 22 LTS recommended).** Check with `node -v`.
60
+
59
61
  ```bash
60
62
  # 1. Install
61
63
  npm install -g @blockrun/franklin
@@ -70,6 +72,31 @@ franklin balance # show address + USDC balance
70
72
 
71
73
  That's it. Zero signup, zero credit card, zero phone verification. Send **$5 of USDC** to the wallet and you've unlocked every frontier model and every paid tool in the BlockRun gateway.
72
74
 
75
+ **No global install? Just run it directly** — no permissions, no `-g`:
76
+
77
+ ```bash
78
+ npx @blockrun/franklin
79
+ ```
80
+
81
+ ### Install troubleshooting
82
+
83
+ | Symptom | Cause | Fix |
84
+ | ------- | ----- | --- |
85
+ | `npm error EACCES … mkdir '/usr/local/lib/node_modules'` | Your global npm folder is owned by root (common when Node was installed from the macOS `.pkg`). | Don't use `sudo`. Either run `npx @blockrun/franklin` (no global install needed), or switch to a user-owned Node via a version manager — see below. |
86
+ | `npm warn EBADENGINE … required: { node: '>=20.x' }` | Node is older than 20.18. | Upgrade to Node 20.18+ or 22 LTS. The warning alone is harmless, but upgrading clears it. |
87
+
88
+ The clean, permanent fix for both is a **user-owned Node** so global installs never touch root-owned system folders:
89
+
90
+ ```bash
91
+ # nvm (https://github.com/nvm-sh/nvm)
92
+ nvm install 22 && nvm use 22
93
+ npm install -g @blockrun/franklin
94
+
95
+ # or fnm (https://github.com/Schniz/fnm)
96
+ fnm install 22 && fnm use 22
97
+ npm install -g @blockrun/franklin
98
+ ```
99
+
73
100
  ### Prefer a GUI? Try Franklin for VS Code
74
101
 
75
102
  [![Franklin for VS Code — Beta is here](assets/franklin-vscode-banner.png)](https://marketplace.visualstudio.com/items?itemName=blockrun.franklin-vscode)
@@ -11,13 +11,18 @@
11
11
  * Base / USDC only. Mirrors the gateway-call pattern in src/phone/client.ts
12
12
  * and reuses the shared x402 POST helper.
13
13
  */
14
- import { API_URLS } from '../config.js';
14
+ import { API_URLS, loadChain } from '../config.js';
15
15
  import { postWithPayment } from '../payments/post-with-payment.js';
16
16
  /**
17
17
  * Mint a one-time Coinbase Onramp link that funds `address` (Base USDC).
18
18
  * Throws if the gateway is unreachable, not configured, or returns no URL.
19
19
  */
20
20
  export async function getOnrampUrl(address) {
21
+ // postWithPayment signs with the active chain's wallet; on Solana that
22
+ // would crash confusingly against this Base-only endpoint. Fail clearly.
23
+ if (loadChain() !== 'base') {
24
+ throw new Error('Onramp is Base-only — switch to Base to buy USDC with a card.');
25
+ }
21
26
  const endpoint = `${API_URLS.base}/v1/onramp/token`;
22
27
  const result = await postWithPayment(endpoint, { address, network: 'base', asset: 'USDC' }, 'Mint a Coinbase Onramp session link to fund this wallet');
23
28
  if (!result.ok) {
@@ -1246,8 +1246,24 @@ document.getElementById('wallet-onramp-btn').addEventListener('click', async ()
1246
1246
  const r = await fetch('/api/wallet/onramp', { method: 'POST' });
1247
1247
  const data = await r.json().catch(() => ({}));
1248
1248
  if (!r.ok || !data.url) throw new Error(data.error || r.statusText || 'failed');
1249
- window.open(data.url, '_blank', 'noopener');
1250
- status.textContent = '';
1249
+ // The mint round-trip can outlive the browser's transient user-activation
1250
+ // window, so popup blockers may eat this open. The token stays valid for
1251
+ // ~5 min — on block, hand the user a real link (a fresh gesture).
1252
+ const win = window.open(data.url, '_blank', 'noopener');
1253
+ if (win) {
1254
+ status.textContent = '';
1255
+ } else {
1256
+ status.textContent = 'Popup blocked — ';
1257
+ const a = document.createElement('a');
1258
+ a.href = data.url;
1259
+ a.target = '_blank';
1260
+ a.rel = 'noopener';
1261
+ a.textContent = 'click here to open Coinbase';
1262
+ status.appendChild(a);
1263
+ }
1264
+ // Funding an empty wallet creates it server-side on first mint — re-render
1265
+ // so the address/QR/balance reflect the wallet Coinbase is about to fund.
1266
+ loadWallet().catch(() => {});
1251
1267
  } catch (err) {
1252
1268
  status.textContent = err && err.message ? err.message : 'Failed to open Coinbase';
1253
1269
  } finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/franklin",
3
- "version": "3.28.0",
3
+ "version": "3.28.2",
4
4
  "description": "Franklin Agent — The AI agent with a wallet. Spends USDC autonomously to get real work done. Pay per action, no subscriptions.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "homepage": "https://Franklin.run",
65
65
  "engines": {
66
- "node": ">=20"
66
+ "node": ">=20.18.0"
67
67
  },
68
68
  "dependencies": {
69
69
  "@blockrun/llm": "^2.0.0",