forked from mistswapdex/default-token-list
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildList.js
32 lines (30 loc) · 888 Bytes
/
buildList.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
const { version } = require("../package.json");
const bch = require("../tokens/smartbch.json");
const bchAmber = require("../tokens/smartbch-amber.json");
module.exports = function buildList() {
const parsed = version.split(".");
return {
name: "MISTswap Menu",
timestamp: new Date().toISOString(),
version: {
major: +parsed[0],
minor: +parsed[1],
patch: +parsed[2],
},
tags: {},
logoURI:
"https://raw.githubusercontent.com/mistswapdex/art/master/mist/logo-256x256.png",
keywords: ["mistswap", "default"],
tokens: [
...bch,
...bchAmber,
]
// sort them by symbol for easy readability
.sort((t1, t2) => {
if (t1.chainId === t2.chainId) {
return t1.symbol.toLowerCase() < t2.symbol.toLowerCase() ? -1 : 1;
}
return t1.chainId < t2.chainId ? -1 : 1;
}),
};
};