signet_bundle/call/
alloy.rs1use crate::{SignetCallBundle, SignetCallBundleResponse};
3use alloy::{network::Network, providers::Provider, transports::TransportResult};
4use core::future::Future;
5
6pub trait SignetBundleApi<N: Network = alloy::network::Ethereum>: Send + Sync {
8 fn call_bundle(
16 &self,
17 bundle: SignetCallBundle,
18 ) -> impl Future<Output = TransportResult<SignetCallBundleResponse>> + Send;
19}
20
21impl<N, P> SignetBundleApi<N> for P
22where
23 N: Network,
24 P: Provider<N>,
25{
26 async fn call_bundle(
27 &self,
28 bundle: SignetCallBundle,
29 ) -> TransportResult<SignetCallBundleResponse> {
30 self.client().request("signet_callBundle", (bundle,)).await
31 }
32}
33
34#[cfg(test)]
35mod tests {
36 use super::*;
37 use alloy::network::Ethereum;
38 use alloy::providers::RootProvider;
39
40 #[allow(dead_code)]
41 const fn assert_impl<T: SignetBundleApi>() {}
42 const _: () = assert_impl::<RootProvider<Ethereum>>();
43}