chain-insights 0.75.0 → 0.76.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 +1 -0
- package/dist/{action-log-D49Par9P.mjs → action-log-Byv9Ln_6.mjs} +4 -10
- package/dist/{action-log-D49Par9P.mjs.map → action-log-Byv9Ln_6.mjs.map} +1 -1
- package/dist/{action-log-HniMMF7f.cjs → action-log-WMW6xFMx.cjs} +3 -9
- package/dist/{active-Dkf8AB1R.mjs → active-D2aabYRF.mjs} +3 -4
- package/dist/{active-Dkf8AB1R.mjs.map → active-D2aabYRF.mjs.map} +1 -1
- package/dist/{active-Bc13hJIm.cjs → active-q3yViZhc.cjs} +2 -3
- package/dist/answer-hint-BlYEBq_Y.cjs +57 -0
- package/dist/answer-hint-vOE1O6Lf.mjs +48 -0
- package/dist/answer-hint-vOE1O6Lf.mjs.map +1 -0
- package/dist/{buy-_mpdRieG.mjs → buy-B2luUbWF.mjs} +5 -6
- package/dist/{buy-_mpdRieG.mjs.map → buy-B2luUbWF.mjs.map} +1 -1
- package/dist/{buy-97M6dtEu.cjs → buy-DEoGITbT.cjs} +4 -5
- package/dist/{cache-location-CBVzUIxq.cjs → cache-location-C09AE55j.cjs} +2 -3
- package/dist/{cache-location-BO2XkfgI.mjs → cache-location-DxTTqBwk.mjs} +2 -3
- package/dist/{cache-location-BO2XkfgI.mjs.map → cache-location-DxTTqBwk.mjs.map} +1 -1
- package/dist/{call-args-B0oMK1-J.mjs → call-args-CBqbYfOE.mjs} +15 -4
- package/dist/{call-args-B0oMK1-J.mjs.map → call-args-CBqbYfOE.mjs.map} +1 -1
- package/dist/{call-args-C8Gp5gco.cjs → call-args-DXEmPeE-.cjs} +14 -2
- package/dist/{capabilities-DxojbX4D.mjs → capabilities-BRNHcabF.mjs} +5 -11
- package/dist/{capabilities-DxojbX4D.mjs.map → capabilities-BRNHcabF.mjs.map} +1 -1
- package/dist/{capabilities-Ds3320iS.cjs → capabilities-DalimVY2.cjs} +4 -10
- package/dist/{claude-desktop-Jmm4PlBZ.cjs → claude-desktop-3OksQZVE.cjs} +2 -3
- package/dist/{claude-desktop-6jwX0Lux.mjs → claude-desktop-C1SDYAP2.mjs} +2 -3
- package/dist/{claude-desktop-6jwX0Lux.mjs.map → claude-desktop-C1SDYAP2.mjs.map} +1 -1
- package/dist/cli.cjs +95 -76
- package/dist/cli.mjs +94 -75
- package/dist/cli.mjs.map +1 -1
- package/dist/{client-7qOfAdpH.mjs → client-BaHAIidE.mjs} +10 -21
- package/dist/{client-7qOfAdpH.mjs.map → client-BaHAIidE.mjs.map} +1 -1
- package/dist/{client-C9uwHnBS.cjs → client-Ddk4X9Ko.cjs} +9 -20
- package/dist/{config-BxtMoo9c.cjs → config-BdE8LcF-.cjs} +3 -5
- package/dist/{config-9MabJh5R.mjs → config-BkLIqOYq.mjs} +4 -6
- package/dist/{config-9MabJh5R.mjs.map → config-BkLIqOYq.mjs.map} +1 -1
- package/dist/{create-CpfZq2fx.mjs → create-CluDZkuF.mjs} +3 -4
- package/dist/{create-CpfZq2fx.mjs.map → create-CluDZkuF.mjs.map} +1 -1
- package/dist/{create-DdggkF04.cjs → create-DvBumvHn.cjs} +2 -3
- package/dist/{dex-registry-Chs79Ukc.cjs → dex-registry-CZQB2YhU.cjs} +4 -26
- package/dist/{dex-registry-rziydXYq.mjs → dex-registry-D6Xxi_vr.mjs} +5 -27
- package/dist/{dex-registry-rziydXYq.mjs.map → dex-registry-D6Xxi_vr.mjs.map} +1 -1
- package/dist/{dex-tool-ib_ICiyV.mjs → dex-tool-BoAYqhZO.mjs} +8 -62
- package/dist/dex-tool-BoAYqhZO.mjs.map +1 -0
- package/dist/{dex-tool-85_76Q8i.cjs → dex-tool-DsM-pSku.cjs} +12 -72
- package/dist/{format-CSesEBvS.mjs → format-CsnW5M4D.mjs} +2 -3
- package/dist/{format-CSesEBvS.mjs.map → format-CsnW5M4D.mjs.map} +1 -1
- package/dist/{format-DfhRQq4L.cjs → format-DUzmoeaE.cjs} +1 -2
- package/dist/{graph-schema-DNJXDaTn.cjs → graph-schema-C8Pi6r7c.cjs} +8 -25
- package/dist/{graph-schema-Bxqwukqu.mjs → graph-schema-D4LAefGf.mjs} +9 -26
- package/dist/{graph-schema-Bxqwukqu.mjs.map → graph-schema-D4LAefGf.mjs.map} +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +0 -16
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -16
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/{known-keys-B87ZqOgE.mjs → known-keys-BbuzCZOW.mjs} +4 -7
- package/dist/{known-keys-B87ZqOgE.mjs.map → known-keys-BbuzCZOW.mjs.map} +1 -1
- package/dist/{known-keys-PKZF5GYd.cjs → known-keys-Cy8lKDOA.cjs} +3 -6
- package/dist/mcp-proxy.cjs +65 -39
- package/dist/mcp-proxy.d.cts +2 -2
- package/dist/mcp-proxy.d.cts.map +1 -1
- package/dist/mcp-proxy.d.mts +2 -2
- package/dist/mcp-proxy.d.mts.map +1 -1
- package/dist/mcp-proxy.mjs +63 -38
- package/dist/mcp-proxy.mjs.map +1 -1
- package/dist/{print-result-if-AbNLY.cjs → print-result-BYppJlUi.cjs} +19 -19
- package/dist/{print-result-BtEAn2Wl.mjs → print-result-IFARsMnL.mjs} +9 -21
- package/dist/print-result-IFARsMnL.mjs.map +1 -0
- package/dist/{public-tools-COG3pCpD.cjs → public-tools-Cfc1OPNS.cjs} +8 -13
- package/dist/{public-tools-DIJs4SHz.mjs → public-tools-DXlZcanX.mjs} +8 -13
- package/dist/{public-tools-DIJs4SHz.mjs.map → public-tools-DXlZcanX.mjs.map} +1 -1
- package/dist/{quote-DfTut0cx.mjs → quote-41CbMc37.mjs} +2 -3
- package/dist/{quote-DfTut0cx.mjs.map → quote-41CbMc37.mjs.map} +1 -1
- package/dist/{quote-B9sYNOiv.cjs → quote-pFKcSvMv.cjs} +1 -2
- package/dist/{request-timeout-CYmQF8N7.cjs → request-timeout-DxwNijQD.cjs} +1 -2
- package/dist/{request-timeout-lBBe0mGf.mjs → request-timeout-K3ljP0pa.mjs} +2 -3
- package/dist/{request-timeout-lBBe0mGf.mjs.map → request-timeout-K3ljP0pa.mjs.map} +1 -1
- package/dist/{robinhood-CCTMagwM.mjs → robinhood-0NZsA6ZW.mjs} +2 -3
- package/dist/robinhood-0NZsA6ZW.mjs.map +1 -0
- package/dist/{robinhood-ChiT69sc.cjs → robinhood-DumTxvlA.cjs} +1 -2
- package/dist/{rolldown-runtime-8H4AJuhK.mjs → rolldown-runtime-BJohB4LM.mjs} +1 -2
- package/dist/{rolldown-runtime-C0BPl7ul.cjs → rolldown-runtime-BW-eSwOZ.cjs} +1 -2
- package/dist/{rules-BWdbOtHi.mjs → rules-B3w9pCeQ.mjs} +2 -3
- package/dist/{rules-BWdbOtHi.mjs.map → rules-B3w9pCeQ.mjs.map} +1 -1
- package/dist/{rules-BD-cNHMX.cjs → rules-BKwfmNsJ.cjs} +1 -2
- package/dist/{schema-KjZqCHbu.mjs → schema-CKnQsdw9.mjs} +6 -13
- package/dist/{schema-KjZqCHbu.mjs.map → schema-CKnQsdw9.mjs.map} +1 -1
- package/dist/{schema-tX0U0-VI.cjs → schema-CSESfCvA.cjs} +5 -12
- package/dist/{schema-cache-DRObKUvS.mjs → schema-cache-BfKHodDY.mjs} +3 -4
- package/dist/{schema-cache-DRObKUvS.mjs.map → schema-cache-BfKHodDY.mjs.map} +1 -1
- package/dist/{schema-cache-C7v9ml6S.cjs → schema-cache-NLgJmh4X.cjs} +3 -4
- package/dist/{skill-refresh-xYWZ_hua.mjs → skill-refresh-BchIsODN.mjs} +2 -3
- package/dist/{skill-refresh-xYWZ_hua.mjs.map → skill-refresh-BchIsODN.mjs.map} +1 -1
- package/dist/{skill-refresh-Be2D5FrX.cjs → skill-refresh-DaCTxhhy.cjs} +2 -3
- package/dist/{subscription-status-DIuH84fM.mjs → subscription-status-5WfPhSep.mjs} +3 -4
- package/dist/{subscription-status-DIuH84fM.mjs.map → subscription-status-5WfPhSep.mjs.map} +1 -1
- package/dist/{subscription-status-9tMfD90J.cjs → subscription-status-w4zI2KCK.cjs} +2 -3
- package/dist/token-lookup-BJ00JO9A.cjs +342 -0
- package/dist/token-lookup-XnyisLQW.mjs +303 -0
- package/dist/token-lookup-XnyisLQW.mjs.map +1 -0
- package/dist/{tool-visibility-DTAYvE9E.cjs → tool-visibility-DIpgPULN.cjs} +5 -10
- package/dist/{tool-visibility-zcmwMSbn.mjs → tool-visibility-Dy3psowS.mjs} +6 -11
- package/dist/tool-visibility-Dy3psowS.mjs.map +1 -0
- package/dist/{tools-D9ep9E7Q.mjs → tools-6pZo4h_p.mjs} +6 -21
- package/dist/{tools-D9ep9E7Q.mjs.map → tools-6pZo4h_p.mjs.map} +1 -1
- package/dist/{tools-Cmnq7yip.cjs → tools-DZLizem9.cjs} +5 -20
- package/dist/{topup-B6gZbTmv.mjs → topup--7JTo4UQ.mjs} +6 -7
- package/dist/{topup-B6gZbTmv.mjs.map → topup--7JTo4UQ.mjs.map} +1 -1
- package/dist/{topup-DVTCU2le.cjs → topup-BgI9OcUd.cjs} +5 -6
- package/dist/{topup-server-ShuYSyBY.cjs → topup-server-D9Uk1Th3.cjs} +7 -24
- package/dist/{topup-server-KQDviFXG.mjs → topup-server-DR0HaUcR.mjs} +8 -25
- package/dist/{topup-server-KQDviFXG.mjs.map → topup-server-DR0HaUcR.mjs.map} +1 -1
- package/dist/{topup-server-BcT7DIpd.mjs → topup-server-DlwzFEF1.mjs} +5 -12
- package/dist/{topup-server-BcT7DIpd.mjs.map → topup-server-DlwzFEF1.mjs.map} +1 -1
- package/dist/{topup-server-f4Gx0vji.cjs → topup-server-H1M_7PJK.cjs} +4 -11
- package/dist/{transport-error-C7OQjmC7.mjs → transport-error-68G35VPH.mjs} +3 -4
- package/dist/{transport-error-C7OQjmC7.mjs.map → transport-error-68G35VPH.mjs.map} +1 -1
- package/dist/{transport-error-qDWQn8hb.cjs → transport-error-DXy1iTpS.cjs} +2 -3
- package/dist/{update-DqBhBXFs.mjs → update-BH8F4cQ2.mjs} +3 -4
- package/dist/{update-DqBhBXFs.mjs.map → update-BH8F4cQ2.mjs.map} +1 -1
- package/dist/{update-NowrCmjR.cjs → update-DUDdQSEU.cjs} +2 -3
- package/dist/{usage-status-Frot6fPG.mjs → usage-status-BUZgRl4r.mjs} +3 -5
- package/dist/{usage-status-Frot6fPG.mjs.map → usage-status-BUZgRl4r.mjs.map} +1 -1
- package/dist/{usage-status-DonwoLR3.cjs → usage-status-DnV3I3gX.cjs} +2 -4
- package/dist/{wallet-QTo5YCFR.mjs → wallet-B1M0HdQh.mjs} +4 -8
- package/dist/{wallet-QTo5YCFR.mjs.map → wallet-B1M0HdQh.mjs.map} +1 -1
- package/dist/{wallet-CgIAfdxL.cjs → wallet-BubGd_sG.cjs} +3 -7
- package/docs/mcp-proxy.md +34 -0
- package/docs/stability.md +3 -2
- package/package.json +1 -1
- package/skills/chain-insights-cypher/SKILL.md +3 -0
- package/dist/dex-tool-ib_ICiyV.mjs.map +0 -1
- package/dist/print-result-BtEAn2Wl.mjs.map +0 -1
- package/dist/robinhood-CCTMagwM.mjs.map +0 -1
- package/dist/tool-visibility-zcmwMSbn.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { Address, Hex } from "viem";
|
|
3
|
-
//#region src/config/schema.d.ts
|
|
4
3
|
declare const ConfigSchema: z.ZodObject<{
|
|
5
4
|
graphMcpEndpoint: z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
6
5
|
graphMcpAuthToken: z.ZodOptional<z.ZodString>;
|
|
@@ -19,13 +18,9 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
19
18
|
truthIngressCaPath: z.ZodOptional<z.ZodString>;
|
|
20
19
|
}, z.core.$strip>;
|
|
21
20
|
type InvestigatorConfig = z.infer<typeof ConfigSchema>;
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/config/index.d.ts
|
|
24
21
|
export declare function loadConfig(): Promise<InvestigatorConfig>;
|
|
25
22
|
export declare function saveConfig(updates: Partial<InvestigatorConfig>): Promise<void>;
|
|
26
23
|
export declare function resetConfigCache(): Promise<void>;
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/wallet/index.d.ts
|
|
29
24
|
export declare function normalizeWalletPrivateKey(value: string): Hex;
|
|
30
25
|
export declare function walletAddressFromPrivateKey(privateKey: string): Address;
|
|
31
26
|
/**
|
|
@@ -59,8 +54,6 @@ export declare function decryptKey(): Promise<string>;
|
|
|
59
54
|
* Does not validate the wallet contents.
|
|
60
55
|
*/
|
|
61
56
|
export declare function isWalletConfigured(): Promise<boolean>;
|
|
62
|
-
//#endregion
|
|
63
|
-
//#region src/wallet/create.d.ts
|
|
64
57
|
interface WalletBackupWarningOptions {
|
|
65
58
|
color?: boolean;
|
|
66
59
|
width?: number;
|
|
@@ -68,8 +61,6 @@ interface WalletBackupWarningOptions {
|
|
|
68
61
|
export declare function generateWalletPrivateKey(): Hex;
|
|
69
62
|
export declare function isWalletBackupConfirmed(answer: string): boolean;
|
|
70
63
|
export declare function formatWalletBackupWarning(privateKey: string, options?: WalletBackupWarningOptions): string;
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region src/wallet/tools.d.ts
|
|
73
64
|
declare const BASE_CHAIN_ID = 8453;
|
|
74
65
|
declare const USDC_ADDRESS: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';
|
|
75
66
|
interface PaymentWalletAccount {
|
|
@@ -117,8 +108,6 @@ export declare function getWalletBalanceResult(account?: PaymentWalletAccount):
|
|
|
117
108
|
export declare function formatWalletBalanceResult(result: WalletBalanceResult): string;
|
|
118
109
|
export declare function getWalletBalanceText(account?: PaymentWalletAccount): Promise<string>;
|
|
119
110
|
export declare function buildTopupInfo(address: string, topupUrl?: string): TopupInfo;
|
|
120
|
-
//#endregion
|
|
121
|
-
//#region src/wallet/mcp-proxy/topup-server.d.ts
|
|
122
111
|
/**
|
|
123
112
|
* The top-up rails. base-usdc funds pay-per-call queries with USDC on Base;
|
|
124
113
|
* robinhood-cia funds the subscription with $CIA and ETH on Robinhood Chain.
|
|
@@ -126,8 +115,6 @@ export declare function buildTopupInfo(address: string, topupUrl?: string): Topu
|
|
|
126
115
|
*/
|
|
127
116
|
type TopupRail = 'base-usdc' | 'robinhood-cia';
|
|
128
117
|
export declare function generateArtifactHtml(walletAddressInput: string, topupUrl: string, rail?: TopupRail): string;
|
|
129
|
-
//#endregion
|
|
130
|
-
//#region src/wallet/topup-server.d.ts
|
|
131
118
|
export declare function getTopupUrl(): string | null;
|
|
132
119
|
/**
|
|
133
120
|
* The browser top-up page of `cia wallet topup` (rail base-usdc) and of
|
|
@@ -135,8 +122,6 @@ export declare function getTopupUrl(): string | null;
|
|
|
135
122
|
* differs by rail.
|
|
136
123
|
*/
|
|
137
124
|
export declare function startTopupServer(account: PaymentWalletAccount | string, rail?: TopupRail): Promise<string>;
|
|
138
|
-
//#endregion
|
|
139
|
-
//#region src/mcp/client.d.ts
|
|
140
125
|
/**
|
|
141
126
|
* Creates an x402-payment-wrapped fetch function for the Chain Insights MCP.
|
|
142
127
|
* Payments are made in USDC on Base Mainnet (eip155:8453) or, when the
|
|
@@ -150,6 +135,5 @@ export declare function startTopupServer(account: PaymentWalletAccount | string,
|
|
|
150
135
|
* @returns A fetch-compatible function that auto-handles HTTP 402 payment challenges
|
|
151
136
|
*/
|
|
152
137
|
export declare function createMcpFetchClient(privateKey: `0x${string}`, authToken?: string): typeof fetch;
|
|
153
|
-
//#endregion
|
|
154
138
|
export type { InvestigatorConfig };
|
|
155
139
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/config/schema.ts","../src/config/index.ts","../src/wallet/index.ts","../src/wallet/create.ts","../src/wallet/tools.ts","../src/wallet/mcp-proxy/topup-server.ts","../src/wallet/topup-server.ts","../src/mcp/client.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/config/schema.ts","../src/config/index.ts","../src/wallet/index.ts","../src/wallet/create.ts","../src/wallet/tools.ts","../src/wallet/mcp-proxy/topup-server.ts","../src/wallet/topup-server.ts","../src/mcp/client.ts"],"mappings":";;cA4Da,cAAY,EAAA;;;;;;;;;;;;;;;;GAcvB,EAAA,KAAA;KAEU,qBAAqB,EAAE,aAAa;wBC3B1B,cAAc,QAAQ;wBAMtB,WAAW,SAAS,QAAQ,sBAAsB;wBAsDlD,oBAAoB;wBCnF1B,0BAA0B,gBAAgB;wBAO1C,4BAA4B,qBAAqB;;;;;;;;wBAW3C,WAAW,qBAAqB;UAwBrC;;EAEf;;;;;;;;wBAuCoB,oBACpB,oBACA,UAAS,6BACR,QAAQ;;;;;;;wBAkEW,cAAc;;;;;wBAwCd,sBAAsB;UCnN3B;EACf;EACA;;wBAGc,4BAA4B;wBAI5B,wBAAwB;wBAQxB,0BACd,oBACA,UAAS;cCXE;cACA;UAgDI;EACf,SAAS;EACT,YAAY;;EAEZ;;UAGe;EACf;EACA;EACA,iBAAiB;EACjB;EACA,uBAAuB;EACvB;;UAoDe;EACf,SAAS;EACT;EACA;EACA,iBAAiB;EACjB;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;IACE,QAAQ;;;;;;;;wBASU,oBAAoB,QAAQ;wBAoB5B,eACpB,SAAS,kBACT,8BACC;wBAsBmB,cACpB,SAAS,kBACT,8BACC;wBAuQa,oBACd,iBACA,qBACA;wBAaoB,uBACpB,UAAU,uBACT,QAAQ;wBAyBK,0BAA0B,QAAQ;wBAK5B,qBAAqB,UAAU,uBAAuB;wBAI5D,eAAe,iBAAiB,oBAAoB;;;;;;KC9cxD;wBAgKI,qBACd,4BACA,kBACA,OAAM;wBC9GQ;;;;;;wBAmBM,iBACpB,SAAS,+BACT,OAAM,YACL;;;;;;;;;;;;;wBCwJa,qBAAqB,2BAA2B,4BAAkB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as saveConfig, n as loadConfig, r as resetConfigCache } from "./config-
|
|
2
|
-
import { a as setWalletPrivateKey, i as normalizeWalletPrivateKey, n as encryptKey, o as walletAddressFromPrivateKey, r as isWalletConfigured, t as decryptKey } from "./wallet-
|
|
3
|
-
import { i as isWalletBackupConfirmed, n as formatWalletBackupWarning, r as generateWalletPrivateKey } from "./create-
|
|
4
|
-
import { a as formatWalletBalanceResult, c as getWalletAccount, i as formatWalletBalance, l as getWalletBalanceResult, o as getBalanceEth, r as buildTopupInfo, s as getBalanceUsdc, u as getWalletBalanceText } from "./tools-
|
|
5
|
-
import { n as generateArtifactHtml } from "./topup-server-
|
|
6
|
-
import { n as startTopupServer, t as getTopupUrl } from "./topup-server-
|
|
7
|
-
import { i as createMcpFetchClient } from "./client-
|
|
1
|
+
import { i as saveConfig, n as loadConfig, r as resetConfigCache } from "./config-BkLIqOYq.mjs";
|
|
2
|
+
import { a as setWalletPrivateKey, i as normalizeWalletPrivateKey, n as encryptKey, o as walletAddressFromPrivateKey, r as isWalletConfigured, t as decryptKey } from "./wallet-B1M0HdQh.mjs";
|
|
3
|
+
import { i as isWalletBackupConfirmed, n as formatWalletBackupWarning, r as generateWalletPrivateKey } from "./create-CluDZkuF.mjs";
|
|
4
|
+
import { a as formatWalletBalanceResult, c as getWalletAccount, i as formatWalletBalance, l as getWalletBalanceResult, o as getBalanceEth, r as buildTopupInfo, s as getBalanceUsdc, u as getWalletBalanceText } from "./tools-6pZo4h_p.mjs";
|
|
5
|
+
import { n as generateArtifactHtml } from "./topup-server-DR0HaUcR.mjs";
|
|
6
|
+
import { n as startTopupServer, t as getTopupUrl } from "./topup-server-DlwzFEF1.mjs";
|
|
7
|
+
import { i as createMcpFetchClient } from "./client-BaHAIidE.mjs";
|
|
8
8
|
export { buildTopupInfo, createMcpFetchClient, decryptKey, encryptKey, formatWalletBackupWarning, formatWalletBalance, formatWalletBalanceResult, generateArtifactHtml, generateWalletPrivateKey, getBalanceEth, getBalanceUsdc, getTopupUrl, getWalletAccount, getWalletBalanceResult, getWalletBalanceText, isWalletBackupConfirmed, isWalletConfigured, loadConfig, normalizeWalletPrivateKey, resetConfigCache, saveConfig, setWalletPrivateKey, startTopupServer, walletAddressFromPrivateKey };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.mjs";
|
|
2
2
|
import { privateKeyToAccount } from "viem/accounts";
|
|
3
|
-
|
|
3
|
+
// src/wallet/known-keys.ts
|
|
4
4
|
var known_keys_exports = /* @__PURE__ */ __exportAll({
|
|
5
5
|
PUBLIC_KEY_WALLET_TEXT: () => PUBLIC_KEY_WALLET_TEXT,
|
|
6
|
-
|
|
7
|
-
isPrivateKeyPublic: () => isPrivateKeyPublic,
|
|
8
|
-
publicKeyReason: () => publicKeyReason
|
|
6
|
+
isPrivateKeyPublic: () => isPrivateKeyPublic
|
|
9
7
|
});
|
|
10
8
|
/**
|
|
11
9
|
* The text every money path shows when the local wallet's key is public.
|
|
@@ -72,7 +70,6 @@ function assertPrivateKeyNotPublic(privateKey) {
|
|
|
72
70
|
const reason = publicKeyReason(privateKey);
|
|
73
71
|
if (reason) throw new Error(`Refused: ${reason}. Anything sent to its address is taken within seconds. Generate a new key with \`cia wallet create\`.`);
|
|
74
72
|
}
|
|
75
|
-
//#endregion
|
|
76
73
|
export { known_keys_exports as i, assertPrivateKeyNotPublic as n, isPrivateKeyPublic as r, PUBLIC_KEY_WALLET_TEXT as t };
|
|
77
74
|
|
|
78
|
-
//# sourceMappingURL=known-keys-
|
|
75
|
+
//# sourceMappingURL=known-keys-BbuzCZOW.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"known-keys-
|
|
1
|
+
{"version":3,"file":"known-keys-BbuzCZOW.mjs","names":[],"sources":["../src/wallet/known-keys.ts"],"sourcesContent":["import { privateKeyToAccount } from 'viem/accounts'\nimport type { Hex } from 'viem'\n\n/**\n * The text every money path shows when the local wallet's key is public.\n * A public key is one anyone can look up: a small number such as 1, a key of\n * one repeated byte, or a key of a well-known test mnemonic. Bots watch those\n * addresses on every EVM chain and take anything sent there within seconds.\n */\nexport const PUBLIC_KEY_WALLET_TEXT =\n \"This wallet's key is public. Anything sent to it is taken within seconds. Run `cia wallet create --replace`.\"\n\n// Below 2^128 a key is a counter, not a random draw: 1, 2, 16 and the like.\n// A random 256-bit key lands there with odds of 2^-128.\nconst SMALL_KEY_LIMIT = 1n << 128n\n// A random key holds about 31 distinct bytes. Fewer than 8 is a pattern,\n// such as one byte repeated.\nconst MIN_DISTINCT_BYTES = 8\n\n// The public test accounts, by address only. A key never sits in this file.\n// - The 20 accounts of the 'test test ... junk' mnemonic that Anvil and\n// Hardhat print at start.\n// - The 10 accounts of the Ganache deterministic mnemonic.\nconst PUBLIC_TEST_ADDRESSES = new Set(\n [\n '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',\n '0x70997970C51812dc3A010C7d01b50e0d17dc79C8',\n '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC',\n '0x90F79bf6EB2c4f870365E785982E1f101E93b906',\n '0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65',\n '0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc',\n '0x976EA74026E726554dB657fA54763abd0C3a0aa9',\n '0x14dC79964da2C08b23698B3D3cc7Ca32193d9955',\n '0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f',\n '0xa0Ee7A142d267C1f36714E4a8F75612F20a79720',\n '0xBcd4042DE499D14e55001CcbB24a551F3b954096',\n '0x71bE63f3384f5fb98995898A86B02Fb2426c5788',\n '0xFABB0ac9d68B0B445fB7357272Ff202C5651694a',\n '0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec',\n '0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097',\n '0xcd3B766CCDd6AE721141F452C550Ca635964ce71',\n '0x2546BcD3c84621e976D8185a91A922aE77ECEc30',\n '0xbDA5747bFD65F08deb54cb465eB87D40e51B197E',\n '0xdD2FD4581271e230360230F9337D5c0430Bf44C0',\n '0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199',\n '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1',\n '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0',\n '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b',\n '0xE11BA2b4D45Eaed5996Cd0823791E0C93114882d',\n '0xd03ea8624C8C5987235048901fB614fDcA89b117',\n '0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC',\n '0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9',\n '0x28a8746e75304c0780E011BEd21C72cD78cd535E',\n '0xACa94ef8bD5ffEE41947b4585a84BdA5a3d3DA6E',\n '0x1dF62f291b2E969fB0849d99D9Ce41e2F137006e',\n ].map((address) => address.toLowerCase())\n)\n\n/** Why a key is public, or null when it is not. */\nexport function publicKeyReason(privateKey: string): string | null {\n if (!/^0x[0-9a-fA-F]{64}$/.test(privateKey)) return null\n const value = BigInt(privateKey)\n if (value < SMALL_KEY_LIMIT) return 'the key is a small number'\n const bytes = new Set<string>()\n for (let i = 2; i < privateKey.length; i += 2) bytes.add(privateKey.slice(i, i + 2).toLowerCase())\n if (bytes.size < MIN_DISTINCT_BYTES) return 'the key repeats a few bytes'\n let address: string\n try {\n address = privateKeyToAccount(privateKey as Hex).address.toLowerCase()\n } catch {\n return null\n }\n if (PUBLIC_TEST_ADDRESSES.has(address)) return 'the key belongs to a public test mnemonic'\n return null\n}\n\nexport function isPrivateKeyPublic(privateKey: string): boolean {\n return publicKeyReason(privateKey) !== null\n}\n\n/** Throws PUBLIC_KEY_WALLET_TEXT, with the reason, when the key is public. */\nexport function assertPrivateKeyNotPublic(privateKey: string): void {\n const reason = publicKeyReason(privateKey)\n if (reason) {\n throw new Error(`Refused: ${reason}. Anything sent to its address is taken within seconds. Generate a new key with \\`cia wallet create\\`.`)\n }\n}\n"],"mappings":";;;;;;;;;;;;;AASA,MAAa,yBACX;AAIF,MAAM,kBAAkB,MAAM;AAG9B,MAAM,qBAAqB;AAM3B,MAAM,wBAAwB,IAAI,IAChC;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK,YAAY,QAAQ,YAAY,CAAC,CAC1C;;AAGA,SAAgB,gBAAgB,YAAmC;CACjE,IAAI,CAAC,sBAAsB,KAAK,UAAU,GAAG,OAAO;CAEpD,IADc,OAAO,UACb,IAAI,iBAAiB,OAAO;CACpC,MAAM,wBAAQ,IAAI,IAAY;CAC9B,KAAK,IAAI,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK,GAAG,MAAM,IAAI,WAAW,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC;CACjG,IAAI,MAAM,OAAO,oBAAoB,OAAO;CAC5C,IAAI;CACJ,IAAI;EACF,UAAU,oBAAoB,UAAiB,CAAC,CAAC,QAAQ,YAAY;CACvE,QAAQ;EACN,OAAO;CACT;CACA,IAAI,sBAAsB,IAAI,OAAO,GAAG,OAAO;CAC/C,OAAO;AACT;AAEA,SAAgB,mBAAmB,YAA6B;CAC9D,OAAO,gBAAgB,UAAU,MAAM;AACzC;;AAGA,SAAgB,0BAA0B,YAA0B;CAClE,MAAM,SAAS,gBAAgB,UAAU;CACzC,IAAI,QACF,MAAM,IAAI,MAAM,YAAY,OAAO,uGAAuG;AAE9I"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-BW-eSwOZ.cjs");
|
|
2
2
|
let viem_accounts = require("viem/accounts");
|
|
3
|
-
|
|
3
|
+
// src/wallet/known-keys.ts
|
|
4
4
|
var known_keys_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
5
5
|
PUBLIC_KEY_WALLET_TEXT: () => PUBLIC_KEY_WALLET_TEXT,
|
|
6
|
-
|
|
7
|
-
isPrivateKeyPublic: () => isPrivateKeyPublic,
|
|
8
|
-
publicKeyReason: () => publicKeyReason
|
|
6
|
+
isPrivateKeyPublic: () => isPrivateKeyPublic
|
|
9
7
|
});
|
|
10
8
|
/**
|
|
11
9
|
* The text every money path shows when the local wallet's key is public.
|
|
@@ -72,7 +70,6 @@ function assertPrivateKeyNotPublic(privateKey) {
|
|
|
72
70
|
const reason = publicKeyReason(privateKey);
|
|
73
71
|
if (reason) throw new Error(`Refused: ${reason}. Anything sent to its address is taken within seconds. Generate a new key with \`cia wallet create\`.`);
|
|
74
72
|
}
|
|
75
|
-
//#endregion
|
|
76
73
|
Object.defineProperty(exports, "PUBLIC_KEY_WALLET_TEXT", {
|
|
77
74
|
enumerable: true,
|
|
78
75
|
get: function() {
|
package/dist/mcp-proxy.cjs
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
3
|
-
const require_print_result = require("./print-result-
|
|
4
|
-
const
|
|
5
|
-
const require_client = require("./client-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const require_capabilities = require("./capabilities-
|
|
10
|
-
const require_graph_schema = require("./graph-schema-
|
|
11
|
-
const require_action_log = require("./action-log-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
2
|
+
const require_rolldown_runtime = require("./rolldown-runtime-BW-eSwOZ.cjs");
|
|
3
|
+
const require_print_result = require("./print-result-BYppJlUi.cjs");
|
|
4
|
+
const require_tool_visibility = require("./tool-visibility-DIpgPULN.cjs");
|
|
5
|
+
const require_client = require("./client-Ddk4X9Ko.cjs");
|
|
6
|
+
const require_usage_status = require("./usage-status-DnV3I3gX.cjs");
|
|
7
|
+
const require_subscription_status = require("./subscription-status-w4zI2KCK.cjs");
|
|
8
|
+
const require_rules = require("./rules-BKwfmNsJ.cjs");
|
|
9
|
+
const require_capabilities = require("./capabilities-DalimVY2.cjs");
|
|
10
|
+
const require_graph_schema = require("./graph-schema-C8Pi6r7c.cjs");
|
|
11
|
+
const require_action_log = require("./action-log-WMW6xFMx.cjs");
|
|
12
|
+
const require_answer_hint = require("./answer-hint-BlYEBq_Y.cjs");
|
|
13
|
+
const require_dex_tool = require("./dex-tool-DsM-pSku.cjs");
|
|
14
|
+
const require_dex_registry = require("./dex-registry-CZQB2YhU.cjs");
|
|
15
|
+
const require_token_lookup = require("./token-lookup-BJ00JO9A.cjs");
|
|
14
16
|
let node_url = require("node:url");
|
|
15
17
|
let node_path = require("node:path");
|
|
16
18
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
@@ -24,7 +26,7 @@ let _modelcontextprotocol_sdk_server_mcp_js = require("@modelcontextprotocol/sdk
|
|
|
24
26
|
let _modelcontextprotocol_sdk_server_stdio_js = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
25
27
|
let _modelcontextprotocol_sdk_client_index_js = require("@modelcontextprotocol/sdk/client/index.js");
|
|
26
28
|
let _modelcontextprotocol_sdk_client_streamableHttp_js = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
27
|
-
|
|
29
|
+
// src/mcp/rate-limit.ts
|
|
28
30
|
/**
|
|
29
31
|
* The graph endpoint limits requests per address. Its refusal arrives as a
|
|
30
32
|
* thrown HTTP error, "too many requests from this address; retry after 3
|
|
@@ -102,8 +104,7 @@ function rateLimitedResult(toolName, err) {
|
|
|
102
104
|
isError: true
|
|
103
105
|
};
|
|
104
106
|
}
|
|
105
|
-
|
|
106
|
-
//#region src/mcp/batch-busy-retry.ts
|
|
107
|
+
// src/mcp/batch-busy-retry.ts
|
|
107
108
|
/**
|
|
108
109
|
* A graph_query_batch member that reads the chain node costs several node
|
|
109
110
|
* calls (an Address read costs four), and the graph server caps node calls
|
|
@@ -220,8 +221,7 @@ async function withBusyRetry(args, call, sleep = defaultSleep) {
|
|
|
220
221
|
}
|
|
221
222
|
return result;
|
|
222
223
|
}
|
|
223
|
-
|
|
224
|
-
//#region src/mcp/layer-routing.ts
|
|
224
|
+
// src/mcp/layer-routing.ts
|
|
225
225
|
/** The routing rule, in one sentence. The server states it in the same words. */
|
|
226
226
|
const ROUTING_RULE = "Route by what the question names: an address, a pair with a day, a transaction or a block. Topology searches outward from an address, while facts and chain look up one known thing.";
|
|
227
227
|
/** The rule in three lines, one for each layer. */
|
|
@@ -288,8 +288,7 @@ function routingHead() {
|
|
|
288
288
|
function routingHintLines() {
|
|
289
289
|
return [`- Pick the layer first. ${ROUTING_RULE} 1. ${ROUTING_LINES[0]} 2. ${ROUTING_LINES[1]} 3. ${ROUTING_LINES[2]} ${ROUTING_NOT_SERVED} ${ROUTING_ADDRESS_ON_CHAIN} ${ROUTING_TWO_FIT} ${ROUTING_HANDOFF} The lookups that USE chain serves are listed in chain_admission.lookups of meta_network_capabilities. Read every limit that the server publishes from meta_network_capabilities (chain_admission and, when the server sends them, topology_admission and facts_admission). Never write a limit down.`, `- Act on a refusal by its class. ${moveLines().join(" ")}`];
|
|
290
290
|
}
|
|
291
|
-
|
|
292
|
-
//#region src/mcp/view-server.ts
|
|
291
|
+
// src/mcp/view-server.ts
|
|
293
292
|
/**
|
|
294
293
|
* The Chain Insights view as a browser page on the user's own PC.
|
|
295
294
|
*
|
|
@@ -538,8 +537,7 @@ Object.freeze([...GRAPH_LINK_COLUMNS, ...GRAPH_NODE_COLUMNS]);
|
|
|
538
537
|
function flowsRecipeReturn(from, to, link = "f") {
|
|
539
538
|
return `${from}.address AS from_address, ${to}.address AS to_address, ${link}.amount_usd_sum AS amount_usd_sum, ${link}.tx_count AS tx_count, ${link}.first_seen_timestamp AS first_seen_timestamp, ${link}.last_seen_timestamp AS last_seen_timestamp, ${from}.labels AS from_labels, ${to}.labels AS to_labels, ${from}.is_exchange AS from_is_exchange, ${to}.is_exchange AS to_is_exchange`;
|
|
540
539
|
}
|
|
541
|
-
|
|
542
|
-
//#region src/mcp/remote-connect.ts
|
|
540
|
+
// src/mcp/remote-connect.ts
|
|
543
541
|
/**
|
|
544
542
|
* Connects a client to a fresh transport. The SDK leaves a transport attached
|
|
545
543
|
* when `connect` fails after `start` (an initialize answered 429), and the
|
|
@@ -649,8 +647,7 @@ async function connectRemote(options) {
|
|
|
649
647
|
message: describeRemoteFailure(options.endpoint, lastErr, lastStatus)
|
|
650
648
|
};
|
|
651
649
|
}
|
|
652
|
-
|
|
653
|
-
//#region src/mcp/proxy.ts
|
|
650
|
+
// src/mcp/proxy.ts
|
|
654
651
|
const LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
655
652
|
"meta_network_capabilities",
|
|
656
653
|
"meta_schema",
|
|
@@ -659,6 +656,7 @@ const LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
|
659
656
|
"meta_help",
|
|
660
657
|
"meta_rules",
|
|
661
658
|
require_dex_tool.META_DEX_LOOKUP_TOOL,
|
|
659
|
+
require_token_lookup.META_TOKEN_LOOKUP_TOOL,
|
|
662
660
|
"wallet_balance",
|
|
663
661
|
"wallet_topup",
|
|
664
662
|
require_rules.SUBSCRIPTION_TOPUP_TOOL,
|
|
@@ -720,17 +718,19 @@ function resolveMcpProxyMode(env = process.env) {
|
|
|
720
718
|
const GRAPH_LAYERS_TEXT = "Use USE topology for topology (address/FLOWED_TO/OPERATED_BY/LINKED graph with SWAPPED, ADDED_LIQUIDITY, REMOVED_LIQUIDITY, BRIDGED and the Pool, Token and NFT labels, unified recent+historical) and USE facts for bounded TRANSFER, SWAP, LIQUIDITY_ADD, LIQUIDITY_REMOVE and BRIDGE_CROSSING rows and enrichment, and USE chain for the chain node's own record of one known transaction, block, address or the head.";
|
|
721
719
|
const TOOL_RULES_FIRST = "Rules first: if the chain-insights-cypher skill is not loaded in this chat, call meta_rules once before this tool. For a graph, alias the columns from_address and to_address; the host draws the picture from the answer itself. Never draw it again with another tool, such as a visualize or widget tool.";
|
|
722
720
|
const GRAPH_QUERY_DEX_DOOR_SENTENCE = "A question that names an exchange and no address starts with meta_dex_lookup, never with a scan of :Protocol, :Pool or labels.";
|
|
721
|
+
const GRAPH_QUERY_TOKEN_DOOR_SENTENCE = "A question that names a token by its ticker or name and gives no contract starts with meta_token_lookup: tickers collide, so never guess the contract.";
|
|
723
722
|
const GRAPH_QUERY_ROLE_MARKS_SENTENCE = ":Sanctioned (is_sanctioned) means the address is on a sanctions list. :IssuerFrozen (is_issuer_frozen) means an issuer froze this wallet; the token in labels says which. Neither is :Scam.";
|
|
724
723
|
const KNOWN_PUBLIC_TOOL_DESCRIPTIONS = {
|
|
725
724
|
meta_network_capabilities: "Return the current Chain Insights network and tool support matrix. Takes no arguments: send {}.",
|
|
726
725
|
meta_schema: require_graph_schema.META_SCHEMA_DESCRIPTION,
|
|
727
726
|
[require_dex_tool.META_DEX_LOOKUP_TOOL]: require_dex_tool.META_DEX_LOOKUP_DESCRIPTION,
|
|
727
|
+
[require_token_lookup.META_TOKEN_LOOKUP_TOOL]: require_token_lookup.META_TOKEN_LOOKUP_DESCRIPTION,
|
|
728
728
|
meta_usage_status: "Return the caller's public free graph_query quota for the current UTC day.",
|
|
729
729
|
meta_subscription_status: require_rules.META_SUBSCRIPTION_STATUS_DESCRIPTION,
|
|
730
730
|
meta_help: "Show a short guide to Chain Insights tools and workflow.",
|
|
731
731
|
meta_rules: "Return the Chain Insights rules: how to write graph_query and graph_query_batch reads that are served, how to name columns so the answer is drawn as a graph, a time series or a table, and how to write the answer. Call it once per chat, before the first graph query, when the chain-insights-cypher skill is not loaded. Takes no arguments: send {}.",
|
|
732
732
|
wallet_balance: "Show the local Chain Insights payment wallet address, payment network, token, and amount.",
|
|
733
|
-
graph_query: `${TOOL_RULES_FIRST} Run a read-only GQL/Cypher query through the Chain Insights graph endpoint. ${GRAPH_LAYERS_TEXT} ${GRAPH_QUERY_DEX_DOOR_SENTENCE} ${GRAPH_QUERY_ROLE_MARKS_SENTENCE} ${ROUTING_NOT_SERVED} Preserve full addresses exactly, and write every address in full, all 42 characters, in your answer: never shorten one with ... or ….`,
|
|
733
|
+
graph_query: `${TOOL_RULES_FIRST} Run a read-only GQL/Cypher query through the Chain Insights graph endpoint. ${GRAPH_LAYERS_TEXT} ${GRAPH_QUERY_DEX_DOOR_SENTENCE} ${GRAPH_QUERY_TOKEN_DOOR_SENTENCE} ${GRAPH_QUERY_ROLE_MARKS_SENTENCE} ${ROUTING_NOT_SERVED} Preserve full addresses exactly, and write every address in full, all 42 characters, in your answer: never shorten one with ... or ….`,
|
|
734
734
|
graph_query_batch: `${TOOL_RULES_FIRST} Run multiple read-only GQL/Cypher queries through the Chain Insights graph endpoint in one paid batch. Prefer this for related topology/facts reads. For a time series across days, send one USE facts total per day with the query id set to the day, "YYYY-MM-DD": the view joins them into one series. Write every address in full in your answer, all 42 characters.`
|
|
735
735
|
};
|
|
736
736
|
const KNOWN_PUBLIC_TOOL_TITLES = {
|
|
@@ -851,12 +851,12 @@ function fallbackGraphPrimitiveTools() {
|
|
|
851
851
|
* public. Reads the address only; nothing is signed or sent.
|
|
852
852
|
*/
|
|
853
853
|
async function localTopupWalletAddress() {
|
|
854
|
-
const { isWalletConfigured } = await Promise.resolve().then(() => require("./wallet-
|
|
854
|
+
const { isWalletConfigured } = await Promise.resolve().then(() => require("./wallet-BubGd_sG.cjs")).then((n) => n.wallet_exports);
|
|
855
855
|
if (!await isWalletConfigured()) return null;
|
|
856
|
-
const { getWalletAccount } = await Promise.resolve().then(() => require("./tools-
|
|
856
|
+
const { getWalletAccount } = await Promise.resolve().then(() => require("./tools-DZLizem9.cjs")).then((n) => n.tools_exports);
|
|
857
857
|
const account = await getWalletAccount();
|
|
858
858
|
if (account.keyIsPublic === true) {
|
|
859
|
-
const { PUBLIC_KEY_WALLET_TEXT } = await Promise.resolve().then(() => require("./known-keys-
|
|
859
|
+
const { PUBLIC_KEY_WALLET_TEXT } = await Promise.resolve().then(() => require("./known-keys-Cy8lKDOA.cjs")).then((n) => n.known_keys_exports);
|
|
860
860
|
throw new Error(PUBLIC_KEY_WALLET_TEXT);
|
|
861
861
|
}
|
|
862
862
|
return account.address;
|
|
@@ -864,7 +864,7 @@ async function localTopupWalletAddress() {
|
|
|
864
864
|
/** The local wallet address for an older server that still asks for it; null when none. */
|
|
865
865
|
async function localSubscriptionWalletAddress() {
|
|
866
866
|
try {
|
|
867
|
-
const { getWalletAccount } = await Promise.resolve().then(() => require("./tools-
|
|
867
|
+
const { getWalletAccount } = await Promise.resolve().then(() => require("./tools-DZLizem9.cjs")).then((n) => n.tools_exports);
|
|
868
868
|
return (await getWalletAccount()).address;
|
|
869
869
|
} catch {
|
|
870
870
|
return null;
|
|
@@ -1190,7 +1190,7 @@ function normalizeRemoteToolResult(toolName, result) {
|
|
|
1190
1190
|
_meta: sanitizeRemoteMeta(result._meta),
|
|
1191
1191
|
isError: result.isError
|
|
1192
1192
|
};
|
|
1193
|
-
return toolName === "graph_query" || toolName === "graph_query_batch" ? require_print_result.withTimestampTextResult(
|
|
1193
|
+
return toolName === "graph_query" || toolName === "graph_query_batch" ? require_print_result.withTimestampTextResult(require_answer_hint.withAnswerHintResult(normalized)) : normalized;
|
|
1194
1194
|
}
|
|
1195
1195
|
function cleanNetworkCapabilities(value) {
|
|
1196
1196
|
const structuredContent = isRecord(value) ? value.structuredContent : void 0;
|
|
@@ -1222,10 +1222,10 @@ function jsonTextResult(structuredContent) {
|
|
|
1222
1222
|
* All diagnostic output goes to console.error() or process.stderr.write().
|
|
1223
1223
|
*/
|
|
1224
1224
|
async function createProxy() {
|
|
1225
|
-
const { loadConfig } = await Promise.resolve().then(() => require("./config-
|
|
1226
|
-
const { activeDataDir, findActiveWorkspace } = await Promise.resolve().then(() => require("./active-
|
|
1227
|
-
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-
|
|
1228
|
-
const { loadSchema, saveSchema } = await Promise.resolve().then(() => require("./schema-cache-
|
|
1225
|
+
const { loadConfig } = await Promise.resolve().then(() => require("./config-BdE8LcF-.cjs")).then((n) => n.config_exports);
|
|
1226
|
+
const { activeDataDir, findActiveWorkspace } = await Promise.resolve().then(() => require("./active-q3yViZhc.cjs")).then((n) => n.active_exports);
|
|
1227
|
+
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-Ddk4X9Ko.cjs")).then((n) => n.client_exports);
|
|
1228
|
+
const { loadSchema, saveSchema } = await Promise.resolve().then(() => require("./schema-cache-NLgJmh4X.cjs"));
|
|
1229
1229
|
const proxyMode = resolveMcpProxyMode();
|
|
1230
1230
|
const workspaceArtifactsEnabled = proxyMode === "workspace";
|
|
1231
1231
|
const loadedConfig = await loadConfig();
|
|
@@ -1244,7 +1244,7 @@ async function createProxy() {
|
|
|
1244
1244
|
log_path: logger.filePath
|
|
1245
1245
|
});
|
|
1246
1246
|
const graphMcpEndpoint = resolveGraphMcpEndpoint(config);
|
|
1247
|
-
const { defersToClaudeDesktop, DEFERRED_SERVER_INSTRUCTIONS } = await Promise.resolve().then(() => require("./claude-desktop-
|
|
1247
|
+
const { defersToClaudeDesktop, DEFERRED_SERVER_INSTRUCTIONS } = await Promise.resolve().then(() => require("./claude-desktop-3OksQZVE.cjs"));
|
|
1248
1248
|
if (defersToClaudeDesktop()) {
|
|
1249
1249
|
await logger.info("proxy.deferred_to_claude_desktop", { version: require_print_result.PACKAGE_VERSION });
|
|
1250
1250
|
await new _modelcontextprotocol_sdk_server_mcp_js.McpServer({
|
|
@@ -1254,7 +1254,7 @@ async function createProxy() {
|
|
|
1254
1254
|
return;
|
|
1255
1255
|
}
|
|
1256
1256
|
if (process.env["CHAIN_INSIGHTS_SKILL_REFRESH"] !== "0") try {
|
|
1257
|
-
const { refreshInstalledSkills } = await Promise.resolve().then(() => require("./skill-refresh-
|
|
1257
|
+
const { refreshInstalledSkills } = await Promise.resolve().then(() => require("./skill-refresh-DaCTxhhy.cjs"));
|
|
1258
1258
|
const refresh = refreshInstalledSkills(require_print_result.PACKAGE_VERSION);
|
|
1259
1259
|
if (refresh.refreshed.length > 0 || refresh.installed.length > 0 || refresh.failed.length > 0) await logger.info("skills.refresh", {
|
|
1260
1260
|
version: require_print_result.PACKAGE_VERSION,
|
|
@@ -1493,6 +1493,30 @@ async function createProxy() {
|
|
|
1493
1493
|
},
|
|
1494
1494
|
annotations: require_dex_tool.META_DEX_LOOKUP_ANNOTATIONS
|
|
1495
1495
|
}, async (args) => require_dex_tool.handleMetaDexLookup(args, dexDependencies));
|
|
1496
|
+
const tokenDependencies = {
|
|
1497
|
+
graphQuery: async (args) => {
|
|
1498
|
+
const options = remoteToolRequestOptions("graph_query");
|
|
1499
|
+
return await withRateLimitRetry(() => options ? remoteClient.callTool({
|
|
1500
|
+
name: "graph_query",
|
|
1501
|
+
arguments: args
|
|
1502
|
+
}, void 0, options) : remoteClient.callTool({
|
|
1503
|
+
name: "graph_query",
|
|
1504
|
+
arguments: args
|
|
1505
|
+
}));
|
|
1506
|
+
},
|
|
1507
|
+
graphQueryBatch: dexDependencies.graphQueryBatch,
|
|
1508
|
+
unavailable: dexDependencies.unavailable,
|
|
1509
|
+
describeFailure: (err) => remoteCallFailureText("graph_query", err)
|
|
1510
|
+
};
|
|
1511
|
+
server.registerTool(require_token_lookup.META_TOKEN_LOOKUP_TOOL, {
|
|
1512
|
+
title: require_token_lookup.META_TOKEN_LOOKUP_TITLE,
|
|
1513
|
+
description: KNOWN_PUBLIC_TOOL_DESCRIPTIONS[require_token_lookup.META_TOKEN_LOOKUP_TOOL],
|
|
1514
|
+
inputSchema: {
|
|
1515
|
+
network: NETWORK_SCHEMA,
|
|
1516
|
+
symbol: zod.string().min(1).max(require_token_lookup.SYMBOL_MAX).describe("The ticker or the token name as the user wrote it: TCITY, USDG, Tcity. Never a contract address: an address is already an anchor.")
|
|
1517
|
+
},
|
|
1518
|
+
annotations: require_token_lookup.META_TOKEN_LOOKUP_ANNOTATIONS
|
|
1519
|
+
}, async (args) => require_token_lookup.handleMetaTokenLookup(args, tokenDependencies));
|
|
1496
1520
|
const readUsageStatus = async () => {
|
|
1497
1521
|
try {
|
|
1498
1522
|
await ensureRemote();
|
|
@@ -1599,7 +1623,7 @@ async function createProxy() {
|
|
|
1599
1623
|
}
|
|
1600
1624
|
}, async () => {
|
|
1601
1625
|
try {
|
|
1602
|
-
const { formatWalletBalanceResult, getWalletAccount, getWalletBalanceResult } = await Promise.resolve().then(() => require("./tools-
|
|
1626
|
+
const { formatWalletBalanceResult, getWalletAccount, getWalletBalanceResult } = await Promise.resolve().then(() => require("./tools-DZLizem9.cjs")).then((n) => n.tools_exports);
|
|
1603
1627
|
const structuredContent = await getWalletBalanceResult(await getWalletAccount());
|
|
1604
1628
|
return {
|
|
1605
1629
|
content: [{
|
|
@@ -1709,7 +1733,7 @@ async function createProxy() {
|
|
|
1709
1733
|
openWorldHint: false
|
|
1710
1734
|
}
|
|
1711
1735
|
}, async () => {
|
|
1712
|
-
const { readPackagedSkillRules } = await Promise.resolve().then(() => require("./skill-refresh-
|
|
1736
|
+
const { readPackagedSkillRules } = await Promise.resolve().then(() => require("./skill-refresh-DaCTxhhy.cjs"));
|
|
1713
1737
|
return {
|
|
1714
1738
|
content: [{
|
|
1715
1739
|
type: "text",
|
|
@@ -1740,6 +1764,7 @@ async function createProxy() {
|
|
|
1740
1764
|
"- meta_network_capabilities: supported networks and available tools. Takes no arguments.",
|
|
1741
1765
|
"- meta_schema: read the live graph schema of one network: labels, link types and field names. Cached for 24 hours.",
|
|
1742
1766
|
"- meta_dex_lookup: turn an exchange name (Aero, Uniswap, Virtuals) into its factories, routers, pools and first reads. Call it first when a question names an exchange and gives no address.",
|
|
1767
|
+
"- meta_token_lookup: turn a ticker or a token name (TCITY, USDG) into every contract that carries it, with its creator. Call it first when a question names a token and gives no contract; tickers collide.",
|
|
1743
1768
|
"- meta_usage_status: check the caller public free graph_query quota.",
|
|
1744
1769
|
"- meta_subscription_status: check the subscription of the local wallet: window, days left, daily allowance and use, and payments not credited yet.",
|
|
1745
1770
|
"- graph_query: run read-only GQL/Cypher through the universal graph endpoint. Use USE topology or USE facts.",
|
|
@@ -1760,6 +1785,7 @@ async function createProxy() {
|
|
|
1760
1785
|
"- meta_network_capabilities: supported networks and available tools. Takes no arguments.",
|
|
1761
1786
|
"- meta_schema: read the live graph schema of one network: labels, link types and field names. Cached for 24 hours.",
|
|
1762
1787
|
"- meta_dex_lookup: turn an exchange name (Aero, Uniswap, Virtuals) into its factories, routers, pools and first reads. Call it first when a question names an exchange and gives no address.",
|
|
1788
|
+
"- meta_token_lookup: turn a ticker or a token name (TCITY, USDG) into every contract that carries it, with its creator. Call it first when a question names a token and gives no contract; tickers collide.",
|
|
1763
1789
|
"- meta_usage_status: check the caller public free graph_query quota.",
|
|
1764
1790
|
"- meta_subscription_status: check the subscription of the local wallet: window, days left, daily allowance and use, and payments not credited yet.",
|
|
1765
1791
|
"- graph_query: run read-only GQL/Cypher through the universal graph endpoint. Use USE topology or USE facts.",
|
|
@@ -1834,7 +1860,7 @@ async function createProxy() {
|
|
|
1834
1860
|
};
|
|
1835
1861
|
server.registerTool(tool.name, toolConfig, handler);
|
|
1836
1862
|
}
|
|
1837
|
-
const { registerTopupView, TOPUP_VIEW_URI } = await Promise.resolve().then(() => require("./topup-server-
|
|
1863
|
+
const { registerTopupView, TOPUP_VIEW_URI } = await Promise.resolve().then(() => require("./topup-server-D9Uk1Th3.cjs")).then((n) => n.topup_server_exports);
|
|
1838
1864
|
await registerTopupView(server, { walletAddress: localTopupWalletAddress });
|
|
1839
1865
|
server.registerResource("Chain Insights view", CLAUDE_VIEW_URI, {
|
|
1840
1866
|
title: "Chain Insights view",
|
|
@@ -1869,11 +1895,11 @@ if (process.argv[1] && require("url").pathToFileURL(__filename).href.includes(pr
|
|
|
1869
1895
|
process.stderr.write(`Chain Insights MCP proxy startup failed: ${err.message}\n`);
|
|
1870
1896
|
process.exit(1);
|
|
1871
1897
|
});
|
|
1872
|
-
//#endregion
|
|
1873
1898
|
exports.APP_ONLY_LOCAL_TOOL_NAMES = APP_ONLY_LOCAL_TOOL_NAMES;
|
|
1874
1899
|
exports.CLAUDE_VIEW_URI = CLAUDE_VIEW_URI;
|
|
1875
1900
|
exports.GRAPH_QUERY_DEX_DOOR_SENTENCE = GRAPH_QUERY_DEX_DOOR_SENTENCE;
|
|
1876
1901
|
exports.GRAPH_QUERY_ROLE_MARKS_SENTENCE = GRAPH_QUERY_ROLE_MARKS_SENTENCE;
|
|
1902
|
+
exports.GRAPH_QUERY_TOKEN_DOOR_SENTENCE = GRAPH_QUERY_TOKEN_DOOR_SENTENCE;
|
|
1877
1903
|
exports.KNOWN_PUBLIC_TOOL_DESCRIPTIONS = KNOWN_PUBLIC_TOOL_DESCRIPTIONS;
|
|
1878
1904
|
exports.LOCAL_TOOL_NAMES = LOCAL_TOOL_NAMES;
|
|
1879
1905
|
exports.MCP_APP_MIME_TYPE = MCP_APP_MIME_TYPE;
|
package/dist/mcp-proxy.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
//#region src/mcp/proxy.d.ts
|
|
3
2
|
export declare const LOCAL_TOOL_NAMES: Set<string>;
|
|
4
3
|
export declare const APP_ONLY_LOCAL_TOOL_NAMES: Set<string>;
|
|
5
4
|
/** The structured refusal of a click refused for money; the view reads it (chain-insights-ui apps/claude-view/credits.ts). */
|
|
@@ -14,6 +13,7 @@ export declare function readClaudeViewHtml(): string;
|
|
|
14
13
|
export type McpProxyMode = 'workspace' | 'stateless';
|
|
15
14
|
export declare function resolveMcpProxyMode(env?: NodeJS.ProcessEnv): McpProxyMode;
|
|
16
15
|
export declare const GRAPH_QUERY_DEX_DOOR_SENTENCE = "A question that names an exchange and no address starts with meta_dex_lookup, never with a scan of :Protocol, :Pool or labels.";
|
|
16
|
+
export declare const GRAPH_QUERY_TOKEN_DOOR_SENTENCE = "A question that names a token by its ticker or name and gives no contract starts with meta_token_lookup: tickers collide, so never guess the contract.";
|
|
17
17
|
export declare const GRAPH_QUERY_ROLE_MARKS_SENTENCE = ":Sanctioned (is_sanctioned) means the address is on a sanctions list. :IssuerFrozen (is_issuer_frozen) means an issuer froze this wallet; the token in labels says which. Neither is :Scam.";
|
|
18
18
|
export declare const KNOWN_PUBLIC_TOOL_DESCRIPTIONS: Record<string, string>;
|
|
19
19
|
type ToolInputShape = Record<string, z.ZodTypeAny>;
|
|
@@ -27,5 +27,5 @@ export declare function knownPublicToolInputSchema(toolName: string): ToolInputS
|
|
|
27
27
|
* All diagnostic output goes to console.error() or process.stderr.write().
|
|
28
28
|
*/
|
|
29
29
|
export declare function createProxy(): Promise<void>;
|
|
30
|
-
|
|
30
|
+
export {};
|
|
31
31
|
//# sourceMappingURL=mcp-proxy.d.cts.map
|
package/dist/mcp-proxy.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-proxy.d.cts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-proxy.d.cts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";qBA4Ea,kBAAgB;qBAehB,2BAAyB;;qBAEzB;qBAUA;qBACA;;;;;wBAyBG;YAkBJ;wBAEI,oBAAoB,MAAK,OAAO,aAA2B;qBAiB9D;qBAIA;qBAKA;qBAGA,gCAAgC;KAuBxC,iBAAiB,eAAe,EAAE;qBAgB1B;wBA2GG,2BAA2B,mBAAmB;;;;;;;;wBAomBxC,eAAe"}
|
package/dist/mcp-proxy.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
//#region src/mcp/proxy.d.ts
|
|
3
2
|
export declare const LOCAL_TOOL_NAMES: Set<string>;
|
|
4
3
|
export declare const APP_ONLY_LOCAL_TOOL_NAMES: Set<string>;
|
|
5
4
|
/** The structured refusal of a click refused for money; the view reads it (chain-insights-ui apps/claude-view/credits.ts). */
|
|
@@ -14,6 +13,7 @@ export declare function readClaudeViewHtml(): string;
|
|
|
14
13
|
export type McpProxyMode = 'workspace' | 'stateless';
|
|
15
14
|
export declare function resolveMcpProxyMode(env?: NodeJS.ProcessEnv): McpProxyMode;
|
|
16
15
|
export declare const GRAPH_QUERY_DEX_DOOR_SENTENCE = "A question that names an exchange and no address starts with meta_dex_lookup, never with a scan of :Protocol, :Pool or labels.";
|
|
16
|
+
export declare const GRAPH_QUERY_TOKEN_DOOR_SENTENCE = "A question that names a token by its ticker or name and gives no contract starts with meta_token_lookup: tickers collide, so never guess the contract.";
|
|
17
17
|
export declare const GRAPH_QUERY_ROLE_MARKS_SENTENCE = ":Sanctioned (is_sanctioned) means the address is on a sanctions list. :IssuerFrozen (is_issuer_frozen) means an issuer froze this wallet; the token in labels says which. Neither is :Scam.";
|
|
18
18
|
export declare const KNOWN_PUBLIC_TOOL_DESCRIPTIONS: Record<string, string>;
|
|
19
19
|
type ToolInputShape = Record<string, z.ZodTypeAny>;
|
|
@@ -27,5 +27,5 @@ export declare function knownPublicToolInputSchema(toolName: string): ToolInputS
|
|
|
27
27
|
* All diagnostic output goes to console.error() or process.stderr.write().
|
|
28
28
|
*/
|
|
29
29
|
export declare function createProxy(): Promise<void>;
|
|
30
|
-
|
|
30
|
+
export {};
|
|
31
31
|
//# sourceMappingURL=mcp-proxy.d.mts.map
|
package/dist/mcp-proxy.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-proxy.d.mts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-proxy.d.mts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";qBA4Ea,kBAAgB;qBAehB,2BAAyB;;qBAEzB;qBAUA;qBACA;;;;;wBAyBG;YAkBJ;wBAEI,oBAAoB,MAAK,OAAO,aAA2B;qBAiB9D;qBAIA;qBAKA;qBAGA,gCAAgC;KAuBxC,iBAAiB,eAAe,EAAE;qBAgB1B;wBA2GG,2BAA2B,mBAAmB;;;;;;;;wBAomBxC,eAAe"}
|