Make the manifest contain name of the coins (#185)
This commit is contained in:
parent
59c6ccdaa8
commit
8b1e8a966b
1541
manifest.json
1541
manifest.json
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
|
@ -39,5 +39,13 @@
|
|||
"erc20-tokens",
|
||||
"erc20",
|
||||
"erc721"
|
||||
]
|
||||
],
|
||||
"scripts": {
|
||||
"manifest": "node scripts/manifest.js",
|
||||
"precommit": "npm run manifest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"alpha-sort": "^2.0.1",
|
||||
"coinlist": "^2.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
const manifest = require('../manifest.json');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const coins = require('coinlist');
|
||||
const alphaSort = require('alpha-sort');
|
||||
|
||||
const icons = manifest.map(icon => {
|
||||
const id = typeof icon === 'string' ? icon : icon.symbol;
|
||||
|
||||
return {
|
||||
name: coins.get(id, 'name') || id,
|
||||
symbol: id.toUpperCase(),
|
||||
};
|
||||
});
|
||||
|
||||
icons.sort((a, b) => {
|
||||
return alphaSort.asc(a.symbol, b.symbol);
|
||||
});
|
||||
|
||||
fs.writeFileSync(path.resolve(__dirname, '../manifest.json'), JSON.stringify(icons, null, 4));
|
Loading…
Reference in New Issue