HashLips / generative-art-opensource

Create generative art by using the canvas api and node js, feel free to contribute to this repo with new ideas.
MIT License
1.36k stars 695 forks source link

Has anyone added ‘rarity’ to their nft metadata? #64

Closed tradermoore closed 2 years ago

tradermoore commented 2 years ago

Alternately open if there is a way to identify the edition rarity through another means. Either way would be useful in a post-generation workflow to price/organize NFTs by rarity.

Ponda1 commented 2 years ago

Im pretty sure you should be able to do that by adding something like

Edition rarity: rarityWeight,

to the let attribute part of the const getAttributeForElement in the index file. I could be wrong though

tradermoore commented 2 years ago

Thanks @Ponda1 really appreciate it. I successfully used your trait_type fix in #19 (thank you, great stuff!) and tried to add in the rarityweight without luck.

I'm looking for this rarity attribute just after the DNA metadata to represent the rarity of the entire element (where adding to the attribute would be rarity of the layer, I think). I believe this was part of an earlier code, so I need to dig in when I get the time later to see if I can find the prior code and reproduce.

Ponda1 commented 2 years ago

Sorry I have no idea then

tradermoore commented 2 years ago

I've confirmed that in the main branch, NFTs will be generated in reverse order of their rarity weight. This answers my original question, so closing. Hope this can help others.

CC: @Ponda1