pub struct FeeHistory {
pub base_fee_per_gas: Vec<u128>,
pub gas_used_ratio: Vec<f64>,
pub base_fee_per_blob_gas: Vec<u128>,
pub blob_gas_used_ratio: Vec<f64>,
pub oldest_block: u64,
pub reward: Option<Vec<Vec<u128>>>,
}
eth
only.Expand description
Response type for eth_feeHistory
Fields§
§base_fee_per_gas: Vec<u128>
An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks.
§Note
Empty list is skipped only for compatibility with Erigon and Geth.
gas_used_ratio: Vec<f64>
An array of block gas used ratios. These are calculated as the ratio
of gasUsed
and gasLimit
.
base_fee_per_blob_gas: Vec<u128>
An array of block base fees per blob gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-4844 blocks.
blob_gas_used_ratio: Vec<f64>
An array of block blob gas used ratios. These are calculated as the ratio of gasUsed and gasLimit.
oldest_block: u64
Lowest number block of the returned range.
reward: Option<Vec<Vec<u128>>>
An (optional) array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty.
Implementations§
Source§impl FeeHistory
impl FeeHistory
Sourcepub fn latest_block_base_fee(&self) -> Option<u128>
pub fn latest_block_base_fee(&self) -> Option<u128>
Returns the base fee of the latest block in the eth_feeHistory
request.
Sourcepub fn next_block_base_fee(&self) -> Option<u128>
pub fn next_block_base_fee(&self) -> Option<u128>
Returns the base fee of the next block.
Sourcepub fn next_block_blob_base_fee(&self) -> Option<u128>
pub fn next_block_blob_base_fee(&self) -> Option<u128>
Returns the blob base fee of the next block.
If the next block is pre-EIP-4844, this will return None
.
Sourcepub fn latest_block_blob_base_fee(&self) -> Option<u128>
pub fn latest_block_blob_base_fee(&self) -> Option<u128>
Returns the blob fee of the latest block in the eth_feeHistory
request.
If the next block is pre-EIP-4844, this will return None
.
Trait Implementations§
Source§impl Clone for FeeHistory
impl Clone for FeeHistory
Source§fn clone(&self) -> FeeHistory
fn clone(&self) -> FeeHistory
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for FeeHistory
impl Debug for FeeHistory
Source§impl Default for FeeHistory
impl Default for FeeHistory
Source§fn default() -> FeeHistory
fn default() -> FeeHistory
Source§impl<'de> Deserialize<'de> for FeeHistory
impl<'de> Deserialize<'de> for FeeHistory
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FeeHistory, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FeeHistory, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for FeeHistory
impl PartialEq for FeeHistory
Source§impl Serialize for FeeHistory
impl Serialize for FeeHistory
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for FeeHistory
Auto Trait Implementations§
impl Freeze for FeeHistory
impl RefUnwindSafe for FeeHistory
impl Send for FeeHistory
impl Sync for FeeHistory
impl Unpin for FeeHistory
impl UnwindSafe for FeeHistory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more