Base
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Base
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_call executes a read-only message call against the Base EVM without broadcasting a transaction or spending any ETH on gas — the node runs your calldata against current state and hands back the return value. Base is Coinbase's OP Stack rollup that settles to Ethereum L1 and uses ETH as its gas token, so this is the method you reach for whenever you need to read contract state rather than mutate it. Send the request to https://base.therpc.io/YOUR_API_KEY (chain ID 8453); because nothing is mined, it costs no gas and never appears on-chain.
balanceOf, decimals, symbol, or totalSupply for the many USDC and token contracts deployed on Base.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | transaction | object | 是 | Transaction object. Required fields: `to` (target contract). Optional: `from` (msg.sender), `gas` (hex), `gasPrice` (hex), `value` (hex wei), `data` (ABI-encoded calldata). |
| 2 | blockTag | string | object | 是 | Block at which to execute the call. Use hex block number or a named tag.默认值: latest |
| 3 | stateOverrides | object | 否 | Optional map of address → { balance, nonce, code, state, stateDiff } overrides applied only for this call. Not supported by all providers. |
| 类型 | 描述 |
|---|---|
| string | Hex-encoded return data from the executed function. Decode with the contract ABI. If the call reverts, an error with code -32000 or 3 is returned instead. |
Try it live in the Base playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
3 | execution reverted | The EVM reverted the call. Error data contains the revert reason. |
-32602 | invalid argument | Malformed transaction object or missing required `to` field. |
-32000 | execution reverted | Node-level revert without revert data (e.g. out-of-gas within the call, or require with no message). |
latest can shift before your transaction is actually included — with ~2s Base blocks the gap is short, but a price or reserve read is still a snapshot, not a guarantee.3 or -32000), not as a special success field — always handle the error path and decode the revert reason from the error data.参数
Transaction object. Required fields: `to` (target contract). Optional: `from` (msg.sender), `gas` (hex), `gasPrice` (hex), `value` (hex wei), `data` (ABI-encoded calldata).
"latest" | "safe" | "finalized" | "earliest" | "pending" | hex block number
Optional map of address → { balance, nonce, code, state, stateDiff } overrides applied only for this call. Not supported by all providers.