From 1717abbf29a14a6f6b106e479fe9a5b1f8768dc4 Mon Sep 17 00:00:00 2001 From: Richard Moore Date: Tue, 9 Apr 2024 20:58:48 -0400 Subject: [PATCH] Added Polygon Amoy testnet (#4645). --- src.ts/providers/default-provider.ts | 2 ++ src.ts/providers/network.ts | 1 + src.ts/providers/provider-alchemy.ts | 3 +++ src.ts/providers/provider-infura.ts | 3 +++ 4 files changed, 9 insertions(+) diff --git a/src.ts/providers/default-provider.ts b/src.ts/providers/default-provider.ts index d24eccea18..6d724b24d0 100644 --- a/src.ts/providers/default-provider.ts +++ b/src.ts/providers/default-provider.ts @@ -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 })); } } diff --git a/src.ts/providers/network.ts b/src.ts/providers/network.ts index e37e3f27d7..438e7fd8f3 100644 --- a/src.ts/providers/network.ts +++ b/src.ts/providers/network.ts @@ -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: [ diff --git a/src.ts/providers/provider-alchemy.ts b/src.ts/providers/provider-alchemy.ts index dbd5c14a5c..aa9d269259 100644 --- a/src.ts/providers/provider-alchemy.ts +++ b/src.ts/providers/provider-alchemy.ts @@ -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] @@ -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": diff --git a/src.ts/providers/provider-infura.ts b/src.ts/providers/provider-infura.ts index 669676c6a4..21bdeb64c0 100644 --- a/src.ts/providers/provider-infura.ts +++ b/src.ts/providers/provider-infura.ts @@ -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] @@ -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":