reth_storage_api/
withdrawals.rs

1use alloy_eips::{
2    eip4895::{Withdrawal, Withdrawals},
3    BlockHashOrNumber,
4};
5use reth_storage_errors::provider::ProviderResult;
6
7///  Client trait for fetching [Withdrawal] related data.
8#[auto_impl::auto_impl(&, Arc)]
9pub trait WithdrawalsProvider: Send + Sync {
10    /// Get withdrawals by block id.
11    fn withdrawals_by_block(
12        &self,
13        id: BlockHashOrNumber,
14        timestamp: u64,
15    ) -> ProviderResult<Option<Withdrawals>>;
16
17    /// Get latest withdrawal from this block or earlier .
18    fn latest_withdrawal(&self) -> ProviderResult<Option<Withdrawal>>;
19}