@blockrun/franklin 3.48.0 → 3.49.0
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/agent/commands.js +11 -9
- package/dist/agent/context.js +5 -5
- package/dist/agent/types.d.ts +2 -1
- package/dist/channel/slack.js +4 -2
- package/dist/channel/telegram.js +4 -2
- package/dist/commands/balance.js +5 -4
- package/dist/commands/doctor.js +3 -2
- package/dist/commands/proxy.js +4 -4
- package/dist/commands/setup.js +6 -5
- package/dist/commands/start.js +4 -2
- package/dist/config.d.ts +13 -1
- package/dist/config.js +28 -8
- package/dist/index.js +4 -4
- package/dist/model-catalog.d.ts +3 -2
- package/dist/model-catalog.js +18 -8
- package/dist/onramp/client.js +5 -0
- package/dist/panel/html.js +39 -22
- package/dist/panel/server.js +8 -7
- package/dist/payments/auth-mode.d.ts +2 -1
- package/dist/payments/auth-mode.js +2 -1
- package/dist/proxy/server.js +2 -1
- package/dist/serve/agent-host.d.ts +2 -1
- package/dist/serve/server.js +4 -1
- package/dist/session/storage.d.ts +2 -1
- package/dist/skills/bootstrap.d.ts +2 -1
- package/dist/tools/moa.d.ts +2 -1
- package/dist/tools/modal.d.ts +2 -1
- package/dist/tools/subagent.d.ts +2 -1
- package/dist/tools/wallet.d.ts +2 -1
- package/dist/tools/wallet.js +2 -1
- package/dist/trading/providers/blockrun/client.js +3 -2
- package/dist/wallet/manager.d.ts +15 -0
- package/dist/wallet/manager.js +27 -1
- package/dist/wallet/reservation.js +4 -2
- package/package.json +6 -6
package/dist/agent/commands.js
CHANGED
|
@@ -1077,7 +1077,8 @@ export async function handleSlashCommand(input, ctx) {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
// /wallet — show wallet info, import, or export
|
|
1079
1079
|
if (input === '/wallet' || input.startsWith('/wallet ')) {
|
|
1080
|
-
const
|
|
1080
|
+
const { loadChain, CHAIN_LABELS } = await import('../config.js');
|
|
1081
|
+
const chain = loadChain();
|
|
1081
1082
|
const args = input.slice(7).trim();
|
|
1082
1083
|
// /wallet export [--show] — key masked by default; --show prints the full key
|
|
1083
1084
|
// Rationale: terminal scrollback, screen recordings, and shared tmux sessions
|
|
@@ -1113,7 +1114,7 @@ export async function handleSlashCommand(input, ctx) {
|
|
|
1113
1114
|
return { handled: true };
|
|
1114
1115
|
}
|
|
1115
1116
|
const w = getOrCreateWallet();
|
|
1116
|
-
ctx.onEvent({ kind: 'text_delta', text: `**Wallet Export (
|
|
1117
|
+
ctx.onEvent({ kind: 'text_delta', text: `**Wallet Export (${CHAIN_LABELS[chain]})**\n` +
|
|
1117
1118
|
` Address: ${w.address}\n` +
|
|
1118
1119
|
` Private Key: ${showKey ? key : mask(key)}\n\n` +
|
|
1119
1120
|
(showKey
|
|
@@ -1136,16 +1137,16 @@ export async function handleSlashCommand(input, ctx) {
|
|
|
1136
1137
|
const key = args.slice(6).replace(/\s/g, '');
|
|
1137
1138
|
if (!key) {
|
|
1138
1139
|
ctx.onEvent({ kind: 'text_delta', text: `**Usage:** \`/wallet import <private-key>\`\n\n` +
|
|
1139
|
-
` Base:
|
|
1140
|
-
` Solana:
|
|
1140
|
+
` Base / Arc: \`/wallet import 0x...\` (hex, 66 chars)\n` +
|
|
1141
|
+
` Solana: \`/wallet import <bs58-key>\` (base58 encoded)\n`
|
|
1141
1142
|
});
|
|
1142
1143
|
emitDone(ctx);
|
|
1143
1144
|
return { handled: true };
|
|
1144
1145
|
}
|
|
1145
|
-
// Shape-validate before touching disk
|
|
1146
|
-
if (chain
|
|
1146
|
+
// Shape-validate before touching disk. Base and Arc share the EVM key.
|
|
1147
|
+
if (chain !== 'solana') {
|
|
1147
1148
|
if (!/^0x[0-9a-fA-F]{64}$/.test(key)) {
|
|
1148
|
-
ctx.onEvent({ kind: 'text_delta', text:
|
|
1149
|
+
ctx.onEvent({ kind: 'text_delta', text: `Import error: ${CHAIN_LABELS[chain]} key must be 0x + 64 hex chars (66 total).\n` });
|
|
1149
1150
|
emitDone(ctx);
|
|
1150
1151
|
return { handled: true };
|
|
1151
1152
|
}
|
|
@@ -1175,7 +1176,7 @@ export async function handleSlashCommand(input, ctx) {
|
|
|
1175
1176
|
const { saveWallet } = await import('@blockrun/llm');
|
|
1176
1177
|
const account = privateKeyToAccount(key);
|
|
1177
1178
|
saveWallet(key);
|
|
1178
|
-
ctx.onEvent({ kind: 'text_delta', text: `**Wallet Imported (
|
|
1179
|
+
ctx.onEvent({ kind: 'text_delta', text: `**Wallet Imported (${CHAIN_LABELS[chain]})**\n` +
|
|
1179
1180
|
` Address: ${account.address}\n` +
|
|
1180
1181
|
` Saved to: ~/.blockrun/wallet.json\n\n` +
|
|
1181
1182
|
`⚠️ IMPORTANT: This session is still using the OLD wallet.\n` +
|
|
@@ -1209,11 +1210,12 @@ export async function handleSlashCommand(input, ctx) {
|
|
|
1209
1210
|
}
|
|
1210
1211
|
else {
|
|
1211
1212
|
const { getOrCreateWallet, setupAgentWallet } = await import('@blockrun/llm');
|
|
1213
|
+
const { readEvmBalance } = await import('../wallet/manager.js');
|
|
1212
1214
|
const w = getOrCreateWallet();
|
|
1213
1215
|
address = w.address;
|
|
1214
1216
|
try {
|
|
1215
1217
|
const client = setupAgentWallet({ silent: true });
|
|
1216
|
-
const bal = await Promise.race([client
|
|
1218
|
+
const bal = await Promise.race([readEvmBalance(chain, client), fetchTimeout(5000)]);
|
|
1217
1219
|
balance = `$${bal.toFixed(2)} USDC`;
|
|
1218
1220
|
}
|
|
1219
1221
|
catch {
|
package/dist/agent/context.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import fs from 'node:fs';
|
|
6
6
|
import path from 'node:path';
|
|
7
7
|
import { execSync } from 'node:child_process';
|
|
8
|
-
import { BLOCKRUN_DIR } from '../config.js';
|
|
8
|
+
import { API_URLS, BLOCKRUN_DIR, CHAIN_LABELS, CHAINS } from '../config.js';
|
|
9
9
|
import { getWalletAddress as getBaseWalletAddress } from '@blockrun/llm';
|
|
10
10
|
import { Keypair } from '@solana/web3.js';
|
|
11
11
|
import bs58 from 'bs58';
|
|
@@ -264,9 +264,9 @@ function getBlockRunApiSection() {
|
|
|
264
264
|
const chargedBy = mode.kind === 'key' ? 'account credits' : 'x402 wallet payment';
|
|
265
265
|
const hosts = mode.kind === 'key'
|
|
266
266
|
? `- **Your host: \`https://api.blockrun.ai\`** — the account API. Requests carry your configured key; the built-in tools attach it. It is a SEPARATE service, not an alias of the Base gateway.
|
|
267
|
-
- Not yours:
|
|
268
|
-
: `- **Your host: \`${mode.apiBase}\`** — the ${mode.chain
|
|
269
|
-
- Not yours:
|
|
267
|
+
- Not yours: ${CHAINS.map(c => `\`${API_URLS[c]}\` (${CHAIN_LABELS[c]} x402 wallet)`).join(', ')}. They ignore an account key and answer 402. Never send one there, and never attach a wallet payment proof to an account request.`
|
|
268
|
+
: `- **Your host: \`${mode.apiBase}\`** — the ${CHAIN_LABELS[mode.chain]} x402 wallet gateway. Paid calls answer 402 and the tools sign from your ${CHAIN_LABELS[mode.chain]} wallet.
|
|
269
|
+
- Not yours: ${CHAINS.filter(c => c !== mode.chain).map(c => `\`${API_URLS[c]}\` (the ${CHAIN_LABELS[c]} wallet gateway)`).join(', ')} and \`https://api.blockrun.ai\` (the account API, which needs a key and 401s without one — it is not an alias of any wallet host).`;
|
|
270
270
|
return `# BlockRun Gateway API (the network you live on)
|
|
271
271
|
You run on the BlockRun AI Gateway. When the user asks you to "test the BlockRun API", "check all endpoints", or call the gateway directly, use ONLY the paths below. **Never invent, pluralize, or singularize an endpoint** — \`/v1/image/generate\` (singular) is wrong, \`/v1/images/generations\` (plural) is correct. If a path you have in mind isn't in this list, fetch the canonical discovery endpoints before calling it.
|
|
272
272
|
|
|
@@ -742,7 +742,7 @@ function buildEnvironmentSection(workingDir) {
|
|
|
742
742
|
if (wallet.chain)
|
|
743
743
|
lines.push(`- Active chain: ${wallet.chain}`);
|
|
744
744
|
if (wallet.base)
|
|
745
|
-
lines.push(`-
|
|
745
|
+
lines.push(`- EVM wallet address (Base and Arc): ${wallet.base} (private key at ~/.blockrun/.session)`);
|
|
746
746
|
if (wallet.solana)
|
|
747
747
|
lines.push(`- Solana wallet address: ${wallet.solana} (private key at ~/.blockrun/.solana-session)`);
|
|
748
748
|
}
|
package/dist/agent/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Core types for the Franklin agent system.
|
|
3
3
|
* All type names and structures are original designs.
|
|
4
4
|
*/
|
|
5
|
+
import type { Chain } from '../config.js';
|
|
5
6
|
export type Role = 'user' | 'assistant';
|
|
6
7
|
export interface TextSegment {
|
|
7
8
|
type: 'text';
|
|
@@ -157,7 +158,7 @@ export type StreamEvent = StreamTextDelta | StreamThinkingDelta | StreamCapabili
|
|
|
157
158
|
export interface AgentConfig {
|
|
158
159
|
model: string;
|
|
159
160
|
apiUrl: string;
|
|
160
|
-
chain:
|
|
161
|
+
chain: Chain;
|
|
161
162
|
systemInstructions: string[];
|
|
162
163
|
capabilities: CapabilityHandler[];
|
|
163
164
|
maxTurns?: number;
|
package/dist/channel/slack.js
CHANGED
|
@@ -28,6 +28,7 @@ import { interactiveSession } from '../agent/loop.js';
|
|
|
28
28
|
import { ModelClient } from '../agent/llm.js';
|
|
29
29
|
import { extractBrainEntities } from '../brain/extract.js';
|
|
30
30
|
import { extractLearnings } from '../learnings/extractor.js';
|
|
31
|
+
import { readEvmBalance } from '../wallet/manager.js';
|
|
31
32
|
// Slack's hard per-message cap is ~40 KB, but readability tanks long before
|
|
32
33
|
// that. Keep chunks small so a long answer arrives as a few tidy messages.
|
|
33
34
|
const CHUNK_MAX = 3500;
|
|
@@ -174,10 +175,11 @@ export async function runSlackBot(agentConfig, opts) {
|
|
|
174
175
|
await postMessage(target, `Chain: solana\nWallet: ${addr}\nBalance: $${bal.toFixed(2)} USDC`);
|
|
175
176
|
}
|
|
176
177
|
else {
|
|
178
|
+
const chain = agentConfig.chain;
|
|
177
179
|
const c = setupAgentWallet({ silent: true });
|
|
178
180
|
const addr = c.getWalletAddress();
|
|
179
|
-
const bal = await c
|
|
180
|
-
await postMessage(target, `Chain:
|
|
181
|
+
const bal = await readEvmBalance(chain, c);
|
|
182
|
+
await postMessage(target, `Chain: ${chain}\nWallet: ${addr}\nBalance: $${bal.toFixed(2)} USDC`);
|
|
181
183
|
}
|
|
182
184
|
}
|
|
183
185
|
catch (err) {
|
package/dist/channel/telegram.js
CHANGED
|
@@ -23,6 +23,7 @@ import { interactiveSession } from '../agent/loop.js';
|
|
|
23
23
|
import { ModelClient } from '../agent/llm.js';
|
|
24
24
|
import { extractBrainEntities } from '../brain/extract.js';
|
|
25
25
|
import { extractLearnings } from '../learnings/extractor.js';
|
|
26
|
+
import { readEvmBalance } from '../wallet/manager.js';
|
|
26
27
|
// Per-bot prefs (persisted so a restart keeps the user's choice).
|
|
27
28
|
const PREFS_FILE = path.join(os.homedir(), '.blockrun', 'telegram-prefs.json');
|
|
28
29
|
function loadPrefs() {
|
|
@@ -201,10 +202,11 @@ export async function runTelegramBot(agentConfig, opts) {
|
|
|
201
202
|
await sendMessage(chatId, `Chain: solana\nWallet: ${addr}\nBalance: $${bal.toFixed(2)} USDC`);
|
|
202
203
|
}
|
|
203
204
|
else {
|
|
205
|
+
const chain = agentConfig.chain;
|
|
204
206
|
const c = setupAgentWallet({ silent: true });
|
|
205
207
|
const addr = c.getWalletAddress();
|
|
206
|
-
const bal = await c
|
|
207
|
-
await sendMessage(chatId, `Chain:
|
|
208
|
+
const bal = await readEvmBalance(chain, c);
|
|
209
|
+
await sendMessage(chatId, `Chain: ${chain}\nWallet: ${addr}\nBalance: $${bal.toFixed(2)} USDC`);
|
|
208
210
|
}
|
|
209
211
|
}
|
|
210
212
|
catch (err) {
|
package/dist/commands/balance.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import { setupAgentWallet, setupAgentSolanaWallet } from '@blockrun/llm';
|
|
3
|
-
import { loadChain, DASHBOARD_URL } from '../config.js';
|
|
3
|
+
import { loadChain, CHAIN_LABELS, DASHBOARD_URL } from '../config.js';
|
|
4
4
|
import { fetchCreditBalance, isKeyMode, loadApiKey, maskApiKey } from '../payments/auth-mode.js';
|
|
5
5
|
import { loadStats } from '../stats/tracker.js';
|
|
6
|
+
import { readEvmBalance } from '../wallet/manager.js';
|
|
6
7
|
export async function balanceCommand() {
|
|
7
8
|
const chain = loadChain();
|
|
8
9
|
// API-key mode settles against a prepaid credit balance. The gateway exposes
|
|
@@ -74,12 +75,12 @@ export async function balanceCommand() {
|
|
|
74
75
|
else {
|
|
75
76
|
const client = setupAgentWallet({ silent: true });
|
|
76
77
|
const address = client.getWalletAddress();
|
|
77
|
-
const balance = await client
|
|
78
|
-
console.log(`Chain: ${chalk.magenta(
|
|
78
|
+
const balance = await readEvmBalance(chain, client);
|
|
79
|
+
console.log(`Chain: ${chalk.magenta(chain)}`);
|
|
79
80
|
console.log(`Wallet: ${chalk.cyan(address)}`);
|
|
80
81
|
console.log(`USDC Balance: ${chalk.green(`$${balance.toFixed(2)}`)}`);
|
|
81
82
|
if (balance === 0) {
|
|
82
|
-
console.log(chalk.dim(`\nSend USDC on
|
|
83
|
+
console.log(chalk.dim(`\nSend USDC on ${CHAIN_LABELS[chain]} to ${address} to get started.`));
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
}
|
package/dist/commands/doctor.js
CHANGED
|
@@ -19,6 +19,7 @@ import { loadChain, VERSION, BLOCKRUN_DIR, DASHBOARD_URL, KEY_API_URL, USER_AGEN
|
|
|
19
19
|
import { gatewayBase, isKeyMode, loadApiKey, maskApiKey } from '../payments/auth-mode.js';
|
|
20
20
|
import { isTelemetryEnabled, readAllRecords } from '../telemetry/store.js';
|
|
21
21
|
import { getAvailableUpdateFresh, kickoffVersionCheck } from '../version-check.js';
|
|
22
|
+
import { readEvmBalance } from '../wallet/manager.js';
|
|
22
23
|
/** Free, auth-gated probe — proves the key works without spending credit. */
|
|
23
24
|
async function verifyKeyReachable() {
|
|
24
25
|
const key = loadApiKey();
|
|
@@ -106,7 +107,7 @@ async function runChecks() {
|
|
|
106
107
|
name: 'Chain',
|
|
107
108
|
status: 'fail',
|
|
108
109
|
detail: `failed to load — ${err.message}`,
|
|
109
|
-
remedy: 'Run: franklin setup
|
|
110
|
+
remedy: 'Run: franklin setup solana (or: franklin setup base / franklin setup arc)',
|
|
110
111
|
});
|
|
111
112
|
}
|
|
112
113
|
// ── 5. Wallet ─────────────────────────────────────────────────────
|
|
@@ -147,7 +148,7 @@ async function runChecks() {
|
|
|
147
148
|
else {
|
|
148
149
|
const client = setupAgentWallet({ silent: true });
|
|
149
150
|
walletAddress = client.getWalletAddress();
|
|
150
|
-
walletBalance = await client
|
|
151
|
+
walletBalance = await readEvmBalance(chain, client);
|
|
151
152
|
}
|
|
152
153
|
out.push({
|
|
153
154
|
name: 'Wallet',
|
package/dist/commands/proxy.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import chalk from 'chalk';
|
|
6
6
|
import { getOrCreateWallet, getOrCreateSolanaWallet } from '@blockrun/llm';
|
|
7
7
|
import { createProxy } from '../proxy/server.js';
|
|
8
|
-
import { loadChain, DEFAULT_PROXY_PORT } from '../config.js';
|
|
8
|
+
import { loadChain, CHAIN_LABELS, DEFAULT_PROXY_PORT } from '../config.js';
|
|
9
9
|
import { gatewayBase } from '../payments/auth-mode.js';
|
|
10
10
|
import { loadConfig } from './config.js';
|
|
11
11
|
import { printBanner } from '../banner.js';
|
|
@@ -53,12 +53,12 @@ export async function proxyCommand(options) {
|
|
|
53
53
|
if (wallet.isNew) {
|
|
54
54
|
console.log(chalk.yellow('No wallet found — created a new one.'));
|
|
55
55
|
console.log(`Address: ${chalk.cyan(wallet.address)}`);
|
|
56
|
-
console.log(`\nSend USDC on
|
|
56
|
+
console.log(`\nSend USDC on ${CHAIN_LABELS[chain]} to this address, then run ${chalk.bold('franklin proxy')} again.\n`);
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
printBanner(version);
|
|
60
60
|
console.log(`Mode: ${chalk.bold('proxy')}`);
|
|
61
|
-
console.log(`Chain: ${chalk.magenta(
|
|
61
|
+
console.log(`Chain: ${chalk.magenta(chain)}`);
|
|
62
62
|
console.log(`Wallet: ${chalk.cyan(wallet.address)}`);
|
|
63
63
|
if (model)
|
|
64
64
|
console.log(`Model: ${chalk.green(model)}`);
|
|
@@ -68,7 +68,7 @@ export async function proxyCommand(options) {
|
|
|
68
68
|
const server = createProxy({
|
|
69
69
|
port,
|
|
70
70
|
apiUrl,
|
|
71
|
-
chain
|
|
71
|
+
chain,
|
|
72
72
|
modelOverride: model,
|
|
73
73
|
debug: options.debug,
|
|
74
74
|
fallbackEnabled,
|
package/dist/commands/setup.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import { getOrCreateWallet, scanWallets, getOrCreateSolanaWallet, scanSolanaWallets, } from '@blockrun/llm';
|
|
3
|
-
import { saveChain, DASHBOARD_URL } from '../config.js';
|
|
3
|
+
import { CHAIN_LABELS, saveChain, DASHBOARD_URL } from '../config.js';
|
|
4
4
|
import { isKeyMode, loadApiKey, maskApiKey } from '../payments/auth-mode.js';
|
|
5
5
|
export async function setupCommand(chainArg) {
|
|
6
|
-
// Solana is the default chain; `franklin setup base`
|
|
7
|
-
|
|
6
|
+
// Solana is the default chain; `franklin setup base` / `franklin setup arc`
|
|
7
|
+
// opt into an EVM chain. Base and Arc share one EVM wallet.
|
|
8
|
+
const chain = chainArg === 'base' || chainArg === 'arc' ? chainArg : 'solana';
|
|
8
9
|
// A configured key already pays for everything, so creating a wallet here
|
|
9
10
|
// would be busywork the user did not ask for. Say so and stop, rather than
|
|
10
11
|
// silently making a second credential they will never fund.
|
|
@@ -45,7 +46,7 @@ export async function setupCommand(chainArg) {
|
|
|
45
46
|
console.log(chalk.dim(' franklin start — start coding'));
|
|
46
47
|
console.log(chalk.dim(' franklin balance — check USDC balance'));
|
|
47
48
|
console.log(chalk.dim(' franklin start -m free — use free models (no USDC needed)'));
|
|
48
|
-
saveChain(
|
|
49
|
+
saveChain(chain);
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
51
52
|
console.log('Creating new wallet...\n');
|
|
@@ -54,7 +55,7 @@ export async function setupCommand(chainArg) {
|
|
|
54
55
|
console.log(chalk.green('Wallet created!\n'));
|
|
55
56
|
}
|
|
56
57
|
console.log(`Address: ${chalk.cyan(address)}`);
|
|
57
|
-
console.log(`\nSend USDC on
|
|
58
|
+
console.log(`\nSend USDC on ${CHAIN_LABELS[chain]} to this address to fund your account.`);
|
|
58
59
|
}
|
|
59
60
|
saveChain(chain);
|
|
60
61
|
console.log(`Then run ${chalk.bold('franklin start')} to begin.\n`);
|
package/dist/commands/start.js
CHANGED
|
@@ -19,6 +19,7 @@ import { pickModel, resolveModel, resolveModelStrict } from '../ui/model-picker.
|
|
|
19
19
|
import { loadMcpConfig } from '../mcp/config.js';
|
|
20
20
|
import { connectMcpServers, disconnectMcpServers, getMcpServerInstructions } from '../mcp/client.js';
|
|
21
21
|
import { ensureCodegraphIndex } from '../mcp/codegraph.js';
|
|
22
|
+
import { readEvmBalance } from '../wallet/manager.js';
|
|
22
23
|
export async function startCommand(options) {
|
|
23
24
|
const version = options.version ?? '1.0.0';
|
|
24
25
|
// Early-validate explicit resume ID so a typo fails fast — before wallet
|
|
@@ -249,15 +250,16 @@ export async function startCommand(options) {
|
|
|
249
250
|
// zero result; genuinely empty wallets still resolve to $0.00 quickly.
|
|
250
251
|
const fetchBalance = async () => {
|
|
251
252
|
try {
|
|
253
|
+
const payChain = chain;
|
|
252
254
|
const bal = await retryFetchBalance(async () => {
|
|
253
|
-
if (
|
|
255
|
+
if (payChain === 'solana') {
|
|
254
256
|
const { setupAgentSolanaWallet } = await import('@blockrun/llm');
|
|
255
257
|
const client = await setupAgentSolanaWallet({ silent: true });
|
|
256
258
|
return client.getBalance();
|
|
257
259
|
}
|
|
258
260
|
const { setupAgentWallet } = await import('@blockrun/llm');
|
|
259
261
|
const client = setupAgentWallet({ silent: true });
|
|
260
|
-
return client
|
|
262
|
+
return readEvmBalance(payChain, client);
|
|
261
263
|
});
|
|
262
264
|
return `$${bal.toFixed(2)} USDC`;
|
|
263
265
|
}
|
package/dist/config.d.ts
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
export declare const VERSION: string;
|
|
2
2
|
export declare const USER_AGENT: string;
|
|
3
|
-
export type Chain = 'base' | 'solana';
|
|
3
|
+
export type Chain = 'base' | 'solana' | 'arc';
|
|
4
|
+
/**
|
|
5
|
+
* Every chain Franklin can pay on. Base and Arc are both EVM and share one
|
|
6
|
+
* wallet key (~/.blockrun/.session): the same address holds USDC on each, and
|
|
7
|
+
* the 402's `network` selects which chain's USDC domain gets signed. Solana has
|
|
8
|
+
* its own key.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CHAINS: readonly Chain[];
|
|
11
|
+
export declare function isChain(value: unknown): value is Chain;
|
|
12
|
+
/** True for the chains paid from the EVM wallet (Base, Arc). */
|
|
13
|
+
export declare function isEvmChain(chain: Chain): boolean;
|
|
14
|
+
/** Display name, for copy that names the chain a payment settles on. */
|
|
15
|
+
export declare const CHAIN_LABELS: Record<Chain, string>;
|
|
4
16
|
export declare const BLOCKRUN_DIR: string;
|
|
5
17
|
export declare const CHAIN_FILE: string;
|
|
6
18
|
export declare const API_URLS: Record<Chain, string>;
|
package/dist/config.js
CHANGED
|
@@ -12,11 +12,35 @@ catch { /* use default */ }
|
|
|
12
12
|
export const VERSION = _version;
|
|
13
13
|
// Shared User-Agent string for all outbound HTTP requests
|
|
14
14
|
export const USER_AGENT = `franklin/${_version} (node/${process.versions.node}; ${process.platform}; ${process.arch})`;
|
|
15
|
+
/**
|
|
16
|
+
* Every chain Franklin can pay on. Base and Arc are both EVM and share one
|
|
17
|
+
* wallet key (~/.blockrun/.session): the same address holds USDC on each, and
|
|
18
|
+
* the 402's `network` selects which chain's USDC domain gets signed. Solana has
|
|
19
|
+
* its own key.
|
|
20
|
+
*/
|
|
21
|
+
export const CHAINS = ['base', 'solana', 'arc'];
|
|
22
|
+
export function isChain(value) {
|
|
23
|
+
return typeof value === 'string' && CHAINS.includes(value);
|
|
24
|
+
}
|
|
25
|
+
/** True for the chains paid from the EVM wallet (Base, Arc). */
|
|
26
|
+
export function isEvmChain(chain) {
|
|
27
|
+
return chain !== 'solana';
|
|
28
|
+
}
|
|
29
|
+
/** Display name, for copy that names the chain a payment settles on. */
|
|
30
|
+
export const CHAIN_LABELS = {
|
|
31
|
+
base: 'Base',
|
|
32
|
+
solana: 'Solana',
|
|
33
|
+
arc: 'Arc',
|
|
34
|
+
};
|
|
15
35
|
export const BLOCKRUN_DIR = path.join(os.homedir(), '.blockrun');
|
|
16
36
|
export const CHAIN_FILE = path.join(BLOCKRUN_DIR, 'payment-chain');
|
|
17
37
|
export const API_URLS = {
|
|
18
38
|
base: 'https://blockrun.ai/api',
|
|
19
39
|
solana: 'https://sol.blockrun.ai/api',
|
|
40
|
+
// Circle's Arc (eip155:5042): the same gateway API as Base, settled through
|
|
41
|
+
// the Circle facilitator. Needs @blockrun/llm >= 3.16, which signs the 402's
|
|
42
|
+
// network rather than Base's USDC domain.
|
|
43
|
+
arc: 'https://arc.blockrun.ai/api',
|
|
20
44
|
};
|
|
21
45
|
export const DEFAULT_PROXY_PORT = 8402;
|
|
22
46
|
// BlockRun agent-market (the paid skill marketplace Franklin browses with
|
|
@@ -31,16 +55,12 @@ export function saveChain(chain) {
|
|
|
31
55
|
}
|
|
32
56
|
export function loadChain() {
|
|
33
57
|
const envChain = process.env.RUNCODE_CHAIN;
|
|
34
|
-
if (envChain
|
|
35
|
-
return
|
|
36
|
-
if (envChain === 'base')
|
|
37
|
-
return 'base';
|
|
58
|
+
if (isChain(envChain))
|
|
59
|
+
return envChain;
|
|
38
60
|
try {
|
|
39
61
|
const content = fs.readFileSync(CHAIN_FILE, 'utf-8').trim();
|
|
40
|
-
if (content
|
|
41
|
-
return
|
|
42
|
-
if (content === 'solana')
|
|
43
|
-
return 'solana';
|
|
62
|
+
if (isChain(content))
|
|
63
|
+
return content;
|
|
44
64
|
}
|
|
45
65
|
catch { /* no explicit choice on disk — fall through to the default */ }
|
|
46
66
|
// Default chain is Solana. Exception: a Base wallet with no Solana wallet
|
package/dist/index.js
CHANGED
|
@@ -48,13 +48,13 @@ program
|
|
|
48
48
|
.name('franklin')
|
|
49
49
|
.description('Franklin Agent — The AI agent with a wallet.\n\n' +
|
|
50
50
|
'While others chat, Franklin Agent spends — turning your USDC into real work.\n\n' +
|
|
51
|
-
'Pay per action — a USDC wallet on Solana or
|
|
51
|
+
'Pay per action — a USDC wallet on Solana, Base or Arc, or a prepaid API key\n' +
|
|
52
52
|
'from user.blockrun.ai. No subscriptions.')
|
|
53
53
|
.option('--wallet', 'Pay from the USDC wallet even when an API key is configured')
|
|
54
54
|
.version(version);
|
|
55
55
|
program
|
|
56
56
|
.command('setup [chain]')
|
|
57
|
-
.description('Create a new wallet for payments (solana or
|
|
57
|
+
.description('Create a new wallet for payments (solana, base or arc)')
|
|
58
58
|
.action((chain) => setupCommand(chain));
|
|
59
59
|
program
|
|
60
60
|
.command('start')
|
|
@@ -368,8 +368,8 @@ function parseStartFlags(argv, startIdx = 0) {
|
|
|
368
368
|
}
|
|
369
369
|
return opts;
|
|
370
370
|
}
|
|
371
|
-
// Handle chain shortcuts: `franklin solana` or `franklin
|
|
372
|
-
if (firstArg === 'solana' || firstArg === 'base') {
|
|
371
|
+
// Handle chain shortcuts: `franklin solana`, `franklin base` or `franklin arc`
|
|
372
|
+
if (firstArg === 'solana' || firstArg === 'base' || firstArg === 'arc') {
|
|
373
373
|
if (hasAnyFlag(args, HELP_FLAGS)) {
|
|
374
374
|
program.parse(['node', 'franklin', 'start', '--help']);
|
|
375
375
|
}
|
package/dist/model-catalog.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/** Shared model facts and policy; payment credentials stay in Franklin. */
|
|
2
|
-
import { type CatalogState
|
|
2
|
+
import { type CatalogState } from '@blockrun/model-catalog';
|
|
3
|
+
import { type Chain } from './config.js';
|
|
3
4
|
export declare function getModelCatalogIdentity(): string;
|
|
4
5
|
export declare function getModelCatalog(): CatalogState;
|
|
5
6
|
export declare function onModelCatalogChange(listener: (state: CatalogState) => void): () => void;
|
|
6
7
|
export declare function refreshModelCatalog(options?: {
|
|
7
|
-
network?:
|
|
8
|
+
network?: Chain;
|
|
8
9
|
force?: boolean;
|
|
9
10
|
}): Promise<CatalogState>;
|
|
10
11
|
export declare function clearModelCatalogCache(): void;
|
package/dist/model-catalog.js
CHANGED
|
@@ -4,8 +4,17 @@ import { API_URLS, loadChain, USER_AGENT } from './config.js';
|
|
|
4
4
|
import { gatewayHeaders, resolvePayMode } from './payments/auth-mode.js';
|
|
5
5
|
const clients = new Map();
|
|
6
6
|
const bundled = new Map();
|
|
7
|
+
/**
|
|
8
|
+
* Model Core's policy and bundled snapshot know Base and Solana. The Arc
|
|
9
|
+
* gateway is a fork of the Base gateway serving the same catalog, so Arc reads
|
|
10
|
+
* Base's policy and offline snapshot, while its live rows and prices come from
|
|
11
|
+
* arc.blockrun.ai itself (the gateway URL below), cached apart from Base's.
|
|
12
|
+
*/
|
|
13
|
+
function catalogNetwork(chain) {
|
|
14
|
+
return chain === 'arc' ? 'base' : chain;
|
|
15
|
+
}
|
|
7
16
|
function bundledState() {
|
|
8
|
-
const network =
|
|
17
|
+
const network = catalogNetwork(sessionChain ?? loadChain());
|
|
9
18
|
let state = bundled.get(network);
|
|
10
19
|
if (!state) {
|
|
11
20
|
state = createCatalogClient({ network }).current();
|
|
@@ -14,15 +23,16 @@ function bundledState() {
|
|
|
14
23
|
return state;
|
|
15
24
|
}
|
|
16
25
|
const listeners = new Set();
|
|
17
|
-
let
|
|
26
|
+
let sessionChain;
|
|
18
27
|
function activeClient() {
|
|
19
28
|
const mode = resolvePayMode();
|
|
20
|
-
const
|
|
21
|
-
const
|
|
29
|
+
const chain = sessionChain ?? loadChain();
|
|
30
|
+
const network = catalogNetwork(chain);
|
|
31
|
+
const gatewayUrl = `${mode.kind === 'key' ? mode.apiBase : API_URLS[chain]}/v1/models?format=json`;
|
|
22
32
|
const catalogUrl = process.env.BLOCKRUN_MODEL_CATALOG_URL
|
|
23
33
|
?? 'https://raw.githubusercontent.com/BlockRunAI/model-catalog/main/dist/snapshot.v1.json';
|
|
24
34
|
// Separate caches for each chain, endpoint and API account; keys never leave memory.
|
|
25
|
-
const identity = JSON.stringify([
|
|
35
|
+
const identity = JSON.stringify([chain, gatewayUrl, catalogUrl, mode.kind === 'key' ? mode.key : '']);
|
|
26
36
|
let client = clients.get(identity);
|
|
27
37
|
if (!client) {
|
|
28
38
|
const headers = { ...gatewayHeaders(mode), 'User-Agent': USER_AGENT };
|
|
@@ -43,7 +53,7 @@ export function getModelCatalogIdentity() {
|
|
|
43
53
|
return activeClient().identity;
|
|
44
54
|
}
|
|
45
55
|
catch {
|
|
46
|
-
return `unconfigured:${
|
|
56
|
+
return `unconfigured:${sessionChain ?? loadChain()}`;
|
|
47
57
|
}
|
|
48
58
|
}
|
|
49
59
|
export function getModelCatalog() {
|
|
@@ -62,7 +72,7 @@ export function onModelCatalogChange(listener) {
|
|
|
62
72
|
}
|
|
63
73
|
export async function refreshModelCatalog(options = {}) {
|
|
64
74
|
if (options.network)
|
|
65
|
-
|
|
75
|
+
sessionChain = options.network;
|
|
66
76
|
const { identity, client } = activeClient();
|
|
67
77
|
const state = process.env.FRANKLIN_CATALOG_OFFLINE === '1'
|
|
68
78
|
? client.current() : await client.refresh({ force: options.force });
|
|
@@ -73,5 +83,5 @@ export async function refreshModelCatalog(options = {}) {
|
|
|
73
83
|
}
|
|
74
84
|
export function clearModelCatalogCache() {
|
|
75
85
|
clients.clear();
|
|
76
|
-
|
|
86
|
+
sessionChain = undefined;
|
|
77
87
|
}
|
package/dist/onramp/client.js
CHANGED
|
@@ -25,6 +25,11 @@ import { postWithPayment } from '../payments/post-with-payment.js';
|
|
|
25
25
|
*/
|
|
26
26
|
export async function getOnrampUrl(address) {
|
|
27
27
|
const chain = loadChain();
|
|
28
|
+
// Coinbase Onramp cannot deliver to Arc, and the Arc gateway refuses any
|
|
29
|
+
// network but Base. Fail before the x402 handshake rather than after it.
|
|
30
|
+
if (chain === 'arc') {
|
|
31
|
+
throw new Error('Card purchase is not available on Arc. Send USDC on Arc (chain 5042) to this wallet, or switch to Base or Solana to buy with a card.');
|
|
32
|
+
}
|
|
28
33
|
const endpoint = `${gatewayBase()}/v1/onramp/token`;
|
|
29
34
|
const result = await postWithPayment(endpoint, { address, network: chain, asset: 'USDC' }, 'Mint a Coinbase Onramp session link to fund this wallet');
|
|
30
35
|
if (!result.ok) {
|
package/dist/panel/html.js
CHANGED
|
@@ -694,6 +694,7 @@ a:hover { text-decoration:underline; }
|
|
|
694
694
|
<div class="chain-switcher" role="tablist" aria-label="Payment chain">
|
|
695
695
|
<button type="button" data-chain="base" id="chain-btn-base" role="tab">Base</button>
|
|
696
696
|
<button type="button" data-chain="solana" id="chain-btn-solana" role="tab">Solana</button>
|
|
697
|
+
<button type="button" data-chain="arc" id="chain-btn-arc" role="tab">Arc</button>
|
|
697
698
|
</div>
|
|
698
699
|
<span class="chain-switcher-note" id="chain-switcher-note"></span>
|
|
699
700
|
|
|
@@ -735,7 +736,7 @@ a:hover { text-decoration:underline; }
|
|
|
735
736
|
<strong>This overwrites your existing wallet file.</strong>
|
|
736
737
|
Make sure the current key is backed up first, or you will lose access to any funds still on it.
|
|
737
738
|
</p>
|
|
738
|
-
<textarea id="wallet-import-input" class="wallet-import-input" placeholder="0x… (Base) or base58 key (Solana)"></textarea>
|
|
739
|
+
<textarea id="wallet-import-input" class="wallet-import-input" placeholder="0x… (Base / Arc) or base58 key (Solana)"></textarea>
|
|
739
740
|
<div class="wallet-actions">
|
|
740
741
|
<button class="btn btn-danger" id="wallet-import-btn">Import & replace</button>
|
|
741
742
|
<span class="wallet-import-status" id="wallet-import-status"></span>
|
|
@@ -1190,6 +1191,8 @@ async function loadLearnings() {
|
|
|
1190
1191
|
}).join('');
|
|
1191
1192
|
}
|
|
1192
1193
|
|
|
1194
|
+
// Payment-chain switcher buttons, in display order.
|
|
1195
|
+
const CHAIN_BUTTON_IDS = ['chain-btn-base', 'chain-btn-solana', 'chain-btn-arc'];
|
|
1193
1196
|
async function loadWallet() {
|
|
1194
1197
|
const w = await api('wallet');
|
|
1195
1198
|
if (!w) return;
|
|
@@ -1199,56 +1202,71 @@ async function loadWallet() {
|
|
|
1199
1202
|
document.getElementById('wallet-chain-pill').textContent = w.chain || '—';
|
|
1200
1203
|
|
|
1201
1204
|
// Chain switcher — highlight active button
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
solanaBtn.classList.toggle('active', w.chain === 'solana');
|
|
1207
|
-
}
|
|
1205
|
+
CHAIN_BUTTON_IDS.forEach((id) => {
|
|
1206
|
+
const b = document.getElementById(id);
|
|
1207
|
+
if (b) b.classList.toggle('active', b.getAttribute('data-chain') === w.chain);
|
|
1208
|
+
});
|
|
1208
1209
|
|
|
1209
|
-
// Coinbase Onramp
|
|
1210
|
-
// mints the link
|
|
1210
|
+
// Coinbase Onramp funds Base and Solana — the gateway of the active chain
|
|
1211
|
+
// mints the link. It cannot deliver to Arc (the Arc gateway refuses any
|
|
1212
|
+
// network but Base), so on Arc the card button is replaced by a hint.
|
|
1213
|
+
const onrampActions = document.getElementById('wallet-onramp-actions');
|
|
1214
|
+
const onrampHint = document.getElementById('wallet-onramp-hint');
|
|
1215
|
+
const onrampOk = w.chain !== 'arc';
|
|
1216
|
+
if (onrampActions) onrampActions.style.display = onrampOk ? 'flex' : 'none';
|
|
1217
|
+
if (onrampHint) onrampHint.textContent = onrampOk
|
|
1218
|
+
? 'Powered by Coinbase Onramp \u00b7 60+ fiat currencies'
|
|
1219
|
+
: 'Card purchase is not available on Arc \u2014 send USDC on Arc (chain 5042) to this address.';
|
|
1211
1220
|
|
|
1212
1221
|
// QR via server — never leak address to third parties.
|
|
1213
1222
|
// Encode chain + USDC token in the QR payload so wallet apps land
|
|
1214
1223
|
// directly on the right network/token instead of a bare address:
|
|
1215
1224
|
// Base → EIP-681: ethereum:<USDC>@8453/transfer?address=<addr>
|
|
1225
|
+
// Arc → EIP-681: ethereum:<USDC>@5042/transfer?address=<addr>
|
|
1216
1226
|
// Solana → Solana Pay: solana:<addr>?spl-token=<USDC mint>
|
|
1217
1227
|
const qrBox = document.getElementById('wallet-qr');
|
|
1218
1228
|
const hint = document.getElementById('wallet-qr-hint');
|
|
1219
1229
|
if (addr && addr !== 'not set') {
|
|
1220
1230
|
const USDC_BASE = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';
|
|
1231
|
+
const USDC_ARC = '0x3600000000000000000000000000000000000000';
|
|
1221
1232
|
const USDC_SOL_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
|
|
1222
1233
|
const payload = w.chain === 'solana'
|
|
1223
1234
|
? 'solana:' + addr + '?spl-token=' + USDC_SOL_MINT
|
|
1224
|
-
:
|
|
1235
|
+
: w.chain === 'arc'
|
|
1236
|
+
? 'ethereum:' + USDC_ARC + '@5042/transfer?address=' + addr
|
|
1237
|
+
: 'ethereum:' + USDC_BASE + '@8453/transfer?address=' + addr;
|
|
1225
1238
|
const svg = await fetch('/api/wallet/qr?data=' + encodeURIComponent(payload)).then(r => r.ok ? r.text() : null);
|
|
1226
1239
|
qrBox.innerHTML = svg || '';
|
|
1227
1240
|
hint.textContent = w.chain === 'solana'
|
|
1228
1241
|
? 'Scan with a Solana wallet (Phantom, Solflare) to send USDC SPL.'
|
|
1229
|
-
:
|
|
1242
|
+
: w.chain === 'arc'
|
|
1243
|
+
? 'Scan with an EVM wallet to send USDC on Arc (chain 5042). Same address as your Base wallet.'
|
|
1244
|
+
: 'Scan with an EVM wallet (MetaMask, Coinbase) to send USDC on Base.';
|
|
1230
1245
|
} else {
|
|
1231
1246
|
qrBox.innerHTML = '';
|
|
1232
1247
|
hint.textContent = 'No wallet set yet — run: franklin setup';
|
|
1233
1248
|
}
|
|
1234
1249
|
}
|
|
1235
1250
|
|
|
1236
|
-
// Chain switcher — click "Base" or "
|
|
1237
|
-
// Creates a wallet on the target chain if one does not exist yet
|
|
1238
|
-
// Note: a currently-running franklin agent reads
|
|
1239
|
-
// so a mid-session switch only affects the next
|
|
1240
|
-
|
|
1251
|
+
// Chain switcher — click "Base", "Solana" or "Arc" to flip payment chain.
|
|
1252
|
+
// Creates a wallet on the target chain if one does not exist yet (Base and
|
|
1253
|
+
// Arc share one EVM wallet). Note: a currently-running franklin agent reads
|
|
1254
|
+
// its chain at startup, so a mid-session switch only affects the next run.
|
|
1255
|
+
function setChainButtonsDisabled(disabled) {
|
|
1256
|
+
CHAIN_BUTTON_IDS.forEach((id) => {
|
|
1257
|
+
const b = document.getElementById(id);
|
|
1258
|
+
if (b) b.disabled = disabled;
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
CHAIN_BUTTON_IDS.forEach((id) => {
|
|
1241
1262
|
const btn = document.getElementById(id);
|
|
1242
1263
|
if (!btn) return;
|
|
1243
1264
|
btn.addEventListener('click', async () => {
|
|
1244
1265
|
const target = btn.getAttribute('data-chain');
|
|
1245
1266
|
const note = document.getElementById('chain-switcher-note');
|
|
1246
|
-
const baseBtn = document.getElementById('chain-btn-base');
|
|
1247
|
-
const solanaBtn = document.getElementById('chain-btn-solana');
|
|
1248
1267
|
// Skip if already active
|
|
1249
1268
|
if (btn.classList.contains('active')) return;
|
|
1250
|
-
|
|
1251
|
-
solanaBtn.disabled = true;
|
|
1269
|
+
setChainButtonsDisabled(true);
|
|
1252
1270
|
note.textContent = 'Switching to ' + target + '…';
|
|
1253
1271
|
// The onramp status (e.g. a popup-blocked Coinbase link) belongs to the
|
|
1254
1272
|
// previous chain's wallet — a stale link would fund the wrong chain.
|
|
@@ -1273,8 +1291,7 @@ async function loadWallet() {
|
|
|
1273
1291
|
} catch (err) {
|
|
1274
1292
|
note.textContent = 'Error: ' + (err && err.message ? err.message : 'network error');
|
|
1275
1293
|
} finally {
|
|
1276
|
-
|
|
1277
|
-
solanaBtn.disabled = false;
|
|
1294
|
+
setChainButtonsDisabled(false);
|
|
1278
1295
|
}
|
|
1279
1296
|
});
|
|
1280
1297
|
});
|
package/dist/panel/server.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import http from 'node:http';
|
|
7
7
|
import fs from 'node:fs';
|
|
8
8
|
import path from 'node:path';
|
|
9
|
-
import { loadChain, saveChain } from '../config.js';
|
|
9
|
+
import { loadChain, saveChain, isChain, CHAIN_LABELS } from '../config.js';
|
|
10
10
|
import { listNumbers as gatewayListNumbers, renewNumber as gatewayRenewNumber, buyNumber as gatewayBuyNumber, releaseNumber as gatewayReleaseNumber, } from '../phone/client.js';
|
|
11
11
|
import { readCache as readPhoneCache, writeCache as writePhoneCache, clearCache as clearPhoneCache, isFresh as isPhoneCacheFresh, } from '../phone/cache.js';
|
|
12
12
|
import { getStatsSummary, getStatsFilePath } from '../stats/tracker.js';
|
|
@@ -24,6 +24,7 @@ import { isTerminalTaskStatus } from '../tasks/types.js';
|
|
|
24
24
|
import { readLiveAgents } from '../session/live-registry.js';
|
|
25
25
|
import { BLOCKRUN_DIR } from '../config.js';
|
|
26
26
|
import { getHTML } from './html.js';
|
|
27
|
+
import { readEvmBalance } from '../wallet/manager.js';
|
|
27
28
|
const sseClients = new Set();
|
|
28
29
|
function json(res, data, status = 200) {
|
|
29
30
|
res.writeHead(status, {
|
|
@@ -103,7 +104,7 @@ function broadcast(data) {
|
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
106
|
/**
|
|
106
|
-
* Resolve the current active wallet address (Base or Solana, depending on
|
|
107
|
+
* Resolve the current active wallet address (EVM for Base/Arc, or Solana, depending on
|
|
107
108
|
* the active chain). Used by phone endpoints that key the cache by wallet,
|
|
108
109
|
* and that must sign x402 payments out of the wallet the user owns.
|
|
109
110
|
*
|
|
@@ -293,7 +294,7 @@ export function createPanelServer(port) {
|
|
|
293
294
|
const { setupAgentWallet } = await import('@blockrun/llm');
|
|
294
295
|
const client = setupAgentWallet({ silent: true });
|
|
295
296
|
address = client.getWalletAddress();
|
|
296
|
-
balance = await client
|
|
297
|
+
balance = await readEvmBalance(chain, client);
|
|
297
298
|
}
|
|
298
299
|
json(res, { address, balance, chain });
|
|
299
300
|
}
|
|
@@ -420,7 +421,7 @@ export function createPanelServer(port) {
|
|
|
420
421
|
// Base: 0x + 64 hex chars
|
|
421
422
|
const normalized = pk.startsWith('0x') ? pk : `0x${pk}`;
|
|
422
423
|
if (!/^0x[0-9a-fA-F]{64}$/.test(normalized)) {
|
|
423
|
-
json(res, { error:
|
|
424
|
+
json(res, { error: `invalid ${CHAIN_LABELS[chain]} private key — expected 0x + 64 hex chars` }, 400);
|
|
424
425
|
return;
|
|
425
426
|
}
|
|
426
427
|
saveWallet(normalized);
|
|
@@ -454,8 +455,8 @@ export function createPanelServer(port) {
|
|
|
454
455
|
const raw = await readBody(req);
|
|
455
456
|
const body = JSON.parse(raw);
|
|
456
457
|
const target = body.chain;
|
|
457
|
-
if (target
|
|
458
|
-
json(res, { error: 'chain must be "base" or "
|
|
458
|
+
if (!isChain(target)) {
|
|
459
|
+
json(res, { error: 'chain must be "base", "solana" or "arc"' }, 400);
|
|
459
460
|
return;
|
|
460
461
|
}
|
|
461
462
|
saveChain(target);
|
|
@@ -472,7 +473,7 @@ export function createPanelServer(port) {
|
|
|
472
473
|
const { setupAgentWallet } = await import('@blockrun/llm');
|
|
473
474
|
const client = setupAgentWallet({ silent: true });
|
|
474
475
|
address = client.getWalletAddress();
|
|
475
|
-
balance = await client
|
|
476
|
+
balance = await readEvmBalance(target, client);
|
|
476
477
|
}
|
|
477
478
|
json(res, { ok: true, chain: target, address, balance });
|
|
478
479
|
}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Franklin can reach the BlockRun gateway two ways:
|
|
5
5
|
*
|
|
6
|
-
* wallet — blockrun.ai/api (Base)
|
|
6
|
+
* wallet — blockrun.ai/api (Base), sol.blockrun.ai/api (Solana) or
|
|
7
|
+
* arc.blockrun.ai/api (Arc). Every
|
|
7
8
|
* paid call answers a 402 by signing USDC from the local wallet.
|
|
8
9
|
* key — api.blockrun.ai with `Authorization: Bearer brk_...`, settled
|
|
9
10
|
* against a prepaid credit balance. No chain involved.
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Franklin can reach the BlockRun gateway two ways:
|
|
5
5
|
*
|
|
6
|
-
* wallet — blockrun.ai/api (Base)
|
|
6
|
+
* wallet — blockrun.ai/api (Base), sol.blockrun.ai/api (Solana) or
|
|
7
|
+
* arc.blockrun.ai/api (Arc). Every
|
|
7
8
|
* paid call answers a 402 by signing USDC from the local wallet.
|
|
8
9
|
* key — api.blockrun.ai with `Authorization: Bearer brk_...`, settled
|
|
9
10
|
* against a prepaid credit balance. No chain involved.
|
package/dist/proxy/server.js
CHANGED
|
@@ -218,7 +218,8 @@ export function createProxy(options) {
|
|
|
218
218
|
const effectiveStreamTimeoutMs = options.streamTimeoutMs ?? getProxyStreamTimeoutMs();
|
|
219
219
|
let baseWallet = null;
|
|
220
220
|
let solanaWallet = null;
|
|
221
|
-
|
|
221
|
+
// Base and Arc both pay from the EVM wallet; the 402 names the network.
|
|
222
|
+
if (chain !== 'solana') {
|
|
222
223
|
const w = getOrCreateWallet();
|
|
223
224
|
baseWallet = { privateKey: w.privateKey, address: w.address };
|
|
224
225
|
}
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
import { type ApprovalRequest } from '../agent/approvals.js';
|
|
21
21
|
import { type AgentRunState } from '../events/types.js';
|
|
22
22
|
import type { AgentConfig, StreamEvent } from '../agent/types.js';
|
|
23
|
+
import type { Chain } from '../config.js';
|
|
23
24
|
export declare function resolveHostedMaxSpendUsd(requested: number | undefined, ceiling: number | undefined): number | undefined;
|
|
24
25
|
export interface DispatchOptions {
|
|
25
26
|
prompt: string;
|
|
@@ -43,7 +44,7 @@ export declare class AgentHost {
|
|
|
43
44
|
private agents;
|
|
44
45
|
constructor(opts: {
|
|
45
46
|
workDir: string;
|
|
46
|
-
chain:
|
|
47
|
+
chain: Chain;
|
|
47
48
|
apiUrl: string;
|
|
48
49
|
defaultModel: string;
|
|
49
50
|
debug?: boolean;
|
package/dist/serve/server.js
CHANGED
|
@@ -39,6 +39,7 @@ import { retryFetchBalance } from '../commands/balance-retry.js';
|
|
|
39
39
|
import { AgentHost } from './agent-host.js';
|
|
40
40
|
import { bus } from '../events/bus.js';
|
|
41
41
|
import { FREE_DEFAULT_MODEL } from '../free-models.js';
|
|
42
|
+
import { readEvmBalance } from '../wallet/manager.js';
|
|
42
43
|
// Curated Base (chainId 8453) tokens for the wallet "holdings" view. Plain RPC
|
|
43
44
|
// can't enumerate every token an address holds (no on-chain "list all"), so we
|
|
44
45
|
// balanceOf a known set and show the non-zero ones. `stable` → USD ≈ amount.
|
|
@@ -523,7 +524,9 @@ export async function startServer(opts) {
|
|
|
523
524
|
async function fetchBalanceUsd() {
|
|
524
525
|
try {
|
|
525
526
|
const client = await getWallet();
|
|
526
|
-
return await retryFetchBalance(() =>
|
|
527
|
+
return await retryFetchBalance(() => chain === 'solana'
|
|
528
|
+
? client.getBalance()
|
|
529
|
+
: readEvmBalance(chain, client));
|
|
527
530
|
}
|
|
528
531
|
catch {
|
|
529
532
|
return undefined;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Session persistence for Franklin.
|
|
3
3
|
* Saves conversation history as JSONL for resume capability.
|
|
4
4
|
*/
|
|
5
|
+
import { type Chain } from '../config.js';
|
|
5
6
|
import type { Dialogue } from '../agent/types.js';
|
|
6
7
|
export declare function setSessionPersistenceDisabled(disabled: boolean): void;
|
|
7
8
|
export declare function isSessionPersistenceDisabled(): boolean;
|
|
@@ -24,7 +25,7 @@ export interface SessionMeta {
|
|
|
24
25
|
* conversation context — switching chains mid-resume is a bug.
|
|
25
26
|
* Optional for back-compat with pre-3.15.35 sessions.
|
|
26
27
|
*/
|
|
27
|
-
chain?:
|
|
28
|
+
chain?: Chain;
|
|
28
29
|
inputTokens?: number;
|
|
29
30
|
outputTokens?: number;
|
|
30
31
|
costUsd?: number;
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import { Registry } from './registry.js';
|
|
25
25
|
import type { LoadError } from './types.js';
|
|
26
|
+
import { type Chain } from '../config.js';
|
|
26
27
|
export interface BundledLoad {
|
|
27
28
|
registry: Registry;
|
|
28
29
|
errors: LoadError[];
|
|
@@ -45,6 +46,6 @@ export declare function loadAllSkills(workDir: string): AllSkillsLoad;
|
|
|
45
46
|
export declare function ensureUserSkillsDir(): string;
|
|
46
47
|
export declare function ensureLearnedSkillsDir(): string;
|
|
47
48
|
export interface SkillVarSource {
|
|
48
|
-
chain?:
|
|
49
|
+
chain?: Chain;
|
|
49
50
|
}
|
|
50
51
|
export declare function getSkillVars(src: SkillVarSource): Record<string, string>;
|
package/dist/tools/moa.d.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* Inspired by the Mixture-of-Agents architecture from Together.ai research.
|
|
12
12
|
*/
|
|
13
13
|
import type { CapabilityHandler } from '../agent/types.js';
|
|
14
|
+
import type { Chain } from '../config.js';
|
|
14
15
|
export declare const moaCapability: CapabilityHandler;
|
|
15
16
|
/** Register the API URL for MoA tool (called during agent setup). */
|
|
16
|
-
export declare function registerMoAConfig(apiUrl: string, chain:
|
|
17
|
+
export declare function registerMoAConfig(apiUrl: string, chain: Chain, parentModel?: string): void;
|
package/dist/tools/modal.d.ts
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
* the SessionSandboxTracker registry.
|
|
27
27
|
*/
|
|
28
28
|
import type { CapabilityHandler } from '../agent/types.js';
|
|
29
|
+
import { type Chain } from '../config.js';
|
|
29
30
|
import { type ReservationToken } from '../wallet/reservation.js';
|
|
30
31
|
export interface SandboxRecord {
|
|
31
32
|
id: string;
|
|
@@ -43,7 +44,7 @@ declare class SessionSandboxTracker {
|
|
|
43
44
|
}
|
|
44
45
|
export declare const sessionSandboxTracker: SessionSandboxTracker;
|
|
45
46
|
export declare function _setPaymentSignerForTests(fn: typeof signPayment | null): void;
|
|
46
|
-
declare function signPayment(response: Response, chain:
|
|
47
|
+
declare function signPayment(response: Response, chain: Chain, endpoint: string, resourceDescription: string): Promise<Record<string, string> | null>;
|
|
47
48
|
/**
|
|
48
49
|
* Generic POST-with-x402-retry helper used by all four Modal endpoints. The
|
|
49
50
|
* first POST gets a 402 with payment requirements; we sign and retry once
|
package/dist/tools/subagent.d.ts
CHANGED
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
* SubAgent capability — spawn a child agent for independent tasks.
|
|
3
3
|
*/
|
|
4
4
|
import type { CapabilityHandler } from '../agent/types.js';
|
|
5
|
-
|
|
5
|
+
import type { Chain } from '../config.js';
|
|
6
|
+
export declare function createSubAgentCapability(apiUrl: string, chain: Chain, capabilities: CapabilityHandler[], parentModel?: string): CapabilityHandler;
|
package/dist/tools/wallet.d.ts
CHANGED
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
* Bash is still available for non-trivial wallet operations (sending,
|
|
13
13
|
* signing arbitrary tx) — Wallet is read-only by design.
|
|
14
14
|
*/
|
|
15
|
+
import { type Chain } from '../config.js';
|
|
15
16
|
import type { CapabilityHandler } from '../agent/types.js';
|
|
16
17
|
export interface WalletReportInput {
|
|
17
|
-
chain:
|
|
18
|
+
chain: Chain;
|
|
18
19
|
address: string;
|
|
19
20
|
balanceUsd: number;
|
|
20
21
|
}
|
package/dist/tools/wallet.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* signing arbitrary tx) — Wallet is read-only by design.
|
|
14
14
|
*/
|
|
15
15
|
import { loadChain } from '../config.js';
|
|
16
|
+
import { readEvmBalance } from '../wallet/manager.js';
|
|
16
17
|
/** Pure formatter — small, deterministic, easy to unit-test. */
|
|
17
18
|
export function formatWalletReport(input) {
|
|
18
19
|
return [
|
|
@@ -34,7 +35,7 @@ async function execute() {
|
|
|
34
35
|
const { setupAgentWallet } = await import('@blockrun/llm');
|
|
35
36
|
const c = setupAgentWallet({ silent: true });
|
|
36
37
|
const address = c.getWalletAddress();
|
|
37
|
-
const balance = await c
|
|
38
|
+
const balance = await readEvmBalance(chain, c);
|
|
38
39
|
return { output: formatWalletReport({ chain, address, balanceUsd: balance }) };
|
|
39
40
|
}
|
|
40
41
|
catch (err) {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* stocks endpoints (`/v1/stocks/{market}/price/{symbol}`) arrive in PR 2
|
|
14
14
|
* together with the x402 signing wrapper.
|
|
15
15
|
*/
|
|
16
|
-
import { USER_AGENT, loadChain } from '../../../config.js';
|
|
16
|
+
import { API_URLS, USER_AGENT, loadChain } from '../../../config.js';
|
|
17
17
|
import { gatewayHeaders, resolvePayMode, walletMayPay } from '../../../payments/auth-mode.js';
|
|
18
18
|
import { recordFetch } from '../telemetry.js';
|
|
19
19
|
import { getOrCreateWallet, getOrCreateSolanaWallet, createPaymentPayload, createSolanaPaymentPayload, parsePaymentRequired, extractPaymentDetails, solanaKeyToBytes, SOLANA_NETWORK, } from '@blockrun/llm';
|
|
@@ -31,7 +31,8 @@ function gatewayUrl(path) {
|
|
|
31
31
|
const mode = resolvePayMode();
|
|
32
32
|
if (mode.kind === 'key')
|
|
33
33
|
return mode.apiBase + path.replace(/^\/api/, '');
|
|
34
|
-
|
|
34
|
+
// Wallet hosts end in /api and `path` already carries it.
|
|
35
|
+
const origin = API_URLS[loadChain()].replace(/\/api$/, '');
|
|
35
36
|
return origin + path;
|
|
36
37
|
}
|
|
37
38
|
const cache = new Map();
|
package/dist/wallet/manager.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Chain } from '../config.js';
|
|
1
2
|
export declare function walletExists(): boolean;
|
|
2
3
|
export declare function setupWallet(): {
|
|
3
4
|
address: string;
|
|
@@ -8,3 +9,17 @@ export declare function setupSolanaWallet(): Promise<{
|
|
|
8
9
|
isNew: boolean;
|
|
9
10
|
}>;
|
|
10
11
|
export declare function getAddress(): string;
|
|
12
|
+
/**
|
|
13
|
+
* USDC balance of an EVM wallet on the given chain, in dollars.
|
|
14
|
+
*
|
|
15
|
+
* Base reads through the SDK. The SDK's reader is Base-only, so Arc asks the
|
|
16
|
+
* Arc gateway's free `/v1/balance`, which reads the USDC ERC-20 at 0x3600…0000
|
|
17
|
+
* (6 decimals) through BlockRun's own Arc RPC — public Arc proxies answer
|
|
18
|
+
* eth_chainId but fail eth_call. Like the Base reader this THROWS on failure
|
|
19
|
+
* rather than returning 0, so an unreachable endpoint never reads as an empty
|
|
20
|
+
* wallet.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readEvmBalance(chain: Exclude<Chain, 'solana'>, client: {
|
|
23
|
+
getWalletAddress(): string;
|
|
24
|
+
getBalance(): Promise<number>;
|
|
25
|
+
}): Promise<number>;
|
package/dist/wallet/manager.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getOrCreateWallet, scanWallets, getWalletAddress, getOrCreateSolanaWallet, scanSolanaWallets, } from '@blockrun/llm';
|
|
2
|
-
import { loadChain } from '../config.js';
|
|
2
|
+
import { API_URLS, USER_AGENT, loadChain } from '../config.js';
|
|
3
3
|
export function walletExists() {
|
|
4
4
|
const chain = loadChain();
|
|
5
5
|
if (chain === 'solana') {
|
|
@@ -21,3 +21,29 @@ export function getAddress() {
|
|
|
21
21
|
throw new Error('No wallet found. Run `franklin setup` first.');
|
|
22
22
|
return addr;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* USDC balance of an EVM wallet on the given chain, in dollars.
|
|
26
|
+
*
|
|
27
|
+
* Base reads through the SDK. The SDK's reader is Base-only, so Arc asks the
|
|
28
|
+
* Arc gateway's free `/v1/balance`, which reads the USDC ERC-20 at 0x3600…0000
|
|
29
|
+
* (6 decimals) through BlockRun's own Arc RPC — public Arc proxies answer
|
|
30
|
+
* eth_chainId but fail eth_call. Like the Base reader this THROWS on failure
|
|
31
|
+
* rather than returning 0, so an unreachable endpoint never reads as an empty
|
|
32
|
+
* wallet.
|
|
33
|
+
*/
|
|
34
|
+
export async function readEvmBalance(chain, client) {
|
|
35
|
+
if (chain !== 'arc')
|
|
36
|
+
return client.getBalance();
|
|
37
|
+
const address = client.getWalletAddress();
|
|
38
|
+
const res = await fetch(`${API_URLS.arc}/v1/balance?address=${encodeURIComponent(address)}`, {
|
|
39
|
+
headers: { 'User-Agent': USER_AGENT, Accept: 'application/json' },
|
|
40
|
+
signal: AbortSignal.timeout(10_000),
|
|
41
|
+
});
|
|
42
|
+
if (!res.ok)
|
|
43
|
+
throw new Error(`Arc balance read failed (HTTP ${res.status})`);
|
|
44
|
+
const body = (await res.json());
|
|
45
|
+
if (typeof body.balance !== 'string' || !/^\d+$/.test(body.balance)) {
|
|
46
|
+
throw new Error('Arc balance read returned no balance');
|
|
47
|
+
}
|
|
48
|
+
return Number(BigInt(body.balance)) / 1_000_000;
|
|
49
|
+
}
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
import { setupAgentWallet, setupAgentSolanaWallet } from '@blockrun/llm';
|
|
32
32
|
import { loadChain } from '../config.js';
|
|
33
33
|
import { fetchCreditBalance, isKeyMode } from '../payments/auth-mode.js';
|
|
34
|
+
import { readEvmBalance } from './manager.js';
|
|
34
35
|
const BALANCE_CACHE_MS = 5_000;
|
|
35
36
|
/**
|
|
36
37
|
* Settlement margin added on top of the caller-supplied request timeout for
|
|
@@ -86,12 +87,13 @@ async function readSpendableBalance() {
|
|
|
86
87
|
const credit = await fetchCreditBalance().catch(() => null);
|
|
87
88
|
return credit?.remainingUsd ?? Number.POSITIVE_INFINITY;
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
+
const chain = loadChain();
|
|
91
|
+
if (chain === 'solana') {
|
|
90
92
|
const client = await setupAgentSolanaWallet({ silent: true });
|
|
91
93
|
return readSolanaBalance(() => client.getBalance());
|
|
92
94
|
}
|
|
93
95
|
const client = setupAgentWallet({ silent: true });
|
|
94
|
-
return client
|
|
96
|
+
return readEvmBalance(chain, client);
|
|
95
97
|
}
|
|
96
98
|
class WalletReservationManager {
|
|
97
99
|
reserved = new Map();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockrun/franklin",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.49.0",
|
|
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": {
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"desktop:package:win": "npm run dist:win --workspace @blockrun/franklin-desktop",
|
|
39
39
|
"dev": "tsc --watch",
|
|
40
40
|
"start": "node dist/index.js",
|
|
41
|
-
"test": "npm run build && node --test --test-concurrency=4 --test-reporter=spec test/local.mjs test/api-key.local.mjs test/solana-migration.local.mjs test/serve-security.local.mjs test/skills.local.mjs test/repair.mjs test/model-resolver.mjs test/exa.local.mjs test/audit-batch.local.mjs test/polymarket.local.mjs test/market.local.mjs test/hooks.local.mjs test/scheduler.local.mjs test/trade-plan.local.mjs test/goal.local.mjs test/memory.local.mjs test/agent-host.local.mjs test/reservation.local.mjs test/model-catalog.local.mjs",
|
|
41
|
+
"test": "npm run build && node --test --test-concurrency=4 --test-reporter=spec test/local.mjs test/api-key.local.mjs test/solana-migration.local.mjs test/serve-security.local.mjs test/skills.local.mjs test/repair.mjs test/model-resolver.mjs test/exa.local.mjs test/audit-batch.local.mjs test/polymarket.local.mjs test/market.local.mjs test/hooks.local.mjs test/scheduler.local.mjs test/trade-plan.local.mjs test/goal.local.mjs test/memory.local.mjs test/agent-host.local.mjs test/reservation.local.mjs test/model-catalog.local.mjs test/arc.local.mjs",
|
|
42
42
|
"test:e2e": "npm run build && node --test --test-reporter=spec test/e2e.mjs",
|
|
43
43
|
"e2e:polymarket:readonly": "npm run build && node scripts/polymarket-e2e-readonly.mjs",
|
|
44
44
|
"test:free-models": "npm run build && node --test --test-reporter=spec test/free-model-matrix.mjs",
|
|
45
45
|
"test:all": "npm run test && npm run test:e2e",
|
|
46
46
|
"test:watch": "node --test --watch test/local.mjs test/skills.local.mjs test/exa.local.mjs test/audit-batch.local.mjs",
|
|
47
47
|
"test:e2e:watch": "node --test --watch test/e2e.mjs",
|
|
48
|
-
"test:catalog": "npm run build && node --test test/model-catalog.local.mjs"
|
|
48
|
+
"test:catalog": "npm run build && node --test test/model-catalog.local.mjs test/arc.local.mjs"
|
|
49
49
|
},
|
|
50
50
|
"keywords": [
|
|
51
51
|
"franklin",
|
|
@@ -75,7 +75,8 @@
|
|
|
75
75
|
"node": ">=20.19.0"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@blockrun/llm": "^3.
|
|
78
|
+
"@blockrun/llm": "^3.19.1",
|
|
79
|
+
"@blockrun/model-catalog": "https://codeload.github.com/BlockRunAI/model-catalog/tar.gz/465c45941fb8ea9d6858fe8402abc8ba8934be90",
|
|
79
80
|
"@blockrun/router-core": "https://codeload.github.com/BlockRunAI/router-core/tar.gz/d7bc10ce184b3daa40bcc115b523fd629d847a52",
|
|
80
81
|
"@colbymchenry/codegraph": "^1.5.0",
|
|
81
82
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
@@ -99,8 +100,7 @@
|
|
|
99
100
|
"react": "^19.2.4",
|
|
100
101
|
"sharp": "^0.35.3",
|
|
101
102
|
"viem": "^2.48.1",
|
|
102
|
-
"ws": "^8.21.1"
|
|
103
|
-
"@blockrun/model-catalog": "https://codeload.github.com/BlockRunAI/model-catalog/tar.gz/465c45941fb8ea9d6858fe8402abc8ba8934be90"
|
|
103
|
+
"ws": "^8.21.1"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
106
|
"@types/node": "^26.1.1",
|