Looks, there is one problem with getNFTBalances?

Moralis Version : 1.5.9

Language : typescript

Platform : Next

Package.json :

{
  "name": "moralis-dashboard6",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@chakra-ui/react": "^1.8.8",
    "@emotion/react": "^11",
    "@emotion/styled": "^11",
    "@solana/web3.js": "^1.41.0",
    "@walletconnect/web3-provider": "^1.7.7",
    "@web3auth/web3auth": "^0.9.0",
    "framer-motion": "^6",
    "magic-sdk": "7.0.0",
    "moralis": "^1.5.9",
    "next": "latest",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-icons": "^4.3.1",
    "react-moralis": "^1.3.5",
    "suncalc": "^1.9.0"
  },
  "devDependencies": {
    "@types/node": "17.0.25",
    "@types/react": "18.0.5",
    "@types/react-dom": "18.0.1",
    "@types/suncalc": "^1.8.1",
    "eslint": "8.13.0",
    "eslint-config-next": "12.1.5",
    "typescript": "4.6.3"
  }
}

There is one more “ipfs” in the result, remove one, can see the pic.

image

  const fetchData = useCallback(async () => {
    if (isInitialized && chain) {
      let nfts = await getNFTBalances({
        params: {
          chain: chainId,
          address: account === null ? "" : account,
        },
      });
      if (data && data.result && data.result.length > 0) {
        setNFTs(data?.result);
        data.result.forEach((n) => {
          console.log("fetchData run, cur nft ********************=> ", n);
        });
      }
    }
    return () => {
      setNFTs(data?.result);
    };
  }, [account, chain, chainId, data, getNFTBalances, isInitialized]);

ok, it looks like a problem, can you share to contract, token_id, chain that returns that wrong url?

is that data present in the metadata that way or it is the correct data in metadata json?

1 Like

Is it correct?

external_url: "https://rarible.com/token/0x60f80121c31a0d46b5279700f9df786054aa5ee5:1206320"
image: "ipfs://ipfs/QmUMmr62ry9CeCqeQSR5dNvEZd5iAofutspQm5KQNdLcAb/image.jpeg"

If I enable the chrome plugin of IPFS Companion, above image value works fine.

Pic will show, in chrome.

it looks like that image url should be different in that metadata:

"image":"ipfs://ipfs/QmUMmr62ry9CeCqeQSR5dNvEZd5iAofutspQm5KQNdLcAb/image.jpeg"

it should be

"image":"ipfs://QmUMmr62ry9CeCqeQSR5dNvEZd5iAofutspQm5KQNdLcAb/image.jpeg"