Base
Base
Base
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_chainId returns the EIP-155 chain ID of the network the endpoint is serving. For Base — Coinbase's OP Stack rollup that uses ETH for gas — the answer at https://base.therpc.io/YOUR_API_KEY is 0x2105, which is decimal 8453. That number is the canonical identifier you embed in signed transactions so a payload meant for Base mainnet can never be replayed on Ethereum L1 or any other chain. It takes no parameters and costs a single CU.
0x2105) and not Ethereum or another OP Stack chain.eth_blockNumber for a full "alive and on the right chain" probe of your Base endpoint in one health check.此方法不需要任何参数,传入空数组 [] 即可。
| 类型 | 描述 |
|---|---|
| string (hex) | Hex-encoded chain ID integer (e.g. "0x1" for Ethereum mainnet). |
Try it live in the Base playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32603 | Internal error | Node failed to retrieve chain configuration. |
net_version, which returns the network ID as a decimal string; on Base both happen to map to 8453, but treat them as separate concepts and use eth_chainId for EIP-155 signing."0x2105"); compare with BigInt(result) === 8453n rather than string equality to avoid casing or zero-padding bugs.