reth_rpc_eth_api/
filter.rsuse alloy_json_rpc::RpcObject;
use alloy_rpc_types_eth::{Filter, FilterChanges, FilterId, Log, PendingTransactionFilterKind};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "eth"))]
#[cfg_attr(feature = "client", rpc(server, client, namespace = "eth"))]
pub trait EthFilterApi<T: RpcObject> {
#[method(name = "newFilter")]
async fn new_filter(&self, filter: Filter) -> RpcResult<FilterId>;
#[method(name = "newBlockFilter")]
async fn new_block_filter(&self) -> RpcResult<FilterId>;
#[method(name = "newPendingTransactionFilter")]
async fn new_pending_transaction_filter(
&self,
kind: Option<PendingTransactionFilterKind>,
) -> RpcResult<FilterId>;
#[method(name = "getFilterChanges")]
async fn filter_changes(&self, id: FilterId) -> RpcResult<FilterChanges<T>>;
#[method(name = "getFilterLogs")]
async fn filter_logs(&self, id: FilterId) -> RpcResult<Vec<Log>>;
#[method(name = "uninstallFilter")]
async fn uninstall_filter(&self, id: FilterId) -> RpcResult<bool>;
#[method(name = "getLogs")]
async fn logs(&self, filter: Filter) -> RpcResult<Vec<Log>>;
}