eth_estimateGas RPC Method
Parâmetros
transação
objeto
OBRIGATÓRIO
Carregando...
de
cadeia de caracteres
Carregando...
para
cadeia de caracteres
OBRIGATÓRIO
Carregando...
gas
número inteiro
Carregando...
gasPrice
número inteiro
Carregando...
valor
número inteiro
Carregando...
dados
cadeia de caracteres
Carregando...
número do bloco
cadeia de caracteres
Carregando...
Devoluções
resultado
Carregando...
Pedido
1curl https://docs-demo.flow-mainnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{"method":"eth_estimateGas","params":[{"from":"0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef","to":"0xD2374e67cf81135c220f3E806afdCd7Cab6515f2"}],"id":1,"jsonrpc":"2.0"}'
1curl https://docs-demo.flow-mainnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{"method":"eth_estimateGas","params":[{"from":"0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef","to":"0xD2374e67cf81135c220f3E806afdCd7Cab6515f2"}],"id":1,"jsonrpc":"2.0"}'
1require 'eth'23client = Eth::Client.create 'https://docs-demo.flow-mainnet.quiknode.pro/'4carga útil = {5"jsonrpc": "2.0",6"method": "eth_estimateGas",7"params": [{"from":"0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef","to":"0xD2374e67cf81135c220f3E806afdCd7Cab6515f2"}],8"id": "1"9}1011response = client.send(payload.to_json)12puts response
1require 'eth'23client = Eth::Client.create 'https://docs-demo.flow-mainnet.quiknode.pro/'4carga útil = {5"jsonrpc": "2.0",6"method": "eth_estimateGas",7"params": [{"from":"0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef","to":"0xD2374e67cf81135c220f3E806afdCd7Cab6515f2"}],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.flow-mainnet.quiknode.pro/");4const response = await provider.estimateGas({5"from": "0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef",6"to": "0xD2374e67cf81135c220f3E806afdCd7Cab6515f2",7});8console.log(response);9})();
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider("https://docs-demo.flow-mainnet.quiknode.pro/");4const response = await provider.estimateGas({5"from": "0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef",6"to": "0xD2374e67cf81135c220f3E806afdCd7Cab6515f2",7});8console.log(response);9})();
1var myHeaders = new Headers();2myHeaders.acrescentar("Content-Type", "application/json");34var raw = JSON.stringify({5"method": "eth_estimateGas",6«params»: [7{8"from": "0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef",9"to": "0xD2374e67cf81135c220f3E806afdCd7Cab6515f2"10}11],12"id": 1,13"jsonrpc": "2.0"14});1516var requestOptions = {17método: 'POST',18cabeçalhos: myHeaders,19body: raw,20redirect: 'follow'21};2223fetch("https://docs-demo.flow-mainnet.quiknode.pro/", requestOptions)24.then(response => response.text())25.then(result => console.log(result))26.catch(error => console.log('error', error));
1var myHeaders = new Headers();2myHeaders.acrescentar("Content-Type", "application/json");34var raw = JSON.stringify({5"method": "eth_estimateGas",6«params»: [7{8"from": "0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef",9"to": "0xD2374e67cf81135c220f3E806afdCd7Cab6515f2"10}11],12"id": 1,13"jsonrpc": "2.0"14});1516var requestOptions = {17método: 'POST',18cabeçalhos: myHeaders,19body: raw,20redirect: 'follow'21};2223fetch("https://docs-demo.flow-mainnet.quiknode.pro/", requestOptions)24.then(response => response.text())25.then(result => console.log(result))26.catch(error => console.log('error', error));
1importar pedidos2import json34url = "https://docs-demo.flow-mainnet.quiknode.pro/"56carga útil = json.dumps({7"method": "eth_estimateGas",8«params»: [9{10"from": "0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef",11"to": "0xD2374e67cf81135c220f3E806afdCd7Cab6515f2"12}13],14"id": 1,15"jsonrpc": "2.0"16})17cabeçalhos = {18'Content-Type': 'application/json'19}2021resposta = pedidos.pedido("POST", url, headers=headers, dados=carga útil)2223imprimir(resposta.texto)24
1importar pedidos2import json34url = "https://docs-demo.flow-mainnet.quiknode.pro/"56carga útil = json.dumps({7"method": "eth_estimateGas",8«params»: [9{10"from": "0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef",11"to": "0xD2374e67cf81135c220f3E806afdCd7Cab6515f2"12}13],14"id": 1,15"jsonrpc": "2.0"16})17cabeçalhos = {18'Content-Type': 'application/json'19}2021resposta = pedidos.pedido("POST", url, headers=headers, dados=carga útil)2223imprimir(resposta.texto)24
1exigir "uri"2require "json"3necessita de "net/http"45url = URI("https://docs-demo.flow-mainnet.quiknode.pro/")67https = Net::HTTP.novo(url.host, url.porta)8https.use_ssl = true910pedido = Líquido::HTTP::POST.novo(url)11pedido["Content-Type"] = "application/json"12request.body = JSON.dump({13"method": "eth_estimateGas",14«params»: [15{16"from": "0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef",17"to": "0xD2374e67cf81135c220f3E806afdCd7Cab6515f2"18}19],20"id": 1,21"jsonrpc": "2.0"22})2324resposta = https.pedido(pedido)25insere a resposta.read_body26
1exigir "uri"2require "json"3necessita de "net/http"45url = URI("https://docs-demo.flow-mainnet.quiknode.pro/")67https = Net::HTTP.novo(url.host, url.porta)8https.use_ssl = true910pedido = Líquido::HTTP::POST.novo(url)11pedido["Content-Type"] = "application/json"12request.body = JSON.dump({13"method": "eth_estimateGas",14«params»: [15{16"from": "0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef",17"to": "0xD2374e67cf81135c220f3E806afdCd7Cab6515f2"18}19],20"id": 1,21"jsonrpc": "2.0"22})2324resposta = https.pedido(pedido)25insere a resposta.read_body26
1de web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.flow-mainnet.quiknode.pro/'))3estimate = w3.eth.estimate_gas({"from":"0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef","to":"0xD2374e67cf81135c220f3E806afdCd7Cab6515f2"})4print(estimate)
1de web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.flow-mainnet.quiknode.pro/'))3estimate = w3.eth.estimate_gas({"from":"0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef","to":"0xD2374e67cf81135c220f3E806afdCd7Cab6515f2"})4print(estimate)
Ainda não tem uma conta?
Crieendpoint seuendpoint Quicknode endpoint segundos e comece a desenvolver
Comece gratuitamente