1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-30 16:18:07 +01:00
metamask-extension/ui/lib/explorer-link.js

16 lines
317 B
JavaScript
Raw Normal View History

2016-06-21 22:18:32 +02:00
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 3: // morden test net
prefix = 'testnet.'
2016-04-27 23:43:09 +02:00
break
default:
prefix = ''
}
return `http://${prefix}etherscan.io/tx/${hash}`
}