[SOLVED] How to set up event listeners automatically for new contract instances?

Hey guys,

I am creating a dapp which needs to listen to events emitted from new instances of contracts created by a contract factory. The contracts will all of course have the same abi but will have different addresses (which I won’t know until they are created).

I would like to know how I can go about automatically registering the new contracts so that moralis listens for events. This issue has been raised before here: Dynamically Create Contract Event Sync

However the issue wasn’t completely resolved and the link recommended by Moralis staff no longer works.

Any help would be appreciated. Thanks!

you should be able to use streams API for this now (it is in beta now), moralis.io/streams

thanks! also, I wanted to thank you for the quick response here as well as of your discord team. I need to wait at least 24 hours for responses on other forums but you guys are instant.

3 Likes