-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ts
More file actions
18 lines (15 loc) · 943 Bytes
/
Copy pathconfig.ts
File metadata and controls
18 lines (15 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const ALCHEMY_KEY = process.env.EXPO_PUBLIC_ALCHEMY_KEY ?? '';
if (!ALCHEMY_KEY) {
console.warn('EXPO_PUBLIC_ALCHEMY_KEY is missing. Run: eas secret:create --scope project --name EXPO_PUBLIC_ALCHEMY_KEY --value <your_key>');
}
// Use public Infura fallback when Alchemy key is absent so the app doesn't crash
const sepoliaRpc = ALCHEMY_KEY ? `https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_KEY}` : 'https://rpc.sepolia.org';
const ethRpc = ALCHEMY_KEY ? `https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}` : 'https://cloudflare-eth.com';
const polygonRpc = ALCHEMY_KEY ? `https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}` : 'https://polygon-rpc.com';
const arbitrumRpc = ALCHEMY_KEY ? `https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}` : 'https://arb1.arbitrum.io/rpc';
export const RPC_URLS: Record<string, string> = {
Sepolia: sepoliaRpc,
Ethereum: ethRpc,
Polygon: polygonRpc,
Arbitrum: arbitrumRpc,
};