diff options
Generate explorer link to match current blockchain
Diffstat (limited to 'ui/lib/explorer-link.js')
-rw-r--r-- | ui/lib/explorer-link.js | 12 |
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}` +} |