eth_call - Celo
Example code for the eth_call JSON-RPC method. Complete guide on how to use eth_call JSON-RPC in GetBlock Web3 documentation.
Parameters
Parameter
Type
Required
Description
Transaction Object
Field
Type
Required
Description
Request Example
curl -X POST https://go.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": "getblock.io",
"method": "eth_call",
"params": [
{
"to": "0x765DE816845861e75A25fCA122bb6898B8B1282a",
"data": "0x70a08231000000000000000000000000742d35cc6634c0532925a3b844bc9e7595f8bb45"
},
"latest"
]
}'const axios = require('axios');
const url = 'https://go.getblock.io/<ACCESS-TOKEN>/';
const payload = {
jsonrpc: '2.0',
id: 'getblock.io',
method: 'eth_call',
params: [
{
to: '0x765DE816845861e75A25fCA122bb6898B8B1282a', // cUSD contract
data: '0x70a08231000000000000000000000000742d35cc6634c0532925a3b844bc9e7595f8bb45'
},
'latest'
]
};
axios.post(url, payload, {
headers: { 'Content-Type': 'application/json' }
})
.then(response => console.log(response.data))
.catch(error => console.error(error));Response Example
Response Definition
Field
Type
Description
Use Cases
Error Handling
Error Code
Description
SDK Integration
Last updated
Was this helpful?