eth_call
Executes a new message call immediately without creating a transaction on the block chain.
To prevent API abuse, the gas parameter in eth_estimateGas and eth_call is capped at 10x (1000%) the current block gas limit. You can recreate this behavior in your local test environment (Ganache, Besu, Geth, or other client) via the rpc.gascap command-line option.
REQUEST
POST https://<network>.chainrpc.io/v3/YOUR-API-KEYHEADERS
Content-Type: application/jsonREQUEST PAYLOAD
TRANSACTION CALL OBJECT[required]from: 20 Bytes - The address the transaction is sent from.to: 20 Bytes - The address the transaction is directed to.gas: [optional] hexadecimal value of the gas provided for the transaction execution.eth_callconsumes zero gas, but this parameter may be needed by some executions.gasPrice: [optional] hexadecimal value of the gasPrice used for each paid gas.maxPriorityFeePerGas: [optional] Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. See EIP-1559 transactions.maxFeePerGas: [optional] Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. See EIP-1559 transactions.value: [optional] hexadecimal value of the value sent with this transaction.data: [optional] Hash of the method signature and encoded parameters. See the Ethereum contract ABI specification.
BLOCK PARAMETER[required] - a hexadecimal block number, or the string "latest", "earliest" or "pending". See the default block parameter.
EXAMPLE
RESPONSE
RESULT FIELDS
RETURN VALUE- the return value of the executed contract method.
BODY
On Mainnet, Rinkeby, Ropsten and Goerli, if this call causes the EVM to execute a REVERT operation, an error response of the following form is returned, with the revert reason pre-decoded as a string:
On Kovan, the actual revert reason is instead returned encoded as part of the data field in the response.
Last updated