NFT attributes not loaded correctly [solved]

Hi guys,

we are trying to load this contract:
https://opensea.io/assets/0xafba8c6b3875868a90e5055e791213258a9fe7a7/4169

From this call ( https://deep-index.moralis.io/api/v2/nft/0xafba8c6b3875868a90e5055e791213258a9fe7a7/4169?chain=eth&format=decimal ) we are not able to get the proper data.

OPENSEA
#1 SPECIES: ROBITS
#2 RARITY: Rare
#3 FACTION: Voxo-Corpo
#4 ARCHETYPE: Waiter
Even the boosts are wrong…on opensea they are set to 23,90% etc but on moralis it is always 50.

MORALIS
“attributes”:[
{
“trait_type”:"#4 Archetype",
“value”:“Unkown”
},
{
“trait_type”:"#3 Faction",
“value”:“Unkown”
},
{
“trait_type”:"#2 Rarity",
“value”:“Unkown”
},
{
“trait_type”:"#1 Species",
“value”:“Unkown”
},
{
“display_type”:“boost_percentage”,
“trait_type”:“Intelligence”,
“value”:50
},
{
“display_type”:“boost_percentage”,
“trait_type”:“Strength”,
“value”:50
},
{
“display_type”:“boost_percentage”,
“trait_type”:“Heart”,
“value”:50
},
{
“display_type”:“boost_percentage”,
“trait_type”:“Cool”,
“value”:50
}

Any idea why this happens?

Thanks

Hey @thealexsachs

Currently our nodes are overloaded. When we fix it, I’ll let you know. :man_mechanic:

Best regards
Dmitry

1 Like

Hello,

I am testing the CORS cloud function that was posted in your youtube video " How To Solve CORS errors using Moralis Cloud Functions"

I am running into the following error when running the code using react:

App.js:107 Uncaught (in promise) TypeError: Cannot read property 'run' of undefined

Moralis Server: 0.0.250

“react”: “^17.0.2”
“moralis”: “^0.0.35”
“react-moralis”: “^0.2.0”

cloud function code


Moralis.Cloud.define("fetchJSON", async (request) => {
  return Moralis.Cloud.httpRequest({
    method: "GET",
    url: request.params.theUrl,
  })
});

react code:

const params = {theUrl: url};
const metadata = Moralis.cloud.run("fetchJSON", params);
console.log(metadata);

Hey @amer

In React you need to use useMoralisCloudFunction() hook:

const { data, error, isLoading } = useMoralisCloudFunction("fetchJSON");
1 Like

Thank you @Yomoo for pointing me in the right direction - it works now.

I read the docs and looked at the full react example in github https://github.com/MoralisWeb3/react-moralis/blob/main/examples/src/modules/CloudFunction.tsx

1 Like