chain-insights 0.79.2 → 0.80.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 +2 -0
- package/dist/cli.cjs +43 -13
- package/dist/cli.mjs +43 -13
- package/dist/cli.mjs.map +1 -1
- package/dist/{deployer-screen-4AxZhsrO.cjs → deployer-screen-BomgSBcq.cjs} +2 -2
- package/dist/{deployer-screen-eix6pvW7.mjs → deployer-screen-ByQBZEsg.mjs} +3 -3
- package/dist/{deployer-screen-eix6pvW7.mjs.map → deployer-screen-ByQBZEsg.mjs.map} +1 -1
- package/dist/{dex-registry-sPTFuCrP.mjs → dex-registry-BY67f4Ul.mjs} +2 -2
- package/dist/{dex-registry-sPTFuCrP.mjs.map → dex-registry-BY67f4Ul.mjs.map} +1 -1
- package/dist/{dex-registry-DdXOg5On.cjs → dex-registry-BhGJUG9_.cjs} +36 -0
- package/dist/{dex-tool-CDmhhXfk.cjs → dex-tool-B6AymECb.cjs} +2 -2
- package/dist/{dex-tool-D61sIjpq.mjs → dex-tool-CjUZY19i.mjs} +3 -3
- package/dist/dex-tool-CjUZY19i.mjs.map +1 -0
- package/dist/exchange-deposit-check-CMGTPv-T.mjs +209 -0
- package/dist/exchange-deposit-check-CMGTPv-T.mjs.map +1 -0
- package/dist/exchange-deposit-check-hJGDHLz1.cjs +242 -0
- package/dist/exchange-registry-CT0rRW__.cjs +347 -0
- package/dist/exchange-registry-CoLgHw6d.mjs +319 -0
- package/dist/exchange-registry-CoLgHw6d.mjs.map +1 -0
- package/dist/exchange-tool-B2SMeC5f.cjs +218 -0
- package/dist/exchange-tool-Dc46SJ49.mjs +179 -0
- package/dist/exchange-tool-Dc46SJ49.mjs.map +1 -0
- package/dist/{graph-schema-D4LAefGf.mjs → graph-schema-B8KMeX75.mjs} +19 -3
- package/dist/{graph-schema-D4LAefGf.mjs.map → graph-schema-B8KMeX75.mjs.map} +1 -1
- package/dist/{graph-schema-C8Pi6r7c.cjs → graph-schema-D8rHCsBJ.cjs} +23 -1
- package/dist/mcp-proxy.cjs +65 -13
- package/dist/mcp-proxy.d.cts +1 -0
- package/dist/mcp-proxy.d.cts.map +1 -1
- package/dist/mcp-proxy.d.mts +1 -0
- package/dist/mcp-proxy.d.mts.map +1 -1
- package/dist/mcp-proxy.mjs +65 -14
- package/dist/mcp-proxy.mjs.map +1 -1
- package/dist/{public-tools-DXlZcanX.mjs → public-tools-CU1nukHW.mjs} +171 -10
- package/dist/public-tools-CU1nukHW.mjs.map +1 -0
- package/dist/{public-tools-Cfc1OPNS.cjs → public-tools-yvRiFSry.cjs} +170 -9
- package/dist/{token-lookup-DBN3Lxl7.cjs → token-lookup-D-5GBEwF.cjs} +1 -1
- package/dist/{token-lookup-Bv_Fviis.mjs → token-lookup-QpIv77P2.mjs} +2 -2
- package/dist/{token-lookup-Bv_Fviis.mjs.map → token-lookup-QpIv77P2.mjs.map} +1 -1
- package/dist/{tool-visibility-DwNr6Rp9.cjs → tool-visibility-D8Up081E.cjs} +7 -1
- package/dist/{tool-visibility-DlxA8R00.mjs → tool-visibility-DuTds7V4.mjs} +8 -2
- package/dist/tool-visibility-DuTds7V4.mjs.map +1 -0
- package/docs/contributing.md +4 -3
- package/docs/development.md +4 -2
- package/docs/graph-query-compatibility.md +20 -4
- package/docs/graph-tools.md +17 -8
- package/docs/mcp-proxy.md +62 -2
- package/docs/stability.md +4 -2
- package/package.json +1 -1
- package/registry/README.md +37 -0
- package/registry/exchanges/ethereum.json +920 -0
- package/registry/exchanges/robinhood.json +87 -0
- package/skills/chain-insights-aml-exchange/SKILL.md +134 -0
- package/skills/chain-insights-aml-exchange/agents/openai.yaml +4 -0
- package/skills/chain-insights-cypher/SKILL.md +41 -11
- package/skills/chain-insights-dex/SKILL.md +1 -1
- package/skills/chain-insights-dex-gauge/SKILL.md +2 -0
- package/skills/chain-insights-dex-launchpad/SKILL.md +2 -0
- package/skills/chain-insights-dex-vault/SKILL.md +2 -0
- package/dist/dex-tool-D61sIjpq.mjs.map +0 -1
- package/dist/public-tools-DXlZcanX.mjs.map +0 -1
- package/dist/tool-visibility-DlxA8R00.mjs.map +0 -1
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.mjs";
|
|
2
|
+
import { n as chainInsightsHome } from "./cache-location-DxTTqBwk.mjs";
|
|
3
|
+
import { a as NEAR_MIN_ALIAS_LENGTH, d as normalizeDexNetwork, i as NEAR_DISTANCE, n as DEX_REGISTRY_TTL_MS, o as damerauLevenshtein, t as DEX_REGISTRY_FETCH_BUDGET_MS, u as normaliseName } from "./dex-registry-BY67f4Ul.mjs";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
7
|
+
import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
8
|
+
// src/mcp/exchange-registry.ts
|
|
9
|
+
/**
|
|
10
|
+
* The centralized exchange lookup, as meta_exchange_lookup and
|
|
11
|
+
* aml_exchange_deposit_check read it.
|
|
12
|
+
*
|
|
13
|
+
* registry/exchanges/<network>.json lists every centralized exchange the
|
|
14
|
+
* indexer-evm-cex registry of the network names, with its id, its display name
|
|
15
|
+
* and its aliases, and under each only the wallets proven on that network's
|
|
16
|
+
* own data: hot wallets that receive the sweeps of its deposits, gas wallets
|
|
17
|
+
* that top deposits up, and spenders that pull approved deposits. Each wallet
|
|
18
|
+
* carries the payer proof and the block it was proven at, always above 0. An
|
|
19
|
+
* exchange tag, or a wallet of another network at the same address, never
|
|
20
|
+
* enters the file: it stays in the indexer's registry and reaches the graph.
|
|
21
|
+
* So an exchange may list no wallet; its deposits, its SWEPT links and its
|
|
22
|
+
* hot wallets are read from the graph (aml_exchange_deposit_check). It is
|
|
23
|
+
* written by scripts/pin-exchange-registry.mjs and held to the rules below by
|
|
24
|
+
* tests/exchange-registry.test.ts.
|
|
25
|
+
*
|
|
26
|
+
* The proxy reads the file as it reads the DEX registry (src/mcp/dex-registry.ts):
|
|
27
|
+
*
|
|
28
|
+
* cached ~/.chain-insights/cache/exchange-registry-<network>.json, younger than one hour
|
|
29
|
+
* fetched the copy on main, https://raw.githubusercontent.com/chainswarm/chain-insights/main/registry/exchanges/<network>.json,
|
|
30
|
+
* within 3 s, at most once an hour per network
|
|
31
|
+
* packaged registry/exchanges/<network>.json of the installed package
|
|
32
|
+
*
|
|
33
|
+
* A fetched file is used only when it passes the rules. A row merged on main
|
|
34
|
+
* reaches every running proxy within the hour, with no release. A lookup is a
|
|
35
|
+
* proxy tool and never a table or a graph property.
|
|
36
|
+
*/
|
|
37
|
+
var exchange_registry_exports = /* @__PURE__ */ __exportAll({ loadExchangeRegistry: () => loadExchangeRegistry });
|
|
38
|
+
const EXCHANGE_REGISTRY_SCHEMA = "chain-insights.exchange-registry.v1";
|
|
39
|
+
const EXCHANGE_REGISTRY_URL_ENV = "CHAIN_INSIGHTS_EXCHANGE_REGISTRY_URL";
|
|
40
|
+
const EXCHANGE_REGISTRY_PUBLIC_URL = "https://raw.githubusercontent.com/chainswarm/chain-insights/main/registry/exchanges/{network}.json";
|
|
41
|
+
const WALLET_ROLES = [
|
|
42
|
+
"hot_wallet",
|
|
43
|
+
"gas_wallet",
|
|
44
|
+
"spender"
|
|
45
|
+
];
|
|
46
|
+
const ADDRESS_RE = /^0x[0-9a-f]{40}$/;
|
|
47
|
+
const EXCHANGE_RE = /^[a-z0-9][a-z0-9._-]{0,31}$/;
|
|
48
|
+
function isRecord(value) {
|
|
49
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
50
|
+
}
|
|
51
|
+
const isStringList = (value) => Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
52
|
+
/** The fault of a lookup file, or null when it is valid for the network. */
|
|
53
|
+
function exchangeRegistryFault(value, network) {
|
|
54
|
+
if (!isRecord(value)) return "the file is not a JSON object";
|
|
55
|
+
if (value.schema !== EXCHANGE_REGISTRY_SCHEMA) return `schema is ${JSON.stringify(value.schema)}, not ${EXCHANGE_REGISTRY_SCHEMA}`;
|
|
56
|
+
if (value.network !== network) return `network is ${JSON.stringify(value.network)}, not ${network}`;
|
|
57
|
+
if (!Number.isInteger(value.registry_version) || value.registry_version < 0) return "registry_version is not a whole number";
|
|
58
|
+
if (typeof value.recorded_on !== "string" || !/^\d{4}-\d{2}-\d{2}$/.test(value.recorded_on)) return "recorded_on is not a YYYY-MM-DD day";
|
|
59
|
+
if (!Array.isArray(value.rows) || value.rows.length === 0) return "rows is empty";
|
|
60
|
+
const ids = /* @__PURE__ */ new Set();
|
|
61
|
+
const owners = /* @__PURE__ */ new Map();
|
|
62
|
+
for (const [index, row] of value.rows.entries()) {
|
|
63
|
+
const at = `rows[${index}]`;
|
|
64
|
+
if (!isRecord(row)) return `${at} is not an object`;
|
|
65
|
+
if (typeof row.exchange !== "string" || !EXCHANGE_RE.test(row.exchange)) return `${at}.exchange is not an id: ${String(row.exchange)}`;
|
|
66
|
+
if (ids.has(row.exchange)) return `${at}.exchange ${row.exchange} is listed twice`;
|
|
67
|
+
ids.add(row.exchange);
|
|
68
|
+
if (typeof row.display !== "string" || row.display.trim() === "") return `${at} (${row.exchange}) has no display`;
|
|
69
|
+
if (!isStringList(row.aliases)) return `${at} (${row.exchange}) aliases is not a list of names`;
|
|
70
|
+
if (!Array.isArray(row.wallets)) return `${at} (${row.exchange}) wallets is not a list`;
|
|
71
|
+
for (const wallet of row.wallets) {
|
|
72
|
+
if (!isRecord(wallet)) return `${at} (${row.exchange}) has a wallet that is not an object`;
|
|
73
|
+
const address = wallet.address;
|
|
74
|
+
if (typeof address !== "string" || !ADDRESS_RE.test(address)) return `${at} (${row.exchange}) address ${String(address)} is not lowercase 0x plus 40 hex characters`;
|
|
75
|
+
if (!WALLET_ROLES.includes(wallet.role)) return `${at} (${row.exchange}) role ${String(wallet.role)} is not hot_wallet, gas_wallet or spender`;
|
|
76
|
+
if (typeof wallet.evidence !== "string" || wallet.evidence.trim() === "") return `${at} (${row.exchange}) ${address} has no evidence`;
|
|
77
|
+
if (!Number.isInteger(wallet.proven_at_block) || wallet.proven_at_block <= 0) return `${at} (${row.exchange}) ${address} proven_at_block is not a block above 0: only a wallet proven on this chain is listed`;
|
|
78
|
+
const owner = owners.get(address);
|
|
79
|
+
if (owner !== void 0) return `${at} (${row.exchange}) ${address} is also a wallet of ${owner}`;
|
|
80
|
+
owners.set(address, row.exchange);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
/** The URL of the served copy: the public file on main, or the override with {network} filled in. */
|
|
86
|
+
function exchangeRegistryUrl(network, env = process.env) {
|
|
87
|
+
const template = env[EXCHANGE_REGISTRY_URL_ENV]?.trim() || EXCHANGE_REGISTRY_PUBLIC_URL;
|
|
88
|
+
if (template.includes("{network}")) return template.replaceAll("{network}", network);
|
|
89
|
+
return template.endsWith("/") ? `${template}${network}.json` : template;
|
|
90
|
+
}
|
|
91
|
+
function exchangeRegistryCachePath(network) {
|
|
92
|
+
return path.join(chainInsightsHome(), "cache", `exchange-registry-${network}.json`);
|
|
93
|
+
}
|
|
94
|
+
/** registry/exchanges of the installed package: next to dist/, or the repository root when run from source. */
|
|
95
|
+
function packagedExchangeRegistryDir() {
|
|
96
|
+
const candidates = [fileURLToPath(new URL("../registry/exchanges", import.meta.url)), fileURLToPath(new URL("../../registry/exchanges", import.meta.url))];
|
|
97
|
+
return candidates.find((candidate) => existsSync(path.join(candidate, "robinhood.json"))) ?? candidates[0];
|
|
98
|
+
}
|
|
99
|
+
/** The packaged copy of a network, or null when the package carries none. A packaged copy that fails the rules throws. */
|
|
100
|
+
function readPackagedExchangeRegistry(network, dir = packagedExchangeRegistryDir()) {
|
|
101
|
+
let parsed;
|
|
102
|
+
try {
|
|
103
|
+
parsed = JSON.parse(readFileSync(path.join(dir, `${network}.json`), "utf8"));
|
|
104
|
+
} catch {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
const fault = exchangeRegistryFault(parsed, network);
|
|
108
|
+
if (fault) throw new Error(`the packaged exchange lookup registry/exchanges/${network}.json is malformed: ${fault}`);
|
|
109
|
+
return parsed;
|
|
110
|
+
}
|
|
111
|
+
async function readCache(network) {
|
|
112
|
+
try {
|
|
113
|
+
const parsed = JSON.parse(await readFile(exchangeRegistryCachePath(network), "utf8"));
|
|
114
|
+
if (!isRecord(parsed) || typeof parsed.checked_at_ms !== "number") return null;
|
|
115
|
+
if (parsed.source !== "fetched" && parsed.source !== "packaged") return null;
|
|
116
|
+
if (exchangeRegistryFault(parsed.document, network) !== null) return null;
|
|
117
|
+
return parsed;
|
|
118
|
+
} catch {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async function writeCache(network, file) {
|
|
123
|
+
const target = exchangeRegistryCachePath(network);
|
|
124
|
+
await mkdir(path.dirname(target), { recursive: true });
|
|
125
|
+
const scratch = `${target}.${process.pid}.tmp`;
|
|
126
|
+
await writeFile(scratch, JSON.stringify(file, null, 2) + "\n", { mode: 384 });
|
|
127
|
+
await rename(scratch, target);
|
|
128
|
+
}
|
|
129
|
+
async function fetchDocument(network, options) {
|
|
130
|
+
const url = exchangeRegistryUrl(network, options.env);
|
|
131
|
+
let response;
|
|
132
|
+
try {
|
|
133
|
+
response = await (options.fetch ?? fetch)(url, { signal: AbortSignal.timeout(options.budgetMs ?? DEX_REGISTRY_FETCH_BUDGET_MS) });
|
|
134
|
+
} catch (err) {
|
|
135
|
+
return { fault: `${url} unreachable: ${err instanceof Error ? err.message : String(err)}` };
|
|
136
|
+
}
|
|
137
|
+
if (response.status !== 200) return { fault: `${url} answered HTTP ${response.status}` };
|
|
138
|
+
let parsed;
|
|
139
|
+
try {
|
|
140
|
+
parsed = JSON.parse(await response.text());
|
|
141
|
+
} catch {
|
|
142
|
+
return { fault: `${url} is not JSON` };
|
|
143
|
+
}
|
|
144
|
+
const fault = exchangeRegistryFault(parsed, network);
|
|
145
|
+
return fault ? { fault: `${url} is malformed: ${fault}` } : { document: parsed };
|
|
146
|
+
}
|
|
147
|
+
/** A network with no file: no rows, so every lookup on it answers with an empty list. */
|
|
148
|
+
function emptyDocument(network) {
|
|
149
|
+
return {
|
|
150
|
+
schema: EXCHANGE_REGISTRY_SCHEMA,
|
|
151
|
+
network,
|
|
152
|
+
registry_version: 0,
|
|
153
|
+
recorded_on: "1970-01-01",
|
|
154
|
+
rows: []
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
const defaultLog = (line) => {
|
|
158
|
+
process.stderr.write(`[chain-insights] exchange-registry: ${line}\n`);
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* The lookup file of one network: the fresh cache, else the public file, else
|
|
162
|
+
* the stale cache, else the packaged copy. A packaged copy with a higher
|
|
163
|
+
* version than the cache or the public file wins. A network with no file
|
|
164
|
+
* anywhere answers with no rows; it never throws for a well-formed network.
|
|
165
|
+
*/
|
|
166
|
+
async function loadExchangeRegistry(rawNetwork, options = {}) {
|
|
167
|
+
const network = normalizeDexNetwork(rawNetwork);
|
|
168
|
+
const now = options.now ?? Date.now;
|
|
169
|
+
const log = options.log ?? defaultLog;
|
|
170
|
+
const packaged = readPackagedExchangeRegistry(network, options.packagedDir);
|
|
171
|
+
const pick = (document, source) => packaged !== null && packaged.registry_version > document.registry_version ? {
|
|
172
|
+
document: packaged,
|
|
173
|
+
source: "packaged"
|
|
174
|
+
} : {
|
|
175
|
+
document,
|
|
176
|
+
source
|
|
177
|
+
};
|
|
178
|
+
const cache = await readCache(network);
|
|
179
|
+
const age = cache ? now() - cache.checked_at_ms : Infinity;
|
|
180
|
+
if (cache && age >= 0 && age < DEX_REGISTRY_TTL_MS) return pick(cache.document, cache.source === "fetched" ? "cached" : "packaged");
|
|
181
|
+
const save = async (file) => {
|
|
182
|
+
try {
|
|
183
|
+
await writeCache(network, file);
|
|
184
|
+
} catch (err) {
|
|
185
|
+
log(`the cache ${exchangeRegistryCachePath(network)} could not be written: ${err instanceof Error ? err.message : String(err)}`);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
const outcome = await fetchDocument(network, options);
|
|
189
|
+
const checked = now();
|
|
190
|
+
if ("document" in outcome) {
|
|
191
|
+
await save({
|
|
192
|
+
document: outcome.document,
|
|
193
|
+
checked_at_ms: checked,
|
|
194
|
+
source: "fetched"
|
|
195
|
+
});
|
|
196
|
+
return pick(outcome.document, "fetched");
|
|
197
|
+
}
|
|
198
|
+
if (cache) {
|
|
199
|
+
log(outcome.fault);
|
|
200
|
+
await save({
|
|
201
|
+
...cache,
|
|
202
|
+
checked_at_ms: checked
|
|
203
|
+
});
|
|
204
|
+
return pick(cache.document, cache.source === "fetched" ? "cached" : "packaged");
|
|
205
|
+
}
|
|
206
|
+
if (packaged) {
|
|
207
|
+
log(outcome.fault);
|
|
208
|
+
await save({
|
|
209
|
+
document: packaged,
|
|
210
|
+
checked_at_ms: checked,
|
|
211
|
+
source: "packaged"
|
|
212
|
+
});
|
|
213
|
+
return {
|
|
214
|
+
document: packaged,
|
|
215
|
+
source: "packaged"
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
return {
|
|
219
|
+
document: emptyDocument(network),
|
|
220
|
+
source: "none"
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* One name against the rows, as matchDex does for a DEX: exact on the id, the
|
|
225
|
+
* display and the aliases; then within two letters of an alias of four or more
|
|
226
|
+
* characters. A tie is listed, never guessed.
|
|
227
|
+
*/
|
|
228
|
+
function matchExchange(name, rows) {
|
|
229
|
+
const listed = rows.map((row) => row.display);
|
|
230
|
+
const wanted = normaliseName(name);
|
|
231
|
+
if (!wanted) return {
|
|
232
|
+
matched: null,
|
|
233
|
+
candidates: [],
|
|
234
|
+
listed
|
|
235
|
+
};
|
|
236
|
+
const exact = rows.filter((row) => [
|
|
237
|
+
row.exchange,
|
|
238
|
+
row.display,
|
|
239
|
+
...row.aliases
|
|
240
|
+
].some((written) => normaliseName(written) === wanted));
|
|
241
|
+
if (exact.length === 1) return {
|
|
242
|
+
matched: exact[0],
|
|
243
|
+
candidates: [],
|
|
244
|
+
listed
|
|
245
|
+
};
|
|
246
|
+
if (exact.length > 1) return {
|
|
247
|
+
matched: null,
|
|
248
|
+
candidates: exact.map((row) => ({
|
|
249
|
+
exchange: row.exchange,
|
|
250
|
+
display: row.display,
|
|
251
|
+
distance: 0
|
|
252
|
+
})),
|
|
253
|
+
listed
|
|
254
|
+
};
|
|
255
|
+
const near = [];
|
|
256
|
+
for (const row of rows) {
|
|
257
|
+
const distances = [
|
|
258
|
+
row.exchange,
|
|
259
|
+
row.display,
|
|
260
|
+
...row.aliases
|
|
261
|
+
].map(normaliseName).filter((alias) => alias.length >= NEAR_MIN_ALIAS_LENGTH).map((alias) => damerauLevenshtein(wanted, alias));
|
|
262
|
+
if (distances.length === 0) continue;
|
|
263
|
+
const distance = Math.min(...distances);
|
|
264
|
+
if (distance <= NEAR_DISTANCE) near.push({
|
|
265
|
+
row,
|
|
266
|
+
distance
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
if (near.length === 0) return {
|
|
270
|
+
matched: null,
|
|
271
|
+
candidates: [],
|
|
272
|
+
listed
|
|
273
|
+
};
|
|
274
|
+
const least = Math.min(...near.map((hit) => hit.distance));
|
|
275
|
+
const nearest = near.filter((hit) => hit.distance === least);
|
|
276
|
+
if (nearest.length === 1) return {
|
|
277
|
+
matched: nearest[0].row,
|
|
278
|
+
took_for: name.trim(),
|
|
279
|
+
candidates: [],
|
|
280
|
+
listed
|
|
281
|
+
};
|
|
282
|
+
return {
|
|
283
|
+
matched: null,
|
|
284
|
+
candidates: nearest.map(({ row, distance }) => ({
|
|
285
|
+
exchange: row.exchange,
|
|
286
|
+
display: row.display,
|
|
287
|
+
distance
|
|
288
|
+
})),
|
|
289
|
+
listed
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
/** The exchange and the wallet a lowercase address is, or null when no row lists it. */
|
|
293
|
+
function exchangeOfWallet(address, rows) {
|
|
294
|
+
for (const entry of rows) {
|
|
295
|
+
const wallet = entry.wallets.find((candidate) => candidate.address === address);
|
|
296
|
+
if (wallet) return {
|
|
297
|
+
entry,
|
|
298
|
+
wallet
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
/** The exchange a list of graph label words names, or null: the first word that is an id, a display name or an alias. */
|
|
304
|
+
function exchangeOfLabels(labels, rows) {
|
|
305
|
+
for (const word of labels) {
|
|
306
|
+
const wanted = normaliseName(word);
|
|
307
|
+
if (!wanted) continue;
|
|
308
|
+
const row = rows.find((entry) => [
|
|
309
|
+
entry.exchange,
|
|
310
|
+
entry.display,
|
|
311
|
+
...entry.aliases
|
|
312
|
+
].some((name) => normaliseName(name) === wanted));
|
|
313
|
+
if (row) return row;
|
|
314
|
+
}
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
export { matchExchange as a, loadExchangeRegistry as i, exchangeOfWallet as n, exchange_registry_exports as r, exchangeOfLabels as t };
|
|
318
|
+
|
|
319
|
+
//# sourceMappingURL=exchange-registry-CoLgHw6d.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exchange-registry-CoLgHw6d.mjs","names":[],"sources":["../src/mcp/exchange-registry.ts"],"sourcesContent":["/**\n * The centralized exchange lookup, as meta_exchange_lookup and\n * aml_exchange_deposit_check read it.\n *\n * registry/exchanges/<network>.json lists every centralized exchange the\n * indexer-evm-cex registry of the network names, with its id, its display name\n * and its aliases, and under each only the wallets proven on that network's\n * own data: hot wallets that receive the sweeps of its deposits, gas wallets\n * that top deposits up, and spenders that pull approved deposits. Each wallet\n * carries the payer proof and the block it was proven at, always above 0. An\n * exchange tag, or a wallet of another network at the same address, never\n * enters the file: it stays in the indexer's registry and reaches the graph.\n * So an exchange may list no wallet; its deposits, its SWEPT links and its\n * hot wallets are read from the graph (aml_exchange_deposit_check). It is\n * written by scripts/pin-exchange-registry.mjs and held to the rules below by\n * tests/exchange-registry.test.ts.\n *\n * The proxy reads the file as it reads the DEX registry (src/mcp/dex-registry.ts):\n *\n * cached ~/.chain-insights/cache/exchange-registry-<network>.json, younger than one hour\n * fetched the copy on main, https://raw.githubusercontent.com/chainswarm/chain-insights/main/registry/exchanges/<network>.json,\n * within 3 s, at most once an hour per network\n * packaged registry/exchanges/<network>.json of the installed package\n *\n * A fetched file is used only when it passes the rules. A row merged on main\n * reaches every running proxy within the hour, with no release. A lookup is a\n * proxy tool and never a table or a graph property.\n */\n\nimport { existsSync, readFileSync } from 'node:fs'\nimport { mkdir, readFile, rename, writeFile } from 'node:fs/promises'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { chainInsightsHome } from './cache-location.js'\nimport {\n DEX_REGISTRY_FETCH_BUDGET_MS,\n DEX_REGISTRY_TTL_MS,\n NEAR_DISTANCE,\n NEAR_MIN_ALIAS_LENGTH,\n damerauLevenshtein,\n normalizeDexNetwork,\n normaliseName,\n} from './dex-registry.js'\n\nexport const EXCHANGE_REGISTRY_SCHEMA = 'chain-insights.exchange-registry.v1' as const\nexport const EXCHANGE_REGISTRY_URL_ENV = 'CHAIN_INSIGHTS_EXCHANGE_REGISTRY_URL'\nexport const EXCHANGE_REGISTRY_PUBLIC_URL =\n 'https://raw.githubusercontent.com/chainswarm/chain-insights/main/registry/exchanges/{network}.json'\n\nexport const WALLET_ROLES = ['hot_wallet', 'gas_wallet', 'spender'] as const\nexport type WalletRole = (typeof WALLET_ROLES)[number]\nexport type ExchangeRegistrySource = 'fetched' | 'cached' | 'packaged' | 'none'\n\n/** One wallet of an exchange, with its evidence. */\nexport interface ExchangeWallet {\n address: string\n role: WalletRole\n /** What the chain showed: payers, the sample that pays only this exchange, the window. */\n evidence: string\n /** The block the payer proof is pinned at, always above 0. */\n proven_at_block: number\n}\n\n/** One exchange of the lookup file. */\nexport interface ExchangeEntry {\n /** The stable lower-case id, the word the graph's labels carry. */\n exchange: string\n display: string\n aliases: string[]\n wallets: ExchangeWallet[]\n}\n\nexport interface ExchangeRegistryDocument {\n schema: typeof EXCHANGE_REGISTRY_SCHEMA\n network: string\n registry_version: number\n recorded_on: string\n rows: ExchangeEntry[]\n}\n\nexport interface LoadedExchangeRegistry {\n document: ExchangeRegistryDocument\n source: ExchangeRegistrySource\n}\n\nconst ADDRESS_RE = /^0x[0-9a-f]{40}$/\nconst EXCHANGE_RE = /^[a-z0-9][a-z0-9._-]{0,31}$/\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === 'object' && !Array.isArray(value)\n}\n\nconst isStringList = (value: unknown): value is string[] =>\n Array.isArray(value) && value.every((entry) => typeof entry === 'string')\n\n/** The fault of a lookup file, or null when it is valid for the network. */\nexport function exchangeRegistryFault(value: unknown, network: string): string | null {\n if (!isRecord(value)) return 'the file is not a JSON object'\n if (value.schema !== EXCHANGE_REGISTRY_SCHEMA) {\n return `schema is ${JSON.stringify(value.schema)}, not ${EXCHANGE_REGISTRY_SCHEMA}`\n }\n if (value.network !== network)\n return `network is ${JSON.stringify(value.network)}, not ${network}`\n if (!Number.isInteger(value.registry_version) || (value.registry_version as number) < 0) {\n return 'registry_version is not a whole number'\n }\n if (typeof value.recorded_on !== 'string' || !/^\\d{4}-\\d{2}-\\d{2}$/.test(value.recorded_on)) {\n return 'recorded_on is not a YYYY-MM-DD day'\n }\n if (!Array.isArray(value.rows) || value.rows.length === 0) return 'rows is empty'\n const ids = new Set<string>()\n const owners = new Map<string, string>()\n for (const [index, row] of value.rows.entries()) {\n const at = `rows[${index}]`\n if (!isRecord(row)) return `${at} is not an object`\n if (typeof row.exchange !== 'string' || !EXCHANGE_RE.test(row.exchange))\n return `${at}.exchange is not an id: ${String(row.exchange)}`\n if (ids.has(row.exchange)) return `${at}.exchange ${row.exchange} is listed twice`\n ids.add(row.exchange)\n if (typeof row.display !== 'string' || row.display.trim() === '')\n return `${at} (${row.exchange}) has no display`\n if (!isStringList(row.aliases)) return `${at} (${row.exchange}) aliases is not a list of names`\n if (!Array.isArray(row.wallets)) return `${at} (${row.exchange}) wallets is not a list`\n for (const wallet of row.wallets) {\n if (!isRecord(wallet)) return `${at} (${row.exchange}) has a wallet that is not an object`\n const address = wallet.address\n if (typeof address !== 'string' || !ADDRESS_RE.test(address))\n return `${at} (${row.exchange}) address ${String(address)} is not lowercase 0x plus 40 hex characters`\n if (!WALLET_ROLES.includes(wallet.role as WalletRole))\n return `${at} (${row.exchange}) role ${String(wallet.role)} is not hot_wallet, gas_wallet or spender`\n if (typeof wallet.evidence !== 'string' || wallet.evidence.trim() === '')\n return `${at} (${row.exchange}) ${address} has no evidence`\n if (!Number.isInteger(wallet.proven_at_block) || (wallet.proven_at_block as number) <= 0)\n return `${at} (${row.exchange}) ${address} proven_at_block is not a block above 0: only a wallet proven on this chain is listed`\n const owner = owners.get(address)\n if (owner !== undefined)\n return `${at} (${row.exchange}) ${address} is also a wallet of ${owner}`\n owners.set(address, row.exchange)\n }\n }\n return null\n}\n\n/** The URL of the served copy: the public file on main, or the override with {network} filled in. */\nexport function exchangeRegistryUrl(network: string, env: NodeJS.ProcessEnv = process.env): string {\n const override = env[EXCHANGE_REGISTRY_URL_ENV]?.trim()\n const template = override || EXCHANGE_REGISTRY_PUBLIC_URL\n if (template.includes('{network}')) return template.replaceAll('{network}', network)\n return template.endsWith('/') ? `${template}${network}.json` : template\n}\n\nexport function exchangeRegistryCachePath(network: string): string {\n return path.join(chainInsightsHome(), 'cache', `exchange-registry-${network}.json`)\n}\n\n/** registry/exchanges of the installed package: next to dist/, or the repository root when run from source. */\nexport function packagedExchangeRegistryDir(): string {\n const candidates = [\n fileURLToPath(new URL('../registry/exchanges', import.meta.url)),\n fileURLToPath(new URL('../../registry/exchanges', import.meta.url)),\n ]\n return (\n candidates.find((candidate) => existsSync(path.join(candidate, 'robinhood.json'))) ??\n candidates[0]!\n )\n}\n\n/** The packaged copy of a network, or null when the package carries none. A packaged copy that fails the rules throws. */\nexport function readPackagedExchangeRegistry(\n network: string,\n dir: string = packagedExchangeRegistryDir()\n): ExchangeRegistryDocument | null {\n let parsed: unknown\n try {\n parsed = JSON.parse(readFileSync(path.join(dir, `${network}.json`), 'utf8'))\n } catch {\n return null\n }\n const fault = exchangeRegistryFault(parsed, network)\n if (fault)\n throw new Error(\n `the packaged exchange lookup registry/exchanges/${network}.json is malformed: ${fault}`\n )\n return parsed as ExchangeRegistryDocument\n}\n\ninterface CacheFile {\n document: ExchangeRegistryDocument\n checked_at_ms: number\n source: 'fetched' | 'packaged'\n}\n\nasync function readCache(network: string): Promise<CacheFile | null> {\n try {\n const parsed = JSON.parse(await readFile(exchangeRegistryCachePath(network), 'utf8')) as unknown\n if (!isRecord(parsed) || typeof parsed.checked_at_ms !== 'number') return null\n if (parsed.source !== 'fetched' && parsed.source !== 'packaged') return null\n if (exchangeRegistryFault(parsed.document, network) !== null) return null\n return parsed as unknown as CacheFile\n } catch {\n return null\n }\n}\n\nasync function writeCache(network: string, file: CacheFile): Promise<void> {\n const target = exchangeRegistryCachePath(network)\n await mkdir(path.dirname(target), { recursive: true })\n const scratch = `${target}.${process.pid}.tmp`\n await writeFile(scratch, JSON.stringify(file, null, 2) + '\\n', { mode: 0o600 })\n await rename(scratch, target)\n}\n\nexport interface LoadExchangeRegistryOptions {\n fetch?: typeof fetch\n now?: () => number\n env?: NodeJS.ProcessEnv\n log?: (line: string) => void\n packagedDir?: string\n budgetMs?: number\n}\n\nasync function fetchDocument(\n network: string,\n options: LoadExchangeRegistryOptions\n): Promise<{ document: ExchangeRegistryDocument } | { fault: string }> {\n const url = exchangeRegistryUrl(network, options.env)\n let response: Response\n try {\n response = await (options.fetch ?? fetch)(url, {\n signal: AbortSignal.timeout(options.budgetMs ?? DEX_REGISTRY_FETCH_BUDGET_MS),\n })\n } catch (err) {\n return { fault: `${url} unreachable: ${err instanceof Error ? err.message : String(err)}` }\n }\n if (response.status !== 200) return { fault: `${url} answered HTTP ${response.status}` }\n let parsed: unknown\n try {\n parsed = JSON.parse(await response.text())\n } catch {\n return { fault: `${url} is not JSON` }\n }\n const fault = exchangeRegistryFault(parsed, network)\n return fault\n ? { fault: `${url} is malformed: ${fault}` }\n : { document: parsed as ExchangeRegistryDocument }\n}\n\n/** A network with no file: no rows, so every lookup on it answers with an empty list. */\nfunction emptyDocument(network: string): ExchangeRegistryDocument {\n return {\n schema: EXCHANGE_REGISTRY_SCHEMA,\n network,\n registry_version: 0,\n recorded_on: '1970-01-01',\n rows: [],\n }\n}\n\nconst defaultLog = (line: string): void => {\n process.stderr.write(`[chain-insights] exchange-registry: ${line}\\n`)\n}\n\n/**\n * The lookup file of one network: the fresh cache, else the public file, else\n * the stale cache, else the packaged copy. A packaged copy with a higher\n * version than the cache or the public file wins. A network with no file\n * anywhere answers with no rows; it never throws for a well-formed network.\n */\nexport async function loadExchangeRegistry(\n rawNetwork: unknown,\n options: LoadExchangeRegistryOptions = {}\n): Promise<LoadedExchangeRegistry> {\n const network = normalizeDexNetwork(rawNetwork)\n const now = options.now ?? Date.now\n const log = options.log ?? defaultLog\n const packaged = readPackagedExchangeRegistry(network, options.packagedDir)\n const pick = (\n document: ExchangeRegistryDocument,\n source: ExchangeRegistrySource\n ): LoadedExchangeRegistry =>\n packaged !== null && packaged.registry_version > document.registry_version\n ? { document: packaged, source: 'packaged' }\n : { document, source }\n\n const cache = await readCache(network)\n const age = cache ? now() - cache.checked_at_ms : Infinity\n if (cache && age >= 0 && age < DEX_REGISTRY_TTL_MS) {\n return pick(cache.document, cache.source === 'fetched' ? 'cached' : 'packaged')\n }\n const save = async (file: CacheFile): Promise<void> => {\n try {\n await writeCache(network, file)\n } catch (err) {\n log(\n `the cache ${exchangeRegistryCachePath(network)} could not be written: ${err instanceof Error ? err.message : String(err)}`\n )\n }\n }\n const outcome = await fetchDocument(network, options)\n const checked = now()\n if ('document' in outcome) {\n await save({ document: outcome.document, checked_at_ms: checked, source: 'fetched' })\n return pick(outcome.document, 'fetched')\n }\n if (cache) {\n log(outcome.fault)\n await save({ ...cache, checked_at_ms: checked })\n return pick(cache.document, cache.source === 'fetched' ? 'cached' : 'packaged')\n }\n if (packaged) {\n log(outcome.fault)\n await save({ document: packaged, checked_at_ms: checked, source: 'packaged' })\n return { document: packaged, source: 'packaged' }\n }\n return { document: emptyDocument(network), source: 'none' }\n}\n\n// ─── The name and the address match ───────────────────────────────────────────\n\nexport interface ExchangeCandidate {\n exchange: string\n display: string\n distance: number\n}\n\nexport interface ExchangeMatchResult {\n matched: ExchangeEntry | null\n /** The name as typed, when the match is a near hit. */\n took_for?: string\n candidates: ExchangeCandidate[]\n /** Every exchange the file lists for the network, by display name. */\n listed: string[]\n}\n\n/**\n * One name against the rows, as matchDex does for a DEX: exact on the id, the\n * display and the aliases; then within two letters of an alias of four or more\n * characters. A tie is listed, never guessed.\n */\nexport function matchExchange(name: string, rows: ExchangeEntry[]): ExchangeMatchResult {\n const listed = rows.map((row) => row.display)\n const wanted = normaliseName(name)\n if (!wanted) return { matched: null, candidates: [], listed }\n const exact = rows.filter((row) =>\n [row.exchange, row.display, ...row.aliases].some((written) => normaliseName(written) === wanted)\n )\n if (exact.length === 1) return { matched: exact[0]!, candidates: [], listed }\n if (exact.length > 1) {\n return {\n matched: null,\n candidates: exact.map((row) => ({\n exchange: row.exchange,\n display: row.display,\n distance: 0,\n })),\n listed,\n }\n }\n const near: Array<{ row: ExchangeEntry; distance: number }> = []\n for (const row of rows) {\n const distances = [row.exchange, row.display, ...row.aliases]\n .map(normaliseName)\n .filter((alias) => alias.length >= NEAR_MIN_ALIAS_LENGTH)\n .map((alias) => damerauLevenshtein(wanted, alias))\n if (distances.length === 0) continue\n const distance = Math.min(...distances)\n if (distance <= NEAR_DISTANCE) near.push({ row, distance })\n }\n if (near.length === 0) return { matched: null, candidates: [], listed }\n const least = Math.min(...near.map((hit) => hit.distance))\n const nearest = near.filter((hit) => hit.distance === least)\n if (nearest.length === 1)\n return { matched: nearest[0]!.row, took_for: name.trim(), candidates: [], listed }\n return {\n matched: null,\n candidates: nearest.map(({ row, distance }) => ({\n exchange: row.exchange,\n display: row.display,\n distance,\n })),\n listed,\n }\n}\n\n/** The exchange and the wallet a lowercase address is, or null when no row lists it. */\nexport function exchangeOfWallet(\n address: string,\n rows: ExchangeEntry[]\n): { entry: ExchangeEntry; wallet: ExchangeWallet } | null {\n for (const entry of rows) {\n const wallet = entry.wallets.find((candidate) => candidate.address === address)\n if (wallet) return { entry, wallet }\n }\n return null\n}\n\n/** The exchange a list of graph label words names, or null: the first word that is an id, a display name or an alias. */\nexport function exchangeOfLabels(\n labels: readonly string[],\n rows: ExchangeEntry[]\n): ExchangeEntry | null {\n for (const word of labels) {\n const wanted = normaliseName(word)\n if (!wanted) continue\n const row = rows.find((entry) =>\n [entry.exchange, entry.display, ...entry.aliases].some(\n (name) => normaliseName(name) === wanted\n )\n )\n if (row) return row\n }\n return null\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAa,2BAA2B;AACxC,MAAa,4BAA4B;AACzC,MAAa,+BACX;AAEF,MAAa,eAAe;CAAC;CAAc;CAAc;AAAS;AAoClE,MAAM,aAAa;AACnB,MAAM,cAAc;AAEpB,SAAS,SAAS,OAAkD;CAClE,OAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AACrE;AAEA,MAAM,gBAAgB,UACpB,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAO,UAAU,OAAO,UAAU,QAAQ;;AAG1E,SAAgB,sBAAsB,OAAgB,SAAgC;CACpF,IAAI,CAAC,SAAS,KAAK,GAAG,OAAO;CAC7B,IAAI,MAAM,WAAW,0BACnB,OAAO,aAAa,KAAK,UAAU,MAAM,MAAM,EAAE,QAAQ;CAE3D,IAAI,MAAM,YAAY,SACpB,OAAO,cAAc,KAAK,UAAU,MAAM,OAAO,EAAE,QAAQ;CAC7D,IAAI,CAAC,OAAO,UAAU,MAAM,gBAAgB,KA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hint-BlYEBq_Y.cjs");
|
|
3
|
+
const require_dex_registry = require("./dex-registry-BhGJUG9_.cjs");
|
|
4
|
+
const require_exchange_registry = require("./exchange-registry-CT0rRW__.cjs");
|
|
5
|
+
// src/mcp/exchange-tool.ts
|
|
6
|
+
/**
|
|
7
|
+
* meta_exchange_lookup: a centralized exchange's name becomes its wallets.
|
|
8
|
+
*
|
|
9
|
+
* A local tool of the proxy. It matches the name against the exchange lookup
|
|
10
|
+
* file (src/mcp/exchange-registry.ts) and answers from it alone: no graph read,
|
|
11
|
+
* no cost. The file lists every exchange, and only the wallets proven on that
|
|
12
|
+
* network's own data, each with its payer proof and the block it was proven
|
|
13
|
+
* at. An address instead of a name says whose wallet the address is. Whether
|
|
14
|
+
* an address is a deposit, and which hot wallet it swept into, is read from
|
|
15
|
+
* the graph by aml_exchange_deposit_check.
|
|
16
|
+
*
|
|
17
|
+
* The description below is the contract with every host, Claude Desktop chat
|
|
18
|
+
* included, which reads no skill: it carries the rule the skill
|
|
19
|
+
* chain-insights-aml-exchange opens with. tests/host-parity.test.ts holds it to
|
|
20
|
+
* the skill's trigger words.
|
|
21
|
+
*/
|
|
22
|
+
var exchange_tool_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({ handleMetaExchangeLookup: () => handleMetaExchangeLookup });
|
|
23
|
+
/**
|
|
24
|
+
* The rule the exchange skill opens with, carried by both of its doors: where a
|
|
25
|
+
* trail ends, and where an exchange's wallets come from.
|
|
26
|
+
*/
|
|
27
|
+
const EXCHANGE_OPENING_RULE = "Money that reaches an exchange deposit with a SWEPT link entered that exchange there: the trail ends at the deposit, and never walks on past a hot wallet. Take an exchange's wallets from meta_exchange_lookup, never from a guess or a graph search by name.";
|
|
28
|
+
const META_EXCHANGE_LOOKUP_TOOL = "meta_exchange_lookup";
|
|
29
|
+
const META_EXCHANGE_LOOKUP_SCHEMA = "chain-insights.meta-exchange-lookup.v1";
|
|
30
|
+
const META_EXCHANGE_LOOKUP_TITLE = "Centralized exchange by name or address";
|
|
31
|
+
const META_EXCHANGE_LOOKUP_DESCRIPTION = `Call this first when a question names a centralized exchange (Binance, Bitget, Bybit, Coinbase, Gate, KuCoin, MEXC, OKX, ...) and gives no address, or asks which exchange a wallet belongs to. It turns the name into the hot wallets of that exchange on the network, The file lists only wallets proven on that chain's own data, each with its payer proof and the block it was proven at, and its gas wallets; an exchange may list none, and its deposits and hot wallets are still marked in the graph. A misspelling within two letters is taken and named in took_for. Send address instead (0x plus 40 hex, any case) to learn whose hot wallet or gas wallet it is. It reads no graph and costs nothing. ${EXCHANGE_OPENING_RULE} Give a name or an address, not both.`;
|
|
32
|
+
const META_EXCHANGE_LOOKUP_ANNOTATIONS = {
|
|
33
|
+
readOnlyHint: true,
|
|
34
|
+
idempotentHint: true,
|
|
35
|
+
openWorldHint: false
|
|
36
|
+
};
|
|
37
|
+
function isRecord(value) {
|
|
38
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
39
|
+
}
|
|
40
|
+
function errorResult(text) {
|
|
41
|
+
return {
|
|
42
|
+
content: [{
|
|
43
|
+
type: "text",
|
|
44
|
+
text
|
|
45
|
+
}],
|
|
46
|
+
isError: true
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function textResult(structured) {
|
|
50
|
+
return {
|
|
51
|
+
content: [{
|
|
52
|
+
type: "text",
|
|
53
|
+
text: JSON.stringify(structured, null, 2)
|
|
54
|
+
}],
|
|
55
|
+
structuredContent: structured,
|
|
56
|
+
isError: false
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const ADDRESS_FORM = /^0x[0-9a-fA-F]{40}$/;
|
|
60
|
+
function walletsOf(entry, role) {
|
|
61
|
+
return entry.wallets.filter((wallet) => wallet.role === role).map(({ address, evidence, proven_at_block }) => ({
|
|
62
|
+
address,
|
|
63
|
+
evidence,
|
|
64
|
+
proven_at_block
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
/** One row of the lookup as the tool returns it. */
|
|
68
|
+
function exchangeMatchOf(entry) {
|
|
69
|
+
return {
|
|
70
|
+
exchange: entry.exchange,
|
|
71
|
+
display: entry.display,
|
|
72
|
+
hot_wallets: walletsOf(entry, "hot_wallet"),
|
|
73
|
+
gas_wallets: walletsOf(entry, "gas_wallet"),
|
|
74
|
+
spenders: walletsOf(entry, "spender")
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const ROLE_WORDS = {
|
|
78
|
+
hot_wallet: "a hot wallet",
|
|
79
|
+
gas_wallet: "a gas wallet",
|
|
80
|
+
spender: "a spender"
|
|
81
|
+
};
|
|
82
|
+
function hintFor(result, name, address) {
|
|
83
|
+
const { network } = result;
|
|
84
|
+
if (address !== null && !result.matched) return `${require_answer_hint.ANSWER_HINT} ${address} is no wallet the exchange lookup lists for ${network}: the file lists only wallets proven on this chain. The graph marks deposits and hot wallets of every exchange: call aml_exchange_deposit_check {network: "${network}", address: "${address}"} to read its cex_role, its exchange and its SWEPT links.`;
|
|
85
|
+
if (address !== null && result.matched) return `${require_answer_hint.ANSWER_HINT} Say in one line: "${address} is ${result.took_for} of ${result.matched.display} on ${network}." A trail that reaches it has entered the exchange: end the trail there. Never walk on past a hot wallet.`;
|
|
86
|
+
if (name === null) return `${require_answer_hint.ANSWER_HINT} These are the exchanges the lookup lists for ${network}. Call meta_exchange_lookup with a name for its wallets.`;
|
|
87
|
+
if (result.matched) {
|
|
88
|
+
const { matched } = result;
|
|
89
|
+
const took = result.took_for ? `Say in one line: "I took ${matched.display} for ${result.took_for}." Ask nothing. ` : "";
|
|
90
|
+
const count = matched.hot_wallets.length;
|
|
91
|
+
const wallets = count === 0 ? `${matched.display} on ${network}: the lookup lists no wallet of it proven on this chain yet; the graph marks its deposits and hot wallets. ` : `${matched.display} on ${network}: ${count} hot wallet${count === 1 ? "" : "s"} proven on this chain. `;
|
|
92
|
+
return `${require_answer_hint.ANSWER_HINT} ${took}${wallets}A deposit of this exchange has a SWEPT link into its hot wallet. Read SWEPT anchored on the address the trail reached, never on a hot wallet: a hot wallet links to many thousands of deposits. To check one address, call aml_exchange_deposit_check. ${EXCHANGE_OPENING_RULE}`;
|
|
93
|
+
}
|
|
94
|
+
if (result.candidates.length > 0) {
|
|
95
|
+
const names = result.candidates.map((candidate) => `${candidate.display} (${candidate.exchange})`).join(", ");
|
|
96
|
+
return `${require_answer_hint.ANSWER_HINT} ${result.candidates.length} exchanges fit "${name}": ${names}. Name both or pick one: call meta_exchange_lookup with each id. Never guess one.`;
|
|
97
|
+
}
|
|
98
|
+
return `${require_answer_hint.ANSWER_HINT} The exchange lookup holds no wallet of "${name}" for ${network}` + (result.listed.length > 0 ? `; it lists ${result.listed.join(", ")}. ` : ". ") + "If the user knows one address of that exchange (a deposit address, or a wallet it paid them from), call aml_exchange_deposit_check with it. Send no graph search by name.";
|
|
99
|
+
}
|
|
100
|
+
/** meta_exchange_lookup, {network, name?, address?}. Every argument is checked before the lookup is read. */
|
|
101
|
+
async function handleMetaExchangeLookup(args, deps) {
|
|
102
|
+
const record = isRecord(args) ? args : {};
|
|
103
|
+
let network;
|
|
104
|
+
try {
|
|
105
|
+
network = require_dex_registry.normalizeDexNetwork(record.network);
|
|
106
|
+
} catch (err) {
|
|
107
|
+
return errorResult(err.message);
|
|
108
|
+
}
|
|
109
|
+
const rawName = record.name;
|
|
110
|
+
if (rawName !== void 0 && rawName !== null && typeof rawName !== "string") return errorResult("invalid_name: name must be the exchange name as text");
|
|
111
|
+
const name = typeof rawName === "string" && rawName.trim() !== "" ? rawName.trim() : null;
|
|
112
|
+
const rawAddress = record.address;
|
|
113
|
+
if (rawAddress !== void 0 && rawAddress !== null && typeof rawAddress !== "string") return errorResult("invalid_address: address must be 0x plus 40 hex characters");
|
|
114
|
+
const addressText = typeof rawAddress === "string" && rawAddress.trim() !== "" ? rawAddress.trim() : null;
|
|
115
|
+
if (name !== null && addressText !== null) return errorResult("Give a name or an address, not both.");
|
|
116
|
+
if (addressText !== null && !ADDRESS_FORM.test(addressText)) return errorResult("invalid_address: address must be 0x plus 40 hex characters");
|
|
117
|
+
const address = addressText === null ? null : addressText.toLowerCase();
|
|
118
|
+
let loaded;
|
|
119
|
+
try {
|
|
120
|
+
loaded = await deps.loadExchangeRegistry(network);
|
|
121
|
+
} catch (err) {
|
|
122
|
+
return errorResult(err instanceof require_dex_registry.DexRegistryError ? err.message : `exchange lookup unavailable: ${err.message}`);
|
|
123
|
+
}
|
|
124
|
+
const { document } = loaded;
|
|
125
|
+
const listed = document.rows.map((row) => row.display);
|
|
126
|
+
const base = {
|
|
127
|
+
schema: META_EXCHANGE_LOOKUP_SCHEMA,
|
|
128
|
+
network,
|
|
129
|
+
registry_version: document.registry_version,
|
|
130
|
+
registry_source: loaded.source,
|
|
131
|
+
recorded_on: document.recorded_on
|
|
132
|
+
};
|
|
133
|
+
if (name === null && address === null) {
|
|
134
|
+
const result = {
|
|
135
|
+
...base,
|
|
136
|
+
matched: null,
|
|
137
|
+
candidates: [],
|
|
138
|
+
listed,
|
|
139
|
+
exchanges: document.rows.map((row) => ({
|
|
140
|
+
exchange: row.exchange,
|
|
141
|
+
display: row.display,
|
|
142
|
+
hot_wallets: row.wallets.filter((wallet) => wallet.role === "hot_wallet").length
|
|
143
|
+
}))
|
|
144
|
+
};
|
|
145
|
+
return textResult({
|
|
146
|
+
...result,
|
|
147
|
+
hint: hintFor(result, null, null)
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
if (address !== null) {
|
|
151
|
+
const owner = require_exchange_registry.exchangeOfWallet(address, document.rows);
|
|
152
|
+
const result = {
|
|
153
|
+
...base,
|
|
154
|
+
matched: owner ? exchangeMatchOf(owner.entry) : null,
|
|
155
|
+
...owner ? { took_for: ROLE_WORDS[owner.wallet.role] } : {},
|
|
156
|
+
candidates: [],
|
|
157
|
+
listed
|
|
158
|
+
};
|
|
159
|
+
return textResult({
|
|
160
|
+
...result,
|
|
161
|
+
hint: hintFor(result, null, address)
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
const match = require_exchange_registry.matchExchange(name, document.rows);
|
|
165
|
+
const result = {
|
|
166
|
+
...base,
|
|
167
|
+
matched: match.matched ? exchangeMatchOf(match.matched) : null,
|
|
168
|
+
...match.took_for ? { took_for: match.took_for } : {},
|
|
169
|
+
candidates: match.candidates,
|
|
170
|
+
listed
|
|
171
|
+
};
|
|
172
|
+
return textResult({
|
|
173
|
+
...result,
|
|
174
|
+
hint: hintFor(result, name, null)
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
Object.defineProperty(exports, "EXCHANGE_OPENING_RULE", {
|
|
178
|
+
enumerable: true,
|
|
179
|
+
get: function() {
|
|
180
|
+
return EXCHANGE_OPENING_RULE;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
Object.defineProperty(exports, "META_EXCHANGE_LOOKUP_ANNOTATIONS", {
|
|
184
|
+
enumerable: true,
|
|
185
|
+
get: function() {
|
|
186
|
+
return META_EXCHANGE_LOOKUP_ANNOTATIONS;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
Object.defineProperty(exports, "META_EXCHANGE_LOOKUP_DESCRIPTION", {
|
|
190
|
+
enumerable: true,
|
|
191
|
+
get: function() {
|
|
192
|
+
return META_EXCHANGE_LOOKUP_DESCRIPTION;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
Object.defineProperty(exports, "META_EXCHANGE_LOOKUP_TITLE", {
|
|
196
|
+
enumerable: true,
|
|
197
|
+
get: function() {
|
|
198
|
+
return META_EXCHANGE_LOOKUP_TITLE;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
Object.defineProperty(exports, "META_EXCHANGE_LOOKUP_TOOL", {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
get: function() {
|
|
204
|
+
return META_EXCHANGE_LOOKUP_TOOL;
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
Object.defineProperty(exports, "exchange_tool_exports", {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function() {
|
|
210
|
+
return exchange_tool_exports;
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
Object.defineProperty(exports, "handleMetaExchangeLookup", {
|
|
214
|
+
enumerable: true,
|
|
215
|
+
get: function() {
|
|
216
|
+
return handleMetaExchangeLookup;
|
|
217
|
+
}
|
|
218
|
+
});
|