chain-insights 0.84.0 → 0.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +5 -5
- package/dist/cli.mjs +5 -5
- package/dist/{deployer-screen-DQw3pC0E.cjs → deployer-screen-9VSQsq1A.cjs} +1 -1
- package/dist/{deployer-screen-e3IbG1Y_.mjs → deployer-screen-Bd1sBcnt.mjs} +2 -2
- package/dist/{deployer-screen-e3IbG1Y_.mjs.map → deployer-screen-Bd1sBcnt.mjs.map} +1 -1
- package/dist/{exchange-deposit-check-9bGrKwcX.mjs → exchange-deposit-check-BgmQnC7m.mjs} +2 -2
- package/dist/{exchange-deposit-check-9bGrKwcX.mjs.map → exchange-deposit-check-BgmQnC7m.mjs.map} +1 -1
- package/dist/{exchange-deposit-check-ClPd7HQl.cjs → exchange-deposit-check-DfqrUzIm.cjs} +1 -1
- package/dist/mcp-proxy.cjs +3 -3
- package/dist/mcp-proxy.mjs +3 -3
- package/dist/{token-lookup-D-5GBEwF.cjs → token-lookup-Ckg-Rliv.cjs} +66 -12
- package/dist/{token-lookup-QpIv77P2.mjs → token-lookup-Dtid9MwW.mjs} +67 -13
- package/dist/token-lookup-Dtid9MwW.mjs.map +1 -0
- package/docs/mcp-proxy.md +37 -28
- package/package.json +2 -2
- package/registry/README.md +2 -2
- package/registry/robinhood.json +85 -2
- package/registry/robinhood.md +33 -2
- package/skills/chain-insights-cypher/SKILL.md +1 -1
- package/skills/chain-insights-dex/SKILL.md +4 -1
- package/skills/chain-insights-dex-vault/SKILL.md +19 -3
- package/skills/chain-insights-virtuals/SKILL.md +1 -1
- package/dist/token-lookup-QpIv77P2.mjs.map +0 -1
|
@@ -13,6 +13,11 @@ const require_print_result = require("./print-result-BYppJlUi.cjs");
|
|
|
13
13
|
* symbol or the name, case-insensitively and exactly, and orders the rows
|
|
14
14
|
* verified first, then oldest first. The proxy keeps that order.
|
|
15
15
|
*
|
|
16
|
+
* The read also asks the server how many contracts match. When more match than
|
|
17
|
+
* the 25 listed, a second read brings the newest: a copy of a verified token is
|
|
18
|
+
* made after it, so the oldest 25 alone hide exactly the copies. A server that
|
|
19
|
+
* does not count yet is read the old way, and the answer says the list is a part.
|
|
20
|
+
*
|
|
16
21
|
* Tickers collide on purpose: clones reuse a symbol to borrow its trust. The
|
|
17
22
|
* tool never picks one. The description below is the contract with every
|
|
18
23
|
* host, Claude Desktop chat included, which reads no skill.
|
|
@@ -26,7 +31,7 @@ var token_lookup_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll(
|
|
|
26
31
|
const META_TOKEN_LOOKUP_TOOL = "meta_token_lookup";
|
|
27
32
|
const META_TOKEN_LOOKUP_SCHEMA = "chain-insights.meta-token-lookup.v1";
|
|
28
33
|
const META_TOKEN_LOOKUP_TITLE = "Token by ticker or name";
|
|
29
|
-
const META_TOKEN_LOOKUP_DESCRIPTION = "Call this first when a question names a token by its ticker or name and gives no contract (TCITY, USDG, SPCX). It returns
|
|
34
|
+
const META_TOKEN_LOOKUP_DESCRIPTION = "Call this first when a question names a token by its ticker or name and gives no contract (TCITY, USDG, SPCX). It returns the contracts on the network that carry that symbol, verified first, then oldest first, with the count of all of them and, when more than 25 match, the newest ones too. Tickers collide: never treat the first row as the token. When several match, name them and ask, or pick by the evidence the user gave. Zero candidates means no contract carries the symbol: say so, and do not search the web.";
|
|
30
35
|
const META_TOKEN_LOOKUP_ANNOTATIONS = {
|
|
31
36
|
readOnlyHint: true,
|
|
32
37
|
idempotentHint: true,
|
|
@@ -72,9 +77,14 @@ function textResult(structured) {
|
|
|
72
77
|
isError: false
|
|
73
78
|
};
|
|
74
79
|
}
|
|
75
|
-
/**
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
/**
|
|
81
|
+
* The facts Asset read by symbol or by name. `counted` asks the server for the
|
|
82
|
+
* number of contracts that match, on every row. `newest` reads the newest 25
|
|
83
|
+
* instead of verified first, then oldest first. With neither it is the read
|
|
84
|
+
* every server admits.
|
|
85
|
+
*/
|
|
86
|
+
function assetQuery(key, value, form = "plain") {
|
|
87
|
+
return `USE facts MATCH (t:Asset {${key}: "${value}"}) RETURN t.asset_contract AS contract, t.asset_symbol AS symbol, t.name AS name, t.token_standard AS token_standard, t.decimals AS decimals, t.verified AS verified, t.verification_source AS verification_source, t.first_seen_timestamp AS first_seen_timestamp` + (form === "counted" ? ", t.match_count AS match_count" : "") + (form === "newest" ? ` ORDER BY t.first_seen_timestamp DESC LIMIT ${CANDIDATES_MAX}` : ` LIMIT ${ROWS_READ}`);
|
|
78
88
|
}
|
|
79
89
|
/** The topology read of who deployed one contract: the deploying address and the transaction's sender. */
|
|
80
90
|
function creatorQuery(contract) {
|
|
@@ -146,12 +156,12 @@ function candidateOf(row) {
|
|
|
146
156
|
factory: null
|
|
147
157
|
};
|
|
148
158
|
}
|
|
149
|
-
async function readAssets(deps, network, key, value) {
|
|
159
|
+
async function readAssets(deps, network, key, value, form) {
|
|
150
160
|
let answer;
|
|
151
161
|
try {
|
|
152
162
|
answer = await deps.graphQuery({
|
|
153
163
|
network,
|
|
154
|
-
query: assetQuery(key, value)
|
|
164
|
+
query: assetQuery(key, value, form)
|
|
155
165
|
});
|
|
156
166
|
} catch (err) {
|
|
157
167
|
return {
|
|
@@ -225,7 +235,8 @@ async function readCreators(deps, network, candidates) {
|
|
|
225
235
|
}
|
|
226
236
|
const NO_WEB = "Do not search the web and do not guess a contract: a web page is not a contract on this network.";
|
|
227
237
|
function hintFor(result, creatorsNotRead) {
|
|
228
|
-
const { network, query, candidates, matched_on, truncated } = result;
|
|
238
|
+
const { network, query, candidates, matched_on, truncated, matches, newest } = result;
|
|
239
|
+
const later = result.first_seen_after_verified;
|
|
229
240
|
const parts = [require_answer_hint.ANSWER_HINT];
|
|
230
241
|
if (candidates.length === 0) {
|
|
231
242
|
parts.push(`No contract on ${network} carries the symbol or the name "${query}". Say so in one line. ${NO_WEB} Ask the user for the contract if they have one.`);
|
|
@@ -233,7 +244,13 @@ function hintFor(result, creatorsNotRead) {
|
|
|
233
244
|
}
|
|
234
245
|
if (matched_on === "name") parts.push(`No contract carries "${query}" as its symbol; these carry it as their name.`);
|
|
235
246
|
if (candidates.length === 1) parts.push(`One contract on ${network} carries "${query}": ${candidates[0].contract}. Say it is the only one on this network, then read it by this full contract on USE topology.`);
|
|
236
|
-
else
|
|
247
|
+
else {
|
|
248
|
+
if (!truncated) parts.push(`${candidates.length} contracts on ${network} carry "${query}".`);
|
|
249
|
+
else if (matches === null) parts.push(`${candidates.length} contracts on ${network} carry "${query}", and more exist than the ${CANDIDATES_MAX} listed. The list is a part: never give its length as the count, and never say that none exist beyond it.`);
|
|
250
|
+
else parts.push(`${matches} contracts on ${network} carry "${query}". candidates lists ${candidates.length} of them, verified first, then oldest first${newest.length > 0 ? `, and newest lists the ${newest.length} newest that are not among them, newest first` : ""}. The lists are a part: the count is ${matches}, never the number of rows.`);
|
|
251
|
+
parts.push("Tickers collide: never treat the first row as the token. Name them, each contract in full, with its creator and first seen time, and ask which one the user means, or pick one by the evidence the user gave (a creator, a launch date, a price move) and say why.");
|
|
252
|
+
}
|
|
253
|
+
if (later && later.count > 0) parts.push(`${later.at_least ? "At least " : ""}${later.count} of them ${later.count === 1 ? "was" : "were"} first seen after the verified contract ${later.verified_contract}: each took a symbol that a verified token already carried. That is a copy of the name. A copied name alone is not proof of a scam.`);
|
|
237
254
|
if (creatorsNotRead) parts.push(`The creators were not read for ${creatorsNotRead}. creator and factory are empty there because the read failed, not because the chain holds none.`);
|
|
238
255
|
parts.push("Write every contract and creator in full, 0x plus 40 hex characters.");
|
|
239
256
|
return parts.join(" ");
|
|
@@ -263,17 +280,25 @@ async function handleMetaTokenLookup(args, deps) {
|
|
|
263
280
|
candidates: [],
|
|
264
281
|
total: 0,
|
|
265
282
|
truncated: false,
|
|
283
|
+
matches: null,
|
|
284
|
+
newest: [],
|
|
285
|
+
first_seen_after_verified: null,
|
|
266
286
|
hint: `${require_answer_hint.ANSWER_HINT} ${address} is a contract address, not a ticker: ${ADDRESS_INPUT_HINT}. Send no token lookup for it.`
|
|
267
287
|
});
|
|
268
288
|
}
|
|
269
289
|
if (unsafeLiteral(symbol)) return errorResult("invalid_symbol: a symbol holds no double quote, backslash or control character. Send the ticker or the name as plain text.");
|
|
270
290
|
const unavailable = await deps.unavailable?.();
|
|
271
291
|
if (unavailable) return errorResult(`No token read was sent: ${unavailable} The lookup has no answer yet, which is not "no contract": try again later, or ask the user for the contract. ${NO_WEB}`);
|
|
292
|
+
let form = "counted";
|
|
272
293
|
let matchedOn = "symbol";
|
|
273
|
-
let read = await readAssets(deps, network, "symbol", symbol);
|
|
294
|
+
let read = await readAssets(deps, network, "symbol", symbol, form);
|
|
295
|
+
if (read.kind === "not_served") {
|
|
296
|
+
form = "plain";
|
|
297
|
+
read = await readAssets(deps, network, "symbol", symbol, form);
|
|
298
|
+
}
|
|
274
299
|
if (read.kind === "rows" && read.rows.length === 0) {
|
|
275
300
|
matchedOn = "name";
|
|
276
|
-
read = await readAssets(deps, network, "name", symbol);
|
|
301
|
+
read = await readAssets(deps, network, "name", symbol, form);
|
|
277
302
|
}
|
|
278
303
|
if (read.kind === "failed") return errorResult(`The token read failed: ${read.text} This is not "no contract": send the same lookup again once, or ask the user for the contract. ${NO_WEB}`);
|
|
279
304
|
if (read.kind === "not_served") return textResult({
|
|
@@ -282,17 +307,46 @@ async function handleMetaTokenLookup(args, deps) {
|
|
|
282
307
|
candidates: [],
|
|
283
308
|
total: 0,
|
|
284
309
|
truncated: false,
|
|
310
|
+
matches: null,
|
|
311
|
+
newest: [],
|
|
312
|
+
first_seen_after_verified: null,
|
|
285
313
|
hint: `${require_answer_hint.ANSWER_HINT} This lookup gave no answer (${read.refusal.code}). That is not "no contract carries ${symbol}": ask the user for the token's contract, 0x plus 40 hex characters. ${NO_WEB}`
|
|
286
314
|
});
|
|
287
315
|
const total = read.rows.length;
|
|
316
|
+
const truncated = total > CANDIDATES_MAX;
|
|
288
317
|
const candidates = read.rows.slice(0, CANDIDATES_MAX).map(candidateOf).filter((candidate) => candidate !== null);
|
|
289
|
-
const
|
|
318
|
+
const counted = form === "counted" ? numberOrNull(read.rows[0]?.match_count) : null;
|
|
319
|
+
const matches = counted !== null && counted >= total ? counted : truncated ? null : total;
|
|
320
|
+
let newestPage = null;
|
|
321
|
+
if (truncated && form === "counted") {
|
|
322
|
+
const page = await readAssets(deps, network, matchedOn, symbol, "newest");
|
|
323
|
+
if (page.kind === "rows") newestPage = page.rows.map(candidateOf).filter((candidate) => candidate !== null);
|
|
324
|
+
}
|
|
325
|
+
const listed = new Set(candidates.map((candidate) => candidate.contract));
|
|
326
|
+
const verified = candidates.filter((candidate) => candidate.verified);
|
|
327
|
+
const anchor = verified.length === 1 && verified[0].first_seen_timestamp !== null ? verified[0] : null;
|
|
328
|
+
const after = (candidate) => anchor !== null && candidate.first_seen_timestamp !== null && candidate.first_seen_timestamp > anchor.first_seen_timestamp;
|
|
329
|
+
let firstSeenAfterVerified = null;
|
|
330
|
+
if (anchor) {
|
|
331
|
+
const pool = !truncated ? candidates : newestPage ?? candidates;
|
|
332
|
+
const reachesBack = !truncated || newestPage !== null && (newestPage.length < CANDIDATES_MAX || newestPage.some((row) => !after(row)));
|
|
333
|
+
firstSeenAfterVerified = {
|
|
334
|
+
verified_contract: anchor.contract,
|
|
335
|
+
count: pool.filter(after).length,
|
|
336
|
+
at_least: !reachesBack
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
const newest = (newestPage ?? []).filter((candidate) => !listed.has(candidate.contract));
|
|
340
|
+
const creatorsNotRead = candidates.length > 0 ? await readCreators(deps, network, [...candidates, ...newest]) : null;
|
|
290
341
|
const result = {
|
|
291
342
|
...base,
|
|
292
343
|
matched_on: candidates.length > 0 ? matchedOn : null,
|
|
293
344
|
candidates,
|
|
294
345
|
total,
|
|
295
|
-
truncated
|
|
346
|
+
truncated,
|
|
347
|
+
matches,
|
|
348
|
+
newest,
|
|
349
|
+
first_seen_after_verified: firstSeenAfterVerified
|
|
296
350
|
};
|
|
297
351
|
return textResult({
|
|
298
352
|
...result,
|
|
@@ -13,6 +13,11 @@ import { i as isEpochMs, o as utcText } from "./print-result-IFARsMnL.mjs";
|
|
|
13
13
|
* symbol or the name, case-insensitively and exactly, and orders the rows
|
|
14
14
|
* verified first, then oldest first. The proxy keeps that order.
|
|
15
15
|
*
|
|
16
|
+
* The read also asks the server how many contracts match. When more match than
|
|
17
|
+
* the 25 listed, a second read brings the newest: a copy of a verified token is
|
|
18
|
+
* made after it, so the oldest 25 alone hide exactly the copies. A server that
|
|
19
|
+
* does not count yet is read the old way, and the answer says the list is a part.
|
|
20
|
+
*
|
|
16
21
|
* Tickers collide on purpose: clones reuse a symbol to borrow its trust. The
|
|
17
22
|
* tool never picks one. The description below is the contract with every
|
|
18
23
|
* host, Claude Desktop chat included, which reads no skill.
|
|
@@ -26,7 +31,7 @@ var token_lookup_exports = /* @__PURE__ */ __exportAll({
|
|
|
26
31
|
const META_TOKEN_LOOKUP_TOOL = "meta_token_lookup";
|
|
27
32
|
const META_TOKEN_LOOKUP_SCHEMA = "chain-insights.meta-token-lookup.v1";
|
|
28
33
|
const META_TOKEN_LOOKUP_TITLE = "Token by ticker or name";
|
|
29
|
-
const META_TOKEN_LOOKUP_DESCRIPTION = "Call this first when a question names a token by its ticker or name and gives no contract (TCITY, USDG, SPCX). It returns
|
|
34
|
+
const META_TOKEN_LOOKUP_DESCRIPTION = "Call this first when a question names a token by its ticker or name and gives no contract (TCITY, USDG, SPCX). It returns the contracts on the network that carry that symbol, verified first, then oldest first, with the count of all of them and, when more than 25 match, the newest ones too. Tickers collide: never treat the first row as the token. When several match, name them and ask, or pick by the evidence the user gave. Zero candidates means no contract carries the symbol: say so, and do not search the web.";
|
|
30
35
|
const META_TOKEN_LOOKUP_ANNOTATIONS = {
|
|
31
36
|
readOnlyHint: true,
|
|
32
37
|
idempotentHint: true,
|
|
@@ -72,9 +77,14 @@ function textResult(structured) {
|
|
|
72
77
|
isError: false
|
|
73
78
|
};
|
|
74
79
|
}
|
|
75
|
-
/**
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
/**
|
|
81
|
+
* The facts Asset read by symbol or by name. `counted` asks the server for the
|
|
82
|
+
* number of contracts that match, on every row. `newest` reads the newest 25
|
|
83
|
+
* instead of verified first, then oldest first. With neither it is the read
|
|
84
|
+
* every server admits.
|
|
85
|
+
*/
|
|
86
|
+
function assetQuery(key, value, form = "plain") {
|
|
87
|
+
return `USE facts MATCH (t:Asset {${key}: "${value}"}) RETURN t.asset_contract AS contract, t.asset_symbol AS symbol, t.name AS name, t.token_standard AS token_standard, t.decimals AS decimals, t.verified AS verified, t.verification_source AS verification_source, t.first_seen_timestamp AS first_seen_timestamp` + (form === "counted" ? ", t.match_count AS match_count" : "") + (form === "newest" ? ` ORDER BY t.first_seen_timestamp DESC LIMIT ${CANDIDATES_MAX}` : ` LIMIT ${ROWS_READ}`);
|
|
78
88
|
}
|
|
79
89
|
/** The topology read of who deployed one contract: the deploying address and the transaction's sender. */
|
|
80
90
|
function creatorQuery(contract) {
|
|
@@ -146,12 +156,12 @@ function candidateOf(row) {
|
|
|
146
156
|
factory: null
|
|
147
157
|
};
|
|
148
158
|
}
|
|
149
|
-
async function readAssets(deps, network, key, value) {
|
|
159
|
+
async function readAssets(deps, network, key, value, form) {
|
|
150
160
|
let answer;
|
|
151
161
|
try {
|
|
152
162
|
answer = await deps.graphQuery({
|
|
153
163
|
network,
|
|
154
|
-
query: assetQuery(key, value)
|
|
164
|
+
query: assetQuery(key, value, form)
|
|
155
165
|
});
|
|
156
166
|
} catch (err) {
|
|
157
167
|
return {
|
|
@@ -225,7 +235,8 @@ async function readCreators(deps, network, candidates) {
|
|
|
225
235
|
}
|
|
226
236
|
const NO_WEB = "Do not search the web and do not guess a contract: a web page is not a contract on this network.";
|
|
227
237
|
function hintFor(result, creatorsNotRead) {
|
|
228
|
-
const { network, query, candidates, matched_on, truncated } = result;
|
|
238
|
+
const { network, query, candidates, matched_on, truncated, matches, newest } = result;
|
|
239
|
+
const later = result.first_seen_after_verified;
|
|
229
240
|
const parts = [ANSWER_HINT];
|
|
230
241
|
if (candidates.length === 0) {
|
|
231
242
|
parts.push(`No contract on ${network} carries the symbol or the name "${query}". Say so in one line. ${NO_WEB} Ask the user for the contract if they have one.`);
|
|
@@ -233,7 +244,13 @@ function hintFor(result, creatorsNotRead) {
|
|
|
233
244
|
}
|
|
234
245
|
if (matched_on === "name") parts.push(`No contract carries "${query}" as its symbol; these carry it as their name.`);
|
|
235
246
|
if (candidates.length === 1) parts.push(`One contract on ${network} carries "${query}": ${candidates[0].contract}. Say it is the only one on this network, then read it by this full contract on USE topology.`);
|
|
236
|
-
else
|
|
247
|
+
else {
|
|
248
|
+
if (!truncated) parts.push(`${candidates.length} contracts on ${network} carry "${query}".`);
|
|
249
|
+
else if (matches === null) parts.push(`${candidates.length} contracts on ${network} carry "${query}", and more exist than the ${CANDIDATES_MAX} listed. The list is a part: never give its length as the count, and never say that none exist beyond it.`);
|
|
250
|
+
else parts.push(`${matches} contracts on ${network} carry "${query}". candidates lists ${candidates.length} of them, verified first, then oldest first${newest.length > 0 ? `, and newest lists the ${newest.length} newest that are not among them, newest first` : ""}. The lists are a part: the count is ${matches}, never the number of rows.`);
|
|
251
|
+
parts.push("Tickers collide: never treat the first row as the token. Name them, each contract in full, with its creator and first seen time, and ask which one the user means, or pick one by the evidence the user gave (a creator, a launch date, a price move) and say why.");
|
|
252
|
+
}
|
|
253
|
+
if (later && later.count > 0) parts.push(`${later.at_least ? "At least " : ""}${later.count} of them ${later.count === 1 ? "was" : "were"} first seen after the verified contract ${later.verified_contract}: each took a symbol that a verified token already carried. That is a copy of the name. A copied name alone is not proof of a scam.`);
|
|
237
254
|
if (creatorsNotRead) parts.push(`The creators were not read for ${creatorsNotRead}. creator and factory are empty there because the read failed, not because the chain holds none.`);
|
|
238
255
|
parts.push("Write every contract and creator in full, 0x plus 40 hex characters.");
|
|
239
256
|
return parts.join(" ");
|
|
@@ -263,17 +280,25 @@ async function handleMetaTokenLookup(args, deps) {
|
|
|
263
280
|
candidates: [],
|
|
264
281
|
total: 0,
|
|
265
282
|
truncated: false,
|
|
283
|
+
matches: null,
|
|
284
|
+
newest: [],
|
|
285
|
+
first_seen_after_verified: null,
|
|
266
286
|
hint: `${ANSWER_HINT} ${address} is a contract address, not a ticker: ${ADDRESS_INPUT_HINT}. Send no token lookup for it.`
|
|
267
287
|
});
|
|
268
288
|
}
|
|
269
289
|
if (unsafeLiteral(symbol)) return errorResult("invalid_symbol: a symbol holds no double quote, backslash or control character. Send the ticker or the name as plain text.");
|
|
270
290
|
const unavailable = await deps.unavailable?.();
|
|
271
291
|
if (unavailable) return errorResult(`No token read was sent: ${unavailable} The lookup has no answer yet, which is not "no contract": try again later, or ask the user for the contract. ${NO_WEB}`);
|
|
292
|
+
let form = "counted";
|
|
272
293
|
let matchedOn = "symbol";
|
|
273
|
-
let read = await readAssets(deps, network, "symbol", symbol);
|
|
294
|
+
let read = await readAssets(deps, network, "symbol", symbol, form);
|
|
295
|
+
if (read.kind === "not_served") {
|
|
296
|
+
form = "plain";
|
|
297
|
+
read = await readAssets(deps, network, "symbol", symbol, form);
|
|
298
|
+
}
|
|
274
299
|
if (read.kind === "rows" && read.rows.length === 0) {
|
|
275
300
|
matchedOn = "name";
|
|
276
|
-
read = await readAssets(deps, network, "name", symbol);
|
|
301
|
+
read = await readAssets(deps, network, "name", symbol, form);
|
|
277
302
|
}
|
|
278
303
|
if (read.kind === "failed") return errorResult(`The token read failed: ${read.text} This is not "no contract": send the same lookup again once, or ask the user for the contract. ${NO_WEB}`);
|
|
279
304
|
if (read.kind === "not_served") return textResult({
|
|
@@ -282,17 +307,46 @@ async function handleMetaTokenLookup(args, deps) {
|
|
|
282
307
|
candidates: [],
|
|
283
308
|
total: 0,
|
|
284
309
|
truncated: false,
|
|
310
|
+
matches: null,
|
|
311
|
+
newest: [],
|
|
312
|
+
first_seen_after_verified: null,
|
|
285
313
|
hint: `${ANSWER_HINT} This lookup gave no answer (${read.refusal.code}). That is not "no contract carries ${symbol}": ask the user for the token's contract, 0x plus 40 hex characters. ${NO_WEB}`
|
|
286
314
|
});
|
|
287
315
|
const total = read.rows.length;
|
|
316
|
+
const truncated = total > CANDIDATES_MAX;
|
|
288
317
|
const candidates = read.rows.slice(0, CANDIDATES_MAX).map(candidateOf).filter((candidate) => candidate !== null);
|
|
289
|
-
const
|
|
318
|
+
const counted = form === "counted" ? numberOrNull(read.rows[0]?.match_count) : null;
|
|
319
|
+
const matches = counted !== null && counted >= total ? counted : truncated ? null : total;
|
|
320
|
+
let newestPage = null;
|
|
321
|
+
if (truncated && form === "counted") {
|
|
322
|
+
const page = await readAssets(deps, network, matchedOn, symbol, "newest");
|
|
323
|
+
if (page.kind === "rows") newestPage = page.rows.map(candidateOf).filter((candidate) => candidate !== null);
|
|
324
|
+
}
|
|
325
|
+
const listed = new Set(candidates.map((candidate) => candidate.contract));
|
|
326
|
+
const verified = candidates.filter((candidate) => candidate.verified);
|
|
327
|
+
const anchor = verified.length === 1 && verified[0].first_seen_timestamp !== null ? verified[0] : null;
|
|
328
|
+
const after = (candidate) => anchor !== null && candidate.first_seen_timestamp !== null && candidate.first_seen_timestamp > anchor.first_seen_timestamp;
|
|
329
|
+
let firstSeenAfterVerified = null;
|
|
330
|
+
if (anchor) {
|
|
331
|
+
const pool = !truncated ? candidates : newestPage ?? candidates;
|
|
332
|
+
const reachesBack = !truncated || newestPage !== null && (newestPage.length < CANDIDATES_MAX || newestPage.some((row) => !after(row)));
|
|
333
|
+
firstSeenAfterVerified = {
|
|
334
|
+
verified_contract: anchor.contract,
|
|
335
|
+
count: pool.filter(after).length,
|
|
336
|
+
at_least: !reachesBack
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
const newest = (newestPage ?? []).filter((candidate) => !listed.has(candidate.contract));
|
|
340
|
+
const creatorsNotRead = candidates.length > 0 ? await readCreators(deps, network, [...candidates, ...newest]) : null;
|
|
290
341
|
const result = {
|
|
291
342
|
...base,
|
|
292
343
|
matched_on: candidates.length > 0 ? matchedOn : null,
|
|
293
344
|
candidates,
|
|
294
345
|
total,
|
|
295
|
-
truncated
|
|
346
|
+
truncated,
|
|
347
|
+
matches,
|
|
348
|
+
newest,
|
|
349
|
+
first_seen_after_verified: firstSeenAfterVerified
|
|
296
350
|
};
|
|
297
351
|
return textResult({
|
|
298
352
|
...result,
|
|
@@ -301,4 +355,4 @@ async function handleMetaTokenLookup(args, deps) {
|
|
|
301
355
|
}
|
|
302
356
|
export { SYMBOL_MAX as a, refusalOf as c, META_TOKEN_LOOKUP_TOOL as i, token_lookup_exports as l, META_TOKEN_LOOKUP_DESCRIPTION as n, handleMetaTokenLookup as o, META_TOKEN_LOOKUP_TITLE as r, membersOf as s, META_TOKEN_LOOKUP_ANNOTATIONS as t };
|
|
303
357
|
|
|
304
|
-
//# sourceMappingURL=token-lookup-
|
|
358
|
+
//# sourceMappingURL=token-lookup-Dtid9MwW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-lookup-Dtid9MwW.mjs","names":[],"sources":["../src/mcp/token-lookup.ts"],"sourcesContent":["/**\n * meta_token_lookup: a ticker or a token name becomes its contracts.\n *\n * A local tool of the proxy. It sends one anchored facts read of the Asset\n * lookup by symbol, the same read by name when the symbol answers nothing, and\n * then the creator and the factory of each candidate from topology, one batch\n * member per candidate. Nothing is matched here: the graph server matches the\n * symbol or the name, case-insensitively and exactly, and orders the rows\n * verified first, then oldest first. The proxy keeps that order.\n *\n * The read also asks the server how many contracts match. When more match than\n * the 25 listed, a second read brings the newest: a copy of a verified token is\n * made after it, so the oldest 25 alone hide exactly the copies. A server that\n * does not count yet is read the old way, and the answer says the list is a part.\n *\n * Tickers collide on purpose: clones reuse a symbol to borrow its trust. The\n * tool never picks one. The description below is the contract with every\n * host, Claude Desktop chat included, which reads no skill.\n */\n\nimport { ANSWER_HINT } from './answer-hint.js'\nimport { DexRegistryError, normalizeDexNetwork } from './dex-registry.js'\nimport { isEpochMs, utcText } from './timestamp-text.js'\n\nexport const META_TOKEN_LOOKUP_TOOL = 'meta_token_lookup'\nexport const META_TOKEN_LOOKUP_SCHEMA = 'chain-insights.meta-token-lookup.v1' as const\nexport const META_TOKEN_LOOKUP_TITLE = 'Token by ticker or name'\nexport const META_TOKEN_LOOKUP_DESCRIPTION =\n 'Call this first when a question names a token by its ticker or name and gives no contract ' +\n '(TCITY, USDG, SPCX). It returns the contracts on the network that carry that symbol, ' +\n 'verified first, then oldest first, with the count of all of them and, when more than 25 match, ' +\n 'the newest ones too. Tickers collide: never treat the first row as the token. ' +\n 'When several match, name them and ask, or pick by the evidence the user gave. Zero candidates ' +\n 'means no contract carries the symbol: say so, and do not search the web.'\nexport const META_TOKEN_LOOKUP_ANNOTATIONS = {\n readOnlyHint: true,\n idempotentHint: true,\n openWorldHint: false,\n} as const\nexport const META_TOKEN_LOOKUP_ARGS = ['network', 'symbol'] as const\n\n/** The candidates returned. The read asks for one more, so a full page says there are more. */\nexport const CANDIDATES_MAX = 25\nexport const ROWS_READ = CANDIDATES_MAX + 1\n/** The graph server admits at most 20 members in one graph_query_batch. */\nexport const CREATOR_BATCH_MAX = 20\nexport const SYMBOL_MAX = 64\n\nexport const ADDRESS_INPUT_HINT = 'an address is already an anchor: read it on USE topology'\n\nexport interface TokenCandidate {\n contract: string\n symbol: string | null\n name: string | null\n token_standard: string | null\n decimals: number | null\n verified: boolean\n verification_source: string | null\n first_seen_timestamp: number | null\n first_seen_timestamp_utc: string | null\n creator: string | null\n factory: string | null\n}\n\nexport interface MetaTokenLookupResult {\n schema: typeof META_TOKEN_LOOKUP_SCHEMA\n network: string\n query: string\n matched_on: 'symbol' | 'name' | null\n candidates: TokenCandidate[]\n /** The rows the server sent, at most 26: 26 means there are more than the 25 returned. */\n total: number\n truncated: boolean\n /** How many contracts carry the key, counted by the server; null when the server does not count. */\n matches: number | null\n /** When more match than the candidates listed: the newest that are not among them, newest first. */\n newest: TokenCandidate[]\n /** With exactly one verified candidate: how many contracts were first seen after it. */\n first_seen_after_verified: { verified_contract: string; count: number; at_least: boolean } | null\n hint: string\n}\n\n/** One graph_query or graph_query_batch reply as the remote client returns it. */\nexport type GraphAnswer = {\n content?: unknown[]\n structuredContent?: unknown\n isError?: boolean\n}\n\nexport interface TokenToolDependencies {\n /** One graph_query through the proxy's remote client, billed as any read. */\n graphQuery: (args: { network: string; query: string }) => Promise<GraphAnswer>\n /** One graph_query_batch through the proxy's remote client, billed as any read. */\n graphQueryBatch: (args: {\n network: string\n queries: Array<{ id: string; query: string }>\n }) => Promise<GraphAnswer>\n /** The reason no read can be sent now, or undefined when the graph is reachable. */\n unavailable?: () => Promise<string | undefined> | string | undefined\n /** The text of a call that threw: payment required, transport. */\n describeFailure: (err: unknown) => string\n}\n\nexport type MetaTokenLookupToolResult = {\n content: Array<{ type: 'text'; text: string }>\n structuredContent?: Record<string, unknown>\n isError: boolean\n}\n\nconst ADDRESS_FORM = /^0x[0-9a-fA-F]{40}$/\nconst CONTRACT_FORM = /^0x[0-9a-f]{40}$/\n// A string literal of the read holds no double quote, no backslash and no\n// control character: the symbol is refused rather than escaped, so the read the\n// server receives is always the read written here.\nfunction unsafeLiteral(text: string): boolean {\n for (const char of text) {\n const code = char.codePointAt(0)!\n if (char === '\"' || char === '\\\\' || code < 0x20 || code === 0x7f) return true\n }\n return false\n}\nconst CODE_PREFIX = /^([a-z][a-z0-9_]*):\\s*/\n// Codes of a read that was stopped, not refused: the same read may answer later.\nconst TRANSIENT_CODE =\n /(timeout|memory_limit|cpu_limit|busy|_failed$|rate_limited|unavailable|too_large|node_error)/\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === 'object' && !Array.isArray(value)\n}\n\nfunction errorResult(text: string): MetaTokenLookupToolResult {\n return { content: [{ type: 'text', text }], isError: true }\n}\n\nfunction textResult(structured: MetaTokenLookupResult): MetaTokenLookupToolResult {\n return {\n content: [{ type: 'text', text: JSON.stringify(structured, null, 2) }],\n structuredContent: structured as unknown as Record<string, unknown>,\n isError: false,\n }\n}\n\n/**\n * The facts Asset read by symbol or by name. `counted` asks the server for the\n * number of contracts that match, on every row. `newest` reads the newest 25\n * instead of verified first, then oldest first. With neither it is the read\n * every server admits.\n */\nexport function assetQuery(\n key: 'symbol' | 'name',\n value: string,\n form: 'plain' | 'counted' | 'newest' = 'plain'\n): string {\n return (\n `USE facts MATCH (t:Asset {${key}: \"${value}\"}) ` +\n 'RETURN t.asset_contract AS contract, t.asset_symbol AS symbol, t.name AS name, ' +\n 't.token_standard AS token_standard, t.decimals AS decimals, t.verified AS verified, ' +\n 't.verification_source AS verification_source, t.first_seen_timestamp AS first_seen_timestamp' +\n (form === 'counted' ? ', t.match_count AS match_count' : '') +\n (form === 'newest'\n ? ` ORDER BY t.first_seen_timestamp DESC LIMIT ${CANDIDATES_MAX}`\n : ` LIMIT ${ROWS_READ}`)\n )\n}\n\n/** The topology read of who deployed one contract: the deploying address and the transaction's sender. */\nexport function creatorQuery(contract: string): string {\n return (\n `USE topology MATCH (f:Address)-[d:DEPLOYED_CONTRACT]->(t:Address {address: \"${contract}\"}) ` +\n 'RETURN f.address AS factory, d.tx_origin AS creator LIMIT 1'\n )\n}\n\nconst textOrNull = (value: unknown): string | null =>\n typeof value === 'string' && value.trim() !== '' ? value : null\n\nconst numberOrNull = (value: unknown): number | null => {\n if (typeof value === 'number' && Number.isFinite(value)) return value\n if (typeof value === 'string' && value.trim() !== '' && Number.isFinite(Number(value)))\n return Number(value)\n return null\n}\n\nconst addressOrNull = (value: unknown): string | null =>\n typeof value === 'string' && ADDRESS_FORM.test(value.trim()) ? value.trim().toLowerCase() : null\n\nfunction verifiedOf(value: unknown): boolean {\n if (typeof value === 'boolean') return value\n if (typeof value === 'number') return value === 1\n if (typeof value === 'string') return ['true', '1'].includes(value.trim().toLowerCase())\n return false\n}\n\nfunction answerText(answer: GraphAnswer): string {\n return (Array.isArray(answer.content) ? answer.content : [])\n .map((block) => (isRecord(block) && typeof block.text === 'string' ? block.text : ''))\n .filter(Boolean)\n .join('\\n')\n .trim()\n}\n\nexport type Refusal = { code: string; text: string; transient: boolean }\n\n/** A graph_query answer that did not answer: its code, its text, and whether the same read may answer later. */\nexport function refusalOf(answer: GraphAnswer): Refusal {\n const text = answerText(answer)\n const detail = isRecord(answer.structuredContent)\n ? answer.structuredContent.error_detail\n : undefined\n const detailCode = isRecord(detail) && typeof detail.code === 'string' ? detail.code : ''\n const detailClass = isRecord(detail) && typeof detail.class === 'string' ? detail.class : ''\n const named = detailCode || CODE_PREFIX.exec(text)?.[1] || ''\n // A refusal that names no class is a stop only when its code says so; a\n // refusal in plain words (\"unknown label Asset\") is a server that lacks the read.\n const transient = detailClass ? detailClass !== 'refused' : TRANSIENT_CODE.test(named)\n const code = named || 'not_served'\n return { code, text: text || `${code}: the graph endpoint refused the read`, transient }\n}\n\n/** The result rows of a graph_query answer, or null when it holds none. */\nfunction rowsOf(answer: GraphAnswer): Array<Record<string, unknown>> | null {\n const facts = isRecord(answer.structuredContent) ? answer.structuredContent.facts : undefined\n const query = isRecord(facts) ? facts.query : undefined\n const results = isRecord(query) ? query.results : undefined\n return Array.isArray(results) ? results.filter(isRecord) : null\n}\n\nexport type Member = { id?: unknown; ok?: unknown; results?: unknown; error?: unknown }\n\n/** The members of a graph_query_batch answer by id. */\nexport function membersOf(answer: GraphAnswer): Map<string, Member> {\n const facts = isRecord(answer.structuredContent) ? answer.structuredContent.facts : undefined\n const queries = isRecord(facts) ? facts.queries : undefined\n const members = new Map<string, Member>()\n if (Array.isArray(queries)) {\n for (const member of queries)\n if (isRecord(member) && typeof member.id === 'string') members.set(member.id, member)\n }\n return members\n}\n\nfunction candidateOf(row: Record<string, unknown>): TokenCandidate | null {\n const contract = textOrNull(row.contract)?.trim().toLowerCase()\n if (!contract) return null\n const firstSeen = numberOrNull(row.first_seen_timestamp)\n return {\n contract,\n symbol: textOrNull(row.symbol),\n name: textOrNull(row.name),\n token_standard: textOrNull(row.token_standard),\n decimals: numberOrNull(row.decimals),\n verified: verifiedOf(row.verified),\n verification_source: textOrNull(row.verification_source),\n first_seen_timestamp: firstSeen,\n first_seen_timestamp_utc: isEpochMs(firstSeen) ? utcText(firstSeen) : null,\n creator: null,\n factory: null,\n }\n}\n\ntype Read =\n | { kind: 'rows'; rows: Array<Record<string, unknown>> }\n | { kind: 'not_served'; refusal: Refusal }\n | { kind: 'failed'; text: string }\n\nasync function readAssets(\n deps: TokenToolDependencies,\n network: string,\n key: 'symbol' | 'name',\n value: string,\n form: 'plain' | 'counted' | 'newest'\n): Promise<Read> {\n let answer: GraphAnswer\n try {\n answer = await deps.graphQuery({ network, query: assetQuery(key, value, form) })\n } catch (err) {\n return { kind: 'failed', text: deps.describeFailure(err) }\n }\n const rows = rowsOf(answer)\n if (answer.isError !== true && rows !== null) return { kind: 'rows', rows }\n const refusal = refusalOf(answer)\n if (answer.isError === true && refusal.transient) return { kind: 'failed', text: refusal.text }\n return { kind: 'not_served', refusal }\n}\n\n/**\n * The creator and the factory of each candidate, written in place. Returns why\n * some creators were not read, or null when every read answered. A read that\n * answered with no row leaves the candidate's creator empty with no note: the\n * graph holds no deployment for it.\n */\nasync function readCreators(\n deps: TokenToolDependencies,\n network: string,\n candidates: TokenCandidate[]\n): Promise<string | null> {\n const contracts = [\n ...new Set(candidates.map((c) => c.contract).filter((c) => CONTRACT_FORM.test(c))),\n ]\n const found = new Map<string, { creator: string | null; factory: string | null }>()\n const reasons: string[] = []\n let unread = candidates.length - candidates.filter((c) => CONTRACT_FORM.test(c.contract)).length\n for (let at = 0; at < contracts.length; at += CREATOR_BATCH_MAX) {\n const chunk = contracts.slice(at, at + CREATOR_BATCH_MAX)\n const queries = chunk.map((contract) => ({\n id: `creator:${contract}`,\n query: creatorQuery(contract),\n }))\n let members = new Map<string, Member>()\n try {\n const answer = await deps.graphQueryBatch({ network, queries })\n members = membersOf(answer)\n if (members.size === 0) {\n reasons.push(\n answer.isError === true ? refusalOf(answer).text : 'the batch answer held no reads'\n )\n }\n } catch (err) {\n reasons.push(deps.describeFailure(err))\n }\n for (const contract of chunk) {\n const member = members.get(`creator:${contract}`)\n if (member?.ok === true && Array.isArray(member.results)) {\n const row = member.results.find(isRecord)\n found.set(contract, {\n creator: row ? addressOrNull(row.creator) : null,\n factory: row ? addressOrNull(row.factory) : null,\n })\n continue\n }\n unread += 1\n if (member && typeof member.error === 'string' && !reasons.includes(member.error))\n reasons.push(member.error)\n }\n }\n for (const candidate of candidates) {\n const read = found.get(candidate.contract)\n if (read) Object.assign(candidate, read)\n }\n if (unread === 0) return null\n return `${unread} of ${candidates.length}${reasons.length > 0 ? `: ${reasons.join('; ')}` : ''}`\n}\n\nconst NO_WEB =\n 'Do not search the web and do not guess a contract: a web page is not a contract on this network.'\n\nfunction hintFor(\n result: Omit<MetaTokenLookupResult, 'hint'>,\n creatorsNotRead: string | null\n): string {\n const { network, query, candidates, matched_on, truncated, matches, newest } = result\n const later = result.first_seen_after_verified\n const parts: string[] = [ANSWER_HINT]\n if (candidates.length === 0) {\n parts.push(\n `No contract on ${network} carries the symbol or the name \"${query}\". Say so in one line. ${NO_WEB} ` +\n 'Ask the user for the contract if they have one.'\n )\n return parts.join(' ')\n }\n if (matched_on === 'name') {\n parts.push(`No contract carries \"${query}\" as its symbol; these carry it as their name.`)\n }\n if (candidates.length === 1) {\n parts.push(\n `One contract on ${network} carries \"${query}\": ${candidates[0]!.contract}. ` +\n 'Say it is the only one on this network, then read it by this full contract on USE topology.'\n )\n } else {\n if (!truncated) {\n parts.push(`${candidates.length} contracts on ${network} carry \"${query}\".`)\n } else if (matches === null) {\n parts.push(\n `${candidates.length} contracts on ${network} carry \"${query}\", and more exist than the ${CANDIDATES_MAX} listed. ` +\n 'The list is a part: never give its length as the count, and never say that none exist beyond it.'\n )\n } else {\n parts.push(\n `${matches} contracts on ${network} carry \"${query}\". candidates lists ${candidates.length} of them, verified first, then oldest first` +\n `${newest.length > 0 ? `, and newest lists the ${newest.length} newest that are not among them, newest first` : ''}. ` +\n `The lists are a part: the count is ${matches}, never the number of rows.`\n )\n }\n parts.push(\n 'Tickers collide: never treat the first row as the token. Name them, each contract in full, ' +\n 'with its creator and first seen time, and ask which one the user means, or pick one by the evidence the user gave ' +\n '(a creator, a launch date, a price move) and say why.'\n )\n }\n if (later && later.count > 0) {\n parts.push(\n `${later.at_least ? 'At least ' : ''}${later.count} of them ${later.count === 1 ? 'was' : 'were'} first seen after the verified contract ${later.verified_contract}: ` +\n 'each took a symbol that a verified token already carried. That is a copy of the name. A copied name alone is not proof of a scam.'\n )\n }\n if (creatorsNotRead) {\n parts.push(\n `The creators were not read for ${creatorsNotRead}. creator and factory are empty there because the read failed, ` +\n 'not because the chain holds none.'\n )\n }\n parts.push('Write every contract and creator in full, 0x plus 40 hex characters.')\n return parts.join(' ')\n}\n\n/** meta_token_lookup, {network, symbol}. Every argument is checked before a read is sent. */\nexport async function handleMetaTokenLookup(\n args: unknown,\n deps: TokenToolDependencies\n): Promise<MetaTokenLookupToolResult> {\n const record = isRecord(args) ? args : {}\n let network: string\n try {\n network = normalizeDexNetwork(record.network)\n } catch (err) {\n return errorResult(\n err instanceof DexRegistryError ? err.message : `invalid_network: ${(err as Error).message}`\n )\n }\n if (typeof record.symbol !== 'string' || record.symbol.trim() === '') {\n return errorResult(\n 'invalid_symbol: symbol is required: the ticker or the name as the user wrote it, for example TCITY'\n )\n }\n const symbol = record.symbol.trim()\n if (symbol.length > SYMBOL_MAX) {\n return errorResult(`invalid_symbol: symbol holds at most ${SYMBOL_MAX} characters`)\n }\n const base = {\n schema: META_TOKEN_LOOKUP_SCHEMA,\n network,\n query: symbol,\n }\n\n if (ADDRESS_FORM.test(symbol)) {\n const address = symbol.toLowerCase()\n return textResult({\n ...base,\n matched_on: null,\n candidates: [],\n total: 0,\n truncated: false,\n matches: null,\n newest: [],\n first_seen_after_verified: null,\n hint: `${ANSWER_HINT} ${address} is a contract address, not a ticker: ${ADDRESS_INPUT_HINT}. Send no token lookup for it.`,\n })\n }\n if (unsafeLiteral(symbol)) {\n return errorResult(\n 'invalid_symbol: a symbol holds no double quote, backslash or control character. Send the ticker or the name as plain text.'\n )\n }\n\n const unavailable = await deps.unavailable?.()\n if (unavailable) {\n return errorResult(\n `No token read was sent: ${unavailable} The lookup has no answer yet, which is not \"no contract\": try again later, or ask the user for the contract. ${NO_WEB}`\n )\n }\n\n // A server that does not count refuses the counted read; the plain read is\n // the one every server admits.\n let form: 'counted' | 'plain' = 'counted'\n let matchedOn: 'symbol' | 'name' = 'symbol'\n let read = await readAssets(deps, network, 'symbol', symbol, form)\n if (read.kind === 'not_served') {\n form = 'plain'\n read = await readAssets(deps, network, 'symbol', symbol, form)\n }\n if (read.kind === 'rows' && read.rows.length === 0) {\n matchedOn = 'name'\n read = await readAssets(deps, network, 'name', symbol, form)\n }\n if (read.kind === 'failed') {\n return errorResult(\n `The token read failed: ${read.text} This is not \"no contract\": send the same lookup again once, or ask the user for the contract. ${NO_WEB}`\n )\n }\n if (read.kind === 'not_served') {\n return textResult({\n ...base,\n matched_on: null,\n candidates: [],\n total: 0,\n truncated: false,\n matches: null,\n newest: [],\n first_seen_after_verified: null,\n hint:\n `${ANSWER_HINT} This lookup gave no answer (${read.refusal.code}). ` +\n `That is not \"no contract carries ${symbol}\": ask the user for the token's contract, 0x plus 40 hex characters. ${NO_WEB}`,\n })\n }\n\n const total = read.rows.length\n const truncated = total > CANDIDATES_MAX\n const candidates = read.rows\n .slice(0, CANDIDATES_MAX)\n .map(candidateOf)\n .filter((candidate): candidate is TokenCandidate => candidate !== null)\n const counted = form === 'counted' ? numberOrNull(read.rows[0]?.match_count) : null\n const matches = counted !== null && counted >= total ? counted : truncated ? null : total\n\n // More match than are listed: the newest page. A failed or refused page\n // leaves the answer as the oldest list, which the hint calls a part.\n let newestPage: TokenCandidate[] | null = null\n if (truncated && form === 'counted') {\n const page = await readAssets(deps, network, matchedOn, symbol, 'newest')\n if (page.kind === 'rows') {\n newestPage = page.rows\n .map(candidateOf)\n .filter((candidate): candidate is TokenCandidate => candidate !== null)\n }\n }\n const listed = new Set(candidates.map((candidate) => candidate.contract))\n const verified = candidates.filter((candidate) => candidate.verified)\n const anchor =\n verified.length === 1 && verified[0]!.first_seen_timestamp !== null ? verified[0]! : null\n const after = (candidate: TokenCandidate): boolean =>\n anchor !== null &&\n candidate.first_seen_timestamp !== null &&\n candidate.first_seen_timestamp > anchor.first_seen_timestamp!\n let firstSeenAfterVerified: MetaTokenLookupResult['first_seen_after_verified'] = null\n if (anchor) {\n // Every later contract is known when the lists reach back to the verified\n // one: nothing was cut, or the newest page holds a row that is not later.\n const pool = !truncated ? candidates : (newestPage ?? candidates)\n const reachesBack =\n !truncated ||\n (newestPage !== null &&\n (newestPage.length < CANDIDATES_MAX || newestPage.some((row) => !after(row))))\n firstSeenAfterVerified = {\n verified_contract: anchor.contract,\n count: pool.filter(after).length,\n at_least: !reachesBack,\n }\n }\n const newest = (newestPage ?? []).filter((candidate) => !listed.has(candidate.contract))\n\n const creatorsNotRead =\n candidates.length > 0 ? await readCreators(deps, network, [...candidates, ...newest]) : null\n const result = {\n ...base,\n matched_on: candidates.length > 0 ? matchedOn : null,\n candidates,\n total,\n truncated,\n matches,\n newest,\n first_seen_after_verified: firstSeenAfterVerified,\n }\n return textResult({ ...result, hint: hintFor(result, creatorsNotRead) })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAa,yBAAyB;AACtC,MAAa,2BAA2B;AACxC,MAAa,0BAA0B;AACvC,MAAa,gCACX;AAMF,MAAa,gCAAgC;CAC3C,cAAc;CACd,gBAAgB;CAChB,eAAe;AACjB;;AAIA,MAAa,iBAAiB;AAC9B,MAAa,YAAY;;AAEzB,MAAa,oBAAoB;AACjC,MAAa,aAAa;AAE1B,MAAa,qBAAqB;AA6DlC,MAAM,eAAe;AACrB,MAAM,gBAAgB;AAItB,SAAS,cAAc,MAAuB;CAC5C,KAAK,MAAM,QAAQ,MAA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M;CACvF,MAAM,SAAS,cACb,WAAW,QACX,UAAU,yBAAyB,QACnC,UAAU,uBAAuB,OAAO;CAC1C,IAAI,yBAA6E;CACjF,IAAI,QAAQ;EAGV,MAAM,OAAO,CAAC,YAAY,aAAc,cAAc;EACtD,MAAM,cACJ,CAAC,aACA,eAAe,SACb,WAAW,SAAS,kBAAkB,WAAW,MAAM,QAAQ,CAAC,MAAM,GAAG,CAAC;EAC/E,yBAAyB;GACvB,mBAAmB,OAAO;GAC1B,OAAO,KAAK,OAAO,KAAK,CAAC,CAAC;GAC1B,UAAU,CAAC;EACb;CACF;CACA,MAAM,UAAU,cAAc,CAAC,EAAA,CAAG,QAAQ,cAAc,CAAC,OAAO,IAAI,UAAU,QAAQ,CAAC;CAEvF,MAAM,kBACJ,WAAW,SAAS,IAAI,MAAM,aAAa,MAAM,SAAS,CAAC,GAAG,YAAY,GAAG,MAAM,CAAC,IAAI;CAC1F,MAAM,SAAS;EACb,GAAG;EACH,YAAY,WAAW,SAAS,IAAI,YAAY;EAChD;EACA;EACA;EACA;EACA;EACA,2BAA2B;CAC7B;CACA,OAAO,WAAW;EAAE,GAAG;EAAQ,MAAM,QAAQ,QAAQ,eAAe;CAAE,CAAC;AACzE"}
|
package/docs/mcp-proxy.md
CHANGED
|
@@ -77,23 +77,23 @@ The proxy:
|
|
|
77
77
|
|
|
78
78
|
## Local Tools
|
|
79
79
|
|
|
80
|
-
| Tool
|
|
81
|
-
|
|
|
82
|
-
| `meta_network_capabilities`
|
|
83
|
-
| `meta_schema`
|
|
84
|
-
| `meta_dex_lookup`
|
|
85
|
-
| `meta_token_lookup`
|
|
86
|
-
| `aml_deployer_screen`
|
|
87
|
-
| `meta_exchange_lookup`
|
|
88
|
-
| `aml_exchange_deposit_check
|
|
89
|
-
| `meta_rules`
|
|
90
|
-
| `meta_help`
|
|
91
|
-
| `meta_usage_status`
|
|
92
|
-
| `meta_subscription_status`
|
|
93
|
-
| `wallet_balance`
|
|
94
|
-
| `wallet_topup`
|
|
95
|
-
| `subscription_topup`
|
|
96
|
-
| `graph_expand`
|
|
80
|
+
| Tool | Purpose |
|
|
81
|
+
| ---------------------------- | ------------------------------------------------------------------------------------ |
|
|
82
|
+
| `meta_network_capabilities` | Show the current Chain Insights network/tool support matrix |
|
|
83
|
+
| `meta_schema` | Show the live graph schema of a network: labels, link types, fields, indexes |
|
|
84
|
+
| `meta_dex_lookup` | Turn an exchange name into its factories, routers or manager, pools and first reads |
|
|
85
|
+
| `meta_token_lookup` | Turn a ticker or a token name into every contract that carries it, with its creator |
|
|
86
|
+
| `aml_deployer_screen` | Screen who is behind a token or a wallet: launcher, first funder, labels, facts only |
|
|
87
|
+
| `meta_exchange_lookup` | Turn a centralized exchange name, or one of its wallets, into its listed wallets |
|
|
88
|
+
| `aml_exchange_deposit_check` | Check one address: an exchange deposit, of which exchange, swept into which wallet |
|
|
89
|
+
| `meta_rules` | Read the answer rules when the `chain-insights-cypher` skill is not loaded |
|
|
90
|
+
| `meta_help` | Show Chain Insights tool and workflow guidance |
|
|
91
|
+
| `meta_usage_status` | Check the caller's daily free-tier graph query allowance |
|
|
92
|
+
| `meta_subscription_status` | Check the proven wallet's subscription, today's allowance and pending payments |
|
|
93
|
+
| `wallet_balance` | Show the local payment wallet address, payment network, token, and amount |
|
|
94
|
+
| `wallet_topup` | Show the local payment wallet address and its QR code, with a Claude view |
|
|
95
|
+
| `subscription_topup` | Show the same wallet and its QR code for $CIA and ETH on Robinhood Chain, read-only |
|
|
96
|
+
| `graph_expand` | Expand a node or list a link's transfers in an open picture; called by the view only |
|
|
97
97
|
|
|
98
98
|
`meta_schema` reads the live graph schema of one network: the labels, the link
|
|
99
99
|
types, every property key, the indexes, the fields of an address and of each
|
|
@@ -144,7 +144,16 @@ never picks one.
|
|
|
144
144
|
1. One `graph_query` reads the `Asset` lookup on `USE facts` by symbol. When
|
|
145
145
|
no contract carries the symbol, the same read runs by name. The server
|
|
146
146
|
matches exactly, in any case, and orders the rows verified first, then
|
|
147
|
-
oldest first. The proxy keeps that order.
|
|
147
|
+
oldest first. The proxy keeps that order. The read also asks for
|
|
148
|
+
`match_count`, the number of contracts that carry the key, and the answer
|
|
149
|
+
gives it as `matches`.
|
|
150
|
+
When more match than the 25 listed, one more `graph_query` reads the 25
|
|
151
|
+
newest (`ORDER BY t.first_seen_timestamp DESC`), and the answer lists the
|
|
152
|
+
ones not among the candidates as `newest`. With exactly one verified
|
|
153
|
+
candidate, `first_seen_after_verified` says how many contracts were first
|
|
154
|
+
seen after it: a copy of a verified token is made after it, so the oldest
|
|
155
|
+
25 alone hide the copies. A server that does not count yet is read the
|
|
156
|
+
old way; `matches` is then null and the hint calls the list a part.
|
|
148
157
|
2. One `graph_query_batch` reads, for each candidate, the address that
|
|
149
158
|
deployed it (`factory`) and the sender of that transaction (`creator`) on
|
|
150
159
|
`USE topology`. A batch holds at most 20 reads, so 25 candidates take two.
|
|
@@ -300,16 +309,16 @@ the same check in a terminal.
|
|
|
300
309
|
**A rule a host never loads does not exist for that host.** Each host loads a
|
|
301
310
|
different part of what this package ships:
|
|
302
311
|
|
|
303
|
-
| What a host loads
|
|
304
|
-
|
|
305
|
-
| skill files (`cia setup`)
|
|
306
|
-
| server instructions
|
|
307
|
-
| `meta_rules`
|
|
308
|
-
| tool descriptions
|
|
309
|
-
| result `hint`
|
|
310
|
-
| protocol tool doors
|
|
311
|
-
| token door `meta_token_lookup`
|
|
312
|
-
| exchange doors `meta_exchange_lookup`, `aml_exchange_deposit_check` | yes
|
|
312
|
+
| What a host loads | Claude Code | Desktop Code mode | Codex | Hermes | scout agent | Desktop chat / claude.ai |
|
|
313
|
+
| ------------------------------------------------------------------- | ----------- | ----------------- | ----- | ------ | -------------- | ------------------------ |
|
|
314
|
+
| skill files (`cia setup`) | yes | yes | yes | yes | copied, 2 of 6 | no |
|
|
315
|
+
| server instructions | yes | yes | yes | yes | yes | no (ignored) |
|
|
316
|
+
| `meta_rules` | yes | yes | yes | yes | yes | no (never called) |
|
|
317
|
+
| tool descriptions | yes | yes | yes | yes | yes | yes |
|
|
318
|
+
| result `hint` | yes | yes | yes | yes | yes | yes |
|
|
319
|
+
| protocol tool doors | yes | yes | yes | yes | yes | yes |
|
|
320
|
+
| token door `meta_token_lookup` | yes | yes | yes | yes | yes | yes |
|
|
321
|
+
| exchange doors `meta_exchange_lookup`, `aml_exchange_deposit_check` | yes | yes | yes | yes | yes | yes |
|
|
313
322
|
|
|
314
323
|
The scout agent pins the CLI by version in its image and copies only
|
|
315
324
|
`chain-insights-cypher` and `chain-insights-virtuals` into its project, yet asks
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chain-insights",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.85.0",
|
|
4
4
|
"description": "AML investigation CLI and MCP proxy for blockchain risk screening and Chain Insights Graph access",
|
|
5
5
|
"homepage": "https://chain-insights.ai",
|
|
6
6
|
"repository": {
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"vitest": "^5.0.3"
|
|
96
96
|
},
|
|
97
97
|
"chainInsights": {
|
|
98
|
-
"dexRegistryVersion":
|
|
98
|
+
"dexRegistryVersion": 9
|
|
99
99
|
},
|
|
100
100
|
"overrides": {
|
|
101
101
|
"ws": "8.21.0",
|
package/registry/README.md
CHANGED
|
@@ -24,8 +24,8 @@ Centralized exchanges have their own folder, [exchanges/](#centralized-exchanges
|
|
|
24
24
|
|
|
25
25
|
| File | Rows served | Why |
|
|
26
26
|
|---|---|---|
|
|
27
|
-
| [robinhood.md](robinhood.md) |
|
|
28
|
-
| [robinhood.json](robinhood.json) |
|
|
27
|
+
| [robinhood.md](robinhood.md) | 89 | registry version 9, recorded 2026-11-19 |
|
|
28
|
+
| [robinhood.json](robinhood.json) | 43 exchanges | the served copy of `robinhood.md`, never edited by hand |
|
|
29
29
|
|
|
30
30
|
A change to the rows merged on `main` reaches every running proxy within one
|
|
31
31
|
hour. No release is needed for a data change.
|
package/registry/robinhood.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "chain-insights.dex-registry.v1",
|
|
3
3
|
"network": "robinhood",
|
|
4
|
-
"registry_version":
|
|
5
|
-
"recorded_on": "2026-11-
|
|
4
|
+
"registry_version": 9,
|
|
5
|
+
"recorded_on": "2026-11-19",
|
|
6
6
|
"rows": [
|
|
7
7
|
{
|
|
8
8
|
"dex": "aero",
|
|
@@ -614,6 +614,89 @@
|
|
|
614
614
|
"since_block": 461784,
|
|
615
615
|
"source": "https://github.com/chainswarm/devops/blob/e270ee1a3c8a2afc52e9d5549be5dbb8b98f0914/charts/chainswarm-indexer-evm-dex/registry/robinhood-v29.json"
|
|
616
616
|
},
|
|
617
|
+
{
|
|
618
|
+
"dex": "tessera",
|
|
619
|
+
"display": "Tessera",
|
|
620
|
+
"aliases": [
|
|
621
|
+
"Tessera",
|
|
622
|
+
"Tessera market maker"
|
|
623
|
+
],
|
|
624
|
+
"trail_type": "vault",
|
|
625
|
+
"adapters": [
|
|
626
|
+
"tessera-custody"
|
|
627
|
+
],
|
|
628
|
+
"roles": {
|
|
629
|
+
"0x907d1d174569b11624bdcefd20dcef27600237f8": "manager"
|
|
630
|
+
},
|
|
631
|
+
"helpers": [
|
|
632
|
+
"0x55555522005bcae1c2424d474bfd5ed477749e3e"
|
|
633
|
+
],
|
|
634
|
+
"factories": [
|
|
635
|
+
"0x907d1d174569b11624bdcefd20dcef27600237f8"
|
|
636
|
+
],
|
|
637
|
+
"routers": [
|
|
638
|
+
"0x907d1d174569b11624bdcefd20dcef27600237f8"
|
|
639
|
+
],
|
|
640
|
+
"example_pool": null,
|
|
641
|
+
"pool_floor": null,
|
|
642
|
+
"since_block": 0,
|
|
643
|
+
"source": "https://github.com/nexroute/van-helsing/blob/f228f9958f198fb55a67d6c3da50cf37c6a74fec/chains/robinhood/Chain.sol"
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
"dex": "woofi",
|
|
647
|
+
"display": "WOOFi",
|
|
648
|
+
"aliases": [
|
|
649
|
+
"WOOFi",
|
|
650
|
+
"WooFi",
|
|
651
|
+
"WOOFi Swap",
|
|
652
|
+
"WooPP"
|
|
653
|
+
],
|
|
654
|
+
"trail_type": "vault",
|
|
655
|
+
"adapters": [
|
|
656
|
+
"woo-custody"
|
|
657
|
+
],
|
|
658
|
+
"roles": {
|
|
659
|
+
"0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4": "manager"
|
|
660
|
+
},
|
|
661
|
+
"helpers": [
|
|
662
|
+
"0x4c4af8dbc524681930a27b2f1af5bcc8062e6fb7"
|
|
663
|
+
],
|
|
664
|
+
"factories": [
|
|
665
|
+
"0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4"
|
|
666
|
+
],
|
|
667
|
+
"routers": [
|
|
668
|
+
"0x5520385bfcf07ec87c4c53a7d8d65595dff69fa4"
|
|
669
|
+
],
|
|
670
|
+
"example_pool": null,
|
|
671
|
+
"pool_floor": null,
|
|
672
|
+
"since_block": 0,
|
|
673
|
+
"source": "https://github.com/woonetwork/docs/blob/9bcc162d55d2f53e2e110cd552a2286ba03248a3/guides/integrate-woofi-as-liquidity-source.md"
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
"dex": "quoted-stock-market",
|
|
677
|
+
"display": "unnamed quoted stock-token market",
|
|
678
|
+
"aliases": [
|
|
679
|
+
"quoted stock-token market",
|
|
680
|
+
"quoted stock market"
|
|
681
|
+
],
|
|
682
|
+
"trail_type": "vault",
|
|
683
|
+
"adapters": [
|
|
684
|
+
"quoted-custody"
|
|
685
|
+
],
|
|
686
|
+
"roles": {
|
|
687
|
+
"0x9d9806fe54de0dca35eb6839374d2222aca3c967": "manager"
|
|
688
|
+
},
|
|
689
|
+
"factories": [
|
|
690
|
+
"0x9d9806fe54de0dca35eb6839374d2222aca3c967"
|
|
691
|
+
],
|
|
692
|
+
"routers": [
|
|
693
|
+
"0x9d9806fe54de0dca35eb6839374d2222aca3c967"
|
|
694
|
+
],
|
|
695
|
+
"example_pool": null,
|
|
696
|
+
"pool_floor": null,
|
|
697
|
+
"since_block": 100062876,
|
|
698
|
+
"source": "https://robin.etherscan.io/tx/0xa4062dc9a318af215fa385f2ea523a320724b00618076c195b8f451387367830"
|
|
699
|
+
},
|
|
617
700
|
{
|
|
618
701
|
"dex": "ramses",
|
|
619
702
|
"display": "Ramses",
|