fc_rpc_v2_types/
fee.rs

1// This file is part of Frontier.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
5
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// You should have received a copy of the GNU General Public License
17// along with this program. If not, see <https://www.gnu.org/licenses/>.
18
19use ethereum_types::U256;
20use serde::{Deserialize, Serialize};
21
22#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
23#[serde(rename_all = "camelCase")]
24pub struct FeeHistoryResult {
25	/// Lowest number block of the returned range.
26	pub oldest_block: U256,
27
28	/// An array of block base fees per gas.
29	///
30	/// This includes the next block after the newest of the returned range, because this value can
31	/// be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks.
32	#[serde(default, skip_serializing_if = "Vec::is_empty")]
33	pub base_fee_per_gas: Vec<U256>,
34
35	/// An array of block gas used ratios.
36	/// These are calculated as the ratio of `gasUsed` and `gasLimit`.
37	pub gas_used_ratio: Vec<f64>,
38
39	/// A two-dimensional array of effective priority fees per gas at the requested block percentiles.
40	///
41	/// A given percentile sample of effective priority fees per gas from a single block in
42	/// ascending order, weighted by gas used. Zeroes are returned if the block is empty.
43	#[serde(default, skip_serializing_if = "Vec::is_empty")]
44	pub reward: Vec<Vec<U256>>,
45}