diff --git a/subxt/src/rpc/mod.rs b/subxt/src/rpc/mod.rs index 3e0e8cf443..95e15d6d27 100644 --- a/subxt/src/rpc/mod.rs +++ b/subxt/src/rpc/mod.rs @@ -69,6 +69,7 @@ pub use rpc_client_t::{ RpcClientT, RpcFuture, RpcSubscription, + RpcSubscriptionId, }; pub use rpc_client::{ diff --git a/subxt/src/rpc/rpc_client_t.rs b/subxt/src/rpc/rpc_client_t.rs index d32924ffbe..c8e4f687f3 100644 --- a/subxt/src/rpc/rpc_client_t.rs +++ b/subxt/src/rpc/rpc_client_t.rs @@ -52,7 +52,7 @@ pub trait RpcClientT: Send + Sync + 'static { sub: &'a str, params: Option>, unsub: &'a str, - ) -> RpcFuture<'a, RpcSubscription>; + ) -> RpcFuture<'a, (RpcSubscription, Option)>; } /// A boxed future that is returned from the [`RpcClientT`] methods. @@ -62,3 +62,6 @@ pub type RpcFuture<'a, T> = /// The inner subscription stream returned from our [`RpcClientT`]'s `subscription` method. pub type RpcSubscription = Pin, RpcError>> + Send + 'static>>; + +/// The ID associated with the [`RpcClientT`]'s `subscription`. +pub type RpcSubscriptionId = String;