Streams - watching an NFT contract for app's user addresses

I have app users saved to the database with their ETH address and I also have their NFTs from a specific contract address saved in the database as well.

I want to watch this NFT contract address for transfers and mints and if the change involves one of the user addresses, I want to update the data for the token Id involved in the transfer.

Would the most efficient way to do this be to just watch all transfers on this NFT contract --> check if to or from address are users --> if user, update the NFT data in database?

As opposed to watching an array of user addresses for changes from a specific NFT contract address?

The following example is to watch the entire blockchain or a specific contract address?

You could add filters to the event stream, to send the data only if it matches a specific users wallet address or NFT tokenId.

1 Like

So the filter can be an array of addresses (users)?

There is an or filter. You can use it to pass an array of conditions, so that when it send the data when any one condition is true.

You can find some examples in the shared link.