A Metamask fork with Infura removed and default networks editable
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import * as networkEnums from '../../app/scripts/controllers/network/enums'
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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 ''
|
|
|
|
}
|
|
|
|
}
|