Skip to content

Commit

Permalink
Added Polygon Amoy testnet (#4645).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Apr 10, 2024
1 parent 014004d commit 1717abb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src.ts/providers/default-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ export function getDefaultProvider(network?: string | Networkish | WebSocketLike
if (allowService("publicPolygon") && staticNetwork) {
if (staticNetwork.name === "matic") {
providers.push(new JsonRpcProvider("https:/\/polygon-rpc.com/", staticNetwork, { staticNetwork }));
} else if (staticNetwork.name === "matic-amoy") {
providers.push(new JsonRpcProvider("https:/\/rpc-amoy.polygon.technology/", staticNetwork, { staticNetwork }));
}
}

Expand Down
1 change: 1 addition & 0 deletions src.ts/providers/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ function injectCommonNetworks(): void {
getGasStationPlugin("https:/\/gasstation.polygon.technology/v2")
]
});
registerEth("matic-amoy", 80002, { });
registerEth("matic-mumbai", 80001, {
altNames: [ "maticMumbai", "maticmum" ], // @TODO: Future remove these alts
plugins: [
Expand Down
3 changes: 3 additions & 0 deletions src.ts/providers/provider-alchemy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* - Optimism Goerli Testnet (``optimism-goerli``)
* - Optimism Sepolia Testnet (``optimism-sepolia``)
* - Polygon (``matic``)
* - Polygon Amoy Testnet (``matic-amoy``)
* - Polygon Mumbai Testnet (``matic-mumbai``)
*
* @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]
Expand Down Expand Up @@ -61,6 +62,8 @@ function getHost(name: string): string {
return "base-sepolia.g.alchemy.com";
case "matic":
return "polygon-mainnet.g.alchemy.com";
case "matic-amoy":
return "polygon-amoy.g.alchemy.com";
case "matic-mumbai":
return "polygon-mumbai.g.alchemy.com";
case "optimism":
Expand Down
3 changes: 3 additions & 0 deletions src.ts/providers/provider-infura.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* - Optimism Goerli Testnet (``optimism-goerli``)
* - Optimism Sepolia Testnet (``optimism-sepolia``)
* - Polygon (``matic``)
* - Polygon Amoy Testnet (``matic-amoy``)
* - Polygon Mumbai Testnet (``matic-mumbai``)
*
* @_subsection: api/providers/thirdparty:INFURA [providers-infura]
Expand Down Expand Up @@ -72,6 +73,8 @@ function getHost(name: string): string {
return "linea-goerli.infura.io";
case "matic":
return "polygon-mainnet.infura.io";
case "matic-amoy":
return "polygon-amoy.infura.io";
case "matic-mumbai":
return "polygon-mumbai.infura.io";
case "optimism":
Expand Down

0 comments on commit 1717abb

Please sign in to comment.