Skip to content

Commit

Permalink
Merge branch 'release/1.49.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin committed Nov 7, 2023
2 parents 312b50a + ede338d commit f841990
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libs/common-const/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import { JsonRpcProvider } from '@ethersproject/providers'

const INFURA_KEY = process.env.REACT_APP_INFURA_KEY || '2af29cd5ac554ae3b8d991afe1ba4b7d' // Default rate-limited infura key (should be overridden, not reliable to use)

const RPC_URL_ENVS: Record<SupportedChainId, string | undefined> = {
[SupportedChainId.MAINNET]: process.env.REACT_APP_NETWORK_URL_1 || undefined,
[SupportedChainId.GNOSIS_CHAIN]: process.env.REACT_APP_NETWORK_URL_100 || undefined,
[SupportedChainId.GOERLI]: process.env.REACT_APP_NETWORK_URL_5 || undefined,
}

const DEFAULT_RPC_URL: Record<SupportedChainId, { url: string; usesInfura: boolean }> = {
[SupportedChainId.MAINNET]: { url: `https://mainnet.infura.io/v3/${INFURA_KEY}`, usesInfura: true },
[SupportedChainId.GNOSIS_CHAIN]: { url: `https://rpc.gnosis.gateway.fm`, usesInfura: false },
Expand All @@ -22,7 +28,7 @@ export const MAINNET_PROVIDER = new JsonRpcProvider(RPC_URLS[SupportedChainId.MA

function getRpcUrl(chainId: SupportedChainId): string {
const envKey = `REACT_APP_NETWORK_URL_${chainId}`
const rpcUrl = process.env[envKey]
const rpcUrl = RPC_URL_ENVS[chainId]

if (rpcUrl) {
return rpcUrl
Expand Down

0 comments on commit f841990

Please sign in to comment.