eth_call RPC Method
Parameters
transaction
object
Loading...
from
string
Loading...
to
string
Loading...
gas
integer
Loading...
gasPrice
integer
Loading...
value
integer
Loading...
data
string
Loading...
blockNumber/tag
string
Loading...
Returns
data
Loading...
Request
curl https://docs-demo.xdai.quiknode.pro/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"eth_call","params":[{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"],"id":1,"jsonrpc":"2.0"}'
require 'eth' client = Eth::Client.create 'https://docs-demo.xdai.quiknode.pro/' payload = { "jsonrpc": "2.0", "method": "eth_call", "params": [{"from":nil,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"], "id": "1" } response = client.send(payload.to_json) puts response
import { ethers } from "ethers"; (async () => { const provider = new ethers.JsonRpcProvider("https://docs-demo.xdai.quiknode.pro/"); const response = await provider.send("eth_call", [ { "from": null, "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE", }, "latest", ]); console.log(response); })();
var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "method": "eth_call", "params": [ { "from": null, "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE" }, "latest" ], "id": 1, "jsonrpc": "2.0" }); var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("https://docs-demo.xdai.quiknode.pro/", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
import requests import json url = "https://docs-demo.xdai.quiknode.pro/" payload = json.dumps({ "method": "eth_call", "params": [ { "from": None, "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE" }, "latest" ], "id": 1, "jsonrpc": "2.0" }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
require "uri" require "json" require "net/http" url = URI("https://docs-demo.xdai.quiknode.pro/") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "method": "eth_call", "params": [ { "from": nil, "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE" }, "latest" ], "id": 1, "jsonrpc": "2.0" }) response = https.request(request) puts response.read_body
from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('https://docs-demo.xdai.quiknode.pro/')) abi = '[{"constant":True,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":False,"stateMutability":"view","type":"function"}]' myContract = w3.eth.contract(address="0x6B175474E89094C44Da98b954EedeAC495271d0F", abi=abi) response = myContract.functions.balanceOf("0x6E0d01A76C3Cf4288372a29124A26D4353EE51BE").call() print(response)
import { Core } from '@quicknode/sdk' const core = new Core({ endpointUrl: "https://docs-demo.xdai.quiknode.pro/", }) core.client .call({ account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }) .then(res => console.log(res))
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free