1

I try to use ethers.js events, but they seem to be polling constantly and eventually the RPC provider sends HTTP code 429: Too Many Requests.

I understand that I can use non-standard APIs of providers, to set up webhooks. (Actually, I don't know of any providers that let me set up webhooks programmatically, except Moralis. Does anyone know any others? Please let me know in a comment, if you do.)

But is there some sort of "streaming websocket" standard that ethers.js could use with a provider, to receive events when they arrive?

Also as a related part of the question: if I give the client a token with which to issue transactions, can't the client use up my entire API quota with the RPC provider with unlimited transactions? And similarly with this websocket thing. So maybe I have to use webhooks if I want to protect my API credits?

1 Answer 1

0

https://docs.ethers.org/v6/api/providers/#WebSocketProvider

check websocket provider out, doesn't poll i beleive, haven't really used it to the point of being cork sure

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Aug 17, 2023 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.