eth_call RPC Method
To use the eth_call method on the C-Chain, ensure that the end of your URL includes ext/bc/C/rpc.
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
data
string
Loading...
Request
curl https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/C/rpc \ -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.flare-mainnet.quiknode.pro/' payload = { "jsonrpc": "2.0", "method": "eth_call", "params": [{"method":"eth_call","params":[{"from":nil,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"],"id":1,"jsonrpc":"2.0"}], "id": "1" } response = client.send(payload.to_json) puts response
import { ethers } from "ethers"; (async () => { const abi = [ { constant: true, inputs: [{ internalType: "address", name: "", type: "address" }], name: "balanceOf", outputs: [{ internalType: "uint256", name: "", type: "uint256" }], payable: false, stateMutability: "view", type: "function", }, ]; const provider = new ethers.JsonRpcProvider( "https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/C/rpc" ); const contract = new ethers.Contract( '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7', abi, provider ) const response = await contract.balanceOf( "0x6E0d01A76C3Cf4288372a29124A26D4353EE51BE" ); console.log(response); })();
from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/C/rpc')) 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="0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", abi=abi) response = myContract.functions.balanceOf("0x6E0d01A76C3Cf4288372a29124A26D4353EE51BE").call() print(response)
const myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); const raw = JSON.stringify({ "method": "eth_call", "params": [ { "from": null, "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE" }, "latest" ], "id": 1, "jsonrpc": "2.0" }); const requestOptions = { method: "POST", headers: myHeaders, body: raw, redirect: "follow" }; fetch("https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/C/rpc", requestOptions) .then((response) => response.text()) .then((result) => console.log(result)) .catch((error) => console.error(error));
import requests import json url = "https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/C/rpc" 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.flare-mainnet.quiknode.pro/ext/bc/C/rpc") 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": "__RUBY\#%0NULL__", "to": "0x6b175474e89094c44da98b954eedeac495271d0f", "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE" }, "latest" ], "id": 1, "jsonrpc": "2.0" }) response = https.request(request) puts response.read_body
import { Core } from '@quicknode/sdk' const core = new Core({ endpointUrl: "https://docs-demo.flare-mainnet.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