# Infura Network Endpoints Reference

This document aligns with the **official Infura/MetaMask endpoint list**. Replace `<YOUR-API-KEY>` with your API key from the [MetaMask Developer dashboard](https://docs.metamask.io/developer-tools/dashboard/) — in this repo that is **`INFURA_PROJECT_ID`** in `.env`.

---

## EVM JSON-RPC over HTTPS (used by scripts)

| Network | Env var (optional override) | URL |
| --- | --- | --- |
| **Ethereum** | | |
| Mainnet | `ETHEREUM_MAINNET_RPC` | `https://mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Testnet (Sepolia) | `ETHEREUM_SEPOLIA_RPC` | `https://sepolia.infura.io/v3/<YOUR-API-KEY>` |
| Testnet (Hoodi) | — | `https://hoodi.infura.io/v3/<YOUR-API-KEY>` |
| **Arbitrum** | | |
| Mainnet | `ARBITRUM_MAINNET_RPC` | `https://arbitrum-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Testnet (Sepolia) | `ARBITRUM_SEPOLIA_RPC` | `https://arbitrum-sepolia.infura.io/v3/<YOUR-API-KEY>` |
| **Avalanche (C-Chain)** | | |
| Mainnet | `AVALANCHE_MAINNET_RPC` | `https://avalanche-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Testnet (Fuji) | `AVALANCHE_FUJI_RPC` | `https://avalanche-fuji.infura.io/v3/<YOUR-API-KEY>` |
| **Base** | | |
| Mainnet | `BASE_MAINNET_RPC` | `https://base-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Testnet (Sepolia) | `BASE_SEPOLIA_RPC` | `https://base-sepolia.infura.io/v3/<YOUR-API-KEY>` |
| **Blast** | | |
| Mainnet | `BLAST_MAINNET_RPC` | `https://blast-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Testnet (Sepolia) | — | `https://blast-sepolia.infura.io/v3/<YOUR-API-KEY>` |
| **Binance Smart Chain** | | |
| Mainnet | `BSC_MAINNET_RPC` / `BSC_RPC_URL` | `https://bsc-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Testnet | `BSC_TESTNET_RPC` | `https://bsc-testnet.infura.io/v3/<YOUR-API-KEY>` |
| **Celo** | | |
| Mainnet | `CELO_MAINNET_RPC` | `https://celo-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Testnet (Sepolia) | — | `https://celo-sepolia.infura.io/v3/<YOUR-API-KEY>` |
| **Linea** | | |
| Mainnet | `LINEA_MAINNET_RPC` | `https://linea-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Testnet (Sepolia) | — | `https://linea-sepolia.infura.io/v3/<YOUR-API-KEY>` |
| **Optimism** | | |
| Mainnet | `OPTIMISM_MAINNET_RPC` | `https://optimism-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Testnet (Sepolia) | `OPTIMISM_SEPOLIA_RPC` | `https://optimism-sepolia.infura.io/v3/<YOUR-API-KEY>` |
| **Polygon PoS** | | |
| Mainnet | `POLYGON_MAINNET_RPC` | `https://polygon-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Testnet (Amoy) | `POLYGON_AMOY_RPC` | `https://polygon-amoy.infura.io/v3/<YOUR-API-KEY>` |
| **Scroll** | | |
| Mainnet | `SCROLL_MAINNET_RPC` | `https://scroll-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Sepolia | — | `https://scroll-sepolia.infura.io/v3/<YOUR-API-KEY>` |
| **ZKsync Era** | | |
| Mainnet | `ZKSYNC_MAINNET_RPC` | `https://zksync-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Testnet (Sepolia) | — | `https://zksync-sepolia.infura.io/v3/<YOUR-API-KEY>` |
| **Other Infura chains** | | |
| Hemi Mainnet | `HEMI_MAINNET_RPC` | `https://hemi-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Mantle Mainnet | `MANTLE_MAINNET_RPC` | `https://mantle-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| MegaETH Mainnet | `MEGAETH_MAINNET_RPC` | `https://megaeth-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Monad Mainnet | `MONAD_MAINNET_RPC` | `https://monad-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| opBNB Mainnet | `OPBNB_MAINNET_RPC` | `https://opbnb-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Palm Mainnet | `PALM_MAINNET_RPC` | `https://palm-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Sei Mainnet | `SEI_MAINNET_RPC` | `https://sei-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Swellchain Mainnet | `SWELLCHAIN_MAINNET_RPC` | `https://swellchain-mainnet.infura.io/v3/<YOUR-API-KEY>` |
| Unichain Mainnet | `UNICHAIN_MAINNET_RPC` | `https://unichain-mainnet.infura.io/v3/<YOUR-API-KEY>` |

---

## WebSocket URLs

Same host path as HTTPS; use `wss://<host_path>.infura.io/ws/v3/<YOUR-API-KEY>`. Example: `wss://mainnet.infura.io/ws/v3/<YOUR-API-KEY>`.

---

## Gas API

The [Gas REST API](https://docs.metamask.io/services/reference/gas-api/) supports many chain IDs. Scripts use `INFURA_PROJECT_ID` (or `INFURA_GAS_API`) for `https://gas.api.infura.io/v3/<ID>/networks/<chain_id>/suggestedGasFees`. See `scripts/deployment/check-balances-gas-and-deploy.sh` and `scripts/lib/infura.sh`.

---

## How we use these

- **`.env`**: Set `INFURA_PROJECT_ID` and optionally `INFURA_PROJECT_SECRET`. Per-chain URLs can be set as `*_RPC` (e.g. `ETHEREUM_MAINNET_RPC=https://mainnet.infura.io/v3/<ID>`) or left unset so scripts build them from `INFURA_PROJECT_ID` via `scripts/lib/infura.sh` (`build_infura_rpc(host_path)`).
- **`config/infura-rpc-urls.conf`**: Lists host paths (e.g. `mainnet`, `arbitrum-mainnet`) for reference and for scripts that build URLs.
- **Verification**: `scripts/deployment/verify-all-rpcs.sh` tests all RPC endpoints defined in `.env` (required, Infura, and other chains). Run from a network that can reach Infura and other RPCs.

**Note**: Cronos is not on Infura; use `CRONOS_RPC_URL=https://evm.cronos.org` or another public RPC.
