-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
44 lines (30 loc) · 1.05 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
const fs = require('fs');
const mainnetTokens = require('./tokens/arbitrum.json');
const testnetTokens = require('./tokens/goerli.json');
const assetsPath = './assets/logos/';
const updatedMainnetTokenList = mainnetTokens.filter((token) => {
const symbol = token.symbol.toLowerCase();
const logoPath = `${assetsPath}${symbol}.png`;
if (fs.existsSync(logoPath)) {
token.logoURI = `https://raw.githubusercontent.com/zarbanio/token-list/main/assets/logos/${symbol}.png`;
return true;
}
return false;
});
fs.writeFileSync(
'./tokens/mainnet.json',
JSON.stringify(updatedMainnetTokenList, null, 2)
);
const updatedTestnetTokenList = testnetTokens.filter((token) => {
const symbol = token.symbol.toLowerCase();
const logoPath = `${assetsPath}${symbol}.png`;
if (fs.existsSync(logoPath)) {
token.logoURI = `https://raw.githubusercontent.com/zarbanio/token-list/main/assets/logos/${symbol}.png`;
return true;
}
return false;
});
fs.writeFileSync(
'./tokens/testnet.json',
JSON.stringify(updatedTestnetTokenList, null, 2)
);