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.
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]);