Added matic support to INFURA and Alchemy (#1546).

This commit is contained in:
Richard Moore 2021-07-23 02:13:35 -04:00
parent bc5cc2e7e3
commit 576e9b54ab
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651
2 changed files with 12 additions and 0 deletions

@ -70,6 +70,12 @@ export class AlchemyProvider extends UrlJsonRpcProvider {
case "kovan":
host = "eth-kovan.alchemyapi.io/v2/";
break;
case "matic":
host = "polygon-mainnet.g.alchemy.com/v2/";
break;
case "maticmum":
host = "polygon-mumbai.g.alchemy.com/v2/";
break;
default:
logger.throwArgumentError("unsupported network", "network", arguments[0]);
}

@ -99,6 +99,12 @@ export class InfuraProvider extends UrlJsonRpcProvider {
case "goerli":
host = "goerli.infura.io";
break;
case "matic":
host = "polygon-mainnet.infura.io";
break;
case "maticmum":
host = "polygon-mumbai.infura.io";
break;
default:
logger.throwError("unsupported network", Logger.errors.INVALID_ARGUMENT, {
argument: "network",