cfx_rpc_eth_api/
filter.rs1use cfx_rpc_eth_types::{EthRpcLogFilter as Filter, FilterChanges, Log};
2use cfx_types::H128 as FilterId;
3use jsonrpsee::{core::RpcResult, proc_macros::rpc};
4
5type PendingTransactionFilterKind = (); #[rpc(server, namespace = "eth")]
9pub trait EthFilterApi {
10 #[method(name = "newFilter")]
12 async fn new_filter(&self, filter: Filter) -> RpcResult<FilterId>;
13
14 #[method(name = "newBlockFilter")]
16 async fn new_block_filter(&self) -> RpcResult<FilterId>;
17
18 #[method(name = "newPendingTransactionFilter")]
20 async fn new_pending_transaction_filter(
21 &self, kind: Option<PendingTransactionFilterKind>,
22 ) -> RpcResult<FilterId>;
23
24 #[method(name = "getFilterChanges")]
26 async fn filter_changes(&self, id: FilterId) -> RpcResult<FilterChanges>;
27
28 #[method(name = "getFilterLogs")]
30 async fn filter_logs(&self, id: FilterId) -> RpcResult<Vec<Log>>;
31
32 #[method(name = "uninstallFilter")]
34 async fn uninstall_filter(&self, id: FilterId) -> RpcResult<bool>;
35}