File tree Expand file tree Collapse file tree 4 files changed +18
-13
lines changed Expand file tree Collapse file tree 4 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,6 @@ export const networks: Network[] = [
9393 symbol: ETH_SYMBOL,
9494 decimals: DECIMALS,
9595 },
96- rpcUrls: [PublicRpcUrls.Ethereum],
9796 blockExplorerUrls: [createExplorerPrefix(SupportedChainIds.Ethereum)],
9897 },
9998 }
Original file line number Diff line number Diff line change 1+ import { SupportedChainIds } from "../enums/networks"
2+
13export const DECIMALS = 18
24export const ETH_SYMBOL = "ETH"
35export const MAIN_ALCHEMY_URL = "g.alchemy.com/v2/"
46export const MAIN_INFURA_URL = "infura.io/v3/"
7+
8+ export const publicRpcUrls : Record < SupportedChainIds , string > = {
9+ [ SupportedChainIds . Ethereum ] : "https://eth.drpc.org" ,
10+ [ SupportedChainIds . Sepolia ] : "https://sepolia.drpc.org" ,
11+ [ SupportedChainIds . Localhost ] : "http://localhost:8545" ,
12+ [ SupportedChainIds . Arbitrum ] : "https://arbitrum.drpc.org" ,
13+ [ SupportedChainIds . ArbitrumSepolia ] : "https://arbitrum-sepolia.drpc.org" ,
14+ [ SupportedChainIds . Base ] : "https://base.drpc.org" ,
15+ [ SupportedChainIds . BaseSepolia ] : "https://base-sepolia.drpc.org" ,
16+ }
Original file line number Diff line number Diff line change @@ -57,13 +57,3 @@ export enum ExplorerDataType {
5757 ADDRESS = "address" ,
5858 BLOCK = "block" ,
5959}
60-
61- export enum PublicRpcUrls {
62- Ethereum = "https://eth.drpc.org" ,
63- Sepolia = "https://sepolia.drpc.org" ,
64- Localhost = "http://localhost:8545" ,
65- Arbitrum = "https://arbitrum.drpc.org" ,
66- ArbitrumSepolia = "https://arbitrum-sepolia.drpc.org" ,
67- Base = "https://base.drpc.org" ,
68- BaseSepolia = "https://base-sepolia.drpc.org" ,
69- }
Original file line number Diff line number Diff line change 11import { EnvVariable } from "../../enums"
22import { getEnvVariable } from "../../utils/getEnvVariable"
3- import { MAIN_ALCHEMY_URL , MAIN_INFURA_URL } from "../constants/networks"
3+ import {
4+ MAIN_ALCHEMY_URL ,
5+ MAIN_INFURA_URL ,
6+ publicRpcUrls ,
7+ } from "../constants/networks"
48import { NetworksName , RpcServices , SupportedChainIds } from "../enums/networks"
59import { getNetworkNameFromChainId } from "./getNetworkNameFromChainId"
610import { getRpcNetworkConfig } from "./getRpcNetworkConfig"
@@ -25,6 +29,6 @@ export const getRpcEndpointUrl = (chainId?: number | string) => {
2529 case RpcServices . Alchemy :
2630 return `https://${ rpcConfig . networkId } -${ rpcConfig . networkType } .${ MAIN_ALCHEMY_URL } ${ rpcServiceApi } `
2731 default :
28- return "http://localhost:8545"
32+ return publicRpcUrls [ chainIdNumber as SupportedChainIds ]
2933 }
3034}
You can’t perform that action at this time.
0 commit comments