chain-insights 0.2.16
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/LICENSE +21 -0
- package/README.md +165 -0
- package/bin/cli.js +10 -0
- package/bin/install.cjs +252 -0
- package/bin/mcp-proxy.cjs +10 -0
- package/dist/active-BSrxLKwn.mjs +50 -0
- package/dist/active-BSrxLKwn.mjs.map +1 -0
- package/dist/active-Dv7Tu-O4.cjs +68 -0
- package/dist/app-BjjuQM0B.mjs +155 -0
- package/dist/app-BjjuQM0B.mjs.map +1 -0
- package/dist/app-Dq1TdB6p.cjs +161 -0
- package/dist/artifact-server-DoxJ7fCx.cjs +47 -0
- package/dist/artifact-server-Dxz5YbuQ.mjs +48 -0
- package/dist/artifact-server-Dxz5YbuQ.mjs.map +1 -0
- package/dist/assets/bg-pattern.png +0 -0
- package/dist/assets/logo.png +0 -0
- package/dist/call-args-DQA2QcRA.cjs +27 -0
- package/dist/call-args-Lk_wOJxd.mjs +29 -0
- package/dist/call-args-Lk_wOJxd.mjs.map +1 -0
- package/dist/capabilities-CB97WMA5.cjs +83 -0
- package/dist/capabilities-DliMBim-.mjs +84 -0
- package/dist/capabilities-DliMBim-.mjs.map +1 -0
- package/dist/cases-By7INiOa.mjs +6 -0
- package/dist/cases-CDcNU91B.cjs +9 -0
- package/dist/chunk-CZWwpsFl.cjs +43 -0
- package/dist/cli.cjs +752 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +753 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/client-D4Bq0rp9.mjs +111 -0
- package/dist/client-D4Bq0rp9.mjs.map +1 -0
- package/dist/client-D4fZgIaO.cjs +132 -0
- package/dist/config-Bmdl5hdk.cjs +67 -0
- package/dist/config-BwrBYmiC.mjs +44 -0
- package/dist/config-BwrBYmiC.mjs.map +1 -0
- package/dist/data-extractor-BNGj7ECT.cjs +347 -0
- package/dist/data-extractor-DFzsa5CS.mjs +336 -0
- package/dist/data-extractor-DFzsa5CS.mjs.map +1 -0
- package/dist/dossier-BsroDgD3.mjs +76 -0
- package/dist/dossier-BsroDgD3.mjs.map +1 -0
- package/dist/dossier-DtxREpPm.cjs +76 -0
- package/dist/evidence-BGcdKxuV.cjs +200 -0
- package/dist/evidence-BhvFW-y_.mjs +195 -0
- package/dist/evidence-BhvFW-y_.mjs.map +1 -0
- package/dist/format-Ce1RObVl.mjs +22 -0
- package/dist/format-Ce1RObVl.mjs.map +1 -0
- package/dist/format-DOrPvXEr.cjs +20 -0
- package/dist/frontmatter-D8wWCeOa.mjs +26 -0
- package/dist/frontmatter-D8wWCeOa.mjs.map +1 -0
- package/dist/frontmatter-DgAuai7E.cjs +35 -0
- package/dist/graph-normalizer-Cv9yK9Pg.mjs +130 -0
- package/dist/graph-normalizer-Cv9yK9Pg.mjs.map +1 -0
- package/dist/graph-normalizer-DeIj6Ses.cjs +133 -0
- package/dist/graph-reports-C4TBjCkM.mjs +63 -0
- package/dist/graph-reports-C4TBjCkM.mjs.map +1 -0
- package/dist/graph-reports-DU05YCei.cjs +64 -0
- package/dist/html-generator-CAv81IWH.cjs +85 -0
- package/dist/html-generator-V6Bp0uRb.mjs +68 -0
- package/dist/html-generator-V6Bp0uRb.mjs.map +1 -0
- package/dist/index.cjs +31 -0
- package/dist/index.d.cts +187 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +187 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +9 -0
- package/dist/init-BjuFt54X.cjs +232 -0
- package/dist/init-CaOsHTIo.mjs +232 -0
- package/dist/init-CaOsHTIo.mjs.map +1 -0
- package/dist/mcp-proxy.cjs +1257 -0
- package/dist/mcp-proxy.d.cts +12 -0
- package/dist/mcp-proxy.d.cts.map +1 -0
- package/dist/mcp-proxy.d.mts +12 -0
- package/dist/mcp-proxy.d.mts.map +1 -0
- package/dist/mcp-proxy.mjs +1255 -0
- package/dist/mcp-proxy.mjs.map +1 -0
- package/dist/output-root-CFYms3ad.cjs +43 -0
- package/dist/output-root-CmWM7aV2.mjs +33 -0
- package/dist/output-root-CmWM7aV2.mjs.map +1 -0
- package/dist/parser-BUIWW1OH.cjs +182 -0
- package/dist/parser-DO0_SssG.mjs +182 -0
- package/dist/parser-DO0_SssG.mjs.map +1 -0
- package/dist/public-tools-D4UI-Zb0.mjs +2554 -0
- package/dist/public-tools-D4UI-Zb0.mjs.map +1 -0
- package/dist/public-tools-XSpkz2ky.cjs +2556 -0
- package/dist/resolver-C2ZS7oC8.mjs +201 -0
- package/dist/resolver-C2ZS7oC8.mjs.map +1 -0
- package/dist/resolver-zYbu4wDV.cjs +203 -0
- package/dist/rolldown-runtime-wcPFST8Q.mjs +13 -0
- package/dist/runner-1Eq55OYb.cjs +148 -0
- package/dist/runner-BhUHbiHG.mjs +149 -0
- package/dist/runner-BhUHbiHG.mjs.map +1 -0
- package/dist/schema-4XpzDFQM.cjs +55 -0
- package/dist/schema-8d0rVIdZ.mjs +37 -0
- package/dist/schema-8d0rVIdZ.mjs.map +1 -0
- package/dist/schema-cache-9CksD7tX.mjs +34 -0
- package/dist/schema-cache-9CksD7tX.mjs.map +1 -0
- package/dist/schema-cache-CgWRCN2N.cjs +36 -0
- package/dist/selector-CkFcTXzz.cjs +10 -0
- package/dist/selector-xjm6NTHI.mjs +12 -0
- package/dist/selector-xjm6NTHI.mjs.map +1 -0
- package/dist/server-BkM5xrXb.mjs +45 -0
- package/dist/server-BkM5xrXb.mjs.map +1 -0
- package/dist/server-DXowbpfi.cjs +54 -0
- package/dist/session-BpNylyuJ.cjs +115 -0
- package/dist/session-CcTgYxsj.mjs +115 -0
- package/dist/session-CcTgYxsj.mjs.map +1 -0
- package/dist/setup-DOpKPrlx.cjs +81 -0
- package/dist/setup-DyrWHuwQ.mjs +80 -0
- package/dist/setup-DyrWHuwQ.mjs.map +1 -0
- package/dist/store-BiUhQOIf.cjs +230 -0
- package/dist/store-BoWE-Gtl.mjs +225 -0
- package/dist/store-BoWE-Gtl.mjs.map +1 -0
- package/dist/templates/graph.html +1406 -0
- package/dist/tool-visibility-3Z_KvO9Q.mjs +28 -0
- package/dist/tool-visibility-3Z_KvO9Q.mjs.map +1 -0
- package/dist/tool-visibility-CwgY205r.cjs +36 -0
- package/dist/tools-Cp2jAAAb.mjs +100 -0
- package/dist/tools-Cp2jAAAb.mjs.map +1 -0
- package/dist/tools-f_vJUZAF.cjs +139 -0
- package/dist/topup-server-BZuQifvh.cjs +940 -0
- package/dist/topup-server-DUjyFftI.mjs +919 -0
- package/dist/topup-server-DUjyFftI.mjs.map +1 -0
- package/dist/version-1gP19Lhi.mjs +8 -0
- package/dist/version-1gP19Lhi.mjs.map +1 -0
- package/dist/version-BNGtdpmH.cjs +18 -0
- package/dist/viz-BlCJe6Tk.mjs +35 -0
- package/dist/viz-BlCJe6Tk.mjs.map +1 -0
- package/dist/viz-ClezVXrJ.cjs +44 -0
- package/dist/wallet-BMelXBYP.mjs +104 -0
- package/dist/wallet-BMelXBYP.mjs.map +1 -0
- package/dist/wallet-RnvvSpV2.cjs +146 -0
- package/docs/architecture.md +145 -0
- package/docs/contributing.md +68 -0
- package/docs/debugging.md +68 -0
- package/docs/development.md +44 -0
- package/docs/graph-tools.md +251 -0
- package/docs/images/graph-mcp-iframe.png +0 -0
- package/docs/images/graph-visualization.png +0 -0
- package/docs/images/topup-page.png +0 -0
- package/docs/investigation-workspaces.md +151 -0
- package/docs/mcp-proxy.md +180 -0
- package/package.json +59 -0
- package/skills/chain-insights-developer-experience/SKILL.md +101 -0
- package/skills/chain-insights-investigation/SKILL.md +285 -0
- package/skills/chain-insights-investigation/agents/openai.yaml +4 -0
- package/skills/chain-insights-investigation/scripts/run-target-uat.sh +197 -0
- package/skills/chain-insights-trace-funds/SKILL.md +249 -0
- package/skills/ci-case/SKILL.md +43 -0
- package/skills/ci-status/SKILL.md +45 -0
- package/skills/test-chain-insights-graphrag-mcp/SKILL.md +75 -0
- package/skills/test-chain-insights-graphrag-mcp/agents/openai.yaml +4 -0
- package/skills/test-chain-insights-graphrag-mcp/scripts/run-uat.sh +414 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-wcPFST8Q.mjs";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { readFileSync } from "node:fs";
|
|
5
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
6
|
+
import os from "node:os";
|
|
7
|
+
//#region src/viz/html-generator.ts
|
|
8
|
+
var html_generator_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
generateHtml: () => generateHtml,
|
|
10
|
+
generateInlineGraphHtml: () => generateInlineGraphHtml,
|
|
11
|
+
transformToGraphHtml: () => transformToGraphHtml,
|
|
12
|
+
writeVizHtml: () => writeVizHtml
|
|
13
|
+
});
|
|
14
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
15
|
+
const template = readFileSync(path.resolve(__dirname, "templates", "graph.html"), "utf-8");
|
|
16
|
+
const ENTITY_TO_ROLE = {
|
|
17
|
+
eoa: "search",
|
|
18
|
+
contract: "intermediary",
|
|
19
|
+
exchange: "exchange",
|
|
20
|
+
mixer: "intermediary",
|
|
21
|
+
unknown: null
|
|
22
|
+
};
|
|
23
|
+
function transformToGraphHtml(data) {
|
|
24
|
+
return {
|
|
25
|
+
nodes: data.nodes.map((n) => ({
|
|
26
|
+
address: n.id,
|
|
27
|
+
address_type: n.entityType === "exchange" ? "exchange" : "wallet",
|
|
28
|
+
labels: n.label ? [n.label] : [],
|
|
29
|
+
flow_in_usd: n.totalIn,
|
|
30
|
+
flow_out_usd: n.totalOut,
|
|
31
|
+
role: ENTITY_TO_ROLE[n.entityType] ?? null,
|
|
32
|
+
risk_level: n.riskLevel === "unknown" ? null : n.riskLevel,
|
|
33
|
+
pattern_flags: []
|
|
34
|
+
})),
|
|
35
|
+
edges: data.edges.map((e) => ({
|
|
36
|
+
source: e.source,
|
|
37
|
+
target: e.target,
|
|
38
|
+
usd_amount: e.value,
|
|
39
|
+
tx_count: 1,
|
|
40
|
+
edge_type: "flows_to"
|
|
41
|
+
})),
|
|
42
|
+
metadata: { title: data.metadata.title }
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function generateHtml(data, _title) {
|
|
46
|
+
return generateInlineGraphHtml(transformToGraphHtml(data));
|
|
47
|
+
}
|
|
48
|
+
function generateInlineGraphHtml(data) {
|
|
49
|
+
const inlineScript = `<script>var INLINE_DATA = ${JSON.stringify(data).replaceAll("<\/script>", "<\\/script>")};<\/script>`;
|
|
50
|
+
return template.replace("</body>", `${inlineScript}\n</body>`);
|
|
51
|
+
}
|
|
52
|
+
function sanitizePathSegment(segment) {
|
|
53
|
+
if (/[/\\]|^\.\.?$/.test(segment)) throw new Error(`Invalid path segment: ${segment}`);
|
|
54
|
+
return segment;
|
|
55
|
+
}
|
|
56
|
+
async function writeVizHtml(vizId, html, caseId) {
|
|
57
|
+
let vizDir;
|
|
58
|
+
if (caseId) vizDir = path.join(os.homedir(), ".chain-insights", "cases", sanitizePathSegment(caseId), "viz");
|
|
59
|
+
else vizDir = path.join(os.homedir(), ".chain-insights", "viz");
|
|
60
|
+
await mkdir(vizDir, { recursive: true });
|
|
61
|
+
const filePath = path.join(vizDir, `${vizId}.html`);
|
|
62
|
+
await writeFile(filePath, html, { mode: 384 });
|
|
63
|
+
return filePath;
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { html_generator_exports as n, writeVizHtml as r, generateHtml as t };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=html-generator-V6Bp0uRb.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-generator-V6Bp0uRb.mjs","names":[],"sources":["../src/viz/html-generator.ts"],"sourcesContent":["import { readFileSync } from 'node:fs'\nimport { writeFile, mkdir } from 'node:fs/promises'\nimport { fileURLToPath } from 'node:url'\nimport path from 'node:path'\nimport os from 'node:os'\nimport type { GraphData } from './graph-model.js'\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url))\nconst templatePath = path.resolve(__dirname, 'templates', 'graph.html')\nconst template = readFileSync(templatePath, 'utf-8')\n\ninterface GraphHtmlNode {\n address: string\n address_type: string\n labels: string[]\n flow_in_usd: number\n flow_out_usd: number\n role: string | null\n risk_level: string | null\n pattern_flags: string[]\n}\n\ninterface GraphHtmlEdge {\n source: string\n target: string\n usd_amount: number\n tx_count: number\n edge_type: string\n}\n\ninterface GraphHtmlData {\n nodes: GraphHtmlNode[]\n edges: GraphHtmlEdge[]\n metadata?: { seed_address?: string; title?: string }\n}\n\nconst ENTITY_TO_ROLE: Record<string, string | null> = {\n eoa: 'search',\n contract: 'intermediary',\n exchange: 'exchange',\n mixer: 'intermediary',\n unknown: null,\n}\n\nexport function transformToGraphHtml(data: GraphData): GraphHtmlData {\n const nodes: GraphHtmlNode[] = data.nodes.map((n) => ({\n address: n.id,\n address_type: n.entityType === 'exchange' ? 'exchange' : 'wallet',\n labels: n.label ? [n.label] : [],\n flow_in_usd: n.totalIn,\n flow_out_usd: n.totalOut,\n role: ENTITY_TO_ROLE[n.entityType] ?? null,\n risk_level: n.riskLevel === 'unknown' ? null : n.riskLevel,\n pattern_flags: [],\n }))\n\n const edges: GraphHtmlEdge[] = data.edges.map((e) => ({\n source: e.source,\n target: e.target,\n usd_amount: e.value,\n tx_count: 1,\n edge_type: 'flows_to',\n }))\n\n return {\n nodes,\n edges,\n metadata: {\n title: data.metadata.title,\n },\n }\n}\n\nexport function generateHtml(data: GraphData, _title: string): string {\n const graphHtmlData = transformToGraphHtml(data)\n return generateInlineGraphHtml(graphHtmlData)\n}\n\nexport function generateInlineGraphHtml(data: unknown): string {\n const dataJson = JSON.stringify(data).replaceAll('</script>', '<\\\\/script>')\n const inlineScript = `<script>var INLINE_DATA = ${dataJson};</script>`\n\n return template.replace('</body>', `${inlineScript}\\n</body>`)\n}\n\nfunction sanitizePathSegment(segment: string): string {\n if (/[/\\\\]|^\\.\\.?$/.test(segment)) throw new Error(`Invalid path segment: ${segment}`)\n return segment\n}\n\nexport async function writeVizHtml(vizId: string, html: string, caseId?: string): Promise<string> {\n let vizDir: string\n if (caseId) {\n vizDir = path.join(os.homedir(), '.chain-insights', 'cases', sanitizePathSegment(caseId), 'viz')\n } else {\n vizDir = path.join(os.homedir(), '.chain-insights', 'viz')\n }\n await mkdir(vizDir, { recursive: true })\n const filePath = path.join(vizDir, `${vizId}.html`)\n await writeFile(filePath, html, { mode: 0o600 })\n return filePath\n}\n"],"mappings":";;;;;;;;;;;;;AAOA,MAAM,YAAY,KAAK,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AAE9D,MAAM,WAAW,aADI,KAAK,QAAQ,WAAW,aAAa,aAChB,EAAE,QAAQ;AA2BpD,MAAM,iBAAgD;CACpD,KAAK;CACL,UAAU;CACV,UAAU;CACV,OAAO;CACP,SAAS;CACV;AAED,SAAgB,qBAAqB,MAAgC;AAoBnE,QAAO;EACL,OApB6B,KAAK,MAAM,KAAK,OAAO;GACpD,SAAS,EAAE;GACX,cAAc,EAAE,eAAe,aAAa,aAAa;GACzD,QAAQ,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,EAAE;GAChC,aAAa,EAAE;GACf,cAAc,EAAE;GAChB,MAAM,eAAe,EAAE,eAAe;GACtC,YAAY,EAAE,cAAc,YAAY,OAAO,EAAE;GACjD,eAAe,EAAE;GAClB,EAWM;EACL,OAV6B,KAAK,MAAM,KAAK,OAAO;GACpD,QAAQ,EAAE;GACV,QAAQ,EAAE;GACV,YAAY,EAAE;GACd,UAAU;GACV,WAAW;GACZ,EAIM;EACL,UAAU,EACR,OAAO,KAAK,SAAS,OACtB;EACF;;AAGH,SAAgB,aAAa,MAAiB,QAAwB;AAEpE,QAAO,wBADe,qBAAqB,KACC,CAAC;;AAG/C,SAAgB,wBAAwB,MAAuB;CAE7D,MAAM,eAAe,6BADJ,KAAK,UAAU,KAAK,CAAC,WAAW,cAAa,cACJ,CAAC;AAE3D,QAAO,SAAS,QAAQ,WAAW,GAAG,aAAa,WAAW;;AAGhE,SAAS,oBAAoB,SAAyB;AACpD,KAAI,gBAAgB,KAAK,QAAQ,CAAE,OAAM,IAAI,MAAM,yBAAyB,UAAU;AACtF,QAAO;;AAGT,eAAsB,aAAa,OAAe,MAAc,QAAkC;CAChG,IAAI;AACJ,KAAI,OACF,UAAS,KAAK,KAAK,GAAG,SAAS,EAAE,mBAAmB,SAAS,oBAAoB,OAAO,EAAE,MAAM;KAEhG,UAAS,KAAK,KAAK,GAAG,SAAS,EAAE,mBAAmB,MAAM;AAE5D,OAAM,MAAM,QAAQ,EAAE,WAAW,MAAM,CAAC;CACxC,MAAM,WAAW,KAAK,KAAK,QAAQ,GAAG,MAAM,OAAO;AACnD,OAAM,UAAU,UAAU,MAAM,EAAE,MAAM,KAAO,CAAC;AAChD,QAAO"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_config = require("./config-Bmdl5hdk.cjs");
|
|
3
|
+
const require_app = require("./app-Dq1TdB6p.cjs");
|
|
4
|
+
const require_server = require("./server-DXowbpfi.cjs");
|
|
5
|
+
const require_wallet = require("./wallet-RnvvSpV2.cjs");
|
|
6
|
+
const require_tools = require("./tools-f_vJUZAF.cjs");
|
|
7
|
+
const require_topup_server = require("./topup-server-BZuQifvh.cjs");
|
|
8
|
+
const require_client = require("./client-D4fZgIaO.cjs");
|
|
9
|
+
const require_viz = require("./viz-ClezVXrJ.cjs");
|
|
10
|
+
exports.buildTopupInfo = require_tools.buildTopupInfo;
|
|
11
|
+
exports.createApp = require_app.createApp;
|
|
12
|
+
exports.createMcpFetchClient = require_client.createMcpFetchClient;
|
|
13
|
+
exports.decryptKey = require_wallet.decryptKey;
|
|
14
|
+
exports.encryptKey = require_wallet.encryptKey;
|
|
15
|
+
exports.formatWalletBalance = require_tools.formatWalletBalance;
|
|
16
|
+
exports.generateArtifactHtml = require_topup_server.generateArtifactHtml;
|
|
17
|
+
exports.generateVisualization = require_viz.generateVisualization;
|
|
18
|
+
exports.getBalanceEth = require_tools.getBalanceEth;
|
|
19
|
+
exports.getBalanceUsdc = require_tools.getBalanceUsdc;
|
|
20
|
+
exports.getTopupUrl = require_topup_server.getTopupUrl;
|
|
21
|
+
exports.getWalletAccount = require_tools.getWalletAccount;
|
|
22
|
+
exports.getWalletBalanceText = require_tools.getWalletBalanceText;
|
|
23
|
+
exports.isWalletConfigured = require_wallet.isWalletConfigured;
|
|
24
|
+
exports.loadConfig = require_config.loadConfig;
|
|
25
|
+
exports.normalizeWalletPrivateKey = require_wallet.normalizeWalletPrivateKey;
|
|
26
|
+
exports.resetConfigCache = require_config.resetConfigCache;
|
|
27
|
+
exports.saveConfig = require_config.saveConfig;
|
|
28
|
+
exports.setWalletPrivateKey = require_wallet.setWalletPrivateKey;
|
|
29
|
+
exports.startServer = require_server.startServer;
|
|
30
|
+
exports.startTopupServer = require_topup_server.startTopupServer;
|
|
31
|
+
exports.walletAddressFromPrivateKey = require_wallet.walletAddressFromPrivateKey;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { Hono } from "hono";
|
|
3
|
+
import { Address, Hex } from "viem";
|
|
4
|
+
|
|
5
|
+
//#region src/config/schema.d.ts
|
|
6
|
+
declare const ConfigSchema: z.ZodObject<{
|
|
7
|
+
mcpEndpoint: z.ZodDefault<z.ZodString>;
|
|
8
|
+
mcpAuthToken: z.ZodOptional<z.ZodString>;
|
|
9
|
+
graphMcpEndpoint: z.ZodDefault<z.ZodString>;
|
|
10
|
+
graphMcpAuthToken: z.ZodOptional<z.ZodString>;
|
|
11
|
+
graphMcpMode: z.ZodDefault<z.ZodEnum<{
|
|
12
|
+
paid: "paid";
|
|
13
|
+
debug: "debug";
|
|
14
|
+
}>>;
|
|
15
|
+
walletAddress: z.ZodOptional<z.ZodString>;
|
|
16
|
+
serverPort: z.ZodDefault<z.ZodNumber>;
|
|
17
|
+
dataDir: z.ZodDefault<z.ZodString>;
|
|
18
|
+
version: z.ZodDefault<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
type InvestigatorConfig = z.infer<typeof ConfigSchema>;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/config/index.d.ts
|
|
23
|
+
declare function loadConfig(): Promise<InvestigatorConfig>;
|
|
24
|
+
declare function saveConfig(updates: Partial<InvestigatorConfig>): Promise<void>;
|
|
25
|
+
declare function resetConfigCache(): Promise<void>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/server/app.d.ts
|
|
28
|
+
declare function createApp(): Hono;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/server/index.d.ts
|
|
31
|
+
declare function startServer(port?: number): () => void;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/wallet/index.d.ts
|
|
34
|
+
declare function normalizeWalletPrivateKey(value: string): Hex;
|
|
35
|
+
declare function walletAddressFromPrivateKey(privateKey: string): Address;
|
|
36
|
+
/**
|
|
37
|
+
* Encrypts a private key and writes it to ~/.chain-insights/wallet.json.
|
|
38
|
+
* Uses AES-256-GCM with a machine-identity-derived key and a random per-wallet salt.
|
|
39
|
+
* File is written with 0o600 permissions (owner read/write only).
|
|
40
|
+
*
|
|
41
|
+
* @param privateKey - The EVM private key to encrypt (0x-prefixed)
|
|
42
|
+
*/
|
|
43
|
+
declare function encryptKey(privateKey: string): Promise<void>;
|
|
44
|
+
declare function setWalletPrivateKey(privateKey: string): Promise<Address>;
|
|
45
|
+
/**
|
|
46
|
+
* Reads and decrypts the private key from ~/.chain-insights/wallet.json.
|
|
47
|
+
* Throws a human-readable error if wallet is absent or decryption fails.
|
|
48
|
+
*
|
|
49
|
+
* @returns The decrypted EVM private key string
|
|
50
|
+
*/
|
|
51
|
+
declare function decryptKey(): Promise<string>;
|
|
52
|
+
/**
|
|
53
|
+
* Returns true if wallet.json exists, false if absent.
|
|
54
|
+
* Does not validate the wallet contents.
|
|
55
|
+
*/
|
|
56
|
+
declare function isWalletConfigured(): Promise<boolean>;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/wallet/tools.d.ts
|
|
59
|
+
declare const BASE_CHAIN_ID = 8453;
|
|
60
|
+
declare const USDC_ADDRESS: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
61
|
+
interface PaymentWalletAccount {
|
|
62
|
+
address: Address;
|
|
63
|
+
privateKey: Hex;
|
|
64
|
+
}
|
|
65
|
+
interface TopupInfo {
|
|
66
|
+
wallet_address: string;
|
|
67
|
+
network: 'Base';
|
|
68
|
+
chain_id: typeof BASE_CHAIN_ID;
|
|
69
|
+
token: 'USDC';
|
|
70
|
+
token_contract: typeof USDC_ADDRESS;
|
|
71
|
+
topup_url?: string;
|
|
72
|
+
}
|
|
73
|
+
declare function getWalletAccount(): Promise<PaymentWalletAccount>;
|
|
74
|
+
declare function getBalanceUsdc(address: Address | string, rpcUrl?: string | undefined): Promise<string>;
|
|
75
|
+
declare function getBalanceEth(address: Address | string, rpcUrl?: string | undefined): Promise<string>;
|
|
76
|
+
declare function formatWalletBalance(address: string, balanceUsdc: string, balanceEth?: string): string;
|
|
77
|
+
declare function getWalletBalanceText(account?: PaymentWalletAccount): Promise<string>;
|
|
78
|
+
declare function buildTopupInfo(address: string, topupUrl?: string): TopupInfo;
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/wallet/mcp-proxy/topup-server.d.ts
|
|
81
|
+
declare function generateArtifactHtml(walletAddress: string, topupUrl: string): string;
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/wallet/topup-server.d.ts
|
|
84
|
+
declare function getTopupUrl(): string | null;
|
|
85
|
+
declare function startTopupServer(account: PaymentWalletAccount | string): Promise<string>;
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/mcp/client.d.ts
|
|
88
|
+
/**
|
|
89
|
+
* Creates an x402-payment-wrapped fetch function for the Chain Insights MCP.
|
|
90
|
+
* Payments are made in USDC on Base Mainnet (eip155:8453).
|
|
91
|
+
*
|
|
92
|
+
* The factory is pure — no side effects, no state, no caching.
|
|
93
|
+
* If called with an invalid private key format, viem throws — the error propagates.
|
|
94
|
+
*
|
|
95
|
+
* @param privateKey - 0x-prefixed EVM private key (decrypted from wallet.json)
|
|
96
|
+
* @returns A fetch-compatible function that auto-handles HTTP 402 payment challenges
|
|
97
|
+
*/
|
|
98
|
+
declare function createMcpFetchClient(privateKey: `0x${string}`, authToken?: string): typeof fetch;
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/viz/graph-model.d.ts
|
|
101
|
+
declare const GraphNode: z.ZodObject<{
|
|
102
|
+
id: z.ZodString;
|
|
103
|
+
label: z.ZodOptional<z.ZodString>;
|
|
104
|
+
entityType: z.ZodDefault<z.ZodEnum<{
|
|
105
|
+
eoa: "eoa";
|
|
106
|
+
contract: "contract";
|
|
107
|
+
exchange: "exchange";
|
|
108
|
+
mixer: "mixer";
|
|
109
|
+
unknown: "unknown";
|
|
110
|
+
}>>;
|
|
111
|
+
riskLevel: z.ZodDefault<z.ZodEnum<{
|
|
112
|
+
unknown: "unknown";
|
|
113
|
+
low: "low";
|
|
114
|
+
medium: "medium";
|
|
115
|
+
high: "high";
|
|
116
|
+
critical: "critical";
|
|
117
|
+
}>>;
|
|
118
|
+
totalIn: z.ZodDefault<z.ZodNumber>;
|
|
119
|
+
totalOut: z.ZodDefault<z.ZodNumber>;
|
|
120
|
+
txCount: z.ZodDefault<z.ZodNumber>;
|
|
121
|
+
firstSeen: z.ZodOptional<z.ZodString>;
|
|
122
|
+
lastSeen: z.ZodOptional<z.ZodString>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
type GraphNode = z.infer<typeof GraphNode>;
|
|
125
|
+
declare const GraphEdge: z.ZodObject<{
|
|
126
|
+
source: z.ZodString;
|
|
127
|
+
target: z.ZodString;
|
|
128
|
+
value: z.ZodNumber;
|
|
129
|
+
txHash: z.ZodOptional<z.ZodString>;
|
|
130
|
+
blockNumber: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
timestamp: z.ZodOptional<z.ZodString>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
type GraphEdge = z.infer<typeof GraphEdge>;
|
|
134
|
+
declare const GraphData: z.ZodObject<{
|
|
135
|
+
nodes: z.ZodArray<z.ZodObject<{
|
|
136
|
+
id: z.ZodString;
|
|
137
|
+
label: z.ZodOptional<z.ZodString>;
|
|
138
|
+
entityType: z.ZodDefault<z.ZodEnum<{
|
|
139
|
+
eoa: "eoa";
|
|
140
|
+
contract: "contract";
|
|
141
|
+
exchange: "exchange";
|
|
142
|
+
mixer: "mixer";
|
|
143
|
+
unknown: "unknown";
|
|
144
|
+
}>>;
|
|
145
|
+
riskLevel: z.ZodDefault<z.ZodEnum<{
|
|
146
|
+
unknown: "unknown";
|
|
147
|
+
low: "low";
|
|
148
|
+
medium: "medium";
|
|
149
|
+
high: "high";
|
|
150
|
+
critical: "critical";
|
|
151
|
+
}>>;
|
|
152
|
+
totalIn: z.ZodDefault<z.ZodNumber>;
|
|
153
|
+
totalOut: z.ZodDefault<z.ZodNumber>;
|
|
154
|
+
txCount: z.ZodDefault<z.ZodNumber>;
|
|
155
|
+
firstSeen: z.ZodOptional<z.ZodString>;
|
|
156
|
+
lastSeen: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
edges: z.ZodArray<z.ZodObject<{
|
|
159
|
+
source: z.ZodString;
|
|
160
|
+
target: z.ZodString;
|
|
161
|
+
value: z.ZodNumber;
|
|
162
|
+
txHash: z.ZodOptional<z.ZodString>;
|
|
163
|
+
blockNumber: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
timestamp: z.ZodOptional<z.ZodString>;
|
|
165
|
+
}, z.core.$strip>>;
|
|
166
|
+
metadata: z.ZodObject<{
|
|
167
|
+
caseId: z.ZodOptional<z.ZodString>;
|
|
168
|
+
title: z.ZodDefault<z.ZodString>;
|
|
169
|
+
generatedAt: z.ZodString;
|
|
170
|
+
truncated: z.ZodDefault<z.ZodBoolean>;
|
|
171
|
+
totalNodes: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
hiddenNodes: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
}, z.core.$strip>;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
type GraphData = z.infer<typeof GraphData>;
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/viz/index.d.ts
|
|
178
|
+
declare function generateVisualization(opts: {
|
|
179
|
+
caseId?: string;
|
|
180
|
+
dataFile?: string;
|
|
181
|
+
}): Promise<{
|
|
182
|
+
vizId: string;
|
|
183
|
+
htmlPath: string;
|
|
184
|
+
}>;
|
|
185
|
+
//#endregion
|
|
186
|
+
export { type GraphData as GraphDataType, type GraphEdge as GraphEdgeType, type GraphNode as GraphNodeType, type InvestigatorConfig, buildTopupInfo, createApp, createMcpFetchClient, decryptKey, encryptKey, formatWalletBalance, generateArtifactHtml, generateVisualization, getBalanceEth, getBalanceUsdc, getTopupUrl, getWalletAccount, getWalletBalanceText, isWalletConfigured, loadConfig, normalizeWalletPrivateKey, resetConfigCache, saveConfig, setWalletPrivateKey, startServer, startTopupServer, walletAddressFromPrivateKey };
|
|
187
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/config/schema.ts","../src/config/index.ts","../src/server/app.ts","../src/server/index.ts","../src/wallet/index.ts","../src/wallet/tools.ts","../src/wallet/mcp-proxy/topup-server.ts","../src/wallet/topup-server.ts","../src/mcp/client.ts","../src/viz/graph-model.ts","../src/viz/index.ts"],"mappings":";;;;;cAIa,YAAA,EAAY,CAAA,CAAA,SAAA;;;;;;;;;;;;;;KAYb,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,YAAA;;;iBCJ1B,UAAA,CAAA,GAAc,OAAA,CAAQ,kBAAA;AAAA,iBAYtB,UAAA,CAAW,OAAA,EAAS,OAAA,CAAQ,kBAAA,IAAsB,OAAA;AAAA,iBASlD,gBAAA,CAAA,GAAoB,OAAA;;;iBCkG1B,SAAA,CAAA,GAAa,IAAA;;;iBChIb,WAAA,CAAY,IAAA;;;iBC0BZ,yBAAA,CAA0B,KAAA,WAAgB,GAAA;AAAA,iBAO1C,2BAAA,CAA4B,UAAA,WAAqB,OAAA;;AJhCjE;;;;;;iBI2CsB,UAAA,CAAW,UAAA,WAAqB,OAAA;AAAA,iBA2BhC,mBAAA,CAAoB,UAAA,WAAqB,OAAA,CAAQ,OAAA;;;;;;;iBAajD,UAAA,CAAA,GAAc,OAAA;;;;;iBA2Cd,kBAAA,CAAA,GAAsB,OAAA;;;cC7H/B,aAAA;AAAA,cACA,YAAA;AAAA,UAmBI,oBAAA;EACf,OAAA,EAAS,OAAA;EACT,UAAA,EAAY,GAAA;AAAA;AAAA,UAGG,SAAA;EACf,cAAA;EACA,OAAA;EACA,QAAA,SAAiB,aAAA;EACjB,KAAA;EACA,cAAA,SAAuB,YAAA;EACvB,SAAA;AAAA;AAAA,iBAGoB,gBAAA,CAAA,GAAoB,OAAA,CAAQ,oBAAA;AAAA,iBAM5B,cAAA,CACpB,OAAA,EAAS,OAAA,WACT,MAAA,wBACC,OAAA;AAAA,iBA2BmB,aAAA,CACpB,OAAA,EAAS,OAAA,WACT,MAAA,wBACC,OAAA;AAAA,iBAsBa,mBAAA,CAAoB,OAAA,UAAiB,WAAA,UAAqB,UAAA;AAAA,iBAUpD,oBAAA,CAAqB,OAAA,GAAU,oBAAA,GAAuB,OAAA;AAAA,iBAS5D,cAAA,CAAe,OAAA,UAAiB,QAAA,YAAoB,SAAA;;;iBC3BpD,oBAAA,CAAqB,aAAA,UAAuB,QAAA;;;iBCjC5C,WAAA,CAAA;AAAA,iBAIM,gBAAA,CAAiB,OAAA,EAAS,oBAAA,YAAgC,OAAA;;;;;;AP3DhF;;;;;;;iBQsEgB,oBAAA,CAAqB,UAAA,iBAA2B,SAAA,mBAAkB,KAAA;;;cClErE,SAAA,EAAS,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;KAWV,SAAA,GAAY,CAAA,CAAE,KAAA,QAAa,SAAA;AAAA,cAE1B,SAAA,EAAS,CAAA,CAAA,SAAA;;;;;;;;KAQV,SAAA,GAAY,CAAA,CAAE,KAAA,QAAa,SAAA;AAAA,cAE1B,SAAA,EAAS,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAYV,SAAA,GAAY,CAAA,CAAE,KAAA,QAAa,SAAA;;;iBClCjB,qBAAA,CAAsB,IAAA;EAC1C,MAAA;EACA,QAAA;AAAA,IACE,OAAA;EAAU,KAAA;EAAe,QAAA;AAAA"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { Hono } from "hono";
|
|
3
|
+
import { Address, Hex } from "viem";
|
|
4
|
+
|
|
5
|
+
//#region src/config/schema.d.ts
|
|
6
|
+
declare const ConfigSchema: z.ZodObject<{
|
|
7
|
+
mcpEndpoint: z.ZodDefault<z.ZodString>;
|
|
8
|
+
mcpAuthToken: z.ZodOptional<z.ZodString>;
|
|
9
|
+
graphMcpEndpoint: z.ZodDefault<z.ZodString>;
|
|
10
|
+
graphMcpAuthToken: z.ZodOptional<z.ZodString>;
|
|
11
|
+
graphMcpMode: z.ZodDefault<z.ZodEnum<{
|
|
12
|
+
paid: "paid";
|
|
13
|
+
debug: "debug";
|
|
14
|
+
}>>;
|
|
15
|
+
walletAddress: z.ZodOptional<z.ZodString>;
|
|
16
|
+
serverPort: z.ZodDefault<z.ZodNumber>;
|
|
17
|
+
dataDir: z.ZodDefault<z.ZodString>;
|
|
18
|
+
version: z.ZodDefault<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
type InvestigatorConfig = z.infer<typeof ConfigSchema>;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/config/index.d.ts
|
|
23
|
+
declare function loadConfig(): Promise<InvestigatorConfig>;
|
|
24
|
+
declare function saveConfig(updates: Partial<InvestigatorConfig>): Promise<void>;
|
|
25
|
+
declare function resetConfigCache(): Promise<void>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/server/app.d.ts
|
|
28
|
+
declare function createApp(): Hono;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/server/index.d.ts
|
|
31
|
+
declare function startServer(port?: number): () => void;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/wallet/index.d.ts
|
|
34
|
+
declare function normalizeWalletPrivateKey(value: string): Hex;
|
|
35
|
+
declare function walletAddressFromPrivateKey(privateKey: string): Address;
|
|
36
|
+
/**
|
|
37
|
+
* Encrypts a private key and writes it to ~/.chain-insights/wallet.json.
|
|
38
|
+
* Uses AES-256-GCM with a machine-identity-derived key and a random per-wallet salt.
|
|
39
|
+
* File is written with 0o600 permissions (owner read/write only).
|
|
40
|
+
*
|
|
41
|
+
* @param privateKey - The EVM private key to encrypt (0x-prefixed)
|
|
42
|
+
*/
|
|
43
|
+
declare function encryptKey(privateKey: string): Promise<void>;
|
|
44
|
+
declare function setWalletPrivateKey(privateKey: string): Promise<Address>;
|
|
45
|
+
/**
|
|
46
|
+
* Reads and decrypts the private key from ~/.chain-insights/wallet.json.
|
|
47
|
+
* Throws a human-readable error if wallet is absent or decryption fails.
|
|
48
|
+
*
|
|
49
|
+
* @returns The decrypted EVM private key string
|
|
50
|
+
*/
|
|
51
|
+
declare function decryptKey(): Promise<string>;
|
|
52
|
+
/**
|
|
53
|
+
* Returns true if wallet.json exists, false if absent.
|
|
54
|
+
* Does not validate the wallet contents.
|
|
55
|
+
*/
|
|
56
|
+
declare function isWalletConfigured(): Promise<boolean>;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/wallet/tools.d.ts
|
|
59
|
+
declare const BASE_CHAIN_ID = 8453;
|
|
60
|
+
declare const USDC_ADDRESS: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
61
|
+
interface PaymentWalletAccount {
|
|
62
|
+
address: Address;
|
|
63
|
+
privateKey: Hex;
|
|
64
|
+
}
|
|
65
|
+
interface TopupInfo {
|
|
66
|
+
wallet_address: string;
|
|
67
|
+
network: 'Base';
|
|
68
|
+
chain_id: typeof BASE_CHAIN_ID;
|
|
69
|
+
token: 'USDC';
|
|
70
|
+
token_contract: typeof USDC_ADDRESS;
|
|
71
|
+
topup_url?: string;
|
|
72
|
+
}
|
|
73
|
+
declare function getWalletAccount(): Promise<PaymentWalletAccount>;
|
|
74
|
+
declare function getBalanceUsdc(address: Address | string, rpcUrl?: string | undefined): Promise<string>;
|
|
75
|
+
declare function getBalanceEth(address: Address | string, rpcUrl?: string | undefined): Promise<string>;
|
|
76
|
+
declare function formatWalletBalance(address: string, balanceUsdc: string, balanceEth?: string): string;
|
|
77
|
+
declare function getWalletBalanceText(account?: PaymentWalletAccount): Promise<string>;
|
|
78
|
+
declare function buildTopupInfo(address: string, topupUrl?: string): TopupInfo;
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/wallet/mcp-proxy/topup-server.d.ts
|
|
81
|
+
declare function generateArtifactHtml(walletAddress: string, topupUrl: string): string;
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/wallet/topup-server.d.ts
|
|
84
|
+
declare function getTopupUrl(): string | null;
|
|
85
|
+
declare function startTopupServer(account: PaymentWalletAccount | string): Promise<string>;
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/mcp/client.d.ts
|
|
88
|
+
/**
|
|
89
|
+
* Creates an x402-payment-wrapped fetch function for the Chain Insights MCP.
|
|
90
|
+
* Payments are made in USDC on Base Mainnet (eip155:8453).
|
|
91
|
+
*
|
|
92
|
+
* The factory is pure — no side effects, no state, no caching.
|
|
93
|
+
* If called with an invalid private key format, viem throws — the error propagates.
|
|
94
|
+
*
|
|
95
|
+
* @param privateKey - 0x-prefixed EVM private key (decrypted from wallet.json)
|
|
96
|
+
* @returns A fetch-compatible function that auto-handles HTTP 402 payment challenges
|
|
97
|
+
*/
|
|
98
|
+
declare function createMcpFetchClient(privateKey: `0x${string}`, authToken?: string): typeof fetch;
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/viz/graph-model.d.ts
|
|
101
|
+
declare const GraphNode: z.ZodObject<{
|
|
102
|
+
id: z.ZodString;
|
|
103
|
+
label: z.ZodOptional<z.ZodString>;
|
|
104
|
+
entityType: z.ZodDefault<z.ZodEnum<{
|
|
105
|
+
eoa: "eoa";
|
|
106
|
+
contract: "contract";
|
|
107
|
+
exchange: "exchange";
|
|
108
|
+
mixer: "mixer";
|
|
109
|
+
unknown: "unknown";
|
|
110
|
+
}>>;
|
|
111
|
+
riskLevel: z.ZodDefault<z.ZodEnum<{
|
|
112
|
+
unknown: "unknown";
|
|
113
|
+
low: "low";
|
|
114
|
+
medium: "medium";
|
|
115
|
+
high: "high";
|
|
116
|
+
critical: "critical";
|
|
117
|
+
}>>;
|
|
118
|
+
totalIn: z.ZodDefault<z.ZodNumber>;
|
|
119
|
+
totalOut: z.ZodDefault<z.ZodNumber>;
|
|
120
|
+
txCount: z.ZodDefault<z.ZodNumber>;
|
|
121
|
+
firstSeen: z.ZodOptional<z.ZodString>;
|
|
122
|
+
lastSeen: z.ZodOptional<z.ZodString>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
type GraphNode = z.infer<typeof GraphNode>;
|
|
125
|
+
declare const GraphEdge: z.ZodObject<{
|
|
126
|
+
source: z.ZodString;
|
|
127
|
+
target: z.ZodString;
|
|
128
|
+
value: z.ZodNumber;
|
|
129
|
+
txHash: z.ZodOptional<z.ZodString>;
|
|
130
|
+
blockNumber: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
timestamp: z.ZodOptional<z.ZodString>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
type GraphEdge = z.infer<typeof GraphEdge>;
|
|
134
|
+
declare const GraphData: z.ZodObject<{
|
|
135
|
+
nodes: z.ZodArray<z.ZodObject<{
|
|
136
|
+
id: z.ZodString;
|
|
137
|
+
label: z.ZodOptional<z.ZodString>;
|
|
138
|
+
entityType: z.ZodDefault<z.ZodEnum<{
|
|
139
|
+
eoa: "eoa";
|
|
140
|
+
contract: "contract";
|
|
141
|
+
exchange: "exchange";
|
|
142
|
+
mixer: "mixer";
|
|
143
|
+
unknown: "unknown";
|
|
144
|
+
}>>;
|
|
145
|
+
riskLevel: z.ZodDefault<z.ZodEnum<{
|
|
146
|
+
unknown: "unknown";
|
|
147
|
+
low: "low";
|
|
148
|
+
medium: "medium";
|
|
149
|
+
high: "high";
|
|
150
|
+
critical: "critical";
|
|
151
|
+
}>>;
|
|
152
|
+
totalIn: z.ZodDefault<z.ZodNumber>;
|
|
153
|
+
totalOut: z.ZodDefault<z.ZodNumber>;
|
|
154
|
+
txCount: z.ZodDefault<z.ZodNumber>;
|
|
155
|
+
firstSeen: z.ZodOptional<z.ZodString>;
|
|
156
|
+
lastSeen: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
edges: z.ZodArray<z.ZodObject<{
|
|
159
|
+
source: z.ZodString;
|
|
160
|
+
target: z.ZodString;
|
|
161
|
+
value: z.ZodNumber;
|
|
162
|
+
txHash: z.ZodOptional<z.ZodString>;
|
|
163
|
+
blockNumber: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
timestamp: z.ZodOptional<z.ZodString>;
|
|
165
|
+
}, z.core.$strip>>;
|
|
166
|
+
metadata: z.ZodObject<{
|
|
167
|
+
caseId: z.ZodOptional<z.ZodString>;
|
|
168
|
+
title: z.ZodDefault<z.ZodString>;
|
|
169
|
+
generatedAt: z.ZodString;
|
|
170
|
+
truncated: z.ZodDefault<z.ZodBoolean>;
|
|
171
|
+
totalNodes: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
hiddenNodes: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
}, z.core.$strip>;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
type GraphData = z.infer<typeof GraphData>;
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/viz/index.d.ts
|
|
178
|
+
declare function generateVisualization(opts: {
|
|
179
|
+
caseId?: string;
|
|
180
|
+
dataFile?: string;
|
|
181
|
+
}): Promise<{
|
|
182
|
+
vizId: string;
|
|
183
|
+
htmlPath: string;
|
|
184
|
+
}>;
|
|
185
|
+
//#endregion
|
|
186
|
+
export { type GraphData as GraphDataType, type GraphEdge as GraphEdgeType, type GraphNode as GraphNodeType, type InvestigatorConfig, buildTopupInfo, createApp, createMcpFetchClient, decryptKey, encryptKey, formatWalletBalance, generateArtifactHtml, generateVisualization, getBalanceEth, getBalanceUsdc, getTopupUrl, getWalletAccount, getWalletBalanceText, isWalletConfigured, loadConfig, normalizeWalletPrivateKey, resetConfigCache, saveConfig, setWalletPrivateKey, startServer, startTopupServer, walletAddressFromPrivateKey };
|
|
187
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/config/schema.ts","../src/config/index.ts","../src/server/app.ts","../src/server/index.ts","../src/wallet/index.ts","../src/wallet/tools.ts","../src/wallet/mcp-proxy/topup-server.ts","../src/wallet/topup-server.ts","../src/mcp/client.ts","../src/viz/graph-model.ts","../src/viz/index.ts"],"mappings":";;;;;cAIa,YAAA,EAAY,CAAA,CAAA,SAAA;;;;;;;;;;;;;;KAYb,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,YAAA;;;iBCJ1B,UAAA,CAAA,GAAc,OAAA,CAAQ,kBAAA;AAAA,iBAYtB,UAAA,CAAW,OAAA,EAAS,OAAA,CAAQ,kBAAA,IAAsB,OAAA;AAAA,iBASlD,gBAAA,CAAA,GAAoB,OAAA;;;iBCkG1B,SAAA,CAAA,GAAa,IAAA;;;iBChIb,WAAA,CAAY,IAAA;;;iBC0BZ,yBAAA,CAA0B,KAAA,WAAgB,GAAA;AAAA,iBAO1C,2BAAA,CAA4B,UAAA,WAAqB,OAAA;;AJhCjE;;;;;;iBI2CsB,UAAA,CAAW,UAAA,WAAqB,OAAA;AAAA,iBA2BhC,mBAAA,CAAoB,UAAA,WAAqB,OAAA,CAAQ,OAAA;;;;;;;iBAajD,UAAA,CAAA,GAAc,OAAA;;;;;iBA2Cd,kBAAA,CAAA,GAAsB,OAAA;;;cC7H/B,aAAA;AAAA,cACA,YAAA;AAAA,UAmBI,oBAAA;EACf,OAAA,EAAS,OAAA;EACT,UAAA,EAAY,GAAA;AAAA;AAAA,UAGG,SAAA;EACf,cAAA;EACA,OAAA;EACA,QAAA,SAAiB,aAAA;EACjB,KAAA;EACA,cAAA,SAAuB,YAAA;EACvB,SAAA;AAAA;AAAA,iBAGoB,gBAAA,CAAA,GAAoB,OAAA,CAAQ,oBAAA;AAAA,iBAM5B,cAAA,CACpB,OAAA,EAAS,OAAA,WACT,MAAA,wBACC,OAAA;AAAA,iBA2BmB,aAAA,CACpB,OAAA,EAAS,OAAA,WACT,MAAA,wBACC,OAAA;AAAA,iBAsBa,mBAAA,CAAoB,OAAA,UAAiB,WAAA,UAAqB,UAAA;AAAA,iBAUpD,oBAAA,CAAqB,OAAA,GAAU,oBAAA,GAAuB,OAAA;AAAA,iBAS5D,cAAA,CAAe,OAAA,UAAiB,QAAA,YAAoB,SAAA;;;iBC3BpD,oBAAA,CAAqB,aAAA,UAAuB,QAAA;;;iBCjC5C,WAAA,CAAA;AAAA,iBAIM,gBAAA,CAAiB,OAAA,EAAS,oBAAA,YAAgC,OAAA;;;;;;AP3DhF;;;;;;;iBQsEgB,oBAAA,CAAqB,UAAA,iBAA2B,SAAA,mBAAkB,KAAA;;;cClErE,SAAA,EAAS,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;KAWV,SAAA,GAAY,CAAA,CAAE,KAAA,QAAa,SAAA;AAAA,cAE1B,SAAA,EAAS,CAAA,CAAA,SAAA;;;;;;;;KAQV,SAAA,GAAY,CAAA,CAAE,KAAA,QAAa,SAAA;AAAA,cAE1B,SAAA,EAAS,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAYV,SAAA,GAAY,CAAA,CAAE,KAAA,QAAa,SAAA;;;iBClCjB,qBAAA,CAAsB,IAAA;EAC1C,MAAA;EACA,QAAA;AAAA,IACE,OAAA;EAAU,KAAA;EAAe,QAAA;AAAA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { i as saveConfig, n as loadConfig, r as resetConfigCache } from "./config-BwrBYmiC.mjs";
|
|
2
|
+
import { t as createApp } from "./app-BjjuQM0B.mjs";
|
|
3
|
+
import { n as startServer } from "./server-BkM5xrXb.mjs";
|
|
4
|
+
import { a as setWalletPrivateKey, i as normalizeWalletPrivateKey, n as encryptKey, o as walletAddressFromPrivateKey, r as isWalletConfigured, t as decryptKey } from "./wallet-BMelXBYP.mjs";
|
|
5
|
+
import { a as getWalletAccount, i as getBalanceUsdc, n as formatWalletBalance, o as getWalletBalanceText, r as getBalanceEth, t as buildTopupInfo } from "./tools-Cp2jAAAb.mjs";
|
|
6
|
+
import { i as generateArtifactHtml, n as startTopupServer, t as getTopupUrl } from "./topup-server-DUjyFftI.mjs";
|
|
7
|
+
import { r as createMcpFetchClient } from "./client-D4Bq0rp9.mjs";
|
|
8
|
+
import { t as generateVisualization } from "./viz-BlCJe6Tk.mjs";
|
|
9
|
+
export { buildTopupInfo, createApp, createMcpFetchClient, decryptKey, encryptKey, formatWalletBalance, generateArtifactHtml, generateVisualization, getBalanceEth, getBalanceUsdc, getTopupUrl, getWalletAccount, getWalletBalanceText, isWalletConfigured, loadConfig, normalizeWalletPrivateKey, resetConfigCache, saveConfig, setWalletPrivateKey, startServer, startTopupServer, walletAddressFromPrivateKey };
|