eth_call
Executes a new message call immediately without creating a transaction on the block chain.

Parameters

Params - a string array containing (required):
  • Object - The transaction call object
    • from(hex string, optional)- the address the transaction is sent from.
    • to(hex string, required) - the address the transaction is directed to.
    • gas(hex string, optional) - integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.
    • gasPrice(hex string, optional) - integer of the gasPrice used for each paid gas
    • value(hex string, optional) - integer of the value sent with this transaction
    • data(hex string, optional) - hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation
  • QUANTITY|TAG(string, required) - integer block number, or the string "latest", "earliest" or "pending", see the default block parameter

Returns

DATA(hex string) - the return value of executed contract.

Example

Request

curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x08a2e41fb99a7599725190b9c970ad3893fa33cf",
"data": "0x18160ddd"
},
"0xa2f2e0"
],
"id": 1
}'

Result

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0000000000000000000000000000000000000000000c685fa11e01ec6f000000"
}
Copy link
Outline
Parameters
Returns
Example
Request
Result