aboutsummaryrefslogtreecommitdiffstats
path: root/ui/classic/lib/account-link.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/classic/lib/account-link.js')
-rw-r--r--ui/classic/lib/account-link.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/ui/classic/lib/account-link.js b/ui/classic/lib/account-link.js
new file mode 100644
index 000000000..d061d0ad1
--- /dev/null
+++ b/ui/classic/lib/account-link.js
@@ -0,0 +1,26 @@
+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://ropsten.etherscan.io/address/${address}`
+ break
+ case 4: // rinkeby test net
+ link = `http://rinkeby.etherscan.io/address/${address}`
+ break
+ case 42: // kovan test net
+ link = `http://kovan.etherscan.io/address/${address}`
+ break
+ default:
+ link = ''
+ break
+ }
+
+ return link
+}