[SOLVED] Moralis Data Sync Not working

I created a Moralis Server and a Demo contract to test Moralis Api - we are investigating the possibility of using Moralis on our Company.

However it seems its not syncing data correctly.

While viewing the data in dashboards i can see the NFT transactions:

However when calling Moralis API for that wallet im getting 0 owned NFT’s for that account. That account is showing in Moralis dashboard as having NFT’s transferred to it.


Should not those NFT’s owned be showing in this request ?

Is something being missed ?

it is the same chain used in both cases?

Yup, im using Polygon Testnet (Mumbai). I can double check, ive checked the api param “chain” and the contract itself.

Also checked the sync configuration:

Also checked the contract itself

that sync configuration will not work with that topic that also contains that event at the beginning

what is that address that should have NFTs? like, can you paste it?

Sure, This is the account:

0x7Ac410F4E36873022b57821D7a8EB3D7513C045a

This is the contract:

0x31aC66CeE4b25b313829Fa67e380Ec64b7Cfdf9f

Really apreciate all the help.

Note, why is the sync won’t work on that topic ? Is it because the event keyword ? Ill remove it.

Btw the event hook seems to be working even with the event keyword there.

problem fixed now, for a new smart contract you need to sync first that smart contract in order to make it work

I used getTokenIdMetadata this time to force that sync:
https://docs.moralis.io/moralis-server/web3-sdk/token#gettokenidmetadata

I understood it was in sync because i could see those transactions on the dashboard.

Im still not getting the NFT’s when calling the web3api

https://deep-index.moralis.io/api/v2/nft/0x7Ac410F4E36873022b57821D7a8EB3D7513C045a?chain=mumbai&format=decimal

returns

{
  "total": 0,
  "page": 0,
  "page_size": 500,
  "cursor": "",
  "result": []
}

However NFT shows in the Dashboards.

I synced by calling the sync endpoint:

https://deep-index.moralis.io/api/v2/nft/0x31aC66CeE4b25b313829Fa67e380Ec64b7Cfdf9f/sync?chain=mumbai

for me it works:

https://deep-index.moralis.io/api/v2/0x7Ac410F4E36873022b57821D7a8EB3D7513C045a/nft?chain=mumbai&format=decimal

=>

{
  "total": 2,
  "page": 0,
  "page_size": 500,
  "cursor": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ3aGVyZSI6eyJvd25lcl9vZiI6IjB4N2FjNDEwZjRlMzY4NzMwMjJiNTc4MjFkN2E4ZWIzZDc1MTNjMDQ1YSJ9LCJsaW1pdCI6NTAwLCJvZmZzZXQiOjUwMCwib3JkZXIiOltbInRyYW5zZmVyX2luZGV4IiwiREVTQyJdXSwicGFnZSI6MSwia2V5IjoiMjU1MjI3NDQuMzcuMTkzLjAiLCJpYXQiOjE2NDczNDgyMDV9.lLjVGgVe2DqFvvU_-GOSZcVDfGdKFM_q8EZ162Aj-Kk",
  "result": [
    {
      "token_address": "0x31ac66cee4b25b313829fa67e380ec64b7cfdf9f",
      "token_id": "2",
      "block_number_minted": "25522818",
      "owner_of": "0x7ac410f4e36873022b57821d7a8eb3d7513c045a",
      "block_number": "25522818",
      "amount": "1",

That does work, should not the nft endpoint also works ?

Maybe it’s a problem with that specific endpoint or perhaps im using it wrong ?

Your query is different from the API website it seems

In the website we see

https://deep-index.moralis.io/api/v2/nft/<account>

But your query is

https://deep-index.moralis.io/api/v2/<account>/nft/

Maybe that’s what was causing the issue ?

Ok now i got it, account/nft is a wallet api where nft/account is a contract api :smiley:

A bit confusing, but i got it. Thanks for all the attention !