etherscan-link
Advanced tools
+4
-2
| const prefixForNetwork = require('./prefix-for-network') | ||
| module.exports = function (hash, network) { | ||
| module.exports = function (address, network) { | ||
| const net = parseInt(network) | ||
| const prefix = prefixForNetwork(network) | ||
| return `http://${prefix}etherscan.io/tx/${hash}` | ||
| return `http://${prefix}etherscan.io/address/${address}` | ||
| } | ||
+5
-24
@@ -1,27 +0,8 @@ | ||
| 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 | ||
| } | ||
| const createExplorerLink = require('./explorer-link') | ||
| const createAccountLink = require('./account-link') | ||
| return link | ||
| module.exports = { | ||
| createExplorerLink, | ||
| createAccountLink, | ||
| } | ||
+2
-2
| { | ||
| "name": "etherscan-link", | ||
| "version": "1.0.1", | ||
| "version": "1.0.2", | ||
| "description": "A library for generating etherscan links.", | ||
| "main": "index.js", | ||
| "scripts": { | ||
| "test": "node test" | ||
| "test": "mocha" | ||
| }, | ||
@@ -9,0 +9,0 @@ "repository": { |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
0
-100%3535
-11.78%61
-22.78%