Execute a message call
curl --request POST \
--url https://ronin-mainnet.core.chainstack.com/3997273fc956a67dc6982384500e669e \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x5a254c12ddeb86e2f5626d59c490eb3db1974944",
"data": "0x0d9160e7"
},
"latest"
]
}
'import requests
url = "https://ronin-mainnet.core.chainstack.com/3997273fc956a67dc6982384500e669e"
payload = {
"id": 1,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x5a254c12ddeb86e2f5626d59c490eb3db1974944",
"data": "0x0d9160e7"
},
"latest"
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 1,
jsonrpc: '2.0',
method: 'eth_call',
params: [
{to: '0x5a254c12ddeb86e2f5626d59c490eb3db1974944', data: '0x0d9160e7'},
'latest'
]
})
};
fetch('https://ronin-mainnet.core.chainstack.com/3997273fc956a67dc6982384500e669e', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ronin-mainnet.core.chainstack.com/3997273fc956a67dc6982384500e669e",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 1,
'jsonrpc' => '2.0',
'method' => 'eth_call',
'params' => [
[
'to' => '0x5a254c12ddeb86e2f5626d59c490eb3db1974944',
'data' => '0x0d9160e7'
],
'latest'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ronin-mainnet.core.chainstack.com/3997273fc956a67dc6982384500e669e"
payload := strings.NewReader("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_call\",\n \"params\": [\n {\n \"to\": \"0x5a254c12ddeb86e2f5626d59c490eb3db1974944\",\n \"data\": \"0x0d9160e7\"\n },\n \"latest\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ronin-mainnet.core.chainstack.com/3997273fc956a67dc6982384500e669e")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_call\",\n \"params\": [\n {\n \"to\": \"0x5a254c12ddeb86e2f5626d59c490eb3db1974944\",\n \"data\": \"0x0d9160e7\"\n },\n \"latest\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ronin-mainnet.core.chainstack.com/3997273fc956a67dc6982384500e669e")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_call\",\n \"params\": [\n {\n \"to\": \"0x5a254c12ddeb86e2f5626d59c490eb3db1974944\",\n \"data\": \"0x0d9160e7\"\n },\n \"latest\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}Ronin node API
eth_call | Ronin
The interactive example here is a call to the Ronin Staking Vesting contract. Specifically, to the lastBlockSendingBonus function.
POST
/
3997273fc956a67dc6982384500e669e
Execute a message call
curl --request POST \
--url https://ronin-mainnet.core.chainstack.com/3997273fc956a67dc6982384500e669e \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x5a254c12ddeb86e2f5626d59c490eb3db1974944",
"data": "0x0d9160e7"
},
"latest"
]
}
'import requests
url = "https://ronin-mainnet.core.chainstack.com/3997273fc956a67dc6982384500e669e"
payload = {
"id": 1,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x5a254c12ddeb86e2f5626d59c490eb3db1974944",
"data": "0x0d9160e7"
},
"latest"
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 1,
jsonrpc: '2.0',
method: 'eth_call',
params: [
{to: '0x5a254c12ddeb86e2f5626d59c490eb3db1974944', data: '0x0d9160e7'},
'latest'
]
})
};
fetch('https://ronin-mainnet.core.chainstack.com/3997273fc956a67dc6982384500e669e', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ronin-mainnet.core.chainstack.com/3997273fc956a67dc6982384500e669e",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 1,
'jsonrpc' => '2.0',
'method' => 'eth_call',
'params' => [
[
'to' => '0x5a254c12ddeb86e2f5626d59c490eb3db1974944',
'data' => '0x0d9160e7'
],
'latest'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ronin-mainnet.core.chainstack.com/3997273fc956a67dc6982384500e669e"
payload := strings.NewReader("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_call\",\n \"params\": [\n {\n \"to\": \"0x5a254c12ddeb86e2f5626d59c490eb3db1974944\",\n \"data\": \"0x0d9160e7\"\n },\n \"latest\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ronin-mainnet.core.chainstack.com/3997273fc956a67dc6982384500e669e")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_call\",\n \"params\": [\n {\n \"to\": \"0x5a254c12ddeb86e2f5626d59c490eb3db1974944\",\n \"data\": \"0x0d9160e7\"\n },\n \"latest\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ronin-mainnet.core.chainstack.com/3997273fc956a67dc6982384500e669e")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_call\",\n \"params\": [\n {\n \"to\": \"0x5a254c12ddeb86e2f5626d59c490eb3db1974944\",\n \"data\": \"0x0d9160e7\"\n },\n \"latest\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}The interactive example here is a call to the Ronin Staking Vesting contract. Specifically, to the
lastBlockSendingBonus function. The data 0x0d9160e7 in the call is the signature for the function lastBlockSendingBonus. You can generate the function signature using Chainstack’s Web3Tools by typing lastBlockSendingBonus() into the function name field.
Ronin API method eth_call allows for executing a message call transaction, which directly interacts with a smart contract method without creating a transaction on the blockchain. This is particularly useful for read-only operations that don’t require a transaction to be committed to a block.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
object- The transaction call object:to: The address of the contract to call.data: The data to send to the contract. This is usually the method signature and encoded parameters.
string- The block number or string (latest,earliest,pending) specifying the state to use for executing the call.
State override (optional)
eth_call accepts an optional third parameter: a state override set that changes account state for this call only. Nothing is written to the chain. The set is an object keyed by account address, and each address can override:
balance— the account balance in wei, hex-encodednonce— the account nonce, hex-encodedcode— the bytecode to run at the addressstate— storage slot values that replace the account’s entire storagestateDiff— storage slot values to change, keeping the rest of the storage
42 at an unused address, then calls that address:
curl --request POST \
--url CHAINSTACK_NODE_URL \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_call",
"params": [
{ "to": "0x00000000000000000000000000000000c0ffee42", "data": "0x" },
"latest",
{ "0x00000000000000000000000000000000c0ffee42": { "code": "0x602a60005260206000f3" } }
]
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x000000000000000000000000000000000000000000000000000000000000002a"
}
Response
result- The return value of the executed contract method, encoded in data. This could be a direct value or a set of values depending on the contract’s method called.
Use case
Theeth_call method is essential for interacting with smart contracts when you need to query their state or execute their read-only methods. For example, getting the balance of a token for a specific address, checking the status of a decentralized application, or any other operation that doesn’t change the state of the blockchain.Last modified on October 1, 2026
Was this page helpful?