Giter Club home page Giter Club logo

Comments (9)

coffeeclubnfts avatar coffeeclubnfts commented on June 20, 2024

It works totally fine when testing with the BAYC collection + metadata, wondering if it's something to do with my tokens starting at 1 and not 0? Any way to fix this?

The contract address I'm trying to generate rarity for is:
https://etherscan.io/address/0x68bf5b45eb1851ed543c757c8dbef352be570cb7#code

from rarity-ranking-nft.

boshjerns avatar boshjerns commented on June 20, 2024

i am stuck here as well - I hope moralis reaches out about this

from rarity-ranking-nft.

JVmano avatar JVmano commented on June 20, 2024

Apparently some collections cause this issue on Moralis like Invisible Friends, Cryptopunks V3, Pepe Universe and some others.

from rarity-ranking-nft.

boshjerns avatar boshjerns commented on June 20, 2024

let metadata = allNFTs.map((e) => {console.log(JSON.parse(e.metadata).attributes)});

where do you toss that in

from rarity-ranking-nft.

raddad88 avatar raddad88 commented on June 20, 2024

sorry, use this instead

let collection = allNFTs.map(e => {
return {
metadata: JSON.parse(e.metadata),
token_id: e.token_id
};
});

let metadata = collection.map(e => e.metadata);
console.log(metadata.length);

for (let i = 0; i < metadata.length; i++) {
console.log(metadata[i]?.attributes, i);
}

from rarity-ranking-nft.

boshjerns avatar boshjerns commented on June 20, 2024

what lines do you add that to/ replace

from rarity-ranking-nft.

raddad88 avatar raddad88 commented on June 20, 2024

you would replace the line with

let metadata = allNFTs.map((e) => JSON.parse(e.metadata).attributes);

with

let collection = allNFTs.map(e => {
return {
metadata: JSON.parse(e.metadata),
token_id: e.token_id
};
});

let metadata = collection.map(e => e.metadata);
console.log(metadata.length);

for (let i = 0; i < metadata.length; i++) {
console.log(metadata[i]?.attributes, i);
}

from rarity-ranking-nft.

boshjerns avatar boshjerns commented on June 20, 2024

running into this now:

let nftTraits = metadata[i].map((e) => e.trait_type);
^

TypeError: metadata[i].map is not a function

appreciate your help a ton

from rarity-ranking-nft.

raddad88 avatar raddad88 commented on June 20, 2024

where is this?

from rarity-ranking-nft.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.