eth_call RPC Method
Parameters
transaction
object
REQUIRED
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...
Object
object
Loading...
balance
string
Loading...
nonce
string
Loading...
code
string
Loading...
state
object
Loading...
stateDiff
integer
Loading...
Returns
data
string
Loading...
Request
1curl https://docs-demo.injective-testnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{5"jsonrpc": "2.0",6"id": 1,7"method": "eth_call",8"params":[{"to":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"]9}'
1curl https://docs-demo.injective-testnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{5"jsonrpc": "2.0",6"id": 1,7"method": "eth_call",8"params":[{"to":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"]9}'
1require 'eth'23client = Eth::Client.create 'https://docs-demo.injective-testnet.quiknode.pro/'4payload = {5"jsonrpc": "2.0",6"method": "eth_call",7"params":[{"to":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],8"id": "1"9}1011response = client.send(payload.to_json)12puts response
1require 'eth'23client = Eth::Client.create 'https://docs-demo.injective-testnet.quiknode.pro/'4payload = {5"jsonrpc": "2.0",6"method": "eth_call",7"params":[{"to":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "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.injective-testnet.quiknode.pro/");4const response = await provider.send("eth_call", [5{6"to": "0x0fd43c8fabe26d70dfa4c8b6fa680db39f147460",7"data": "0x919840ad"8},9"latest",10{11"0x0fd43c8fabe26d70dfa4c8b6fa680db39f147460": {12"code": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063919840ad14602d575b600080fd5b60336045565b60408051918252519081900360200190f35b60005a90509056fea265627a7a72315820df124583906aafd283490b866399b6762e2075e1d84214363893c5993a13276f64736f6c63430005110032"13}14}15]);16console.log(response);17})();
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider("https://docs-demo.injective-testnet.quiknode.pro/");4const response = await provider.send("eth_call", [5{6"to": "0x0fd43c8fabe26d70dfa4c8b6fa680db39f147460",7"data": "0x919840ad"8},9"latest",10{11"0x0fd43c8fabe26d70dfa4c8b6fa680db39f147460": {12"code": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063919840ad14602d575b600080fd5b60336045565b60408051918252519081900360200190f35b60005a90509056fea265627a7a72315820df124583906aafd283490b866399b6762e2075e1d84214363893c5993a13276f64736f6c63430005110032"13}14}15]);16console.log(response);17})();
1var myHeaders = new Headers();2myHeaders.append("Content-Type", "application/json");34var raw = JSON.stringify({5"method": "eth_call",6"params":[{"to":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],7"id": 1,8"jsonrpc": "2.0"9});1011var requestOptions = {12method: 'POST',13headers: myHeaders,14body: raw,15redirect: 'follow'16};1718fetch("https://docs-demo.injective-testnet.quiknode.pro/", requestOptions)19.then(response => response.text())20.then(result => console.log(result))21.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":[{"to":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],7"id": 1,8"jsonrpc": "2.0"9});1011var requestOptions = {12method: 'POST',13headers: myHeaders,14body: raw,15redirect: 'follow'16};1718fetch("https://docs-demo.injective-testnet.quiknode.pro/", requestOptions)19.then(response => response.text())20.then(result => console.log(result))21.catch(error => console.log('error', error));
1import requests2import json34url = "https://docs-demo.injective-testnet.quiknode.pro/"56payload = json.dumps({7"method": "eth_call",8"params":[{"to":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],9"id": 1,10"jsonrpc": "2.0"11})12headers = {13'Content-Type': 'application/json'14}1516response = requests.request("POST", url, headers=headers, data=payload)1718print(response.text)19
1import requests2import json34url = "https://docs-demo.injective-testnet.quiknode.pro/"56payload = json.dumps({7"method": "eth_call",8"params":[{"to":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],9"id": 1,10"jsonrpc": "2.0"11})12headers = {13'Content-Type': 'application/json'14}1516response = requests.request("POST", url, headers=headers, data=payload)1718print(response.text)19
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.injective-testnet.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":[{"to":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],15"id": 1,16"jsonrpc": "2.0"17})1819response = https.request(request)20puts response.read_body21
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.injective-testnet.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":[{"to":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],15"id": 1,16"jsonrpc": "2.0"17})1819response = https.request(request)20puts response.read_body21
1from web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.injective-testnet.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="0x0f37613A717a793560DF394928bCc22ed0D8653f", abi=abi)5response = myContract.functions.balanceOf("0xcd2120D608C7FCa8ed6A69016cF7A7562ED730B1").call()6print(response)
1from web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.injective-testnet.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="0x0f37613A717a793560DF394928bCc22ed0D8653f", abi=abi)5response = myContract.functions.balanceOf("0xcd2120D608C7FCa8ed6A69016cF7A7562ED730B1").call()6print(response)
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free