From 5440ed23d621c9ebcd24f89d54701f978e1c086e Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 27 Jun 2017 14:49:41 -0700 Subject: Support other network links --- ui/lib/etherscan-prefix-for-network.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ui/lib/etherscan-prefix-for-network.js (limited to 'ui/lib/etherscan-prefix-for-network.js') diff --git a/ui/lib/etherscan-prefix-for-network.js b/ui/lib/etherscan-prefix-for-network.js new file mode 100644 index 000000000..2c1904f1c --- /dev/null +++ b/ui/lib/etherscan-prefix-for-network.js @@ -0,0 +1,21 @@ +module.exports = function (network) { + const net = parseInt(network) + let prefix + switch (net) { + case 1: // main net + prefix = '' + break + case 3: // ropsten test net + prefix = 'ropsten.' + break + case 4: // rinkeby test net + prefix = 'rinkeby.' + break + case 42: // kovan test net + prefix = 'kovan.' + break + default: + prefix = '' + } + return prefix +} -- cgit