eth_call RPC Method
Please note that this RPC method doesn't support state override and pending block at the moment.
Parameters
transaction
object
Loading...
from
string
Loading...
to
string
REQUIRED
Loading...
gas
integer
Loading...
gasPrice
integer
Loading...
value
integer
Loading...
data
string
Loading...
blockNumber/tag
string
REQUIRED
Loading...
Returns
result
string
Loading...
Request
1curl https://docs-demo.xlayer-mainnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{"method":"eth_call","params":[{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"],"id":1,"jsonrpc":"2.0"}'
1curl https://docs-demo.xlayer-mainnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{"method":"eth_call","params":[{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"],"id":1,"jsonrpc":"2.0"}'
1require 'eth'23client = Eth::Client.create 'https://docs-demo.xlayer-mainnet.quiknode.pro/'4payload = {5"jsonrpc": "2.0",6"method": "eth_call",7"params": [{"from":nil,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"],8"id": "1"9}1011response = client.send(payload.to_json)12puts response
1require 'eth'23client = Eth::Client.create 'https://docs-demo.xlayer-mainnet.quiknode.pro/'4payload = {5"jsonrpc": "2.0",6"method": "eth_call",7"params": [{"from":nil,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"],8"id": "1"9}1011response = client.send(payload.to_json)12puts response
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider("https://docs-demo.xlayer-mainnet.quiknode.pro/");4const response = await provider.send("eth_call", [5{6"from": null,7"to": "0x6b175474e89094c44da98b954eedeac495271d0f",8"data":9"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE",10},11"latest",12]);13console.log(response);14})();15
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider("https://docs-demo.xlayer-mainnet.quiknode.pro/");4const response = await provider.send("eth_call", [5{6"from": null,7"to": "0x6b175474e89094c44da98b954eedeac495271d0f",8"data":9"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE",10},11"latest",12]);13console.log(response);14})();15
1var myHeaders = new Headers();2myHeaders.append("Content-Type", "application/json");34var raw = JSON.stringify({5"method": "eth_call",6"params": [7{8"from": null,9"to": "0x6b175474e89094c44da98b954eedeac495271d0f",10"data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"11},12"latest"13],14"id": 1,15"jsonrpc": "2.0"16});1718var requestOptions = {19method: 'POST',20headers: myHeaders,21body: raw,22redirect: 'follow'23};2425fetch("https://docs-demo.xlayer-mainnet.quiknode.pro/", requestOptions)26.then(response => response.text())27.then(result => console.log(result))28.catch(error => console.log('error', error));
1var myHeaders = new Headers();2myHeaders.append("Content-Type", "application/json");34var raw = JSON.stringify({5"method": "eth_call",6"params": [7{8"from": null,9"to": "0x6b175474e89094c44da98b954eedeac495271d0f",10"data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"11},12"latest"13],14"id": 1,15"jsonrpc": "2.0"16});1718var requestOptions = {19method: 'POST',20headers: myHeaders,21body: raw,22redirect: 'follow'23};2425fetch("https://docs-demo.xlayer-mainnet.quiknode.pro/", requestOptions)26.then(response => response.text())27.then(result => console.log(result))28.catch(error => console.log('error', error));
1import requests2import json34url = "https://docs-demo.xlayer-mainnet.quiknode.pro/"56payload = json.dumps({7"method": "eth_call",8"params": [9{10"from": None,11"to": "0x6b175474e89094c44da98b954eedeac495271d0f",12"data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"13},14"latest"15],16"id": 1,17"jsonrpc": "2.0"18})19headers = {20'Content-Type': 'application/json'21}2223response = requests.request("POST", url, headers=headers, data=payload)2425print(response.text)26
1import requests2import json34url = "https://docs-demo.xlayer-mainnet.quiknode.pro/"56payload = json.dumps({7"method": "eth_call",8"params": [9{10"from": None,11"to": "0x6b175474e89094c44da98b954eedeac495271d0f",12"data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"13},14"latest"15],16"id": 1,17"jsonrpc": "2.0"18})19headers = {20'Content-Type': 'application/json'21}2223response = requests.request("POST", url, headers=headers, data=payload)2425print(response.text)26
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.xlayer-mainnet.quiknode.pro/")67https = Net::HTTP.new(url.host, url.port)8https.use_ssl = true910request = Net::HTTP::Post.new(url)11request["Content-Type"] = "application/json"12request.body = JSON.dump({13"method": "eth_call",14"params": [15{16"from": nil,17"to": "0x6b175474e89094c44da98b954eedeac495271d0f",18"data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"19},20"latest"21],22"id": 1,23"jsonrpc": "2.0"24})2526response = https.request(request)27puts response.read_body28
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.xlayer-mainnet.quiknode.pro/")67https = Net::HTTP.new(url.host, url.port)8https.use_ssl = true910request = Net::HTTP::Post.new(url)11request["Content-Type"] = "application/json"12request.body = JSON.dump({13"method": "eth_call",14"params": [15{16"from": nil,17"to": "0x6b175474e89094c44da98b954eedeac495271d0f",18"data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"19},20"latest"21],22"id": 1,23"jsonrpc": "2.0"24})2526response = https.request(request)27puts response.read_body28
1from web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.xlayer-mainnet.quiknode.pro/'))3abi = '[{"constant":True,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":False,"stateMutability":"view","type":"function"}]'4myContract = w3.eth.contract(address="0x6B175474E89094C44Da98b954EedeAC495271d0F", abi=abi)5response = myContract.functions.balanceOf("0x6E0d01A76C3Cf4288372a29124A26D4353EE51BE").call()6print(response)
1from web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.xlayer-mainnet.quiknode.pro/'))3abi = '[{"constant":True,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":False,"stateMutability":"view","type":"function"}]'4myContract = w3.eth.contract(address="0x6B175474E89094C44Da98b954EedeAC495271d0F", abi=abi)5response = myContract.functions.balanceOf("0x6E0d01A76C3Cf4288372a29124A26D4353EE51BE").call()6print(response)
1import { Core } from '@quicknode/sdk'23const core = new Core({4endpointUrl: "https://docs-demo.xlayer-mainnet.quiknode.pro/",5})67core.client8.call({9account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',10data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',11to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',12})13.then(res => console.log(res))14
1import { Core } from '@quicknode/sdk'23const core = new Core({4endpointUrl: "https://docs-demo.xlayer-mainnet.quiknode.pro/",5})67core.client8.call({9account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',10data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',11to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',12})13.then(res => console.log(res))14
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free