chain-insights 0.37.2 → 0.40.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/README.md +25 -1
- package/bin/install.cjs +59 -2
- package/dist/{action-log-diTHyMbV.mjs → action-log-D49Par9P.mjs} +2 -2
- package/dist/{action-log-diTHyMbV.mjs.map → action-log-D49Par9P.mjs.map} +1 -1
- package/dist/{active-BQopLul8.mjs → active-Dkf8AB1R.mjs} +2 -2
- package/dist/{active-BQopLul8.mjs.map → active-Dkf8AB1R.mjs.map} +1 -1
- package/dist/apps/claude-view.html +117 -0
- package/dist/{capabilities-C8DQSfyW.mjs → capabilities-BOOUnAeV.mjs} +3 -3
- package/dist/{capabilities-C8DQSfyW.mjs.map → capabilities-BOOUnAeV.mjs.map} +1 -1
- package/dist/cli.cjs +26 -24
- package/dist/cli.mjs +49 -47
- package/dist/cli.mjs.map +1 -1
- package/dist/{client-CHYskPnG.mjs → client-gsLi528K.mjs} +4 -4
- package/dist/{client-CHYskPnG.mjs.map → client-gsLi528K.mjs.map} +1 -1
- package/dist/{config-DbbPiGk0.mjs → config-Br6VEK0O.mjs} +3 -3
- package/dist/{config-DbbPiGk0.mjs.map → config-Br6VEK0O.mjs.map} +1 -1
- package/dist/{config-B542AM4w.cjs → config-CPUhkz0Z.cjs} +1 -1
- package/dist/{create-C0buxEfU.mjs → create-CpfZq2fx.mjs} +2 -2
- package/dist/{create-C0buxEfU.mjs.map → create-CpfZq2fx.mjs.map} +1 -1
- package/dist/index.cjs +5 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +7 -6
- package/dist/mcp-proxy.cjs +459 -34
- package/dist/mcp-proxy.d.cts +7 -0
- package/dist/mcp-proxy.d.cts.map +1 -1
- package/dist/mcp-proxy.d.mts +7 -0
- package/dist/mcp-proxy.d.mts.map +1 -1
- package/dist/mcp-proxy.mjs +466 -44
- package/dist/mcp-proxy.mjs.map +1 -1
- package/dist/{public-tools-DWONw7kZ.cjs → public-tools-3yTC17cA.cjs} +1 -6
- package/dist/{public-tools-CDpFHbZ8.mjs → public-tools-CZyeptJQ.mjs} +3 -8
- package/dist/public-tools-CZyeptJQ.mjs.map +1 -0
- package/dist/{rolldown-runtime-D7D4PA-g.mjs → rolldown-runtime-8H4AJuhK.mjs} +1 -0
- package/dist/{schema-B0OuHW_l.mjs → schema-KjZqCHbu.mjs} +3 -3
- package/dist/schema-KjZqCHbu.mjs.map +1 -0
- package/dist/schema-cache-DJdU4MIP.mjs.map +1 -1
- package/dist/{schema-CtFWYoJz.cjs → schema-tX0U0-VI.cjs} +1 -1
- package/dist/{subscription-status-MyeqOmbA.mjs → subscription-status-CJ-DaMW9.mjs} +2 -2
- package/dist/{subscription-status-MyeqOmbA.mjs.map → subscription-status-CJ-DaMW9.mjs.map} +1 -1
- package/dist/{tool-visibility-CyZqYnQA.cjs → tool-visibility-Boxtlbtr.cjs} +19 -1
- package/dist/{tool-visibility-CJV9HezW.mjs → tool-visibility-IB5nHCZ_.mjs} +16 -4
- package/dist/tool-visibility-IB5nHCZ_.mjs.map +1 -0
- package/dist/{tools-BRQAPF2R.mjs → tools-BnThuvE2.mjs} +3 -3
- package/dist/{tools-BRQAPF2R.mjs.map → tools-BnThuvE2.mjs.map} +1 -1
- package/dist/topup-server-BIbSfvX5.cjs +146 -0
- package/dist/{topup-server-YN3iHrHW.cjs → topup-server-Bh7MlzRt.cjs} +485 -239
- package/dist/{topup-server-BLdF1SFQ.mjs → topup-server-BrkPhqJG.mjs} +488 -242
- package/dist/topup-server-BrkPhqJG.mjs.map +1 -0
- package/dist/topup-server-DzeM_YAt.mjs +131 -0
- package/dist/topup-server-DzeM_YAt.mjs.map +1 -0
- package/dist/{usage-status-CHiOPA-2.mjs → usage-status-CXOnrq-s.mjs} +2 -2
- package/dist/{usage-status-CHiOPA-2.mjs.map → usage-status-CXOnrq-s.mjs.map} +1 -1
- package/dist/{wallet-COcm4oIb.mjs → wallet-GNDl3FkR.mjs} +2 -2
- package/dist/{wallet-COcm4oIb.mjs.map → wallet-GNDl3FkR.mjs.map} +1 -1
- package/docs/graph-query-compatibility.md +27 -10
- package/docs/graph-tools.md +40 -16
- package/docs/mcp-proxy.md +39 -8
- package/docs/stability.md +2 -1
- package/package.json +5 -6
- package/skills/chain-insights-cypher/SKILL.md +56 -23
- package/skills/chain-insights-schema-evm/SKILL.md +38 -27
- package/dist/html-generator-BCDtYcGs.mjs +0 -16
- package/dist/html-generator-BCDtYcGs.mjs.map +0 -1
- package/dist/html-generator-DFwMRWN3.cjs +0 -16
- package/dist/public-tools-CDpFHbZ8.mjs.map +0 -1
- package/dist/schema-B0OuHW_l.mjs.map +0 -1
- package/dist/tool-visibility-CJV9HezW.mjs.map +0 -1
- package/dist/topup-server-BLdF1SFQ.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -145,9 +145,9 @@ const program = new Command();
|
|
|
145
145
|
function createCliCommand(name) {
|
|
146
146
|
return new Command(name).showHelpAfterError();
|
|
147
147
|
}
|
|
148
|
-
program.name("cia").description("AML investigation toolkit for blockchain analysis").version(PACKAGE_INFO.version).showHelpAfterError().option("--claude", "Install Claude Code skills globally to ~/.claude/skills/").option("--codex", "Install Codex skills globally to ~/.codex/skills/ and register MCP").option("--hermes", "Install Hermes skills globally to ~/.hermes/skills/chain-insights/ and register MCP");
|
|
148
|
+
program.name("cia").description("AML investigation toolkit for blockchain analysis").version(PACKAGE_INFO.version).showHelpAfterError().option("--claude", "Install Claude Code skills globally to ~/.claude/skills/").option("--claude-desktop", "Register the MCP proxy in Claude Desktop").option("--codex", "Install Codex skills globally to ~/.codex/skills/ and register MCP").option("--hermes", "Install Hermes skills globally to ~/.hermes/skills/chain-insights/ and register MCP");
|
|
149
149
|
const rawArgs = process.argv.slice(2);
|
|
150
|
-
const installerFlags = rawArgs.filter((a) => a === "--claude" || a === "--codex" || a === "--hermes");
|
|
150
|
+
const installerFlags = rawArgs.filter((a) => a === "--claude" || a === "--claude-desktop" || a === "--codex" || a === "--hermes");
|
|
151
151
|
function normalizeAmlToolVersionArgv(argv) {
|
|
152
152
|
const commandIndex = rawArgs.findIndex((arg, index) => arg === "aml-address-risk" && index === 1 && rawArgs[0] === "workflow");
|
|
153
153
|
if (commandIndex === -1) return argv;
|
|
@@ -182,9 +182,9 @@ function runInstaller(flag) {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
async function withGraphMcpClient(name, fn) {
|
|
185
|
-
const { loadConfig } = await import("./config-
|
|
185
|
+
const { loadConfig } = await import("./config-Br6VEK0O.mjs").then((n) => n.t);
|
|
186
186
|
const config = await loadConfig();
|
|
187
|
-
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await import("./client-
|
|
187
|
+
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await import("./client-gsLi528K.mjs").then((n) => n.r);
|
|
188
188
|
const { toGraphMcpEndpointError } = await import("./transport-error-CSEb6sPr.mjs");
|
|
189
189
|
const endpoint = resolveGraphMcpEndpoint(config);
|
|
190
190
|
const paymentFetch = await createConfiguredGraphMcpFetch(config);
|
|
@@ -199,7 +199,7 @@ async function withGraphMcpClient(name, fn) {
|
|
|
199
199
|
} catch (err) {
|
|
200
200
|
throw toGraphMcpEndpointError(err, endpoint);
|
|
201
201
|
}
|
|
202
|
-
const { installActionLogging } = await import("./action-log-
|
|
202
|
+
const { installActionLogging } = await import("./action-log-D49Par9P.mjs").then((n) => n.n);
|
|
203
203
|
installActionLogging(client);
|
|
204
204
|
try {
|
|
205
205
|
return await fn(client, config);
|
|
@@ -210,22 +210,22 @@ async function withGraphMcpClient(name, fn) {
|
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
async function printNetworkCapabilities(opts) {
|
|
213
|
-
const { loadConfig } = await import("./config-
|
|
214
|
-
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await import("./capabilities-
|
|
213
|
+
const { loadConfig } = await import("./config-Br6VEK0O.mjs").then((n) => n.t);
|
|
214
|
+
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await import("./capabilities-BOOUnAeV.mjs").then((n) => n.t);
|
|
215
215
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
216
216
|
if (opts.json) console.log(JSON.stringify(document, null, 2));
|
|
217
217
|
else console.log(formatNetworkCapabilities(document));
|
|
218
218
|
}
|
|
219
219
|
async function printNetworkOverview(opts) {
|
|
220
|
-
const { loadConfig } = await import("./config-
|
|
221
|
-
const { fetchNetworkCapabilities, formatNetworkOverview } = await import("./capabilities-
|
|
220
|
+
const { loadConfig } = await import("./config-Br6VEK0O.mjs").then((n) => n.t);
|
|
221
|
+
const { fetchNetworkCapabilities, formatNetworkOverview } = await import("./capabilities-BOOUnAeV.mjs").then((n) => n.t);
|
|
222
222
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
223
223
|
if (opts.json) console.log(JSON.stringify(document, null, 2));
|
|
224
224
|
else console.log(formatNetworkOverview(document));
|
|
225
225
|
}
|
|
226
226
|
async function printNetworkCapability(name, opts) {
|
|
227
|
-
const { loadConfig } = await import("./config-
|
|
228
|
-
const { fetchNetworkCapabilities, findNetworkCapability, formatNetworkCapability } = await import("./capabilities-
|
|
227
|
+
const { loadConfig } = await import("./config-Br6VEK0O.mjs").then((n) => n.t);
|
|
228
|
+
const { fetchNetworkCapabilities, findNetworkCapability, formatNetworkCapability } = await import("./capabilities-BOOUnAeV.mjs").then((n) => n.t);
|
|
229
229
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
230
230
|
const network = findNetworkCapability(document, name);
|
|
231
231
|
if (!network) {
|
|
@@ -245,14 +245,14 @@ async function printNetworkCapability(name, opts) {
|
|
|
245
245
|
*/
|
|
246
246
|
async function fetchSubscriptionStatusForCli() {
|
|
247
247
|
try {
|
|
248
|
-
const { getWalletAccount } = await import("./tools-
|
|
248
|
+
const { getWalletAccount } = await import("./tools-BnThuvE2.mjs").then((n) => n.p);
|
|
249
249
|
const account = await getWalletAccount();
|
|
250
250
|
return await withGraphMcpClient("chain-insights-cli-subscription-status", async (client) => {
|
|
251
251
|
const result = await client.callTool({
|
|
252
252
|
name: "subscription_status",
|
|
253
253
|
arguments: { wallet: account.address }
|
|
254
254
|
});
|
|
255
|
-
const { parseSubscriptionStatusToolResult } = await import("./subscription-status-
|
|
255
|
+
const { parseSubscriptionStatusToolResult } = await import("./subscription-status-CJ-DaMW9.mjs").then((n) => n.t);
|
|
256
256
|
const facts = parseSubscriptionStatusToolResult(result);
|
|
257
257
|
if (!facts) return {
|
|
258
258
|
kind: "unavailable",
|
|
@@ -271,7 +271,7 @@ async function fetchSubscriptionStatusForCli() {
|
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
async function printSubscriptionPassGuidance(pass) {
|
|
274
|
-
const { formatDepositGuardLine, formatDepositIrreversibilityWarning, formatSubscriptionPassHint, isDepositConfirmed, resolveSubscriptionMonthUsd } = await import("./subscription-status-
|
|
274
|
+
const { formatDepositGuardLine, formatDepositIrreversibilityWarning, formatSubscriptionPassHint, isDepositConfirmed, resolveSubscriptionMonthUsd } = await import("./subscription-status-CJ-DaMW9.mjs").then((n) => n.t);
|
|
275
275
|
const hint = formatSubscriptionPassHint(pass, resolveSubscriptionMonthUsd());
|
|
276
276
|
const status = await fetchSubscriptionStatusForCli();
|
|
277
277
|
if (status.kind === "available") {
|
|
@@ -299,11 +299,11 @@ async function printSubscriptionPassGuidance(pass) {
|
|
|
299
299
|
function addAmlAddressRiskCommand(parent, networksCommand) {
|
|
300
300
|
parent.addCommand(createCliCommand("aml-address-risk").description("CIA workflow: screen an address for AML risk, exchange behavior, and optional comparison with another address").requiredOption("--address <address>", "Full blockchain address to screen").requiredOption("--network <network>", `Network to query. Run \`${networksCommand}\` for supported networks.`).option("--compare-address <address>", "Optional second address to compare against the screened address").option("--json", "Print machine-readable JSON output").option("--version <version>", "AML tool contract version. Omit to use the latest version (currently v1)").addOption(new Option("--tool-version <version>", "Internal alias for the AML tool version").hideHelp()).action(async (opts) => {
|
|
301
301
|
try {
|
|
302
|
-
const { resolveAmlAddressRiskVersion } = await import("./public-tools-
|
|
302
|
+
const { resolveAmlAddressRiskVersion } = await import("./public-tools-CZyeptJQ.mjs");
|
|
303
303
|
const requestedVersion = opts.toolVersion ?? opts.version;
|
|
304
304
|
resolveAmlAddressRiskVersion(requestedVersion);
|
|
305
305
|
await withGraphMcpClient("chain-insights-cli-aml-address-risk", async (client) => {
|
|
306
|
-
const { runAmlAddressRisk } = await import("./public-tools-
|
|
306
|
+
const { runAmlAddressRisk } = await import("./public-tools-CZyeptJQ.mjs");
|
|
307
307
|
const result = await runAmlAddressRisk(client, {
|
|
308
308
|
address: opts.address,
|
|
309
309
|
network: opts.network,
|
|
@@ -342,7 +342,7 @@ program.command("workflows").description("List CIA workflow tools").option("--js
|
|
|
342
342
|
});
|
|
343
343
|
addAmlAddressRiskCommand(program.command("workflow").description("Run a high-level CIA workflow"), "cia networks");
|
|
344
344
|
program.command("status").description("Show toolkit status and configuration").action(async () => {
|
|
345
|
-
const { loadConfig } = await import("./config-
|
|
345
|
+
const { loadConfig } = await import("./config-Br6VEK0O.mjs").then((n) => n.t);
|
|
346
346
|
const config = await loadConfig();
|
|
347
347
|
const graphMcpStatus = config.graphMcpMode === "debug" && config.graphMcpAuthToken?.trim() ? "bearer access mode" : `${config.graphMcpMode} mode`;
|
|
348
348
|
console.log("Config: ", config.dataDir);
|
|
@@ -376,7 +376,7 @@ program.command("update").description("Check npmjs for a newer Chain Insights re
|
|
|
376
376
|
});
|
|
377
377
|
program.command("debug").description("Configure Chain Insights Graph debug mode").addCommand(createCliCommand("on").description("Enable Chain Insights Graph debug mode without x402 payments").requiredOption("--token <token>", "Debug bearer token").option("--endpoint <url>", "Chain Insights Graph endpoint").action(async (opts) => {
|
|
378
378
|
try {
|
|
379
|
-
const { saveConfig } = await import("./config-
|
|
379
|
+
const { saveConfig } = await import("./config-Br6VEK0O.mjs").then((n) => n.t);
|
|
380
380
|
await saveConfig({
|
|
381
381
|
graphMcpMode: "debug",
|
|
382
382
|
graphMcpAuthToken: opts.token,
|
|
@@ -391,7 +391,7 @@ program.command("debug").description("Configure Chain Insights Graph debug mode"
|
|
|
391
391
|
}
|
|
392
392
|
})).addCommand(createCliCommand("off").description("Disable Chain Insights Graph debug mode and use paid x402 calls").action(async () => {
|
|
393
393
|
try {
|
|
394
|
-
const { saveConfig } = await import("./config-
|
|
394
|
+
const { saveConfig } = await import("./config-Br6VEK0O.mjs").then((n) => n.t);
|
|
395
395
|
await saveConfig({
|
|
396
396
|
graphMcpMode: "paid",
|
|
397
397
|
graphMcpAuthToken: ""
|
|
@@ -404,7 +404,7 @@ program.command("debug").description("Configure Chain Insights Graph debug mode"
|
|
|
404
404
|
}
|
|
405
405
|
})).addCommand(createCliCommand("status").description("Show Chain Insights Graph payment/debug mode").action(async () => {
|
|
406
406
|
try {
|
|
407
|
-
const { loadConfig } = await import("./config-
|
|
407
|
+
const { loadConfig } = await import("./config-Br6VEK0O.mjs").then((n) => n.t);
|
|
408
408
|
const config = await loadConfig();
|
|
409
409
|
console.log(`Chain Insights Graph mode: ${config.graphMcpMode}`);
|
|
410
410
|
console.log(`Graph endpoint: ${config.graphMcpEndpoint}`);
|
|
@@ -419,7 +419,7 @@ program.command("access-key").description("Configure Chain Insights Graph test a
|
|
|
419
419
|
try {
|
|
420
420
|
const normalizedKey = key.trim();
|
|
421
421
|
if (!normalizedKey) throw new Error("Test access key is required");
|
|
422
|
-
const { saveConfig } = await import("./config-
|
|
422
|
+
const { saveConfig } = await import("./config-Br6VEK0O.mjs").then((n) => n.t);
|
|
423
423
|
await saveConfig({
|
|
424
424
|
graphMcpMode: "debug",
|
|
425
425
|
graphMcpAuthToken: normalizedKey,
|
|
@@ -434,7 +434,7 @@ program.command("access-key").description("Configure Chain Insights Graph test a
|
|
|
434
434
|
}
|
|
435
435
|
})).addCommand(createCliCommand("clear").description("Remove the Chain Insights Graph test access key and use paid x402 calls").action(async () => {
|
|
436
436
|
try {
|
|
437
|
-
const { saveConfig } = await import("./config-
|
|
437
|
+
const { saveConfig } = await import("./config-Br6VEK0O.mjs").then((n) => n.t);
|
|
438
438
|
await saveConfig({
|
|
439
439
|
graphMcpMode: "paid",
|
|
440
440
|
graphMcpAuthToken: ""
|
|
@@ -447,7 +447,7 @@ program.command("access-key").description("Configure Chain Insights Graph test a
|
|
|
447
447
|
}
|
|
448
448
|
})).addCommand(createCliCommand("status").description("Show Chain Insights Graph test access key status").action(async () => {
|
|
449
449
|
try {
|
|
450
|
-
const { loadConfig } = await import("./config-
|
|
450
|
+
const { loadConfig } = await import("./config-Br6VEK0O.mjs").then((n) => n.t);
|
|
451
451
|
const config = await loadConfig();
|
|
452
452
|
console.log(`Graph endpoint: ${config.graphMcpEndpoint}`);
|
|
453
453
|
console.log(`Access key: ${config.graphMcpAuthToken?.trim() ? "configured" : "not configured"}`);
|
|
@@ -459,14 +459,16 @@ program.command("access-key").description("Configure Chain Insights Graph test a
|
|
|
459
459
|
}));
|
|
460
460
|
program.command("setup").description("Configure external MCP clients").addCommand(createCliCommand("claude-code").alias("claude").description("Install Claude Code skills and register the MCP proxy").action(() => {
|
|
461
461
|
runInstaller("--claude");
|
|
462
|
+
})).addCommand(createCliCommand("claude-desktop").description("Register the MCP proxy in Claude Desktop, which draws the money-flow views").action(() => {
|
|
463
|
+
runInstaller("--claude-desktop");
|
|
462
464
|
})).addCommand(createCliCommand("codex").description("Install Codex skills and register the MCP proxy").action(() => {
|
|
463
465
|
runInstaller("--codex");
|
|
464
466
|
})).addCommand(createCliCommand("hermes").description("Install Hermes skills and register the MCP proxy").action(() => {
|
|
465
467
|
runInstaller("--hermes");
|
|
466
468
|
}));
|
|
467
469
|
program.command("config").description("Read or write configuration values").addCommand(createCliCommand("get").description("Read one Chain Insights configuration value").argument("<key>", "Config key to read").action(async (key) => {
|
|
468
|
-
const { loadConfig } = await import("./config-
|
|
469
|
-
const { CONFIG_KEYS } = await import("./schema-
|
|
470
|
+
const { loadConfig } = await import("./config-Br6VEK0O.mjs").then((n) => n.t);
|
|
471
|
+
const { CONFIG_KEYS } = await import("./schema-KjZqCHbu.mjs").then((n) => n.r);
|
|
470
472
|
if (!CONFIG_KEYS.includes(key)) {
|
|
471
473
|
console.error(`Unknown config key: ${key}`);
|
|
472
474
|
process.exit(1);
|
|
@@ -476,7 +478,7 @@ program.command("config").description("Read or write configuration values").addC
|
|
|
476
478
|
})).addCommand(createCliCommand("set").description("Write one Chain Insights configuration value").argument("<key>", "Config key to write").argument("<value>", "Value to set").action(async (key, value) => {
|
|
477
479
|
if (key === "walletPrivateKey") {
|
|
478
480
|
try {
|
|
479
|
-
const { setWalletPrivateKey } = await import("./wallet-
|
|
481
|
+
const { setWalletPrivateKey } = await import("./wallet-GNDl3FkR.mjs").then((n) => n.s);
|
|
480
482
|
const address = await setWalletPrivateKey(value);
|
|
481
483
|
console.log("Wallet private key encrypted and stored in ~/.chain-insights/wallet.json");
|
|
482
484
|
console.log(`Wallet address: ${address}`);
|
|
@@ -486,8 +488,8 @@ program.command("config").description("Read or write configuration values").addC
|
|
|
486
488
|
}
|
|
487
489
|
return;
|
|
488
490
|
}
|
|
489
|
-
const { loadConfig, saveConfig } = await import("./config-
|
|
490
|
-
const { CONFIG_KEYS, DEFAULT_CONFIG } = await import("./schema-
|
|
491
|
+
const { loadConfig, saveConfig } = await import("./config-Br6VEK0O.mjs").then((n) => n.t);
|
|
492
|
+
const { CONFIG_KEYS, DEFAULT_CONFIG } = await import("./schema-KjZqCHbu.mjs").then((n) => n.r);
|
|
491
493
|
const current = await loadConfig();
|
|
492
494
|
if (!CONFIG_KEYS.includes(key)) {
|
|
493
495
|
console.error(`Unknown config key: ${key}`);
|
|
@@ -502,9 +504,9 @@ program.command("config").description("Read or write configuration values").addC
|
|
|
502
504
|
}));
|
|
503
505
|
program.command("wallet").description("Manage the local Base USDC payment wallet").addCommand(createCliCommand("create").description("Generate a new local Base payment wallet").action(async () => {
|
|
504
506
|
try {
|
|
505
|
-
const { isWalletConfigured, setWalletPrivateKey, walletPath } = await import("./wallet-
|
|
507
|
+
const { isWalletConfigured, setWalletPrivateKey, walletPath } = await import("./wallet-GNDl3FkR.mjs").then((n) => n.s);
|
|
506
508
|
const { createInterface } = await import("node:readline/promises");
|
|
507
|
-
const { formatWalletBackupWarning, generateWalletPrivateKey, isWalletBackupConfirmed } = await import("./create-
|
|
509
|
+
const { formatWalletBackupWarning, generateWalletPrivateKey, isWalletBackupConfirmed } = await import("./create-CpfZq2fx.mjs").then((n) => n.t);
|
|
508
510
|
if (await isWalletConfigured()) throw new Error("A payment wallet already exists. Run `cia wallet address` to view it or use `cia wallet import <private-key> --force` to replace it.");
|
|
509
511
|
const privateKey = generateWalletPrivateKey();
|
|
510
512
|
const color = process.stderr.isTTY === true && process.env["NO_COLOR"] === void 0;
|
|
@@ -531,7 +533,7 @@ program.command("wallet").description("Manage the local Base USDC payment wallet
|
|
|
531
533
|
}
|
|
532
534
|
})).addCommand(createCliCommand("import").description("Import a Base payment wallet").argument("<private-key>", "0x-prefixed EVM private key").option("--force", "Replace an existing wallet (the previous key is backed up next to wallet.json)").action(async (privateKey, opts) => {
|
|
533
535
|
try {
|
|
534
|
-
const { setWalletPrivateKey, isWalletConfigured } = await import("./wallet-
|
|
536
|
+
const { setWalletPrivateKey, isWalletConfigured } = await import("./wallet-GNDl3FkR.mjs").then((n) => n.s);
|
|
535
537
|
const replacing = opts.force === true && await isWalletConfigured();
|
|
536
538
|
const address = await setWalletPrivateKey(privateKey, { force: opts.force });
|
|
537
539
|
if (replacing) console.log("Previous wallet key backed up next to ~/.chain-insights/wallet.json");
|
|
@@ -545,7 +547,7 @@ program.command("wallet").description("Manage the local Base USDC payment wallet
|
|
|
545
547
|
}
|
|
546
548
|
})).addCommand(createCliCommand("address").description("Print the local payment wallet address").action(async () => {
|
|
547
549
|
try {
|
|
548
|
-
const { getWalletAccount } = await import("./tools-
|
|
550
|
+
const { getWalletAccount } = await import("./tools-BnThuvE2.mjs").then((n) => n.p);
|
|
549
551
|
const account = await getWalletAccount();
|
|
550
552
|
console.log(account.address);
|
|
551
553
|
} catch (err) {
|
|
@@ -554,7 +556,7 @@ program.command("wallet").description("Manage the local Base USDC payment wallet
|
|
|
554
556
|
}
|
|
555
557
|
})).addCommand(createCliCommand("balance").description("Show the local payment wallet Base USDC balance").action(async () => {
|
|
556
558
|
try {
|
|
557
|
-
const { getWalletBalanceText } = await import("./tools-
|
|
559
|
+
const { getWalletBalanceText } = await import("./tools-BnThuvE2.mjs").then((n) => n.p);
|
|
558
560
|
console.log(await getWalletBalanceText());
|
|
559
561
|
} catch (err) {
|
|
560
562
|
console.error(err.message);
|
|
@@ -562,7 +564,7 @@ program.command("wallet").description("Manage the local Base USDC payment wallet
|
|
|
562
564
|
}
|
|
563
565
|
})).addCommand(createCliCommand("ready").description("Check and prepare the wallet for paid Chain Insights Graph calls").option("--check-only", "Only check readiness; do not submit the one-time payment setup").addOption(new Option("--no-approve", "Deprecated alias for --check-only").hideHelp()).option("--payment-usdc <amount>", "USDC setup cap to prepare for paid calls", "1").addOption(new Option("--approval-usdc <amount>", "Deprecated alias for --payment-usdc").hideHelp()).option("--json", "Print machine-readable readiness metadata").action(async (opts) => {
|
|
564
566
|
try {
|
|
565
|
-
const { formatWalletReadiness, parsePaymentApprovalUnits, prepareWalletForPaidCalls } = await import("./tools-
|
|
567
|
+
const { formatWalletReadiness, parsePaymentApprovalUnits, prepareWalletForPaidCalls } = await import("./tools-BnThuvE2.mjs").then((n) => n.p);
|
|
566
568
|
const result = await prepareWalletForPaidCalls({
|
|
567
569
|
minimumApprovalUnits: parsePaymentApprovalUnits(opts.paymentUsdc ?? opts.approvalUsdc ?? "1"),
|
|
568
570
|
approve: opts.checkOnly ? false : opts.approve !== false
|
|
@@ -578,8 +580,8 @@ program.command("wallet").description("Manage the local Base USDC payment wallet
|
|
|
578
580
|
}
|
|
579
581
|
})).addCommand(createCliCommand("topup").description("Open a local browser page to top up the payment wallet").option("--no-open", "Print the top-up URL without opening a browser").option("--json", "Print machine-readable top-up metadata").action(async (opts) => {
|
|
580
582
|
try {
|
|
581
|
-
const { buildTopupInfo, getWalletAccount } = await import("./tools-
|
|
582
|
-
const { startTopupServer } = await import("./topup-server-
|
|
583
|
+
const { buildTopupInfo, getWalletAccount } = await import("./tools-BnThuvE2.mjs").then((n) => n.p);
|
|
584
|
+
const { startTopupServer } = await import("./topup-server-DzeM_YAt.mjs").then((n) => n.r);
|
|
583
585
|
const account = await getWalletAccount();
|
|
584
586
|
const url = await startTopupServer(account);
|
|
585
587
|
const info = buildTopupInfo(account.address, url);
|
|
@@ -626,9 +628,9 @@ program.command("mcp").description("Low-level access to the Chain Insights MCP e
|
|
|
626
628
|
try {
|
|
627
629
|
const { loadSchema, saveSchema } = await import("./schema-cache-DJdU4MIP.mjs");
|
|
628
630
|
const { formatToolsTable } = await import("./format-DB2IH2U5.mjs");
|
|
629
|
-
const { visibleRemoteTools } = await import("./tool-visibility-
|
|
630
|
-
const { loadConfig } = await import("./config-
|
|
631
|
-
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await import("./client-
|
|
631
|
+
const { visibleRemoteTools } = await import("./tool-visibility-IB5nHCZ_.mjs").then((n) => n.a);
|
|
632
|
+
const { loadConfig } = await import("./config-Br6VEK0O.mjs").then((n) => n.t);
|
|
633
|
+
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await import("./client-gsLi528K.mjs").then((n) => n.r);
|
|
632
634
|
const config = await loadConfig();
|
|
633
635
|
const graphMcpEndpoint = resolveGraphMcpEndpoint(config);
|
|
634
636
|
let tools = opts.refresh ? null : await loadSchema(graphMcpEndpoint);
|
|
@@ -656,13 +658,13 @@ program.command("mcp").description("Low-level access to the Chain Insights MCP e
|
|
|
656
658
|
})).addCommand(createCliCommand("call").description("Call a low-level MCP tool directly (advanced)").option("--json", "Print machine-readable JSON output").argument("<tool>", "Tool name to call").argument("[args...]", "Key=value arguments (e.g. address=0x1234... network=robinhood)").action(async (tool, rawArgs, opts) => {
|
|
657
659
|
try {
|
|
658
660
|
const { parseMcpCallArgs } = await import("./call-args-ysbB_xdA.mjs");
|
|
659
|
-
const { assertPublicMcpToolName, validatePublicMcpToolArguments } = await import("./tool-visibility-
|
|
661
|
+
const { assertPublicMcpToolName, validatePublicMcpToolArguments } = await import("./tool-visibility-IB5nHCZ_.mjs").then((n) => n.a);
|
|
660
662
|
const args = parseMcpCallArgs(rawArgs);
|
|
661
663
|
assertPublicMcpToolName(tool);
|
|
662
664
|
if (tool === "aml_address_risk") throw new Error("aml_address_risk is a CIA workflow. Run `cia workflow aml-address-risk` instead.");
|
|
663
665
|
validatePublicMcpToolArguments(tool, args);
|
|
664
666
|
if (tool === "wallet_balance") {
|
|
665
|
-
const { getWalletBalanceText } = await import("./tools-
|
|
667
|
+
const { getWalletBalanceText } = await import("./tools-BnThuvE2.mjs").then((n) => n.p);
|
|
666
668
|
console.log(await getWalletBalanceText());
|
|
667
669
|
return;
|
|
668
670
|
}
|
|
@@ -685,16 +687,16 @@ program.command("mcp").description("Low-level access to the Chain Insights MCP e
|
|
|
685
687
|
json: opts.json
|
|
686
688
|
});
|
|
687
689
|
} catch (err) {
|
|
688
|
-
const { isMissingUsageStatusToolError, primitiveBackendUsageStatus, usageStatusText } = await import("./usage-status-
|
|
690
|
+
const { isMissingUsageStatusToolError, primitiveBackendUsageStatus, usageStatusText } = await import("./usage-status-CXOnrq-s.mjs").then((n) => n.n);
|
|
689
691
|
if (!isMissingUsageStatusToolError(err)) throw err;
|
|
690
|
-
const { resolveGraphMcpEndpoint } = await import("./client-
|
|
692
|
+
const { resolveGraphMcpEndpoint } = await import("./client-gsLi528K.mjs").then((n) => n.r);
|
|
691
693
|
console.log(usageStatusText(primitiveBackendUsageStatus(resolveGraphMcpEndpoint(config))));
|
|
692
694
|
}
|
|
693
695
|
return;
|
|
694
696
|
}
|
|
695
697
|
if (tool === "meta_subscription_status") {
|
|
696
698
|
try {
|
|
697
|
-
const { getWalletAccount } = await import("./tools-
|
|
699
|
+
const { getWalletAccount } = await import("./tools-BnThuvE2.mjs").then((n) => n.p);
|
|
698
700
|
const account = await getWalletAccount();
|
|
699
701
|
printMcpTextContent(await client.callTool({
|
|
700
702
|
name: "subscription_status",
|
|
@@ -704,9 +706,9 @@ program.command("mcp").description("Low-level access to the Chain Insights MCP e
|
|
|
704
706
|
json: opts.json
|
|
705
707
|
});
|
|
706
708
|
} catch (err) {
|
|
707
|
-
const { isMissingSubscriptionStatusToolError, unavailableSubscriptionStatus, subscriptionStatusText } = await import("./subscription-status-
|
|
709
|
+
const { isMissingSubscriptionStatusToolError, unavailableSubscriptionStatus, subscriptionStatusText } = await import("./subscription-status-CJ-DaMW9.mjs").then((n) => n.t);
|
|
708
710
|
if (!isMissingSubscriptionStatusToolError(err)) throw err;
|
|
709
|
-
const { resolveGraphMcpEndpoint } = await import("./client-
|
|
711
|
+
const { resolveGraphMcpEndpoint } = await import("./client-gsLi528K.mjs").then((n) => n.r);
|
|
710
712
|
console.log(subscriptionStatusText(unavailableSubscriptionStatus(resolveGraphMcpEndpoint(config), `subscription_status failed: ${err.message}`)));
|
|
711
713
|
}
|
|
712
714
|
return;
|
|
@@ -725,7 +727,7 @@ program.command("mcp").description("Low-level access to the Chain Insights MCP e
|
|
|
725
727
|
});
|
|
726
728
|
});
|
|
727
729
|
} catch (err) {
|
|
728
|
-
const { formatMcpCallError } = await import("./tool-visibility-
|
|
730
|
+
const { formatMcpCallError } = await import("./tool-visibility-IB5nHCZ_.mjs").then((n) => n.a);
|
|
729
731
|
console.error(formatMcpCallError(tool, err));
|
|
730
732
|
process.exit(1);
|
|
731
733
|
}
|