Skip to content

Commit b11abc0

Browse files
committed
Add arbitrum support
1 parent 08581ee commit b11abc0

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

lib/get-request.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,20 @@ const axios = require('axios');
55
* @returns {string}
66
*/
77
function pickChainUrl(chain) {
8-
if (!chain || !TESTNET_API_URL_MAP[chain]) {
8+
if (!chain || !OTHER_API_URL_MAP[chain]) {
99
return MAIN_API_URL;
1010
}
11-
if (ROLLUP_API_URL_MAP[chain]) {
12-
return ROLLUP_API_URL_MAP[chain];
13-
}
14-
return TESTNET_API_URL_MAP[chain];
11+
12+
return OTHER_API_URL_MAP[chain];
1513
}
1614

1715

1816
const MAIN_API_URL = 'https://api.etherscan.io';
19-
const TESTNET_API_URL_MAP = {
17+
const OTHER_API_URL_MAP = {
2018
ropsten: 'https://api-ropsten.etherscan.io',
2119
kovan: 'https://api-kovan.etherscan.io',
2220
rinkeby: 'https://api-rinkeby.etherscan.io',
23-
homestead: 'https://api.etherscan.io'
24-
};
25-
26-
const ROLLUP_API_URL_MAP = {
21+
homestead: 'https://api.etherscan.io',
2722
arbitrum: 'https://arbiscan.io',
2823
arbitrum_rinkeby: 'https://testnet.arbiscan.io'
2924
};

lib/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const account = require('./account');
1212

1313
/**
1414
* @param {string} apiKey - (optional) Your Etherscan APIkey
15-
* @param {string} chain - (optional) Testnet chain keys [ropsten, rinkeby, kovan]
15+
* @param {string} chain - (optional) Other chain keys [ropsten, rinkeby, kovan]
1616
* @param {number} timeout - (optional) Timeout in milliseconds for requests, default 10000
1717
*/
1818
module.exports = function(apiKey, chain, timeout) {

0 commit comments

Comments
 (0)