const MAIN_API_URL = 'https://api.etherscan.io';
const OTHER_API_URL_MAP = {
  ropsten: 'https://api-ropsten.etherscan.io',
  kovan: 'https://api-kovan.etherscan.io',
  rinkeby: 'https://api-rinkeby.etherscan.io',
  homestead: 'https://api.etherscan.io',
  arbitrum: 'https://api.arbiscan.io',
  arbitrum_rinkeby: 'https://api-testnet.arbiscan.io'
};

/**
 * gets  the correct urls of the backend 
 * @param {string} chain 
 * @returns Url of backend
 */
function pickChainUrl(chain) {
    if (!chain || !OTHER_API_URL_MAP[chain]) {
      return MAIN_API_URL;
    }
    return OTHER_API_URL_MAP[chain];
}


  module.exports = pickChainUrl;
const MAIN_API_URL = 'https://api.etherscan.io';
const OTHER_API_URL_MAP = {
  ropsten: 'https://api-ropsten.etherscan.io',
  kovan: 'https://api-kovan.etherscan.io',
  rinkeby: 'https://api-rinkeby.etherscan.io',
  goerli: 'https://api-goerli.etherscan.io',
  sepolia: 'https://api-sepolia.etherscan.io',
  homestead: 'https://api.etherscan.io',
  arbitrum: 'https://api.arbiscan.io',
  arbitrum_rinkeby: 'https://api-testnet.arbiscan.io'
};

/**
 * gets  the correct urls of the backend 
 * @param {string} chain 
 * @returns Url of backend
 */
function pickChainUrl(chain) {
    if (!chain || !OTHER_API_URL_MAP[chain]) {
      return MAIN_API_URL;
    }
    return OTHER_API_URL_MAP[chain];
}


  module.exports = pickChainUrl;

Add Goerli and Sepolia to the API list
Add Goerli and Sepolia to the API list

Hey @sebs 

Thanks a lot for this amazing library.

I created this PR to include the Sepolia and Goerli API endpoints. Currently I'm creating the client (with `axios.create`) to support those two, but I'd be cool if I have directly included on the library.

Thanks!