eth_call - Ethereum

Proceeds the next message call momentarily. You don’t have to create a new transaction on the blockchain

How to Use the eth_call Method

You will use this call frequently to read the data of blockchains with actual smart contracts but with no new publications. This call is not Ether-consuming.

The API has a limit of 1000% of the current gas limit for eth_estimateGas and eth_call methods to prevent abuse.

Parameters

TRANSACTION CALL OBJECT [necessary]

  • from: 20 Bytes - the address where the transaction originated from.

  • to: 20 Bytes - the address where the transaction is sent to.

  • gas: [variable] - the gas provided for the transaction execution (integer). eth_call doesn’t consume gas, but some executions require stating this parameter.

  • gasPrice: [variable] the gasPrice applied for each paid gas (integer).

  • value: [variable] the value sent with a stated transaction

  • data: [variable] Hash of the method signature and encoded parameters. Check Ethereum Contract ABI for more details.

BLOCK PARAMETER [necessary] - the string "latest", "earliest" or "pending", or an integer block number.

What you receive

RETURN VALUE - the recalled value of the proceeded contract method.

Sample

Here is a typical appliance example.

Call

curl https://eth-mainnet.rpcfast.com/?api_key=<key> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_call","params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155","to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567","gas": "0x76c0","gasPrice": "0x9184e72a000","value": "0x9184e72a","data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"],"id":1}'

Outcome

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x"
}

Last updated