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

Example

Command Shell
Bash
1
curl https://bsc-<network>.web3api.com/v1/YOUR-API-KEY
2
-X POST
3
-H "Content-Type: application/json"
4
-d "{\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\": [{\"from\": \"0xb60e8dd61c5d32be8058bb8eb970870f07233155\",\"to\": \"0xd46e8dd67c5d32be8058bb8eb970870f07244567\",\"gas\": \"0x76c0\",\"gasPrice\": \"0x9184e72a000\",\"value\": \"0x9184e72a\",\"data\": \"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675\"}, \"latest\"],\"id\":1}"
Copied!
1
curl -X POST 'https://bsc-<network>.web3api.com/v1/YOUR-API-KEY' \
2
-H 'Content-Type: application/json' \
3
--data-raw '{"jsonrpc":"2.0","method":"eth_call","params": [{"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155","to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567","gas": "0x76c0","gasPrice": "0x9184e72a000","value": "0x9184e72a","data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"}, "latest"],"id":1}'
Copied!
Request Parameters
Response
  1. 1.
    BLOCK PARAMETER - An int block number in the form of hex, appended with 0x such as 0x6D7FE0, or pre-defined strings latest, earliest, pending.
  2. 2.
    TRANSACTION CALL OBJECT - A transaction object to be broadcasted.
Web3API's Composer accepts int block numbers, which will be auto-converted to a hex representation before being sent to a node.
Within the transaction call object, the following information are required.
  1. 1.
    from: 20 Bytes - address of the sender.
  2. 2.
    to: 20 Bytes - address of the receiver.
  3. 3.
    gas: Hex representation of an integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.
  4. 4.
    gasPrice: Hex representation of an integer of the gasPrice used for each paid gas
  5. 5.
    value: Hex representation of an integer of the value sent with this transaction
  6. 6.
    data: Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI.
Result Fields
RETURN VALUE - the return value of the executed contract method.
Body
1
{
2
"jsonrpc":"2.0",
3
"id":1,
4
"result": "0x"
5
}
Copied!
Last modified 5mo ago
Copy link