Comments (9)
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.
i am stuck here as well - I hope moralis reaches out about this
from rarity-ranking-nft.
Apparently some collections cause this issue on Moralis like Invisible Friends, Cryptopunks V3, Pepe Universe and some others.
from rarity-ranking-nft.
let metadata = allNFTs.map((e) => {console.log(JSON.parse(e.metadata).attributes)});
where do you toss that in
from rarity-ranking-nft.
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.
what lines do you add that to/ replace
from rarity-ranking-nft.
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.
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.
where is this?
from rarity-ranking-nft.
Related Issues (13)
- Avalanche Ranker HOT 14
- Define a default collection shown when opening the page
- cannot read properties of undefined reading map:
- Load collection when page loads
- Offset not working HOT 6
- can we open this back up
- Rarity Generator issues HOT 5
- Getting TypeError: Cannot read property 'attributes' of null error HOT 1
- Null metadata
- Solana Integration
- Error: Cannot find module 'rxjs' HOT 1
- Polygon Issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rarity-ranking-nft.