1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
mod http;
pub use http::Provider as Http;
mod provider;
mod ens;
mod pending_transaction;
pub use pending_transaction::PendingTransaction;
mod stream;
pub use stream::FilterStream;
pub use futures_util::StreamExt;
use async_trait::async_trait;
use serde::{Deserialize, Serialize};
use std::{error::Error, fmt::Debug};
pub use provider::{Provider, ProviderError};
#[async_trait]
pub trait JsonRpcClient: Debug + Clone + Send + Sync {
type Error: Error + Into<ProviderError>;
async fn request<T, R>(&self, method: &str, params: T) -> Result<R, Self::Error>
where
T: Debug + Serialize + Send + Sync,
R: for<'a> Deserialize<'a>;
}