bigbuffet-rw/app/soapbox/features/crypto-donate/utils/coin-db.ts

14 lines
428 B
TypeScript
Raw Normal View History

import { fromJS } from 'immutable';
2022-11-15 09:23:36 -08:00
import manifestMap from './manifest-map';
// All this does is converts the result from manifest_map.js into an ImmutableMap
const coinDB = fromJS(manifestMap);
export default coinDB;
2022-03-25 14:55:48 -07:00
/** Get title from CoinDB based on ticker symbol */
export const getTitle = (ticker: string): string => {
const title = coinDB.getIn([ticker, 'name']);
return typeof title === 'string' ? title : '';
};