forked from mangrovedao/mangrove-webapp-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare-icons.js
64 lines (61 loc) · 1.96 KB
/
prepare-icons.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
const fs = require("fs")
const manifest = require("cryptocurrency-icons/manifest.json")
function copyIcons() {
fs.cpSync(
"./node_modules/cryptocurrency-icons/svg",
"./public/cryptocurrency-icons/svg",
{ recursive: true },
)
// TODO: to remove after working on a generic mapping
fs.copyFileSync(
"./node_modules/cryptocurrency-icons/svg/color/eth.svg",
"./public/cryptocurrency-icons/svg/color/weth.svg",
)
fs.copyFileSync(
"./node_modules/cryptocurrency-icons/svg/color/matic.svg",
"./public/cryptocurrency-icons/svg/color/wmatic.svg",
)
fs.copyFileSync(
"./public/custom-token-icons/blast/usdb.svg",
"./public/cryptocurrency-icons/svg/color/usdb.svg",
)
fs.copyFileSync(
"./public/custom-token-icons/blast/usde.svg",
"./public/cryptocurrency-icons/svg/color/usde.svg",
)
fs.copyFileSync(
"./public/custom-token-icons/blast/blast.svg",
"./public/cryptocurrency-icons/svg/color/blast.svg",
)
fs.copyFileSync(
"./public/custom-token-icons/blast/weeth.svg",
"./public/cryptocurrency-icons/svg/color/weeth.svg",
)
}
function genetareDicFromManifestFile() {
const dic = Object.assign(
{},
...manifest.map(({ symbol, color, name }) => ({
[symbol]: { color, name, symbol },
})),
// TODO: to remove after working on a generic mapping
{ WETH: { color: "#627eea", name: "Wrapped Ethereum", symbol: "WETH" } },
{
weETH: {
color: "#37A1F4",
name: "Wrapped eETH (weETH)",
symbol: "weETH",
},
},
{ WMATIC: { color: "#7F44E0", name: "Wrapped MATIC", symbol: "WMATIC" } },
{ USDB: { color: "#FCFC01", name: "USDB", symbol: "USDB" } },
{ BLAST: { color: "#FCFC01", name: "BLAST", symbol: "BLAST" } },
{ USDe: { color: "#FFFFFF", name: "USDe", symbol: "USDe" } },
)
fs.mkdirSync("./generated", { recursive: true })
fs.writeFileSync("./generated/icons.json", JSON.stringify(dic))
}
;(() => {
copyIcons()
genetareDicFromManifestFile()
})()