eth_feeHistory RPC 方法
參數
blockCount
字串/整數
必填
載入中...
最新區塊
字串
必填
載入中...
獎勵百分位數
整數
必填
載入中...
退貨
結果
物件
載入中...
oldestBlock
字串
載入中...
baseFeePerGas
陣列
載入中...
gasUsedRatio
陣列
載入中...
獎勵
陣列
載入中...
baseFeePerBlobGas
陣列
載入中...
blobGasUsedRatio
陣列
載入中...
請求
1curl https://docs-demo.moca-testnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{"method":"eth_feeHistory","params":["0x5", "latest", [25, 75]],"id":1,"jsonrpc":"2.0"}'
1curl https://docs-demo.moca-testnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{"method":"eth_feeHistory","params":["0x5", "latest", [25, 75]],"id":1,"jsonrpc":"2.0"}'
1需要 'eth'23client = Eth::Client.create 'https://docs-demo.moca-testnet.quiknode.pro/'4有效載荷 = {5"jsonrpc": "2.0",6"method": "eth_feeHistory",7"params":["0x5", "latest", [25, 75]],8"id": "1"9}1011回應 = 客戶.傳送(有效載荷.to_json)12將回應
1需要 'eth'23client = Eth::Client.create 'https://docs-demo.moca-testnet.quiknode.pro/'4有效載荷 = {5"jsonrpc": "2.0",6"method": "eth_feeHistory",7"params":["0x5", "latest", [25, 75]],8"id": "1"9}1011回應 = 客戶.傳送(有效載荷.to_json)12將回應
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider(4"https://docs-demo.moca-testnet.quiknode.pro/"5);6const response = await provider.send("eth_feeHistory", [4, "latest", [25, 75]]);7console.log(response);8})();
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider(4"https://docs-demo.moca-testnet.quiknode.pro/"5);6const response = await provider.send("eth_feeHistory", [4, "latest", [25, 75]]);7console.log(response);8})();
1var myHeaders = new Headers();2myHeaders.追加("Content-Type", "application/json");34var raw = JSON.stringify({5「方法」: "eth_feeHistory",6"params":["0x5", "latest", [25, 75]7],8"id": 1,9"jsonrpc": "2.0"10});1112var requestOptions = {13方法: 'POST',14標題: myHeaders,15正文: 原始,16redirect: 'follow'17};1819fetch("https://docs-demo.moca-testnet.quiknode.pro/", requestOptions)20.then(response => response.text())21.then(result => console.log(result))22.catch(error => console.log('error', error));
1var myHeaders = new Headers();2myHeaders.追加("Content-Type", "application/json");34var raw = JSON.stringify({5「方法」: "eth_feeHistory",6"params":["0x5", "latest", [25, 75]7],8"id": 1,9"jsonrpc": "2.0"10});1112var requestOptions = {13方法: 'POST',14標題: myHeaders,15正文: 原始,16redirect: 'follow'17};1819fetch("https://docs-demo.moca-testnet.quiknode.pro/", requestOptions)20.then(response => response.text())21.then(result => console.log(result))22.catch(error => console.log('error', error));
1匯入 請求2import json34url = "https://docs-demo.moca-testnet.quiknode.pro/"56有效載荷 = json.dumps({7「方法」: "eth_feeHistory",8"params":["0x5", "latest", [25, 75]9],10"id": 1,11"jsonrpc": "2.0"12})13標題 = {14「Content-Type」: 'application/json'15}1617回應 = 請求.請求("POST", url, headers=headers, data=有效載荷)1819列印(回應.text)20
1匯入 請求2import json34url = "https://docs-demo.moca-testnet.quiknode.pro/"56有效載荷 = json.dumps({7「方法」: "eth_feeHistory",8"params":["0x5", "latest", [25, 75]9],10"id": 1,11"jsonrpc": "2.0"12})13標題 = {14「Content-Type」: 'application/json'15}1617回應 = 請求.請求("POST", url, headers=headers, data=有效載荷)1819列印(回應.text)20
1需要 "uri"2require "json"3需要 "net/http"45url = URI("https://docs-demo.moca-testnet.quiknode.pro/")67https = 網::HTTP.new(url.主機, url.port)8https.use_ssl = true910請求 = 淨::HTTP::POST.new(網址)11請求["Content-Type"] = "application/json"12請求。正文 = JSON.dump({13「方法」: "eth_feeHistory",14"params":["0x5", "latest", [25, 75]15],16"id": 1,17"jsonrpc": "2.0"18})1920回應 = https.請求(請求)21將回應。read_body22
1需要 "uri"2require "json"3需要 "net/http"45url = URI("https://docs-demo.moca-testnet.quiknode.pro/")67https = 網::HTTP.new(url.主機, url.port)8https.use_ssl = true910請求 = 淨::HTTP::POST.new(網址)11請求["Content-Type"] = "application/json"12請求。正文 = JSON.dump({13「方法」: "eth_feeHistory",14"params":["0x5", "latest", [25, 75]15],16"id": 1,17"jsonrpc": "2.0"18})1920回應 = https.請求(請求)21將回應。read_body22
1出自 web3 import Web3, HTTPProvider2provider = Web3.HTTPProvider("https://docs-demo.moca-testnet.quiknode.pro/")3result = provider.make_request('eth_feeHistory', [4, "latest", [25, 75]])4print(result)
1出自 web3 import Web3, HTTPProvider2provider = Web3.HTTPProvider("https://docs-demo.moca-testnet.quiknode.pro/")3result = provider.make_request('eth_feeHistory', [4, "latest", [25, 75]])4print(result)