[SOLVED] How to add abi of entire contract for Moralis Streams programmatically?

Hey guys,
How can we add our entire contract to Moralis Streams programmatically? This example (https://docs.moralis.io/docs/monitor-ens-name-registrations) only shows how to add one event. But what if we want to add all the events in the contract?

Can we even do this or is it one stream per event?

Thanks!

You can add multiple topics from the same abi in the same stream

So I just use a comma and write more event names and params here:

const options = {  
  chains: [EvmChain.ETHEREUM], // Ethereum Name Service so we only monitor Ethereum  
  description: "ENS Name Registrations", // your description  
  tag: "ensRegistrationByBob", // give it a tag  
  abi: ensNameRegisteredAbi,  
  filter,  
  topic0: ["NameRegistered(string,bytes32,address,uint256,uint256)"],  

Here you can add a list of topics

1 Like