Polygon
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Polygon
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
eth_call executes a read-only message call against Polygon's EVM-equivalent state without broadcasting a transaction or spending any MATIC. The node runs your calldata against the target contract at a chosen block and returns the raw return data — nothing is mined, no gas leaves your account. This is the workhorse for reading on-chain state: an ERC-20 balanceOf, a QuickSwap pool's reserves, or an Aave position, all without signing anything. Point it at https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89) and decode the hex result with the contract ABI.
balanceOf, decimals, symbol, or totalSupply — for example query USDT on Polygon at 0xc2132D05D31c914a87C6611C10748AEb04B58e8F.stateOverrides argument to test what-if scenarios — overridden balances or code — without touching live chain state.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | transaction | object | Sí | 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 | Sí | Block at which to execute the call. Use hex block number or a named tag.Predeterminado: latest |
| 3 | stateOverrides | object | No | Optional map of address → { balance, nonce, code, state, stateDiff } overrides applied only for this call. Not supported by all providers. |
| Tipo | Descripción |
|---|---|
| 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 Polygon playground.
| Código | Mensaje | Causa |
|---|---|---|
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 between your call and actual inclusion — at ~2s Polygon blocks the head moves quickly, so never treat a read as a settlement guarantee. For reorg-safe reads use finalized.stateOverrides third argument is not supported by every node; detect the failure and fall back to a plain call rather than assuming it worked.3 or -32000), not as a special success field — always handle the error path and decode the revert reason from the error data.Parámetros
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.