bigbuffet-rw/app/soapbox/features/crypto_donate/utils/manifest_map.ts
marcin mikołajczak 58539146a4 TypeScript: ChatPanes, CryptoDonate, utils/ethereum
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-06-10 19:34:17 +02:00

11 lines
602 B
TypeScript

// Converts cryptocurrency-icon's manifest file from a list to a map.
// See: https://github.com/spothq/cryptocurrency-icons/blob/master/manifest.json
import manifest from 'cryptocurrency-icons/manifest.json';
import { List as ImmutableList, Map as ImmutableMap, fromJS } from 'immutable';
const manifestMap = (fromJS(manifest) as ImmutableList<ImmutableMap<string, string>>).reduce((acc: ImmutableMap<string, ImmutableMap<string, string>>, entry: ImmutableMap<string, string>) => {
return acc.set(entry.get('symbol')!.toLowerCase(), entry);
}, ImmutableMap());
export default manifestMap.toJS();