Skip to content

Commit

Permalink
Added matic support to INFURA and Alchemy (#1546).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jul 23, 2021
1 parent bc5cc2e commit 576e9b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/providers/src.ts/alchemy-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down
6 changes: 6 additions & 0 deletions packages/providers/src.ts/infura-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 576e9b5

Please sign in to comment.