eth_call RPC Method
Paramètres
transaction
objet
OBLIGATOIRE
Chargement en cours...
de
chaîne de caractères
Chargement en cours...
à
chaîne de caractères
OBLIGATOIRE
Chargement en cours...
gas
entier
Chargement en cours...
gasPrice
entier
Chargement en cours...
valeur
entier
Chargement en cours...
données
chaîne de caractères
Chargement en cours...
blockNumber/tag
chaîne de caractères
OBLIGATOIRE
Chargement en cours...
Retours
résultat
chaîne de caractères
Chargement en cours...
Demande
1curl -X POST "https://docs-demo.gravity-mainnet.quiknode.pro/" \2-H « Content-Type : application/json » \3-d '{4« jsonrpc » : « 2.0 »,5"method": "eth_call",6« params » : [7{8"to": "0x779c127bd3b93efcefacf182e2ce4907765db997",9"gas": "0x7a120",10"gasPrice": "0x0",11"value": "0x0",12"data": "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"13},14« dernier »15],16« id » : 117}'
1curl -X POST "https://docs-demo.gravity-mainnet.quiknode.pro/" \2-H « Content-Type : application/json » \3-d '{4« jsonrpc » : « 2.0 »,5"method": "eth_call",6« params » : [7{8"to": "0x779c127bd3b93efcefacf182e2ce4907765db997",9"gas": "0x7a120",10"gasPrice": "0x0",11"value": "0x0",12"data": "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"13},14« dernier »15],16« id » : 117}'
1import { ethers } from "ethers";23async fonction main() {4const provider = new ethers.JsonRpcProvider("https://docs-demo.gravity-mainnet.quiknode.pro/");5const response = await provider.send("eth_call", [6{7"to": "0x779c127bd3b93efcefacf182e2ce4907765db997",8"gas": "0x7a120",9"gasPrice": "0x0",10"value": "0x0",11"data": "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"12},13« dernier »14]);15console.journal(réponse);16}1718Accueil();
1import { ethers } from "ethers";23async fonction main() {4const provider = new ethers.JsonRpcProvider("https://docs-demo.gravity-mainnet.quiknode.pro/");5const response = await provider.send("eth_call", [6{7"to": "0x779c127bd3b93efcefacf182e2ce4907765db997",8"gas": "0x7a120",9"gasPrice": "0x0",10"value": "0x0",11"data": "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"12},13« dernier »14]);15console.journal(réponse);16}1718Accueil();
1Source : web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.gravity-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="0x779c127bd3b93efcefacf182e2ce4907765db997", abi=abi)5response = myContract.functions.balanceOf("0x0000000000000000000000000000000000000000").call()6imprimer(réponse)
1Source : web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.gravity-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="0x779c127bd3b93efcefacf182e2ce4907765db997", abi=abi)5response = myContract.functions.balanceOf("0x0000000000000000000000000000000000000000").call()6imprimer(réponse)
1import { createPublicClient, http } de 'viem'23async fonction main() {4const client = createPublicClient({5transport: http('https://docs-demo.gravity-mainnet.quiknode.pro/')6})78const résultat = await client.requête({9method: 'eth_call',10paramètres: [11{12"to": "0x779c127bd3b93efcefacf182e2ce4907765db997",13"gas": "0x7a120",14"gasPrice": "0x0",15"value": "0x0",16"data": "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"17},18« dernier »19]20})2122console.journal(résultat)23}2425Accueil()
1import { createPublicClient, http } de 'viem'23async fonction main() {4const client = createPublicClient({5transport: http('https://docs-demo.gravity-mainnet.quiknode.pro/')6})78const résultat = await client.requête({9method: 'eth_call',10paramètres: [11{12"to": "0x779c127bd3b93efcefacf182e2ce4907765db997",13"gas": "0x7a120",14"gasPrice": "0x0",15"value": "0x0",16"data": "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"17},18« dernier »19]20})2122console.journal(résultat)23}2425Accueil()
1import { QuicknodeSdk } from '@quicknode/sdk'23const qn = new QuicknodeSdk({})45const result = await qn.rpc.call(6'eth_call',7[8{9"to": "0x779c127bd3b93efcefacf182e2ce4907765db997",10"gas": "0x7a120",11"gasPrice": "0x0",12"value": "0x0",13"data": "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"14},15« dernier »16],17undefined,18'https://docs-demo.gravity-mainnet.quiknode.pro/'19)2021console.log(result)
1import { QuicknodeSdk } from '@quicknode/sdk'23const qn = new QuicknodeSdk({})45const result = await qn.rpc.call(6'eth_call',7[8{9"to": "0x779c127bd3b93efcefacf182e2ce4907765db997",10"gas": "0x7a120",11"gasPrice": "0x0",12"value": "0x0",13"data": "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"14},15« dernier »16],17undefined,18'https://docs-demo.gravity-mainnet.quiknode.pro/'19)2021console.log(result)
1import asyncio2from quicknode_sdk import QuicknodeSdk, SdkFullConfig34async def main():5qn = QuicknodeSdk(SdkFullConfig(api_key=None))6result = await qn.rpc.call(7"eth_call",8[9{10"to": "0x779c127bd3b93efcefacf182e2ce4907765db997",11"gas": "0x7a120",12"gasPrice": "0x0",13"value": "0x0",14"data": "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"15},16« dernier »17],18endpoint_url="https://docs-demo.gravity-mainnet.quiknode.pro/",19)20print(result)2122asyncio.run(main())
1import asyncio2from quicknode_sdk import QuicknodeSdk, SdkFullConfig34async def main():5qn = QuicknodeSdk(SdkFullConfig(api_key=None))6result = await qn.rpc.call(7"eth_call",8[9{10"to": "0x779c127bd3b93efcefacf182e2ce4907765db997",11"gas": "0x7a120",12"gasPrice": "0x0",13"value": "0x0",14"data": "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"15},16« dernier »17],18endpoint_url="https://docs-demo.gravity-mainnet.quiknode.pro/",19)20print(result)2122asyncio.run(main())
1require "quicknode_sdk"23qn = QuicknodeSdk::SDK.from_config(api_key: nil)45result = qn.rpc.call(6method: "eth_call",7params: [8{9"to" => "0x779c127bd3b93efcefacf182e2ce4907765db997",10"gas" => "0x7a120",11"gasPrice" => "0x0",12"value" => "0x0",13"data" => "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"14},15« dernier »16],17endpoint_url: "https://docs-demo.gravity-mainnet.quiknode.pro/"18)1920puts result
1require "quicknode_sdk"23qn = QuicknodeSdk::SDK.from_config(api_key: nil)45result = qn.rpc.call(6method: "eth_call",7params: [8{9"to" => "0x779c127bd3b93efcefacf182e2ce4907765db997",10"gas" => "0x7a120",11"gasPrice" => "0x0",12"value" => "0x0",13"data" => "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"14},15« dernier »16],17endpoint_url: "https://docs-demo.gravity-mainnet.quiknode.pro/"18)1920puts result
1use quicknode_sdk::{QuicknodeSdk, SdkFullConfig};23#[tokio::main]4async fn main() -> Result<(), Box<dyn std::error::Error>> {5let qn = QuicknodeSdk::new(&SdkFullConfig::keyless())?;6let result = qn7.rpc8.call(9"eth_call",10Some(serde_json::json!([11{12"to": "0x779c127bd3b93efcefacf182e2ce4907765db997",13"gas": "0x7a120",14"gasPrice": "0x0",15"value": "0x0",16"data": "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"17},18« dernier »19])),20None,21Some("https://docs-demo.gravity-mainnet.quiknode.pro/".into()),22)23.await?;2425println!("{result}");26D'accord(())27}
1use quicknode_sdk::{QuicknodeSdk, SdkFullConfig};23#[tokio::main]4async fn main() -> Result<(), Box<dyn std::error::Error>> {5let qn = QuicknodeSdk::new(&SdkFullConfig::keyless())?;6let result = qn7.rpc8.call(9"eth_call",10Some(serde_json::json!([11{12"to": "0x779c127bd3b93efcefacf182e2ce4907765db997",13"gas": "0x7a120",14"gasPrice": "0x0",15"value": "0x0",16"data": "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"17},18« dernier »19])),20None,21Some("https://docs-demo.gravity-mainnet.quiknode.pro/".into()),22)23.await?;2425println!("{result}");26D'accord(())27}
1const corps = {2jsonrpc: '2.0',3method: 'eth_call',4params: [{"to":"0x779c127bd3b93efcefacf182e2ce4907765db997","gas":"0x7a120","gasPrice":"0x0","value":"0x0","data":"0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"},"latest"],5id: 16}78async fonction main() {9const response = await fetch('https://docs-demo.gravity-mainnet.quiknode.pro/', {10méthode: « POST »,11headers: {'Content-Type': 'application/json'},12corps: JSON.convertir(body)13})14const données = await réponse.json()15console.journal(données)16}1718Accueil()
1const corps = {2jsonrpc: '2.0',3method: 'eth_call',4params: [{"to":"0x779c127bd3b93efcefacf182e2ce4907765db997","gas":"0x7a120","gasPrice":"0x0","value":"0x0","data":"0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"},"latest"],5id: 16}78async fonction main() {9const response = await fetch('https://docs-demo.gravity-mainnet.quiknode.pro/', {10méthode: « POST »,11headers: {'Content-Type': 'application/json'},12corps: JSON.convertir(body)13})14const données = await réponse.json()15console.journal(données)16}1718Accueil()
1import demandes2import json34url = "https://docs-demo.gravity-mainnet.quiknode.pro/"56charge utile = json.dumps({7« jsonrpc »: « 2.0 »,8"method": "eth_call",9« params »: [10{11"to": "0x779c127bd3b93efcefacf182e2ce4907765db997",12"gas": "0x7a120",13"gasPrice": "0x0",14"value": "0x0",15"data": "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"16},17« dernier »18],19« id »: 120})21en-têtes = {22« Content-Type »: 'application/json'23}2425réponse = demandes.demande(« POST », url, en-têtes=en-têtes, données=charge utile)2627imprimer(réponse.texte)
1import demandes2import json34url = "https://docs-demo.gravity-mainnet.quiknode.pro/"56charge utile = json.dumps({7« jsonrpc »: « 2.0 »,8"method": "eth_call",9« params »: [10{11"to": "0x779c127bd3b93efcefacf182e2ce4907765db997",12"gas": "0x7a120",13"gasPrice": "0x0",14"value": "0x0",15"data": "0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"16},17« dernier »18],19« id »: 120})21en-têtes = {22« Content-Type »: 'application/json'23}2425réponse = demandes.demande(« POST », url, en-têtes=en-têtes, données=charge utile)2627imprimer(réponse.texte)
1nécessite « uri »2require « json »3nécessite « net/http »45uri = URI("https://docs-demo.gravity-mainnet.quiknode.pro/")67charge utile = {8jsonrpc: « 2.0 »,9id: 1,10method: "eth_call",11params: [{"to":"0x779c127bd3b93efcefacf182e2ce4907765db997","gas":"0x7a120","gasPrice":"0x0","value":"0x0","data":"0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"},"latest"]12}1314demande = Net::HTTP::POST.nouveau(URI)15demande[« Content-Type »] = « application/json »16demande.corps = JSON.générer(payload)1718réponse = Net::HTTP.début(uri.hôte, uri.port, use_ssl: true) faire |http|19http.requête(demande)20fin2122affiche la réponse.corps
1nécessite « uri »2require « json »3nécessite « net/http »45uri = URI("https://docs-demo.gravity-mainnet.quiknode.pro/")67charge utile = {8jsonrpc: « 2.0 »,9id: 1,10method: "eth_call",11params: [{"to":"0x779c127bd3b93efcefacf182e2ce4907765db997","gas":"0x7a120","gasPrice":"0x0","value":"0x0","data":"0x70a0823100000000000000000000000043e4a1aa550a979582dc3449a6bd441f37f2f84c"},"latest"]12}1314demande = Net::HTTP::POST.nouveau(URI)15demande[« Content-Type »] = « application/json »16demande.corps = JSON.générer(payload)1718réponse = Net::HTTP.début(uri.hôte, uri.port, use_ssl: true) faire |http|19http.requête(demande)20fin2122affiche la réponse.corps
Réponse
1{2« jsonrpc »: « 2.0 »,3« id »: 1,4"result": "0x"5}
1{2« jsonrpc »: « 2.0 »,3« id »: 1,4"result": "0x"5}
Vous n'avez pas encore de compte ?
Créez votreendpoint Quicknode endpoint quelques secondes et commencez à développer
Commencez gratuitement