aboutsummaryrefslogtreecommitdiffstats
path: root/ui/lib/explorer-link.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-04-20 09:21:28 +0800
committerDan Finlay <dan@danfinlay.com>2016-04-20 09:21:28 +0800
commitf79601ee58a07ec6275d4588845578795f550d84 (patch)
tree5ce3e35ec1cb6b97ae94c2de1d80bd39dbe3fa42 /ui/lib/explorer-link.js
parentb8c57433ce0f6a50318671912b02082e12a0ecb0 (diff)
downloadtangerine-wallet-browser-f79601ee58a07ec6275d4588845578795f550d84.tar
tangerine-wallet-browser-f79601ee58a07ec6275d4588845578795f550d84.tar.gz
tangerine-wallet-browser-f79601ee58a07ec6275d4588845578795f550d84.tar.bz2
tangerine-wallet-browser-f79601ee58a07ec6275d4588845578795f550d84.tar.lz
tangerine-wallet-browser-f79601ee58a07ec6275d4588845578795f550d84.tar.xz
tangerine-wallet-browser-f79601ee58a07ec6275d4588845578795f550d84.tar.zst
tangerine-wallet-browser-f79601ee58a07ec6275d4588845578795f550d84.zip
Generate explorer link to match current blockchain
Diffstat (limited to 'ui/lib/explorer-link.js')
-rw-r--r--ui/lib/explorer-link.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/ui/lib/explorer-link.js b/ui/lib/explorer-link.js
new file mode 100644
index 000000000..a2e7872f9
--- /dev/null
+++ b/ui/lib/explorer-link.js
@@ -0,0 +1,12 @@
+module.exports = function(hash, network) {
+ let prefix
+ switch (network) {
+ case 1: // main net
+ prefix = ''
+ case 2: // morden test net
+ prefix = 'testnet.'
+ default:
+ prefix = ''
+ }
+ return `http://${prefix}etherscan.io/tx/${hash}`
+}