1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
metamask-extension/ui/lib/explorer-link.js

16 lines
316 B
JavaScript
Raw Normal View History

module.exports = function(hash, network) {
2016-04-27 23:43:09 +02:00
const net = parseInt(network)
let prefix
2016-04-27 23:43:09 +02:00
switch (net) {
case 1: // main net
prefix = ''
2016-04-27 23:43:09 +02:00
break
case 2: // morden test net
prefix = 'testnet.'
2016-04-27 23:43:09 +02:00
break
default:
prefix = ''
}
return `http://${prefix}etherscan.io/tx/${hash}`
}