Optimism
Optimism
Optimism
Free tier covers personal projects. Pay-as-you-go scales without a card.
net_version returns the network ID of the chain a node is connected to as a decimal string. On OP Mainnet — the OP Stack rollup that settles to Ethereum L1 and uses ETH for gas — this returns "10", matching the chain ID. It is a fast way for a wallet or backend to confirm it is talking to the right network before acting. Call it at https://optimism.therpc.io/YOUR_API_KEY (chain ID 10, 0xa) and you get the decimal string "10" back.
10) before submitting a transaction, guarding against accidental sends on the wrong chain.10) from OP Sepolia (11155420) in environment-aware logic that picks contract addresses and config per network.This method takes no parameters. Pass an empty array [].
| Type | Description |
|---|---|
| string | Decimal string network ID, e.g. `"1"` for Ethereum mainnet. Note: network ID and chain ID coincide on most networks but can differ. |
Try it live in the Optimism playground.
10), but that is not guaranteed on every network — always use eth_chainId for the value you fold into EIP-155 transaction signing."10"), not a 0x-prefixed hex value like most other numeric RPC responses, so parse it accordingly.