@defillama/sdk 5.0.218 → 5.0.219

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.
@@ -307,7 +307,7 @@
307
307
  "metis": "Metis",
308
308
  "mezo": "Mezo",
309
309
  "migaloo": "Migaloo",
310
- "milkomeda": "Milkomeda C1 (Deprecated)",
310
+ "milkomeda": "Milkomeda C1",
311
311
  "milkomeda_a1": "Milkomeda A1",
312
312
  "milkyway": "Milkyway",
313
313
  "milkyway_rollup": "MilkyWay Rollup",
@@ -388,7 +388,7 @@
388
388
  "pharos": "Pharos",
389
389
  "planq": "Planq",
390
390
  "plasma": "Plasma",
391
- "plume": "Plume (Deprecated)",
391
+ "plume": "Plume",
392
392
  "plume_mainnet": "Plume Mainnet",
393
393
  "pokt": "Pokt",
394
394
  "polis": "Polis",
@@ -977,6 +977,7 @@
977
977
  "Pharos": "pharos",
978
978
  "Planq": "planq",
979
979
  "Plasma": "plasma",
980
+ "Plume": "plume",
980
981
  "Plume (Deprecated)": "plume",
981
982
  "Plume Mainnet": "plume_mainnet",
982
983
  "Pokt": "pokt",
@@ -1180,5 +1181,67 @@
1180
1181
  "zkLink Nova": "zklink",
1181
1182
  "zkSync": "zksync",
1182
1183
  "zkSync Era": "era"
1184
+ },
1185
+ "deadChains": {
1186
+ "airdao": "2026-01-20",
1187
+ "artela": "2026-06-05",
1188
+ "astrzk": "2026-02-12",
1189
+ "bitrock": "2026-02-12",
1190
+ "boba_bnb": "2026-01-20",
1191
+ "btnx": "2026-07-09",
1192
+ "chainx": "2026-01-20",
1193
+ "corn": "2026-06-30",
1194
+ "crab": "2026-01-01",
1195
+ "cube": "2026-06-24",
1196
+ "curio": "2026-06-24",
1197
+ "dchainmainnet": "2026-06-24",
1198
+ "dfs": "2026-06-24",
1199
+ "enuls": "2026-03-25",
1200
+ "eon": "2026-02-12",
1201
+ "eos_evm": "2026-02-12",
1202
+ "eventum": "2026-07-01",
1203
+ "evmos": "2026-05-18",
1204
+ "fhe": "2026-06-01",
1205
+ "fluence": "2026-04-08",
1206
+ "functionx": "2026-06-24",
1207
+ "genesys": "2026-03-01",
1208
+ "godwoken": "2026-01-06",
1209
+ "godwoken_v1": "2026-01-06",
1210
+ "grove": "2025-07-28",
1211
+ "ham": "2026-06-05",
1212
+ "heco": "2026-02-12",
1213
+ "inevm": "2026-04-08",
1214
+ "kadena": "2026-02-12",
1215
+ "kardia": "2026-01-20",
1216
+ "kinto": "2026-03-06",
1217
+ "kroma": "2026-01-20",
1218
+ "migaloo": "2026-02-12",
1219
+ "milkomeda": "2026-02-12",
1220
+ "milkomeda_a1": "2026-02-12",
1221
+ "milkyway": "2026-01-20",
1222
+ "milkyway_rollup": "2026-01-20",
1223
+ "mint": "2026-04-17",
1224
+ "nos": "2026-06-24",
1225
+ "nuls": "2026-03-25",
1226
+ "onus": "2026-06-05",
1227
+ "planq": "2026-06-05",
1228
+ "plume": "2026-02-12",
1229
+ "polygon_zkevm": "2026-07-01",
1230
+ "pryzm": "2026-02-09",
1231
+ "qom": "2026-01-20",
1232
+ "real": "2026-02-12",
1233
+ "redstone": "2026-05-18",
1234
+ "rpg": "2026-02-12",
1235
+ "saga": "2026-02-16",
1236
+ "soon_base": "2026-05-25",
1237
+ "stargaze": "2026-06-01",
1238
+ "swellchain": "2026-06-23",
1239
+ "sx": "2026-04-23",
1240
+ "tara": "2026-03-09",
1241
+ "tenet": "2026-04-22",
1242
+ "titan": "2026-05-05",
1243
+ "vision": "2026-02-20",
1244
+ "winr": "2026-05-01",
1245
+ "zksync": "2026-05-15"
1183
1246
  }
1184
1247
  }
@@ -4,3 +4,6 @@ export declare function updateData(): Promise<void>;
4
4
  export declare const sluggifyString: (name: string) => string;
5
5
  export declare function getChainKeyFromLabel(label: string): string;
6
6
  export declare function getChainLabelFromKey(id: string): string;
7
+ export declare function getDeadChains(): string[];
8
+ export declare function getDeadChainsSet(): Set<string>;
9
+ export declare function isDeadChain(chainKeyOrLabel: string): boolean;
@@ -7,12 +7,18 @@ exports.sluggifyString = exports.chainLabelsToKeyMap = exports.chainKeyToChainLa
7
7
  exports.updateData = updateData;
8
8
  exports.getChainKeyFromLabel = getChainKeyFromLabel;
9
9
  exports.getChainLabelFromKey = getChainLabelFromKey;
10
+ exports.getDeadChains = getDeadChains;
11
+ exports.getDeadChainsSet = getDeadChainsSet;
12
+ exports.isDeadChain = isDeadChain;
10
13
  const data_json_1 = require("./data.json");
11
14
  Object.defineProperty(exports, "chainKeyToChainLabelMap", { enumerable: true, get: function () { return data_json_1.chainKeyToChainLabelMap; } });
12
15
  Object.defineProperty(exports, "chainLabelsToKeyMap", { enumerable: true, get: function () { return data_json_1.chainLabelsToKeyMap; } });
13
16
  const fs_1 = __importDefault(require("fs"));
14
17
  const path_1 = __importDefault(require("path"));
18
+ const deadChainsArray = Object.keys(data_json_1.deadChains);
19
+ const deadChainsSet = new Set(deadChainsArray);
15
20
  async function updateData() {
21
+ var _a;
16
22
  try {
17
23
  // mapping pulled from https://github.com/DefiLlama/defillama-server/blob/master/defi/src/utils/normalizeChain.ts
18
24
  const response = await fetch('https://api.llama.fi/overview/_internal/chain-name-id-map-v2');
@@ -23,11 +29,22 @@ async function updateData() {
23
29
  for (const [key, value] of Object.entries(remoteData.chainLabelsToKeyMap)) {
24
30
  data_json_1.chainLabelsToKeyMap[key] = value;
25
31
  }
32
+ // dead chains are pulled from the `deadFrom` field on chainCoingeckoIds entries in https://api.llama.fi/config
33
+ const configResponse = await fetch('https://api.llama.fi/config');
34
+ const config = await configResponse.json();
35
+ for (const [label, value] of Object.entries((_a = config.chainCoingeckoIds) !== null && _a !== void 0 ? _a : {})) {
36
+ const deadFrom = value === null || value === void 0 ? void 0 : value.deadFrom;
37
+ if (!deadFrom)
38
+ continue;
39
+ const key = getChainKeyFromLabel(label);
40
+ data_json_1.deadChains[key] = deadFrom;
41
+ }
26
42
  // Save to data.json file
27
43
  const dataFilePath = path_1.default.join(__dirname, 'data.json');
28
44
  fs_1.default.writeFileSync(dataFilePath, JSON.stringify({
29
45
  chainKeyToChainLabelMap: sortJSONData(data_json_1.chainKeyToChainLabelMap),
30
46
  chainLabelsToKeyMap: sortJSONData(data_json_1.chainLabelsToKeyMap),
47
+ deadChains: sortJSONData(data_json_1.deadChains),
31
48
  }, null, 2));
32
49
  }
33
50
  catch (error) {
@@ -72,3 +89,17 @@ function getChainLabelFromKey(id) {
72
89
  data_json_1.chainKeyToChainLabelMap[id] = value;
73
90
  return value;
74
91
  }
92
+ // returns the map of dead chains keyed by chain key, with the date (YYYY-MM-DD) the chain was marked dead as the value
93
+ function getDeadChains() {
94
+ return deadChainsArray;
95
+ }
96
+ // returns a Set of dead chain keys (cached)
97
+ function getDeadChainsSet() {
98
+ return deadChainsSet;
99
+ }
100
+ // returns true if the given chain (by key or label) is dead
101
+ function isDeadChain(chainKeyOrLabel) {
102
+ if (deadChainsSet.has(chainKeyOrLabel))
103
+ return true;
104
+ return deadChainsSet.has(getChainKeyFromLabel(chainKeyOrLabel));
105
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defillama/sdk",
3
- "version": "5.0.218",
3
+ "version": "5.0.219",
4
4
  "description": "SDK for calculating TVL",
5
5
  "main": "build/index.js",
6
6
  "scripts": {