How to watch all NFTs of a specific contract in PolygonNFTOwners table?

Hello,
I would like to know if there is a possibility to see all the NFTs of a specific erc1155 contract in the PolygonNFTOwners table.

Indeed, I can see the NFTs of my contract for the users registered in the “User” table, but I can’t see the NFTs of the users outside my application.

I have already tried several things:

  • Set the contract address to “sync and watch address” in the “sync” tab of the server.
  • Call functions like “const nftOwners = await Moralis.Web3API.token.getNFTOwners(options);” which according to the documentation: “Requests for contract addresses not yet indexed will automatically start the indexing process for that NFT collection”

But this does not work.

I’m working on Polygon mumbai testnet.

Thank you.

You can sync events in another table, or query web3api to get all the owners, but I don’t know of a way to do what you want to do directly in that table.

Ok that’s too bad, does my question not make sense? Finally I would like to list the owners of NFTs on my contract.
But I will use the web3api for that if it is not possible to have a complete synchronization in database.
By web3api I won’t have access to the “NFTOwnersPending” table information I think?

Just again, according to the documentation: “Requests for contract addresses not yet indexed will automatically start the indexing process for that NFT collection”, what does that mean then?
https://docs.moralis.io/moralis-server/web3-sdk/token#getnftowners

that means that sometimes Moralis doesn’t index any new NFT smart contract, and it will start indexing it after that web3api call

with web3api for now you don’t have access to latest info that it would be in NFTOwnersPending

maybe you could still use for example an event specific to the NFT transfers for that particular smart contract in order to get latest information

Ok understood.
I’ll will use the transfers event (“TransferSingle” in openzeppelin erc1155 contrat) to calculate the ownerships.
I hope Moralis will soon include a way to synchronize in database all owners of a specific contract, this doesn’t seem to be a uncommon case in my opinion.

Thank again for your help.