Skip to content

Commit

Permalink
Add support for subscribing to newPendingTransactionsComplete
Browse files Browse the repository at this point in the history
  • Loading branch information
joleeee committed Apr 20, 2022
1 parent 3bc8aac commit 175762e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ethers-providers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,15 @@ pub trait Middleware: Sync + Send + Debug {
self.inner().subscribe_pending_txs().await.map_err(FromErr::from)
}

async fn subscribe_pending_txs_complete(
&self,
) -> Result<SubscriptionStream<'_, Self::Provider, Transaction>, Self::Error>
where
<Self as Middleware>::Provider: PubsubClient,
{
self.inner().subscribe_pending_txs_complete().await.map_err(FromErr::from)
}

async fn subscribe_logs<'a>(
&'a self,
filter: &Filter,
Expand Down
9 changes: 9 additions & 0 deletions ethers-providers/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,15 @@ impl<P: JsonRpcClient> Middleware for Provider<P> {
self.subscribe(["newPendingTransactions"]).await
}

async fn subscribe_pending_txs_complete(
&self,
) -> Result<SubscriptionStream<'_, P, Transaction>, ProviderError>
where
P: PubsubClient,
{
self.subscribe(["newPendingTransactionsComplete"]).await
}

async fn subscribe_logs<'a>(
&'a self,
filter: &Filter,
Expand Down

0 comments on commit 175762e

Please sign in to comment.