Skip to content

Commit

Permalink
Updated third-party provider network URLs (#4542).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jan 16, 2024
1 parent 4efef76 commit 84ca14f
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 4 deletions.
27 changes: 26 additions & 1 deletion src.ts/providers/provider-alchemy.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
/**
* About Alchemy
* [[link-alchemy]] provides a third-party service for connecting to
* various blockchains over JSON-RPC.
*
* **Supported Networks**
*
* - Ethereum Mainnet (``mainnet``)
* - Goerli Testnet (``goerli``)
* - Sepolia Testnet (``sepolia``)
* - Arbitrum (``arbitrum``)
* - Arbitrum Goerli Testnet (``arbitrum-goerli``)
* - Arbitrum Sepolia Testnet (``arbitrum-sepolia``)
* - Base (``base``)
* - Base Goerlia Testnet (``base-goerli``)
* - Base Sepolia Testnet (``base-sepolia``)
* - Optimism (``optimism``)
* - Optimism Goerli Testnet (``optimism-goerli``)
* - Optimism Sepolia Testnet (``optimism-sepolia``)
* - Polygon (``matic``)
* - Polygon Mumbai Testnet (``matic-mumbai``)
*
* @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]
*/

import {
defineProperties, resolveProperties, assert, assertArgument,
FetchRequest
Expand Down Expand Up @@ -32,10 +51,14 @@ function getHost(name: string): string {
return "arb-mainnet.g.alchemy.com";
case "arbitrum-goerli":
return "arb-goerli.g.alchemy.com";
case "arbitrum-sepolia":
return "arb-sepolia.g.alchemy.com";
case "base":
return "base-mainnet.g.alchemy.com";
case "base-goerli":
return "base-goerli.g.alchemy.com";
case "base-sepolia":
return "base-sepolia.g.alchemy.com";
case "matic":
return "polygon-mainnet.g.alchemy.com";
case "matic-mumbai":
Expand All @@ -44,6 +67,8 @@ function getHost(name: string): string {
return "opt-mainnet.g.alchemy.com";
case "optimism-goerli":
return "opt-goerli.g.alchemy.com";
case "optimism-sepolia":
return "opt-sepolia.g.alchemy.com";
}

assertArgument(false, "unsupported network", "network", name);
Expand Down
37 changes: 34 additions & 3 deletions src.ts/providers/provider-ankr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@
*
* - Ethereum Mainnet (``mainnet``)
* - Goerli Testnet (``goerli``)
* - Polygon (``matic``)
* - Sepolia Testnet (``sepolia``)
* - Arbitrum (``arbitrum``)
* - Base (``base``)
* - Base Goerlia Testnet (``base-goerli``)
* - Base Sepolia Testnet (``base-sepolia``)
* - BNB (``bnb``)
* - BNB Testnet (``bnbt``)
* - Optimism (``optimism``)
* - Optimism Goerli Testnet (``optimism-goerli``)
* - Optimism Sepolia Testnet (``optimism-sepolia``)
* - Polygon (``matic``)
* - Polygon Mumbai Testnet (``matic-mumbai``)
*
* @_subsection: api/providers/thirdparty:Ankr [providers-ankr]
*/
Expand All @@ -33,10 +43,31 @@ function getHost(name: string): string {
return "rpc.ankr.com/eth";
case "goerli":
return "rpc.ankr.com/eth_goerli";
case "matic":
return "rpc.ankr.com/polygon";
case "sepolia":
return "rpc.ankr.com/eth_sepolia";

case "arbitrum":
return "rpc.ankr.com/arbitrum";
case "base":
return "rpc.ankr.com/base";
case "base-goerli":
return "rpc.ankr.com/base_goerli";
case "base-sepolia":
return "rpc.ankr.com/base_sepolia";
case "bnb":
return "rpc.ankr.com/bsc";
case "bnbt":
return "rpc.ankr.com/bsc_testnet_chapel";
case "matic":
return "rpc.ankr.com/polygon";
case "matic-mumbai":
return "rpc.ankr.com/polygon_mumbai";
case "optimism":
return "rpc.ankr.com/optimism";
case "optimism-goerli":
return "rpc.ankr.com/optimism_testnet";
case "optimism-sepolia":
return "rpc.ankr.com/optimism_sepolia";
}

assertArgument(false, "unsupported network", "network", name);
Expand Down
23 changes: 23 additions & 0 deletions src.ts/providers/provider-infura.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@
* - Sepolia Testnet (``sepolia``)
* - Arbitrum (``arbitrum``)
* - Arbitrum Goerli Testnet (``arbitrum-goerli``)
* - Arbitrum Sepolia Testnet (``arbitrum-sepolia``)
* - Base (``base``)
* - Base Goerlia Testnet (``base-goerli``)
* - Base Sepolia Testnet (``base-sepolia``)
* - BNB (``bnb``)
* - BNB Testnet (``bnbt``)
* - Linea (``linea``)
* - Linea Goerlia Testnet (``linea-goerli``)
* - Optimism (``optimism``)
* - Optimism Goerli Testnet (``optimism-goerli``)
* - Optimism Sepolia Testnet (``optimism-sepolia``)
* - Polygon (``matic``)
* - Polygon Mumbai Testnet (``matic-mumbai``)
*
Expand Down Expand Up @@ -45,6 +54,18 @@ function getHost(name: string): string {
return "arbitrum-mainnet.infura.io";
case "arbitrum-goerli":
return "arbitrum-goerli.infura.io";
case "arbitrum-sepolia":
return "arbitrum-sepolia.infura.io";
case "base":
return "base-mainnet.infura.io";
case "base-goerlia":
return "base-goerli.infura.io";
case "base-sepolia":
return "base-sepolia.infura.io";
case "bnb":
return "bnbsmartchain-mainnet.infura.io";
case "bnbt":
return "bnbsmartchain-testnet.infura.io";
case "linea":
return "linea-mainnet.infura.io";
case "linea-goerli":
Expand All @@ -57,6 +78,8 @@ function getHost(name: string): string {
return "optimism-mainnet.infura.io";
case "optimism-goerli":
return "optimism-goerli.infura.io";
case "optimism-sepolia":
return "optimism-sepolia.infura.io";
}

assertArgument(false, "unsupported network", "network", name);
Expand Down

0 comments on commit 84ca14f

Please sign in to comment.