Skip to content

Commit 42807da

Browse files
committed
Add arbitrum support
1 parent b11abc0 commit 42807da

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

dist/bundle.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ const axios = require('axios');
269269
* @returns {string}
270270
*/
271271
function pickChainUrl(chain) {
272-
if (!chain || !TESTNET_API_URL_MAP[chain]) {
272+
if (!chain || !OTHER_API_URL_MAP[chain]) {
273273
return MAIN_API_URL;
274274
}
275275

@@ -278,11 +278,13 @@ function pickChainUrl(chain) {
278278

279279

280280
const MAIN_API_URL = 'https://api.etherscan.io';
281-
const TESTNET_API_URL_MAP = {
281+
const OTHER_API_URL_MAP = {
282282
ropsten: 'https://api-ropsten.etherscan.io',
283283
kovan: 'https://api-kovan.etherscan.io',
284284
rinkeby: 'https://api-rinkeby.etherscan.io',
285-
homestead: 'https://api.etherscan.io'
285+
homestead: 'https://api.etherscan.io',
286+
arbitrum: 'https://arbiscan.io',
287+
arbitrum_rinkeby: 'https://testnet.arbiscan.io'
286288
};
287289

288290
module.exports = function(chain, timeout) {
@@ -343,7 +345,7 @@ const account = require('./account');
343345

344346
/**
345347
* @param {string} apiKey - (optional) Your Etherscan APIkey
346-
* @param {string} chain - (optional) Testnet chain keys [ropsten, rinkeby, kovan]
348+
* @param {string} chain - (optional) Other chain keys [ropsten, rinkeby, kovan, arbitrum, arbitrum_rinkeby]
347349
* @param {number} timeout - (optional) Timeout in milliseconds for requests, default 10000
348350
*/
349351
module.exports = function(apiKey, chain, timeout) {

0 commit comments

Comments
 (0)