forked from subscan-explorer/projects-info
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
70 lines (66 loc) · 2.12 KB
/
index.js
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
const kusamaJsons = require.context("./networks/kusama/parachain", false, /\.json$/);
const kusamaParachains = {};
kusamaJsons.keys().forEach((k) => {
const c = kusamaJsons(k);
if (c.data && c.data.ParaID) {
kusamaParachains[c.data.ParaID] = c.data;
try {
const logoPaths = c.data.Logo.split("/");
const imageName = logoPaths[logoPaths.length - 1];
kusamaParachains[
c.data.ParaID
].logo = require(`./assets/images/${imageName}`);
} catch {}
}
});
const polkadotJsons = require.context("./networks/polkadot/parachain", false, /\.json$/);
const polkadotParachains = {};
polkadotJsons.keys().forEach((k) => {
const c = polkadotJsons(k);
if (c.data && c.data.ParaID) {
polkadotParachains[c.data.ParaID] = c.data;
try {
const logoPaths = c.data.Logo.split("/");
const imageName = logoPaths[logoPaths.length - 1];
polkadotParachains[
c.data.ParaID
].logo = require(`./assets/images/${imageName}`);
} catch {}
}
});
const rococoJsons = require.context("./networks/rococo/parachain", false, /\.json$/);
const rococoParachains = {};
rococoJsons.keys().forEach((k) => {
const c = rococoJsons(k);
if (c.data && c.data.ParaID) {
rococoParachains[c.data.ParaID] = c.data;
try {
const logoPaths = c.data.Logo.split("/");
const imageName = logoPaths[logoPaths.length - 1];
rococoParachains[
c.data.ParaID
].logo = require(`./assets/images/${imageName}`);
} catch {}
}
});
const westendJsons = require.context("./networks/westend/parachain", false, /\.json$/);
const westendParachains = {};
westendJsons.keys().forEach((k) => {
const c = westendJsons(k);
if (c.data && c.data.ParaID) {
westendParachains[c.data.ParaID] = c.data;
try {
const logoPaths = c.data.Logo.split("/");
const imageName = logoPaths[logoPaths.length - 1];
westendParachains[
c.data.ParaID
].logo = require(`./assets/images/${imageName}`);
} catch {}
}
});
export const parachainInfos = {
kusama: kusamaParachains,
polkadot: polkadotParachains,
rococo: rococoParachains,
westend: westendParachains,
};