mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 20:39:08 +01:00
652db3fd36
* convert network id enums to string * stringify appropriate chain/network ids in tests Co-authored-by: Mark Stacey <markjstacey@gmail.com>
23 lines
687 B
JavaScript
23 lines
687 B
JavaScript
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 ''
|
|
}
|
|
}
|