ethers_core/types/
fee.rs

1use crate::types::{serde_helpers::deserialize_stringified_numeric, U256};
2use serde::{Deserialize, Serialize};
3
4#[derive(Deserialize, Serialize, Debug, Clone)]
5#[serde(rename_all = "camelCase")]
6pub struct FeeHistory {
7    #[serde(default, skip_serializing_if = "Vec::is_empty")]
8    pub base_fee_per_gas: Vec<U256>,
9    pub gas_used_ratio: Vec<f64>,
10    #[serde(deserialize_with = "deserialize_stringified_numeric")]
11    /// oldestBlock is returned as an unsigned integer up to geth v1.10.6. From
12    /// geth v1.10.7, this has been updated to return in the hex encoded form.
13    /// The custom deserializer allows backward compatibility for those clients
14    /// not running v1.10.7 yet.
15    pub oldest_block: U256,
16    /// An (optional) array of effective priority fee per gas data points from a single block. All
17    /// zeroes are returned if the block is empty.
18    #[serde(default, skip_serializing_if = "Vec::is_empty")]
19    pub reward: Vec<Vec<U256>>,
20}