Repository navigation
Expand file tree
/
Copy pathasset-list.js
More file actions
332 lines (323 loc) · 21.4 KB
/
Copy pathasset-list.js
File metadata and controls
332 lines (323 loc) · 21.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
// Read-only list of what a Universal Profile holds on one network: native balance, LSP7/LSP8 from
// the UP's own LSP5ReceivedAssets (read from the chain), and ERC-20, ERC-721, ERC-1155 (and any LSP
// asset not in LSP5) from an indexer: Alchemy when config.js has a key and the network is covered,
// otherwise Blockscout's public API. An RPC node cannot list an address's tokens by itself; the
// indexer rows are only as complete as the indexer. No wallet, no signature.
//
// Used by up-identity.html and up-wallet.html. Indexed ERC-721 / ERC-1155 are read again on the chain
// (ownerOf, or the balance of each ID) and dropped when the UP no longer holds them.
// Rows: { address, type, name, symbol, amount, ids, rawIds, count, spam, source, image, lsp4Metadata }
// (amount: formatted fungible balance; ids: NFT token IDs to show, at most MAX_IDS; rawIds: the same
// IDs in full, as the contract takes them: bytes32 for LSP8, decimal strings otherwise; count: NFTs held;
// image: URL from the indexer; lsp4Metadata: the asset's LSP4Metadata value, a VerifiableURI the page
// resolves to the token or collection image).
(function () {
const LSP5_ARRAY = "0x6460ee3c0aac563ccbf76d6e1d07bada78e3a9514e6382b736ed3f478ab7b90b"; // LSP5ReceivedAssets[]
const LSP5_MAP = "0x812c4334633eb816c80d0000"; // LSP5ReceivedAssetsMap:<address>
const LSP4_NAME = "0xdeba1e292f8ba88238e10ab3c7f88bd4be4fac56cad5194b6ecceaf653468af1";
const LSP4_SYMBOL = "0x2f0a68ab07768e01943a599e73362a0e17a63a72e94dd2e384d2c1d4db932756";
const LSP4_METADATA = "0x9afb95cacc9f95858ec44aa8c3b685511002e30ae54415823f406128b85b238e";
// How LSP8 token IDs are written: LSP8TokenIdFormat (0.14+), LSP8TokenIdType (older). In both,
// 0 = number and 1 = string; the other values differ between releases, so they stay hex.
const LSP8_ID_FORMAT = "0xf675e9361af1c1664c1868cfa3eb97672d6b1a513aa5b81dec34c9ee330e818d";
const LSP8_ID_TYPE = "0x715f248956de7ce65e94d9d836bfead479f7e70d69b718d47bfe7b00e05b4fe4";
// LSP7 / LSP8 interface IDs across @lukso/lsp-smart-contracts releases (same list as the Send page).
const LSP7_IDS = ["0x05519512", "0xc52d6008", "0xb3c4928f", "0xdaa746b7"];
const LSP8_IDS = ["0x1ae9ba1f", "0x3a271706", "0xecad9f75", "0x30dc5278"];
const MAX_ASSETS = 100, MAX_IDS = 20, MAX_PAGES = 5;
const IFACE = new ethers.Interface([
"function getDataBatch(bytes32[]) view returns (bytes[])",
"function balanceOf(address) view returns (uint256)",
"function balanceOf(address,uint256) view returns (uint256)",
"function ownerOf(uint256) view returns (address)",
"function decimals() view returns (uint8)",
"function tokenIdsOf(address) view returns (bytes32[])",
]);
// Blockscout instances with the v2 API, by chains.js key (LUKSO's explorer is a Blockscout too).
const BLOCKSCOUT = {
"lukso": "https://explorer.execution.mainnet.lukso.network", "lukso-testnet": "https://explorer.execution.testnet.lukso.network",
"ethereum": "https://eth.blockscout.com", "base": "https://base.blockscout.com",
"optimism": "https://optimism.blockscout.com", "arbitrum-one": "https://arbitrum.blockscout.com",
"polygon": "https://polygon.blockscout.com", "gnosis": "https://gnosis.blockscout.com",
"celo": "https://celo.blockscout.com", "unichain": "https://unichain.blockscout.com",
"soneium": "https://soneium.blockscout.com", "zora": "https://explorer.zora.energy",
"mode": "https://explorer.mode.network", "ink": "https://explorer.inkonchain.com",
"ethereum-sepolia": "https://eth-sepolia.blockscout.com", "base-sepolia": "https://base-sepolia.blockscout.com",
"arbitrum-sepolia": "https://arbitrum-sepolia.blockscout.com",
"arc": "https://explorer.arc.io",
};
// Networks whose gas token also has an ERC-20 interface over the same balance (Arc's USDC): that token is
// the native balance shown again, so it is not listed as a separate asset.
const NATIVE_TWIN = { "arc": "0x3600000000000000000000000000000000000000" };
// Alchemy network names, by chains.js key (same list as the Send page).
const ALCHEMY = {
"ethereum": "eth-mainnet", "polygon": "polygon-mainnet", "base": "base-mainnet",
"arbitrum-one": "arb-mainnet", "optimism": "opt-mainnet", "zksync": "zksync-mainnet",
"linea": "linea-mainnet", "scroll": "scroll-mainnet", "blast": "blast-mainnet",
"zora": "zora-mainnet", "world-chain": "worldchain-mainnet", "avalanche-c-chain": "avax-mainnet",
"bnb-smart-chain": "bnb-mainnet", "gnosis": "gnosis-mainnet", "celo": "celo-mainnet",
"unichain": "unichain-mainnet", "soneium": "soneium-mainnet", "ink": "ink-mainnet",
"sonic": "sonic-mainnet", "berachain": "berachain-mainnet", "apechain": "apechain-mainnet",
"ethereum-sepolia": "eth-sepolia", "base-sepolia": "base-sepolia",
"arbitrum-sepolia": "arb-sepolia", "polygon-amoy": "polygon-amoy",
"arc": "arc-mainnet",
};
function alchemyKey() {
const k = (window.CROSSCHAIN_CONFIG && window.CROSSCHAIN_CONFIG.alchemyApiKey) || "";
return /^[A-Za-z0-9_-]{8,128}$/.test(k) ? k : null;
}
// Which indexer a network gets: { kind: "alchemy" | "blockscout", ... } or null.
function indexerFor(netKey) {
if (alchemyKey() && ALCHEMY[netKey]) return { kind: "alchemy", net: ALCHEMY[netKey], key: alchemyKey() };
if (BLOCKSCOUT[netKey]) return { kind: "blockscout", base: BLOCKSCOUT[netKey] };
return null;
}
// Image URLs taken from indexers: only https://, ipfs:// and small data:image/ URIs; anything else is dropped.
function imageUrl(u) {
if (typeof u !== "string" || u.length > 200000) return null;
if (/^https:\/\//i.test(u) || /^ipfs:\/\//i.test(u) || /^data:image\/(png|jpe?g|gif|webp)[;,]/i.test(u)) return u;
return null;
}
const text = (v) => { if (!v || v === "0x") return null; try { return ethers.toUtf8String(v).slice(0, 80); } catch (e) { return null; } };
const fmt = (amount, decimals) => { try { return ethers.formatUnits(amount, Number(decimals || 0)); } catch (e) { return amount.toString(); } };
const shortId = (id) => { const s = String(id); return s.length > 20 ? s.slice(0, 10) + "…" + s.slice(-6) : s; };
async function call(provider, to, fn, args) {
const raw = await provider.call({ to, data: IFACE.encodeFunctionData(fn, args) });
return IFACE.decodeFunctionResult(fn, raw)[0];
}
const tryCall = (provider, to, fn, args) => call(provider, to, fn, args).catch(() => null);
// Runs fn over items, a few at a time (public RPCs answer 429 to bursts).
async function pool(items, n, fn) {
const out = new Array(items.length); let i = 0;
await Promise.all(Array.from({ length: Math.min(n, items.length) }, async () => { while (i < items.length) { const k = i++; out[k] = await fn(items[k]); } }));
return out;
}
// LSP7/LSP8 the UP registered through its Universal Receiver Delegate, with balances read now.
async function fromLsp5(provider, up) {
const [lenRaw] = await call(provider, up, "getDataBatch", [[LSP5_ARRAY]]);
const len = lenRaw && lenRaw !== "0x" ? Number(BigInt(lenRaw)) : 0;
if (!len) return { rows: [], total: 0 };
const n = Math.min(len, MAX_ASSETS);
const items = await call(provider, up, "getDataBatch", [Array.from({ length: n }, (_, i) => LSP5_ARRAY.slice(0, 34) + i.toString(16).padStart(32, "0"))]);
const addrs = items.filter(v => v && ethers.dataLength(v) === 20).map(v => ethers.getAddress(v));
const maps = addrs.length ? await call(provider, up, "getDataBatch", [addrs.map(a => LSP5_MAP + a.slice(2).toLowerCase())]) : [];
// LSP5ReceivedAssetsMap value: interface ID (4 bytes) + index; the interface ID tells LSP8 from LSP7.
const entries = addrs.map((address, k) => ({ address, iid: maps[k] && ethers.dataLength(maps[k]) >= 4 ? maps[k].slice(0, 10).toLowerCase() : "" }));
const rows = await pool(entries, 4, async ({ address, iid }) => {
const type = LSP8_IDS.includes(iid) ? "LSP8" : "LSP7";
const meta = await tryCall(provider, address, "getDataBatch", [[LSP4_NAME, LSP4_SYMBOL, LSP8_ID_FORMAT, LSP8_ID_TYPE, LSP4_METADATA]]);
const bal = await tryCall(provider, address, "balanceOf(address)", [up]);
const row = { address, type, name: meta ? text(meta[0]) : null, symbol: meta ? text(meta[1]) : null, spam: false, source: "lsp5",
lsp4Metadata: meta && meta[4] && meta[4] !== "0x" ? meta[4] : null };
if (bal === null) return { ...row, unreadable: true };
if (type === "LSP8") {
const ids = await tryCall(provider, address, "tokenIdsOf", [up]);
const fmtRaw = meta && meta[2] && meta[2] !== "0x" ? meta[2] : meta && meta[3] && meta[3] !== "0x" ? meta[3] : null;
const idFmt = fmtRaw ? Number(BigInt(fmtRaw)) : null;
const showId = (id) => {
if (idFmt === 0) return shortId(BigInt(id).toString());
if (idFmt === 1) { const t = text(id.replace(/(00)+$/, "")); if (t) return shortId(t); }
return shortId(id);
};
const raw = ids ? Array.from(ids).slice(0, MAX_IDS) : [];
return { ...row, count: bal.toString(), ids: raw.map(showId), rawIds: raw };
}
const dec = await tryCall(provider, address, "decimals", []);
return { ...row, amount: fmt(bal, dec === null ? 18 : dec), zero: bal === 0n };
});
return { rows: rows.filter(r => r && !r.zero && r.count !== "0"), total: len };
}
// At most 20 s per request: a request that never answers (seen on Base, through the browser extension) would
// hold the whole network's reading until the overview gives up on it.
async function getJson(url, init) {
let timer;
const late = new Promise((_, no) => { timer = setTimeout(() => no(new Error("timeout")), 20000); });
try {
const r = await Promise.race([fetch(url, { headers: { accept: "application/json" }, credentials: "omit", referrerPolicy: "no-referrer", ...(init || {}) }), late]);
if (!r.ok) throw new Error("HTTP " + r.status);
return await Promise.race([r.json(), late]);
} finally { clearTimeout(timer); }
}
const bsAddr = (tok) => (tok && (tok.address_hash || tok.address)) || null;
// Spam only when Blockscout marks the token as a scam: a reputation that is merely not "ok" (not rated
// yet, as for a new stablecoin) is not enough to hide a token.
const bsSpam = (tok) => !!(tok && (tok.is_scam === true || tok.reputation === "scam"));
const NFT_TYPES = ["ERC-721", "ERC-1155", "ERC-404", "LSP8"];
async function fromBlockscout(base, up) {
const rows = [];
const balances = await getJson(`${base}/api/v2/addresses/${up}/token-balances`);
(Array.isArray(balances) ? balances : []).forEach(b => {
const tok = b.token || {}, address = bsAddr(tok);
if (!address || !ethers.isAddress(address) || NFT_TYPES.includes(tok.type)) return;
let amount; try { amount = BigInt(b.value || "0"); } catch (e) { return; }
if (amount === 0n) return;
rows.push({ address: ethers.getAddress(address), type: tok.type || "?", name: tok.name, symbol: tok.symbol, amount: fmt(amount, tok.decimals), spam: bsSpam(tok), source: "blockscout", image: imageUrl(tok.icon_url) });
});
let params = "";
for (let page = 0; page < MAX_PAGES; page++) {
const res = await getJson(`${base}/api/v2/addresses/${up}/nft/collections${params}`);
(res.items || []).forEach(c => {
const tok = c.token || {}, address = bsAddr(tok);
if (!address || !ethers.isAddress(address)) return;
const insts = (c.token_instances || []).filter(i => i.id !== undefined && i.id !== null);
const ids = insts.map(i => String(i.id));
// The collection's icon, else the first token's image.
const image = imageUrl(tok.icon_url) || insts.map(i => imageUrl(i.image_url) || imageUrl(i.metadata && i.metadata.image)).find(Boolean) || null;
rows.push({ address: ethers.getAddress(address), type: tok.type || "?", name: tok.name, symbol: tok.symbol, count: String(c.amount || ids.length), ids: ids.slice(0, MAX_IDS).map(shortId), rawIds: ids.slice(0, MAX_IDS), spam: bsSpam(tok), source: "blockscout", image });
});
if (!res.next_page_params) break;
params = "?" + new URLSearchParams(res.next_page_params).toString();
}
return rows;
}
async function alchemyRpc(net, key, method, params) {
const j = await getJson(`https://${net}.g.alchemy.com/v2/${key}`, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params }) });
if (j.error) throw new Error(j.error.message || "RPC error");
return j.result;
}
// A token's name, symbol, decimals and logo do not change: kept for 30 days (memory, then localStorage), so a
// UP that received many tokens (airdrops, spam) is not read again token by token at every refresh.
const META = new Map(), META_STORE = "alchemy.meta.v1.", META_TTL = 30 * 24 * 3600 * 1000;
async function tokenMeta(net, key, address) {
const k = `${net}.${address.toLowerCase()}`;
if (META.has(k)) return META.get(k);
try {
const v = JSON.parse(localStorage.getItem(META_STORE + k) || "null");
if (v && Date.now() - v.at < META_TTL) { META.set(k, v.m); return v.m; }
} catch (e) { /* no storage */ }
const r = await alchemyRpc(net, key, "alchemy_getTokenMetadata", [address]);
const m = { name: r && r.name, symbol: r && r.symbol, decimals: r && r.decimals, logo: r && r.logo };
META.set(k, m);
try { localStorage.setItem(META_STORE + k, JSON.stringify({ m, at: Date.now() })); } catch (e) { /* storage full or off */ }
return m;
}
async function fromAlchemy(net, key, up) {
const rows = [];
let pageKey = null;
for (let page = 0; page < MAX_PAGES; page++) {
const res = await alchemyRpc(net, key, "alchemy_getTokenBalances", pageKey ? [up, "erc20", { pageKey }] : [up, "erc20"]);
const held = [];
for (const b of (res && res.tokenBalances) || []) {
let amount; try { amount = BigInt(b.tokenBalance || "0x0"); } catch (e) { continue; }
if (amount === 0n || !ethers.isAddress(b.contractAddress)) continue;
held.push({ address: ethers.getAddress(b.contractAddress), amount });
}
// The metadata 6 at a time (one by one, a UP with hundreds of tokens took longer than the overview waits).
const metas = new Array(held.length);
let next = 0;
const worker = async () => { while (next < held.length) { const i = next++; metas[i] = await tokenMeta(net, key, held[i].address).catch(() => ({})); } };
await Promise.all(Array.from({ length: Math.min(6, held.length) }, worker));
held.forEach((h, i) => {
const meta = metas[i] || {};
rows.push({ address: h.address, type: "ERC-20", name: meta.name, symbol: meta.symbol, amount: fmt(h.amount, meta.decimals), spam: false, source: "alchemy", image: imageUrl(meta.logo) });
});
pageKey = res && res.pageKey;
if (!pageKey) break;
}
const nfts = {};
pageKey = null;
// The NFT API may refuse while the token API answers (seen with the browser extension's key: HTTP 403 on
// getNFTsForOwner, 200 on the token calls): the tokens are kept, the NFTs come from elsewhere (list()).
try {
for (let page = 0; page < MAX_PAGES; page++) {
const u = new URL(`https://${net}.g.alchemy.com/nft/v3/${key}/getNFTsForOwner`);
u.searchParams.set("owner", up); u.searchParams.set("withMetadata", "true"); u.searchParams.set("pageSize", "100");
if (pageKey) u.searchParams.set("pageKey", pageKey);
const res = await getJson(u.toString());
for (const n of res.ownedNfts || []) {
const c = n.contract || {};
if (!ethers.isAddress(c.address || "") || n.tokenId === undefined) continue;
const address = ethers.getAddress(c.address);
let id; try { id = BigInt(n.tokenId).toString(); } catch (e) { continue; }
const type = c.tokenType === "ERC1155" ? "ERC-1155" : c.tokenType === "ERC721" ? "ERC-721" : (c.tokenType || "?");
// Only Alchemy's verdict counts as spam (its spamClassifications also flag popular collections).
const row = nfts[address] || (nfts[address] = { address, type, name: c.name || (c.openSeaMetadata && c.openSeaMetadata.collectionName), symbol: c.symbol, ids: [], rawIds: [], n: 0, spam: c.isSpam === true || c.isSpam === "true", source: "alchemy",
image: imageUrl(c.openSeaMetadata && c.openSeaMetadata.imageUrl) });
// No collection image: the first token's (Alchemy's cached thumbnail first).
if (!row.image) row.image = imageUrl(n.image && (n.image.thumbnailUrl || n.image.cachedUrl || n.image.originalUrl)) || null;
row.n++;
if (row.ids.length < MAX_IDS) { row.ids.push(shortId(id) + (n.balance && n.balance !== "1" ? ` ×${n.balance}` : "")); row.rawIds.push(id); }
}
pageKey = res.pageKey;
if (!pageKey) break;
}
} catch (e) { rows.nftErr = e.message || String(e); return rows; }
Object.values(nfts).forEach(r => { r.count = String(r.n); delete r.n; rows.push(r); });
return rows;
}
// Indexed ERC-721 / ERC-1155 read again on the chain: an index can still list tokens the UP has sent
// away (Alchemy lags behind). An ID the chain says the UP no longer holds is dropped, a collection with
// none left too; an ID that cannot be read stays as the index has it. Returns { rows, gone }.
async function checkIndexedNfts(provider, up, rows) {
let gone = 0;
const out = await pool(rows, 3, async (r) => {
if ((r.type !== "ERC-721" && r.type !== "ERC-1155") || !r.rawIds || !r.rawIds.length) return r;
const held = await pool(r.rawIds, 4, async (id) => {
let n;
try { n = BigInt(id); } catch (e) { return true; }
if (r.type === "ERC-721") {
const owner = await tryCall(provider, r.address, "ownerOf", [n]);
return owner === null || owner.toLowerCase() === up.toLowerCase();
}
const bal = await tryCall(provider, r.address, "balanceOf(address,uint256)", [up, n]);
return bal === null || bal > 0n;
});
const keep = held.map((h, k) => (h ? k : -1)).filter((k) => k >= 0);
const lost = r.rawIds.length - keep.length;
if (!lost) return r;
gone += lost;
if (!keep.length && Number(r.count) <= r.rawIds.length) return null;
const count = Number.isFinite(Number(r.count)) ? String(Math.max(Number(r.count) - lost, keep.length)) : r.count;
return { ...r, ids: keep.map((k) => r.ids[k]), rawIds: keep.map((k) => r.rawIds[k]), count };
});
return { rows: out.filter(Boolean), gone };
}
// Everything for one network. Never throws: each part reports its own error.
// Returns { native, lsp5, lsp5Total, indexer: { kind, rows, err, gone } | null, rows, errors }
// (gone: indexed NFT IDs the chain says the UP no longer holds, left out).
async function list(provider, up, netKey) {
const out = { native: null, lsp5: [], lsp5Total: 0, indexer: null, rows: [], errors: {} };
try { out.native = await provider.getBalance(up); } catch (e) { out.errors.native = e.shortMessage || e.message; }
try { const r = await fromLsp5(provider, up); out.lsp5 = r.rows; out.lsp5Total = r.total; } catch (e) { out.errors.lsp5 = e.shortMessage || e.message; }
const ix = indexerFor(netKey);
if (ix) {
out.indexer = { kind: ix.kind, rows: [] };
try { out.indexer.rows = ix.kind === "alchemy" ? await fromAlchemy(ix.net, ix.key, up) : await fromBlockscout(ix.base, up); }
catch (e) { out.indexer.err = e.message; }
// Alchemy refused (a network whose token API it does not serve, the key's limits): the network's
// Blockscout, when it has one.
if (out.indexer.err && ix.kind === "alchemy" && BLOCKSCOUT[netKey]) {
try { out.indexer = { kind: "blockscout", rows: await fromBlockscout(BLOCKSCOUT[netKey], up), fallback: out.indexer.err }; }
catch (e) { out.indexer.err += "; Blockscout: " + e.message; }
}
// Alchemy gave the tokens but not the NFTs: the NFTs from the network's Blockscout, when it has one.
const nftErr = out.indexer.rows && out.indexer.rows.nftErr;
if (!out.indexer.err && nftErr) {
out.indexer.nftErr = nftErr;
if (BLOCKSCOUT[netKey]) {
try {
const have = new Set(out.indexer.rows.map((r) => r.address));
// At most 25 s: Base's Blockscout can be slow, and the tokens already read must not be lost with it
// (the browser extension's Alchemy key gets no NFTs, so it always comes here).
let timer;
const late = new Promise((_, no) => { timer = setTimeout(() => no(new Error("timeout 25 s")), 25000); });
const all = await Promise.race([fromBlockscout(BLOCKSCOUT[netKey], up), late]).finally(() => clearTimeout(timer));
const nftRows = all.filter((r) => Array.isArray(r.rawIds) && !have.has(r.address));
out.indexer.rows = out.indexer.rows.concat(nftRows);
out.indexer.nftSource = "blockscout";
} catch (e) { out.indexer.nftErr += "; Blockscout: " + e.message; }
}
}
if (!out.indexer.err) {
const c = await checkIndexedNfts(provider, up, out.indexer.rows);
out.indexer.rows = c.rows; out.indexer.gone = c.gone;
}
}
// The chain's own LSP5 rows win; indexer rows for the same contract are dropped.
const seen = new Set(out.lsp5.map(r => r.address));
if (NATIVE_TWIN[netKey]) seen.add(ethers.getAddress(NATIVE_TWIN[netKey]));
out.rows = out.lsp5.concat(out.indexer ? out.indexer.rows.filter(r => !seen.has(r.address)) : []);
return out;
}
window.AssetList = { list, imageUrl, LSP4_METADATA, indexerFor, fromLsp5, BLOCKSCOUT, ALCHEMY, NATIVE_TWIN, LSP5_ARRAY, LSP5_MAP, MAX_ASSETS, MAX_IDS };
})();