eth_estimateGas RPC Method
To use the eth_estimateGas method on the C-Chain, ensure that the end of your URL includes ext/bc/C/rpc.
매개변수
거래
객체
로딩 중...
출처:
문자열
로딩 중...
~에
문자열
필수
로딩 중...
가스
정수
로딩 중...
가스 가격
정수
로딩 중...
값
정수
로딩 중...
데이터
문자열
로딩 중...
블록 번호
문자열
로딩 중...
반품
quantity
문자열
로딩 중...
요청
1curl -X POST "https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/C/rpc/" \2-H "Content-Type: application/json" \3-d '{4"jsonrpc": "2.0",5"method": "eth_estimateGas",6"params": [7{8"from": "0x7Ac6d25FD5E437cB7c57Aee77aC2d0A6Cb85936C",9"to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",10"value": "0x186a0"11},12"최신"13],14"id": 115}'
1curl -X POST "https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/C/rpc/" \2-H "Content-Type: application/json" \3-d '{4"jsonrpc": "2.0",5"method": "eth_estimateGas",6"params": [7{8"from": "0x7Ac6d25FD5E437cB7c57Aee77aC2d0A6Cb85936C",9"to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",10"value": "0x186a0"11},12"최신"13],14"id": 115}'
1const 본문 = {2jsonrpc: '2.0',3method: 'eth_estimateGas',4params: [{"from":"0x7Ac6d25FD5E437cB7c57Aee77aC2d0A6Cb85936C","to":"0xd3CdA913deB6f67967B99D67aCDFa1712C293601","value":"0x186a0"},"latest"],5id: 16}78async 함수 main() {9const response = await fetch('https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/C/rpc/', {10메서드: 'POST',11headers: {'Content-Type': 'application/json'},12본문: JSON.stringify(body)13})14const data = await response.json()15콘솔.log(데이터)16}1718main()
1const 본문 = {2jsonrpc: '2.0',3method: 'eth_estimateGas',4params: [{"from":"0x7Ac6d25FD5E437cB7c57Aee77aC2d0A6Cb85936C","to":"0xd3CdA913deB6f67967B99D67aCDFa1712C293601","value":"0x186a0"},"latest"],5id: 16}78async 함수 main() {9const response = await fetch('https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/C/rpc/', {10메서드: 'POST',11headers: {'Content-Type': 'application/json'},12본문: JSON.stringify(body)13})14const data = await response.json()15콘솔.log(데이터)16}1718main()
1import 요청2import json34url = "https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/C/rpc/"56페이로드 = json.dumps({7"jsonrpc": "2.0",8"method": "eth_estimateGas",9"params": [10{11"from": "0x7Ac6d25FD5E437cB7c57Aee77aC2d0A6Cb85936C",12"to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",13"value": "0x186a0"14},15"최신"16],17"id": 118})19헤더 = {20'Content-Type': 'application/json'21}2223답변 = 요청.요청("POST", url, 헤더=헤더, data=페이로드)2425인쇄(응답.text)
1import 요청2import json34url = "https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/C/rpc/"56페이로드 = json.dumps({7"jsonrpc": "2.0",8"method": "eth_estimateGas",9"params": [10{11"from": "0x7Ac6d25FD5E437cB7c57Aee77aC2d0A6Cb85936C",12"to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",13"value": "0x186a0"14},15"최신"16],17"id": 118})19헤더 = {20'Content-Type': 'application/json'21}2223답변 = 요청.요청("POST", url, 헤더=헤더, data=페이로드)2425인쇄(응답.text)
1require "uri"2require "json"3require "net/http"45uri = URI("https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/C/rpc/")67페이로드 = {8jsonrpc: "2.0",9id: 1,10method: "eth_estimateGas",11params: [{"from":"0x7Ac6d25FD5E437cB7c57Aee77aC2d0A6Cb85936C","to":"0xd3CdA913deB6f67967B99D67aCDFa1712C293601","value":"0x186a0"},"latest"]12}1314요청 = 순::HTTP::POST.새(URI)15요청["Content-Type"] = "application/json"16요청.본문 = JSON.생성(페이로드)1718답변 = 순::HTTP.시작(uri.host, uri.port, use_ssl: true) do |http|19http.요청(요청)20끝2122응답을 넣습니다.본문
1require "uri"2require "json"3require "net/http"45uri = URI("https://docs-demo.flare-mainnet.quiknode.pro/ext/bc/C/rpc/")67페이로드 = {8jsonrpc: "2.0",9id: 1,10method: "eth_estimateGas",11params: [{"from":"0x7Ac6d25FD5E437cB7c57Aee77aC2d0A6Cb85936C","to":"0xd3CdA913deB6f67967B99D67aCDFa1712C293601","value":"0x186a0"},"latest"]12}1314요청 = 순::HTTP::POST.새(URI)15요청["Content-Type"] = "application/json"16요청.본문 = JSON.생성(페이로드)1718답변 = 순::HTTP.시작(uri.host, uri.port, use_ssl: true) do |http|19http.요청(요청)20끝2122응답을 넣습니다.본문
답변
1{2"jsonrpc": "2.0",3"id": 1,4"result": "0x5208"5}
1{2"jsonrpc": "2.0",3"id": 1,4"result": "0x5208"5}