UNPKG

dotbit

Version:

A complete .bit SDK and utilities in TypeScript

26 lines 802 B
import slip44 from './coinType2Symbol.json'; export function mapCoinTypeToSymbol(coinType) { if (coinType === null || coinType === void 0 ? void 0 : coinType.match(/^\d+$/)) { return (slip44[coinType] || coinType).toUpperCase(); } return coinType === null || coinType === void 0 ? void 0 : coinType.toUpperCase(); } export function mapSymbolToCoinType(chain) { const customMapper = { POLYGON: '966', BSC: '9006' }; if (chain) { chain = chain.toUpperCase(); if (customMapper[chain]) { return customMapper[chain]; } for (const coinType in slip44) { if (slip44[coinType] === chain) { return coinType; } } } return chain; } //# sourceMappingURL=slip44.js.map