zks_estimateFee RPC Method
Paramètres
transaction
objet
OBLIGATOIRE
Chargement en cours...
de
chaîne de caractères
OBLIGATOIRE
Chargement en cours...
à
chaîne de caractères
OBLIGATOIRE
Chargement en cours...
données
chaîne de caractères
Chargement en cours...
Retours
gas_limit
Chargement en cours...
gas_per_pubdata_limit
Chargement en cours...
max_fee_per_gas
Chargement en cours...
max_priority_fee_per_gas
Chargement en cours...
Demande
1curl -X POST "https://docs-demo.zksync-mainnet.quiknode.pro/" \2-H « Content-Type : application/json » \3-d '{4« jsonrpc » : « 2.0 »,5"method": "zks_estimateFee",6« params » : [7{8"from": "0x1111111111111111111111111111111111111111",9"to": "0x2222222222222222222222222222222222222222",10"data": "0xffffffff"11}12],13« id » : 114}'
1curl -X POST "https://docs-demo.zksync-mainnet.quiknode.pro/" \2-H « Content-Type : application/json » \3-d '{4« jsonrpc » : « 2.0 »,5"method": "zks_estimateFee",6« params » : [7{8"from": "0x1111111111111111111111111111111111111111",9"to": "0x2222222222222222222222222222222222222222",10"data": "0xffffffff"11}12],13« id » : 114}'
1import { ethers } from "ethers";23async fonction main() {4const provider = new ethers.JsonRpcProvider("https://docs-demo.zksync-mainnet.quiknode.pro/");5const response = await provider.send("zks_estimateFee", [6{7"from": "0x1111111111111111111111111111111111111111",8"to": "0x2222222222222222222222222222222222222222",9"data": "0xffffffff"10}11]);12console.journal(réponse);13}1415Accueil();
1import { ethers } from "ethers";23async fonction main() {4const provider = new ethers.JsonRpcProvider("https://docs-demo.zksync-mainnet.quiknode.pro/");5const response = await provider.send("zks_estimateFee", [6{7"from": "0x1111111111111111111111111111111111111111",8"to": "0x2222222222222222222222222222222222222222",9"data": "0xffffffff"10}11]);12console.journal(réponse);13}1415Accueil();
1require 'eth'23client = Eth::Client.create 'https://docs-demo.zksync-mainnet.quiknode.pro/'4charge utile = {5"jsonrpc": "2.0",6"method": "zks_estimateFee",7"params": [8{9"from": "0x1111111111111111111111111111111111111111",10"to": "0x2222222222222222222222222222222222222222",11"data": "0xffffffff"12}13],14"id": "1"15}1617response = client.send(payload.to_json)18puts response
1require 'eth'23client = Eth::Client.create 'https://docs-demo.zksync-mainnet.quiknode.pro/'4charge utile = {5"jsonrpc": "2.0",6"method": "zks_estimateFee",7"params": [8{9"from": "0x1111111111111111111111111111111111111111",10"to": "0x2222222222222222222222222222222222222222",11"data": "0xffffffff"12}13],14"id": "1"15}1617response = client.send(payload.to_json)18puts response
1Source : web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.zksync-mainnet.quiknode.pro/'))3response = w3.provider.make_request("zks_estimateFee", [{"from":"0x1111111111111111111111111111111111111111","to":"0x2222222222222222222222222222222222222222","data":"0xffffffff"}])4imprimer(réponse)
1Source : web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.zksync-mainnet.quiknode.pro/'))3response = w3.provider.make_request("zks_estimateFee", [{"from":"0x1111111111111111111111111111111111111111","to":"0x2222222222222222222222222222222222222222","data":"0xffffffff"}])4imprimer(réponse)
1import { createPublicClient, http } de 'viem'23async fonction main() {4const client = createPublicClient({5transport: http('https://docs-demo.zksync-mainnet.quiknode.pro/')6})78const résultat = await client.requête({9method: 'zks_estimateFee',10paramètres: [11{12"from": "0x1111111111111111111111111111111111111111",13"to": "0x2222222222222222222222222222222222222222",14"data": "0xffffffff"15}16]17})1819console.journal(résultat)20}2122Accueil()
1import { createPublicClient, http } de 'viem'23async fonction main() {4const client = createPublicClient({5transport: http('https://docs-demo.zksync-mainnet.quiknode.pro/')6})78const résultat = await client.requête({9method: 'zks_estimateFee',10paramètres: [11{12"from": "0x1111111111111111111111111111111111111111",13"to": "0x2222222222222222222222222222222222222222",14"data": "0xffffffff"15}16]17})1819console.journal(résultat)20}2122Accueil()
1import { QuicknodeSdk } depuis '@quicknode/sdk'23const qn = new QuicknodeSdk({})45const résultat = await qn.rpc.appel(6'zks_estimateFee',7[8{9"from": "0x1111111111111111111111111111111111111111",10"to": "0x2222222222222222222222222222222222222222",11"data": "0xffffffff"12}13],14non défini,15'https://docs-demo.zksync-mainnet.quiknode.pro/'16)1718console.journal(résultat)
1import { QuicknodeSdk } depuis '@quicknode/sdk'23const qn = new QuicknodeSdk({})45const résultat = await qn.rpc.appel(6'zks_estimateFee',7[8{9"from": "0x1111111111111111111111111111111111111111",10"to": "0x2222222222222222222222222222222222222222",11"data": "0xffffffff"12}13],14non défini,15'https://docs-demo.zksync-mainnet.quiknode.pro/'16)1718console.journal(résultat)
1import asyncio2Source :quicknode_sdk import QuicknodeSdk, SdkFullConfig34async def main():5qn = QuicknodeSdk(SdkFullConfig(api_key=None))6résultat = await qn.rpc.appel(7"zks_estimateFee",8[9{10"from": "0x1111111111111111111111111111111111111111",11"to": "0x2222222222222222222222222222222222222222",12"data": "0xffffffff"13}14],15endpoint_url="https://docs-demo.zksync-mainnet.quiknode.pro/",16)17imprimer(résultat)1819asyncio.run(main()))
1import asyncio2Source :quicknode_sdk import QuicknodeSdk, SdkFullConfig34async def main():5qn = QuicknodeSdk(SdkFullConfig(api_key=None))6résultat = await qn.rpc.appel(7"zks_estimateFee",8[9{10"from": "0x1111111111111111111111111111111111111111",11"to": "0x2222222222222222222222222222222222222222",12"data": "0xffffffff"13}14],15endpoint_url="https://docs-demo.zksync-mainnet.quiknode.pro/",16)17imprimer(résultat)1819asyncio.run(main()))
1require "quicknode_sdk"23qn = QuicknodeSdk::SDK.from_config(api_key: nil)45résultat = qn.rpc.appel(6method: "zks_estimateFee",7paramètres: [8{9"from" => "0x1111111111111111111111111111111111111111",10"to" => "0x2222222222222222222222222222222222222222",11"data" => "0xffffffff"12}13],14endpoint_url: "https://docs-demo.zksync-mainnet.quiknode.pro/"15)1617affiche le résultat
1require "quicknode_sdk"23qn = QuicknodeSdk::SDK.from_config(api_key: nil)45résultat = qn.rpc.appel(6method: "zks_estimateFee",7paramètres: [8{9"from" => "0x1111111111111111111111111111111111111111",10"to" => "0x2222222222222222222222222222222222222222",11"data" => "0xffffffff"12}13],14endpoint_url: "https://docs-demo.zksync-mainnet.quiknode.pro/"15)1617affiche le résultat
1use quicknode_sdk::{QuicknodeSdk, SdkFullConfig};23#[tokio::main]4async fn main() -> Result<(), Box<dyn std::error::Error>> {5soit qn = QuicknodeSdk::new(&SdkFullConfig::sans clé())?;6soit résultat = qn7.rpc8.appel(9"zks_estimateFee",10Certains(serde_json::json!([11{12"from": "0x1111111111111111111111111111111111111111",13"to": "0x2222222222222222222222222222222222222222",14"data": "0xffffffff"15}16])),17Aucun,18Some("https://docs-demo.zksync-mainnet.quiknode.pro/".into()),19)20.await?;2122println!("{result}");23D'accord(())24}
1use quicknode_sdk::{QuicknodeSdk, SdkFullConfig};23#[tokio::main]4async fn main() -> Result<(), Box<dyn std::error::Error>> {5soit qn = QuicknodeSdk::new(&SdkFullConfig::sans clé())?;6soit résultat = qn7.rpc8.appel(9"zks_estimateFee",10Certains(serde_json::json!([11{12"from": "0x1111111111111111111111111111111111111111",13"to": "0x2222222222222222222222222222222222222222",14"data": "0xffffffff"15}16])),17Aucun,18Some("https://docs-demo.zksync-mainnet.quiknode.pro/".into()),19)20.await?;2122println!("{result}");23D'accord(())24}
1const corps = {2jsonrpc: '2.0',3method: 'zks_estimateFee',4params: [{"from":"0x1111111111111111111111111111111111111111","to":"0x2222222222222222222222222222222222222222","data":"0xffffffff"}],5id: 16}78async fonction main() {9const response = await fetch('https://docs-demo.zksync-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: 'zks_estimateFee',4params: [{"from":"0x1111111111111111111111111111111111111111","to":"0x2222222222222222222222222222222222222222","data":"0xffffffff"}],5id: 16}78async fonction main() {9const response = await fetch('https://docs-demo.zksync-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.zksync-mainnet.quiknode.pro/"56charge utile = json.dumps({7« jsonrpc »: « 2.0 »,8"method": "zks_estimateFee",9« params »: [10{11"from": "0x1111111111111111111111111111111111111111",12"to": "0x2222222222222222222222222222222222222222",13"data": "0xffffffff"14}15],16« id »: 117})18en-têtes = {19« Content-Type »: 'application/json'20}2122réponse = demandes.demande(« POST », url, en-têtes=en-têtes, données=charge utile)2324imprimer(réponse.texte)
1import demandes2import json34url = "https://docs-demo.zksync-mainnet.quiknode.pro/"56charge utile = json.dumps({7« jsonrpc »: « 2.0 »,8"method": "zks_estimateFee",9« params »: [10{11"from": "0x1111111111111111111111111111111111111111",12"to": "0x2222222222222222222222222222222222222222",13"data": "0xffffffff"14}15],16« id »: 117})18en-têtes = {19« Content-Type »: 'application/json'20}2122réponse = demandes.demande(« POST », url, en-têtes=en-têtes, données=charge utile)2324imprimer(réponse.texte)
1nécessite « uri »2require « json »3nécessite « net/http »45uri = URI("https://docs-demo.zksync-mainnet.quiknode.pro/")67charge utile = {8jsonrpc: « 2.0 »,9id: 1,10method: "zks_estimateFee",11params: [{"from":"0x1111111111111111111111111111111111111111","to":"0x2222222222222222222222222222222222222222","data":"0xffffffff"}]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.zksync-mainnet.quiknode.pro/")67charge utile = {8jsonrpc: « 2.0 »,9id: 1,10method: "zks_estimateFee",11params: [{"from":"0x1111111111111111111111111111111111111111","to":"0x2222222222222222222222222222222222222222","data":"0xffffffff"}]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": {5"gas_limit": "0x20941",6"max_fee_per_gas": "0x2b275d0",7"max_priority_fee_per_gas": "0x0",8"gas_per_pubdata_limit": "0x10"9}10}
1{2« jsonrpc »: « 2.0 »,3« id »: 1,4"result": {5"gas_limit": "0x20941",6"max_fee_per_gas": "0x2b275d0",7"max_priority_fee_per_gas": "0x0",8"gas_per_pubdata_limit": "0x10"9}10}
Vous n'avez pas encore de compte ?
Créez votreendpoint Quicknode endpoint quelques secondes et commencez à développer
Commencez gratuitement