aboutsummaryrefslogtreecommitdiffstats
path: root/ui/lib
diff options
context:
space:
mode:
authorChi Kei Chan <chikeichan@gmail.com>2017-10-19 14:01:40 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-10-19 14:01:40 +0800
commita8bba2f4b7ca714d46b2e1ca405aec3135aa23b2 (patch)
tree017600778515e74eaf15bf4f889e5b26638c56d7 /ui/lib
parentc8c773d6416f92c520a509a9811d73f68aa00fc0 (diff)
downloadtangerine-wallet-browser-a8bba2f4b7ca714d46b2e1ca405aec3135aa23b2.tar
tangerine-wallet-browser-a8bba2f4b7ca714d46b2e1ca405aec3135aa23b2.tar.gz
tangerine-wallet-browser-a8bba2f4b7ca714d46b2e1ca405aec3135aa23b2.tar.bz2
tangerine-wallet-browser-a8bba2f4b7ca714d46b2e1ca405aec3135aa23b2.tar.lz
tangerine-wallet-browser-a8bba2f4b7ca714d46b2e1ca405aec3135aa23b2.tar.xz
tangerine-wallet-browser-a8bba2f4b7ca714d46b2e1ca405aec3135aa23b2.tar.zst
tangerine-wallet-browser-a8bba2f4b7ca714d46b2e1ca405aec3135aa23b2.zip
Merge master to NewUI-flat
Diffstat (limited to 'ui/lib')
-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
+}