Skip to content

Commit

Permalink
fix: add alchemy mainnet key
Browse files Browse the repository at this point in the history
  • Loading branch information
DillonLin authored Feb 22, 2023
1 parent 1110556 commit 263817d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ REACT_APP_ENABLE_TERMS_OF_USE=true
REACT_APP_INFURA_PROJECT_ID=0454e8da3dd7418c8cc8bf0961417068
REACT_APP_ALCHEMY_PROJECT_ID=PAYPVgUFFCJE6uKwBWzZI_PjrSF79-0I
REACT_APP_ALCHEMY_ARBITRUM_PROJECT_ID=zHh7If3eVmL8WETSWzpqFV61YqUNARwe
REACT_APP_ALCHEMY_ETHEREUM_PROJECT_ID=7CT7Q2obESWD4Kfvf8tUo2PynUzaZh1N

# Analytics
REACT_APP_POST_HOG_API_KEY=phc_1duTJdHbYFcVN268FV4CI3vDf3dgM0AqKsBkM2nasBt
Expand Down
10 changes: 9 additions & 1 deletion app/src/utils/mainnetProvider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import nullthrows from 'nullthrows'

import CachedStaticJsonRpcProvider from './CachedStaticJsonRpcProvider'
import filterNulls from './filterNulls'

const REACT_APP_ALCHEMY_ETHEREUM_PROJECT_ID = process.env.REACT_APP_ALCHEMY_ETHEREUM_PROJECT_ID

const INFURA_PROJECT_ID = nullthrows(
process.env.REACT_APP_INFURA_PROJECT_ID,
Expand All @@ -13,7 +16,12 @@ export const MAINNET_NETWORK_CONFIG = {
chainId: 1,
network: 'ethereum',
walletRpcUrl: `https://mainnet.infura.io/v3/${INFURA_PROJECT_ID}`,
readRpcUrls: [`https://mainnet.infura.io/v3/${INFURA_PROJECT_ID}`],
readRpcUrls: filterNulls([
`https://mainnet.infura.io/v3/${INFURA_PROJECT_ID}`,
REACT_APP_ALCHEMY_ETHEREUM_PROJECT_ID
? `https://eth-mainnet.g.alchemy.com/v2/${REACT_APP_ALCHEMY_ETHEREUM_PROJECT_ID}`
: null,
]),
blockExplorerUrl: 'https://etherscan.io/',
iconUrls: [],
}
Expand Down

0 comments on commit 263817d

Please sign in to comment.