Skip to main content
Skip to main content

Supported Chains

web3agent supports 17 EVM-compatible chains out of the box. Every chain ships with a built-in public RPC endpoint so you can get started without any additional configuration. Blockscout indexer support is available on 8 of those chains, unlocking the full suite of explorer tools.

Chain Reference

ChainChain IDDefault RPCBlockscout Support
Ethereum1YesYes
Base8453YesYes
Arbitrum42161YesYes
Optimism10YesYes
Polygon137YesYes
Linea59144YesNo
BSC56YesNo
Avalanche43114YesNo
zkSync Era324YesYes
Scroll534352YesYes
Mode34443YesNo
Blast81457YesNo
Mantle5000YesNo
Celo42220YesNo
Gnosis100YesYes
Sepolia11155111YesNo
Base Sepolia84532YesNo

Base (8453) is the default chain. All tools that accept a chainId parameter will use Base unless you specify otherwise.

Blockscout-Enabled Chains

The following 8 chains have full Blockscout indexer support, which powers the blockscout_* family of explorer tools (address info, transaction history, token transfers, contract ABIs, NFT metadata, and more):

  • Ethereum (1)
  • Base (8453)
  • Arbitrum (42161)
  • Optimism (10)
  • Polygon (137)
  • Gnosis (100)
  • Scroll (534352)
  • zkSync Era (324)

On chains without Blockscout support, the evm_* tools still work for live on-chain reads (balances, contract calls, gas estimation), but indexed historical data is not available.

Configuring the Default Chain

Environment variable

Set CHAIN_ID in your environment to change the global default:

CHAIN_ID=42161  # Use Arbitrum as default

Per-call override

Most tools and SDK functions accept a chainId parameter that overrides the default for that specific call:

import { getSwapQuote } from "web3agent";

const quote = await getSwapQuote({
  fromToken: "0x...",
  toToken: "0x...",
  fromAmount: "1000000",
  chainId: 42161,  // Arbitrum, regardless of CHAIN_ID env var
});

Custom RPC endpoint

To use a private or faster RPC for the default chain, set RPC_URL:

RPC_URL=https://mainnet.infura.io/v3/YOUR_KEY
CHAIN_ID=1

RPC_URL applies only to the chain specified by CHAIN_ID. For other chains, the built-in public RPCs are used.

Chain Resolution

Two SDK functions let you look up chain metadata programmatically:

import { getChain, findChainByName } from "web3agent";

// Look up by numeric ID
const base = getChain(8453);
// { id: 8453, name: "Base", nativeCurrency: { symbol: "ETH", decimals: 18 }, ... }

// Look up by name (case-insensitive)
const arb = findChainByName("arbitrum");
// { id: 42161, name: "Arbitrum One", ... }

Both functions return undefined if the chain is not found, so check the return value before using it.

Testnets

Sepolia (11155111) and Base Sepolia (84532) are included for development and testing. They behave identically to mainnet chains from the API perspective, but Blockscout indexer support is not available on either testnet.

Testnet chains use test ETH with no real value. Make sure CHAIN_ID is set correctly before executing any write operations.