eth_estimateGas RPC Method
Parámetros
transacción
objeto
OBLIGATORIO
Cargando...
de
cadena
Cargando...
a
cadena
OBLIGATORIO
Cargando...
gas
entero
Cargando...
precio del gas
entero
Cargando...
valor
entero
Cargando...
datos
cadena
Cargando...
número de bloque
cadena
Cargando...
Devoluciones
quantity
Cargando...
Solicitud
1curl -X POST "https://docs-demo.imx-testnet.quiknode.pro/" \2-H "Content-Type: application/json" \3-d '{4"jsonrpc": "2.0",5"method": "eth_estimateGas",6"params": [7{8"from": "0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef",9"to": "0xD2374e67cf81135c220f3E806afdCd7Cab6515f2",10"value": "0x186a0"11},12«último»13],14"id": 115}'
1curl -X POST "https://docs-demo.imx-testnet.quiknode.pro/" \2-H "Content-Type: application/json" \3-d '{4"jsonrpc": "2.0",5"method": "eth_estimateGas",6"params": [7{8"from": "0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef",9"to": "0xD2374e67cf81135c220f3E806afdCd7Cab6515f2",10"value": "0x186a0"11},12«último»13],14"id": 115}'
1const cuerpo = {2jsonrpc: '2.0',3method: 'eth_estimateGas',4params: [{"from":"0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef","to":"0xD2374e67cf81135c220f3E806afdCd7Cab6515f2","value":"0x186a0"},"latest"],5id: 16}78asíncrono función main() {9const response = await fetch('https://docs-demo.imx-testnet.quiknode.pro/', {10método: 'POST',11headers: {'Content-Type': 'application/json'},12cuerpo: JSON.convertir(body)13})14const datos = await respuesta.json()15consola.registro(datos)16}1718principal()
1const cuerpo = {2jsonrpc: '2.0',3method: 'eth_estimateGas',4params: [{"from":"0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef","to":"0xD2374e67cf81135c220f3E806afdCd7Cab6515f2","value":"0x186a0"},"latest"],5id: 16}78asíncrono función main() {9const response = await fetch('https://docs-demo.imx-testnet.quiknode.pro/', {10método: 'POST',11headers: {'Content-Type': 'application/json'},12cuerpo: JSON.convertir(body)13})14const datos = await respuesta.json()15consola.registro(datos)16}1718principal()
1import solicitudes2import json34url = "https://docs-demo.imx-testnet.quiknode.pro/"56carga útil = json.dumps({7«jsonrpc»: "2.0",8"method": "eth_estimateGas",9«params»: [10{11"from": "0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef",12"to": "0xD2374e67cf81135c220f3E806afdCd7Cab6515f2",13"value": "0x186a0"14},15«último»16],17«id»: 118})19encabezados = {20«Content-Type»: 'application/json'21}2223respuesta = solicitudes.solicitud(«POST», url, encabezados=encabezados, datos=carga útil)2425imprimir(respuesta.texto)
1import solicitudes2import json34url = "https://docs-demo.imx-testnet.quiknode.pro/"56carga útil = json.dumps({7«jsonrpc»: "2.0",8"method": "eth_estimateGas",9«params»: [10{11"from": "0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef",12"to": "0xD2374e67cf81135c220f3E806afdCd7Cab6515f2",13"value": "0x186a0"14},15«último»16],17«id»: 118})19encabezados = {20«Content-Type»: 'application/json'21}2223respuesta = solicitudes.solicitud(«POST», url, encabezados=encabezados, datos=carga útil)2425imprimir(respuesta.texto)
1requiere «uri»2require "json"3require «net/http»45uri = URI(«https://docs-demo.imx-testnet.quiknode.pro/»)67carga útil = {8jsonrpc: "2.0",9id: 1,10method: "eth_estimateGas",11params: [{"from":"0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef","to":"0xD2374e67cf81135c220f3E806afdCd7Cab6515f2","value":"0x186a0"},"latest"]12}1314solicitud = Net::HTTP::POST.nuevo(uri)15solicitud[«Content-Type»] = "application/json"16solicitud.cuerpo = JSON.generar(carga)1718respuesta = Net::HTTP.inicio(uri.host, uri.puerto, use_ssl: true) do |http|19http.solicitud(solicitud)20fin2122inserta la respuesta.cuerpo
1requiere «uri»2require "json"3require «net/http»45uri = URI(«https://docs-demo.imx-testnet.quiknode.pro/»)67carga útil = {8jsonrpc: "2.0",9id: 1,10method: "eth_estimateGas",11params: [{"from":"0xd9275Eb8276E14b9e28d5f9B12e90dDAAF3586Ef","to":"0xD2374e67cf81135c220f3E806afdCd7Cab6515f2","value":"0x186a0"},"latest"]12}1314solicitud = Net::HTTP::POST.nuevo(uri)15solicitud[«Content-Type»] = "application/json"16solicitud.cuerpo = JSON.generar(carga)1718respuesta = Net::HTTP.inicio(uri.host, uri.puerto, use_ssl: true) do |http|19http.solicitud(solicitud)20fin2122inserta la respuesta.cuerpo
Respuesta
1{2«jsonrpc»: "2.0",3«id»: 1,4"result": "0x5208"5}
1{2«jsonrpc»: "2.0",3«id»: 1,4"result": "0x5208"5}
¿Aún no tienes una cuenta?
Crea tu punto de conexión de Quicknode en cuestión de segundos y empieza a desarrollar
Empieza gratis