use crate::Provider;
use alloy_network::Network;
use alloy_rpc_types::RpcModules;
use alloy_transport::TransportResult;
#[cfg_attr(target_family = "wasm", async_trait::async_trait(?Send))]
#[cfg_attr(not(target_family = "wasm"), async_trait::async_trait)]
pub trait RpcApi<N>: Send + Sync {
async fn rpc_modules(&self) -> TransportResult<RpcModules>;
}
#[cfg_attr(target_family = "wasm", async_trait::async_trait(?Send))]
#[cfg_attr(not(target_family = "wasm"), async_trait::async_trait)]
impl<N, P> RpcApi<N> for P
where
N: Network,
P: Provider<N>,
{
async fn rpc_modules(&self) -> TransportResult<RpcModules> {
self.client().request_noparams("rpc_modules").await
}
}