use std::fmt::Debug;
use crate::neo_clients::ProviderError;
use async_trait::async_trait;
use auto_impl::auto_impl;
use serde::{de::DeserializeOwned, Serialize};
#[cfg_attr(target_arch = "wasm32", async_trait(? Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
#[auto_impl(&, Box, Arc)]
pub trait JsonRpcProvider: Debug + Send + Sync {
type Error: Into<ProviderError>;
async fn fetch<T, R>(&self, method: &str, params: T) -> Result<R, Self::Error>
where
T: Debug + Serialize + Send + Sync,
R: DeserializeOwned + Send;
}
pub use JsonRpcProvider as JsonRpcClient;