aboutsummaryrefslogtreecommitdiffstats
path: root/ui/lib/account-link.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-01-04 03:06:08 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-01-04 03:06:08 +0800
commita6f062a6865d3e1e5ceb98885ab4b38713e4293d (patch)
treeea379a341cc19f8942536b1800c309f7d79b3583 /ui/lib/account-link.js
parent313b3c087a09bcc4462da15ff3caeac515967cf5 (diff)
parentdfb22471087f040d8345a5a17321e1462842045c (diff)
downloadtangerine-wallet-browser-a6f062a6865d3e1e5ceb98885ab4b38713e4293d.tar.gz
tangerine-wallet-browser-a6f062a6865d3e1e5ceb98885ab4b38713e4293d.tar.zst
tangerine-wallet-browser-a6f062a6865d3e1e5ceb98885ab4b38713e4293d.zip
Merge branch 'NewUI-flat' into NewUI-flat-4.0.5c
Diffstat (limited to 'ui/lib/account-link.js')
-rw-r--r--ui/lib/account-link.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/ui/lib/account-link.js b/ui/lib/account-link.js
new file mode 100644
index 000000000..037d990fa
--- /dev/null
+++ b/ui/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 = `https://etherscan.io/address/${address}`
+ break
+ case 2: // morden test net
+ link = `https://morden.etherscan.io/address/${address}`
+ break
+ case 3: // ropsten test net
+ link = `https://ropsten.etherscan.io/address/${address}`
+ break
+ case 4: // rinkeby test net
+ link = `https://rinkeby.etherscan.io/address/${address}`
+ break
+ case 42: // kovan test net
+ link = `https://kovan.etherscan.io/address/${address}`
+ break
+ default:
+ link = ''
+ break
+ }
+
+ return link
+}