Skip to content

Commit

Permalink
Update testnets for third-party providers (ethers-io#3320, ethers-io#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo authored and Woodpile37 committed Jan 14, 2024
1 parent 6feeb7a commit b8534c8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 37 deletions.
17 changes: 1 addition & 16 deletions packages/providers/src.ts/alchemy-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,8 @@ export class AlchemyProvider extends UrlJsonRpcProvider {
case "homestead":
host = "eth-mainnet.alchemyapi.io/v2/";
break;
case "ropsten":
host = "eth-ropsten.alchemyapi.io/v2/";
break;
case "rinkeby":
host = "eth-rinkeby.alchemyapi.io/v2/";
break;
case "goerli":
host = "eth-goerli.alchemyapi.io/v2/";
break;
case "kovan":
host = "eth-kovan.alchemyapi.io/v2/";
host = "eth-goerli.g.alchemyapi.io/v2/";
break;
case "matic":
host = "polygon-mainnet.g.alchemy.com/v2/";
Expand All @@ -79,18 +70,12 @@ export class AlchemyProvider extends UrlJsonRpcProvider {
case "arbitrum":
host = "arb-mainnet.g.alchemy.com/v2/";
break;
case "arbitrum-rinkeby":
host = "arb-rinkeby.g.alchemy.com/v2/";
break;
case "arbitrum-goerli":
host = "arb-goerli.g.alchemy.com/v2/";
break;
case "optimism":
host = "opt-mainnet.g.alchemy.com/v2/";
break;
case "optimism-kovan":
host = "opt-kovan.g.alchemy.com/v2/";
break;
case "optimism-goerli":
host = "opt-goerli.g.alchemy.com/v2/"
break;
Expand Down
18 changes: 10 additions & 8 deletions packages/providers/src.ts/etherscan-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,20 +171,22 @@ export class EtherscanProvider extends BaseProvider{
switch(this.network ? this.network.name: "invalid") {
case "homestead":
return "https:/\/api.etherscan.io";
case "ropsten":
return "https:/\/api-ropsten.etherscan.io";
case "rinkeby":
return "https:/\/api-rinkeby.etherscan.io";
case "kovan":
return "https:/\/api-kovan.etherscan.io";
case "goerli":
return "https:/\/api-goerli.etherscan.io";
case "sepolia":
return "https:/\/api-sepolia.etherscan.io";
case "matic":
return "https:/\/api.polygonscan.com";
case "maticmum":
return "https:/\/api-testnet.polygonscan.com";
case "arbitrum":
return "https:/\/api.arbiscan.io";
case "arbitrum-goerli":
return "https:/\/api-goerli.arbiscan.io";
case "optimism":
return "https:/\/api-optimistic.etherscan.io";
case "optimism-kovan":
return "https:/\/api-kovan-optimistic.etherscan.io";
case "optimism-goerli":
return "https:/\/api-goerli-optimistic.etherscan.io";
default:
}

Expand Down
17 changes: 4 additions & 13 deletions packages/providers/src.ts/infura-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,6 @@ export class InfuraProvider extends UrlJsonRpcProvider {
case "homestead":
host = "mainnet.infura.io";
break;
case "ropsten":
host = "ropsten.infura.io";
break;
case "rinkeby":
host = "rinkeby.infura.io";
break;
case "kovan":
host = "kovan.infura.io";
break;
case "goerli":
host = "goerli.infura.io";
break;
Expand All @@ -111,14 +102,14 @@ export class InfuraProvider extends UrlJsonRpcProvider {
case "optimism":
host = "optimism-mainnet.infura.io";
break;
case "optimism-kovan":
host = "optimism-kovan.infura.io";
case "optimism-goerli":
host = "optimism-goerli.infura.io";
break;
case "arbitrum":
host = "arbitrum-mainnet.infura.io";
break;
case "arbitrum-rinkeby":
host = "arbitrum-rinkeby.infura.io";
case "arbitrum-goerli":
host = "arbitrum-goerli.infura.io";
break;
default:
logger.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
Expand Down

0 comments on commit b8534c8

Please sign in to comment.