FeeHistory has no information about blob gas
#4436
Replies: 1 comment
|
yeah this is a real gap — confirmed by looking at the source. the interestingly, viem already has files that would need changes:
for reference, alloy on the Rust side already has both fields in their quick sketch of the type change: export type FeeHistory<quantity = bigint> = {
baseFeePerGas: quantity[]
gasUsedRatio: number[]
oldestBlock: quantity
reward?: quantity[][] | undefined
// EIP-4844 blob gas fields
baseFeePerBlobGas?: quantity[]
blobGasUsedRatio?: number[]
}made them optional since pre-Dencun nodes won't return them. would be worth opening a PR for this — pretty straightforward change. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
viem/src/types/fee.ts
Lines 3 to 15 in 0cb1b2e
https://docs.rs/alloy/latest/alloy/rpc/types/struct.FeeHistory.html
{ "method": "eth_feeHistory", "params": [ "0x2", "latest", [] ], "id": 0, "jsonrpc": "2.0" }{ "jsonrpc": "2.0", "id": 0, "result": { "baseFeePerGas": [ "0x18f0c80", "0x15d5c78", "0x131dc48" ], "gasUsedRatio": [ 0.0019393333333333333, 0.0019397333333333333 ], "baseFeePerBlobGas": [ "0x1", "0x1", "0x1" ], "blobGasUsedRatio": [ 0, 0 ], "oldestBlock": "0x1e", "reward": [] } }All reactions