Watch Pending Transactions #1553
Answered
by
jxom
real-lazy-coder
asked this question in
Question
-
Reading through the code it looks like the websocket client covers the newPendingTransactions subscription. I'm looking to implement the alchemy_pendingTransactions subscription. This is a subscription unique to alchemy. Before I go through the process of creating a PR to add the feature, is there another avenue I should look into to achieve this? Is there a way to subscribe to a custom message via a viem client? |
Beta Was this translation helpful? Give feedback.
Answered by
jxom
Dec 2, 2023
Replies: 1 comment 1 reply
-
You can use the raw subscribe method from the websocket transport... if you're using a websocket transport, you can do client.transport.subscribe({
params: ['alchemy_pendingTransactions'],
onData(data) {
console.log(data)
}
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
real-lazy-coder
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the raw subscribe method from the websocket transport... if you're using a websocket transport, you can do