eth_call - Arbitrum
Example code for the eth_call json-rpc method. Сomplete guide on how to use eth_call json-rpc in GetBlock.io Web3 documentation.
This method executes a read-only smart contract call on the Arbitrum blockchain without creating a transaction.
This method does not modify the blockchain state. It only simulates the call and returns the output.
Parameters
transaction
object
yes
Main transaction object containing the call data
from
string
optional
Caller address used for the simulation. Included inside the transaction object
to
string
yes
Smart contract address to call
gas
string (hex)
optional
Gas limit for the simulated call
gasPrice
string (hex)
optional
Ignored for simulations but allowed for compatibility
value
string (hex)
optional
Amount of ETH to send with the call (usually zero)
data
string
yes
Encoded function selector plus parameters
block tag
string or hex
optional
Block context for the simulation. Default is latest
Request
curl --location 'https://go.getblock.us/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_call",
"id": "getblock.io",
"params": [
{
"to": "0x1F98431c8aD98523631AE4a59f267346ea31F984",
"data": "0x8da5cb5b"
},
"latest"
]
}'import axios from 'axios'
let data = JSON.stringify({
"jsonrpc": "2.0",
"method": "eth_call",
"id": "getblock.io",
"params": [
{
"to": "0x1F98431c8aD98523631AE4a59f267346ea31F984",
"data": "0x8da5cb5b"
},
"latest"
]
};
let config = {
method: "post",
maxBodyLength: Infinity,
url: "https://go.getblock.us/<ACCESS_TOKEN>",
headers: {
"Content-Type": "application/json",
},
data: data,
};
axios
.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Response
Reponse Parameter Definition
result
string
The return value of the executed contract function, encoded as a hexadecimal string.
Use case
eth_call is used to:
Track the latest block height
Monitor chain progress or finality
Trigger event-based updates when the block number increases
Error handling
403
Forbidden
Missing or invalid ACCESS_TOKEN.
Integration with Web3
The eth_call can help developers to:
Enables trustless frontends
Reads live contract state without gas
Supports dashboards, DeFi analytics, wallets, NFT explorers
Let's developers simulate transactions before execution
Last updated
Was this helpful?