zks_estimateGasL1ToL2 RPC Method
Parameters
from
string
REQUIRED
Loading...
to
string
REQUIRED
Loading...
data
string
Loading...
Returns
result
string
Loading...
Request
1curl https://docs-demo.abstract-mainnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{"method":"zks_estimateGasL1ToL2","params":[{ "from": "0x1111111111111111111111111111111111111111", "to":"0x2222222222222222222222222222222222222222", "data": "0xffffffff" } ],"id":1,"jsonrpc":"2.0"}'
1curl https://docs-demo.abstract-mainnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{"method":"zks_estimateGasL1ToL2","params":[{ "from": "0x1111111111111111111111111111111111111111", "to":"0x2222222222222222222222222222222222222222", "data": "0xffffffff" } ],"id":1,"jsonrpc":"2.0"}'
1require 'eth'23client = Eth::Client.create 'https://docs-demo.abstract-mainnet.quiknode.pro/'4payload = {5"jsonrpc": "2.0",6"method": "zks_estimateGasL1ToL2",7"params": [{ "from": "0x1111111111111111111111111111111111111111", "to":"0x2222222222222222222222222222222222222222", "data": "0xffffffff" }],8"id": "1"9}1011response = client.send(payload.to_json)12puts response
1require 'eth'23client = Eth::Client.create 'https://docs-demo.abstract-mainnet.quiknode.pro/'4payload = {5"jsonrpc": "2.0",6"method": "zks_estimateGasL1ToL2",7"params": [{ "from": "0x1111111111111111111111111111111111111111", "to":"0x2222222222222222222222222222222222222222", "data": "0xffffffff" }],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.abstract-mainnet.quiknode.pro/");4const response = await provider.send("zks_estimateGasL1ToL2", [{ "from": "0x1111111111111111111111111111111111111111", "to":"0x2222222222222222222222222222222222222222", "data": "0xffffffff" }]);5console.log(response);6})();7
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider("https://docs-demo.abstract-mainnet.quiknode.pro/");4const response = await provider.send("zks_estimateGasL1ToL2", [{ "from": "0x1111111111111111111111111111111111111111", "to":"0x2222222222222222222222222222222222222222", "data": "0xffffffff" }]);5console.log(response);6})();7
1var myHeaders = new Headers();2myHeaders.append("Content-Type", "application/json");34var raw = JSON.stringify({5"method": "zks_estimateGasL1ToL2",6"params": [7{8"from": "0x1111111111111111111111111111111111111111",9"to": "0x2222222222222222222222222222222222222222",10"data": "0xffffffff"11}12],13"id": 1,14"jsonrpc": "2.0"15});1617var requestOptions = {18method: 'POST',19headers: myHeaders,20body: raw,21redirect: 'follow'22};2324fetch("https://docs-demo.abstract-mainnet.quiknode.pro/", requestOptions)25.then(response => response.text())26.then(result => console.log(result))27.catch(error => console.log('error', error));
1var myHeaders = new Headers();2myHeaders.append("Content-Type", "application/json");34var raw = JSON.stringify({5"method": "zks_estimateGasL1ToL2",6"params": [7{8"from": "0x1111111111111111111111111111111111111111",9"to": "0x2222222222222222222222222222222222222222",10"data": "0xffffffff"11}12],13"id": 1,14"jsonrpc": "2.0"15});1617var requestOptions = {18method: 'POST',19headers: myHeaders,20body: raw,21redirect: 'follow'22};2324fetch("https://docs-demo.abstract-mainnet.quiknode.pro/", requestOptions)25.then(response => response.text())26.then(result => console.log(result))27.catch(error => console.log('error', error));
1import requests2import json34url = "https://docs-demo.abstract-mainnet.quiknode.pro/"56payload = json.dumps({7"method": "zks_estimateGasL1ToL2",8"params": [9{10"from": "0x1111111111111111111111111111111111111111",11"to": "0x2222222222222222222222222222222222222222",12"data": "0xffffffff"13}14],15"id": 1,16"jsonrpc": "2.0"17})18headers = {19'Content-Type': 'application/json'20}2122response = requests.request("POST", url, headers=headers, data=payload)2324print(response.text)25
1import requests2import json34url = "https://docs-demo.abstract-mainnet.quiknode.pro/"56payload = json.dumps({7"method": "zks_estimateGasL1ToL2",8"params": [9{10"from": "0x1111111111111111111111111111111111111111",11"to": "0x2222222222222222222222222222222222222222",12"data": "0xffffffff"13}14],15"id": 1,16"jsonrpc": "2.0"17})18headers = {19'Content-Type': 'application/json'20}2122response = requests.request("POST", url, headers=headers, data=payload)2324print(response.text)25
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.abstract-mainnet.quiknode.pro/")67http = Net::HTTP.new(url.host, url.port);8request = Net::HTTP::Post.new(url)9request["Content-Type"] = "application/json"10request.body = JSON.dump({11"method": "zks_estimateGasL1ToL2",12"params": [13{14"from": "0x1111111111111111111111111111111111111111",15"to": "0x2222222222222222222222222222222222222222",16"data": "0xffffffff"17}18],19"id": 1,20"jsonrpc": "2.0"21})2223response = http.request(request)24puts response.read_body25
1require "uri"2require "json"3require "net/http"45url = URI("https://docs-demo.abstract-mainnet.quiknode.pro/")67http = Net::HTTP.new(url.host, url.port);8request = Net::HTTP::Post.new(url)9request["Content-Type"] = "application/json"10request.body = JSON.dump({11"method": "zks_estimateGasL1ToL2",12"params": [13{14"from": "0x1111111111111111111111111111111111111111",15"to": "0x2222222222222222222222222222222222222222",16"data": "0xffffffff"17}18],19"id": 1,20"jsonrpc": "2.0"21})2223response = http.request(request)24puts response.read_body25
1from web3 import HTTPProvider2client = HTTPProvider('https://docs-demo.abstract-mainnet.quiknode.pro/')3params = [{ "from": "0x1111111111111111111111111111111111111111", "to":"0x2222222222222222222222222222222222222222", "data": "0xffffffff" }]4response = client.make_request('zks_estimateGasL1ToL2', params)5print(response)6
1from web3 import HTTPProvider2client = HTTPProvider('https://docs-demo.abstract-mainnet.quiknode.pro/')3params = [{ "from": "0x1111111111111111111111111111111111111111", "to":"0x2222222222222222222222222222222222222222", "data": "0xffffffff" }]4response = client.make_request('zks_estimateGasL1ToL2', params)5print(response)6
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free