Ethereum
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Ethereum
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
eth_call runs a message call through the Ethereum Virtual Machine and hands back the return data, all without broadcasting anything or burning a single wei of ETH. The call executes against state at a block you choose, then the result is discarded — nothing is written, no nonce moves, no gas leaves your account. This is how every dApp reads contract storage on Ethereum mainnet: token balances, pool reserves, allowance checks, view functions of any kind. Send the request to https://ethereum.therpc.io/YOUR_API_KEY (chain ID 1) with ABI-encoded calldata in the data field and decode the hex you get back with the contract's ABI.
balanceOf, decimals, symbol, totalSupply — the four calls every wallet makes to render a token row are all eth_call under the hood.getReserves or a router's getAmountsOut to compute a spot quote without quoting on-chain.latest state to catch a revert before you pay for it.stateOverrides argument to fake a balance, swap in different bytecode, or rewrite a storage slot, then see how the call behaves — all on a throwaway copy of state.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 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 Ethereum 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 is a snapshot. By the time your signed transaction lands a slot or two later, the same call can return something else — never treat an eth_call quote as a settlement guarantee.stateOverrides third argument is a node extension, not part of the base JSON-RPC spec. Some backends ignore it or reject it; detect that and degrade to a plain call rather than assuming it took effect.3 with revert data, or -32000 when there's no reason string), not as a normal return value. Always wire up the error path, decoding the revert reason where it exists.المعاملات
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.