pub mod http;
pub mod provider;
pub use http::Http;
pub use provider::Provider;
use crate::Error;
use async_trait::async_trait;
use jsonrpsee::core::traits::ToRpcParams;
use serde::de::DeserializeOwned;
use std::fmt::Debug;
#[async_trait]
pub trait JsonRpcClient: Debug + Send + Sync {
async fn request<T, R>(&self, method: &str, params: T) -> Result<R, Error>
where
T: Debug + Send + Sync + ToRpcParams,
R: DeserializeOwned + Send;
}
pub enum RPCErrorCode {
RpcInvalidRequest = -32600,
RpcMethodNotFound = -32601,
RpcInvalidParams = -32602,
RpcInternalError = -32603,
RpcParseError = -32700,
RpcMiscError = -1, RpcTypeError = -3, RpcInvalidAddressOrKey = -5, RpcInvalidParameter = -8, RpcDatabaseError = -20, RpcDeserializationError = -22, RpcVerifyError = -25, RpcVerifyRejected = -26, RpcInWarmup = -28, RpcMethodDeprecated = -32, }