aboutsummaryrefslogblamecommitdiffstats
path: root/ui/lib/account-link.js
blob: ff52d9c54894e5e181f3fb74ee8a87971cfc069f (plain) (tree)
1
2
3
4
5
6
7
8
9
                                             







                                                     
                                                            
           
                               
                                                             
           






               
module.exports = function(address, network) {
  const net = parseInt(network)
  let link

  switch (net) {
    case 1: // main net
      link = `http://etherscan.io/address/${address}`
      break
    case 2: // morden test net
      link = `http://morden.etherscan.io/address/${address}`
      break
    case 3: // ropsten test net
      link = `http://testnet.etherscan.io/address/${address}`
      break
    default:
      link = ''
      break
  }

  return link
}