1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 15:50:28 +01:00
metamask-extension/ui/lib/etherscan-prefix-for-network.js
Erik Marks 76a2a9bb8b
@metamask/eslint config@5.0.0 (#10358)
* @metamask/eslint-config@5.0.0
* Update eslintrc and prettierrc
* yarn lint:fix
2021-02-04 10:15:23 -08:00

24 lines
685 B
JavaScript

import * as networkEnums from '../../shared/constants/network';
/**
* Gets the etherscan.io URL prefix for a given network ID.
*
* @param {string} networkId - The network ID to get the prefix for.
* @returns {string} The etherscan.io URL prefix for the given network ID.
*/
export function getEtherscanNetworkPrefix(networkId) {
switch (networkId) {
case networkEnums.ROPSTEN_NETWORK_ID:
return 'ropsten.';
case networkEnums.RINKEBY_NETWORK_ID:
return 'rinkeby.';
case networkEnums.KOVAN_NETWORK_ID:
return 'kovan.';
case networkEnums.GOERLI_NETWORK_ID:
return 'goerli.';
default:
// also covers mainnet
return '';
}
}