@web3auth/no-modal
Version:
Multi chain wallet aggregator for web3Auth
15 lines (11 loc) • 409 B
JavaScript
;
require('@babel/runtime/helpers/objectSpread2');
const formatChainId = chainId => {
if (typeof chainId === "number") {
return `0x${chainId.toString(16)}`;
} else if (typeof chainId === "string") {
return chainId.startsWith("0x") ? chainId : `0x${parseInt(chainId, 10).toString(16)}`;
}
throw new Error(`Invalid chainId: ${chainId}`);
};
exports.formatChainId = formatChainId;