Git Product home page Git Product logo

thepeanutgalleryandco / create-and-mint-nft-collection Goto Github PK

View Code? Open in Web Editor NEW
116.0 116.0 44.0 1.36 MB

This code repo has been created to help NFT enthusiasts to create their generative art via the Hashlips generative art codebase and then to utilize the NFTPort API service to upload their NFT files and finally mint them.

License: Other

JavaScript 100.00%
generative-art hashlips-art-engine nft nftcollection nftport nfts nodejs

create-and-mint-nft-collection's People

Contributors

razielll avatar roebou avatar thepeanutgalleryandco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

create-and-mint-nft-collection's Issues

[FEATURE] Layer Item Maximum Repeatability Settings

Summary

At the moment, it is only possible to set maximum repeatability for all layers and layer items at a global level. Add the ability to also set the maximum number of times that a specific layer or layer item can repeat / be part of the collection.

Basic example

If I have a character layer with one item, hair layer with two items and glasses with three items.

Character:
main.png

Hair:
short.png
long.png

Glasses:
funky.png
square.png
oversized.png

Maximum layer repeatability: If I set my Glasses layer's maximum repeatability to 1, then only a single art work that gets generated will have this layer item. So with the layers, there would then be art work items generated:

  1. main.png + short.png + (funky.png OR square.png OR oversized.png)

Maximum layer item repeatability: If I set my Glasses layer item funky.png's maximum repeatability to 1, then only a single art work that gets generated will have this layer item. So with the layers, there would then be art work items generated:

  1. main.png + short.png + square.png
  2. main.png + short.png + oversized.png
  3. main.png + long.png + square.png
  4. main.png + long.png + oversized.png
  5. main.png + (short.png OR long.png) + funky.png

Motivation

Users would like to be able to force rarity on certain layer items for their collections.

[QUESTION] Why 'layerItemsMaxRepeatedTraits' don't work?

Hello guys!

Thanks a lot for your amazing code!

Im trying to use 'layerItemsMaxRepeatedTraits' because I want each item from "hat" layer to repeat only once.

This is my code:

doubt

It doesn't work for me, the "hat" layer items keep repeating more than once.

Does anyone know why?

Thanks in advance.

BR

Betty

[FEATURE] Opensea Selling Scripts To Use Wallet PrivateKey

Summary

Making use of the seed phrase and account number is a bit cumbersome, especially if you have multiple wallets. Users would rather want to make use of their wallet private key to choose a specific wallet that they want to make use of in the sell_nfts.js and cancel_on_sale_nfts.js script files.

Basic example

Instead of providing a seed phrase and wallet account number, provide a wallet private key. Metamask should load that wallet and use it for the selling functionality.

Motivation

Making use of the seed phrase and account number is a bit cumbersome and problematic when you have multiple wallets.

[FEATURE] Reveal NFTs Functionality Via NFTPort

Summary

Add the ability to poll every X number of seconds to fetch all NFTs on a specific wallet address. Find all NFTs that belong to a specific contract from these NFTs. Match the NFTs from this new list with the list of NFTs from the original Minting process. If a NFT is in the original minting file, but it is not in the list retrieved, then the NFT should be revealed.

Once a NFT has been revealed, it should be recorded and future checks should not try to reveal the NFT again as it should first check the recorded files to check if it was revealed before or not.

Basic example

As a user, I have minted a 1000 NFT collection to contract ABC against wallet 12345.
Check wallet 12345 and find all NFTs available from contract ABC and add it into a list.
Loop through the minted NFT collection file and check if NFT in the list can be found in the list retrieved in the previous step.

If it can't be found, then reveal the NFT and write out a new reveal json file. If the NFT can be found in both lists, then skip the file as the NFT was not sold or transferred and still belongs to the original owner.

Motivation

Users can deploy a script that they leave running on a pc, laptop, cloud server that will manage their reveal processes. This will give users time to focus on the rest of the work like community building and not be concerned users' NFTs not being revealed once purchased.

[FEATURE] Add Maximum Repeatability For All Items In A Layer In A Single Configuration

Summary

Add the ability to specify the maximum repeatability for all items in a layer. At the moment, only the layer's repeatability can be set.

Basic example

Layer X with 10 layer items.
Each layer item should generate a maximum of 2 times.
Grow edition size to 20.
Set the maximum repeatability of layer X to 2.

20 Images should be generated with each layer X item only added twice. Any other generated attempts with the layer X item should be discarded and added to the fail count as the maximum repeatability has been reached.

Motivation

Instead of adding a maximum repeatability of 2 for each of layer X's items, the repeatability can be set once off for all layer items.

[FEATURE] SVG Support

Summary

As a user I would like to be able to use SVG files instead of PNG files to create my art works.

Basic example

Add SVG files instead of PNG files into the layers folder and the output in the images folder should also be SVG files.

Motivation

This allows for a new file type to be used by artists.

[FEATURE] Cancel NFTs On Sale On Opensea

Summary

If a user decides to change their pricing strategy, then they want to be able to remove the items from being sale in an automated way.

Basic example

I want to move the price of my NFTs from 0.003 WETH to 0.0025 WETH to cater for pricing changes, then I would like to run a script that removes NFT editions X to Y. After this is done, I can run the sell_nfts script to put the items on sale again.

Motivation

Changing pricing strategies.

[FEATURE] Opensea Refresh Metadata Script

Summary

Add a new script that will allow users to automatically refresh all of their collection's NFT metadata.

Basic example

I would like to run a script that will then go to my contract / collection on Opensea and then refresh each NFT's metadata.

Motivation

It is a very time consuming activity to do this individually and this will give users more free time to focus on more important matters.

[FEATURE] Layer Maximum Repeatability Settings

Summary

Add the ability to set the maximum number of times that a specific layer can repeat / be part of the collection.

Basic example

If I have a character layer with one item, hair layer with two items and glasses with three items.

Character:
main.png

Hair:
short.png
long.png

Glasses:
funky.png
square.png
oversized.png

Maximum layer repeatability: If I set my Glasses layer's maximum repeatability to 1, then only a single art work that gets generated will have one of the 3 glasses layer items. So with the layers, there would then be art work items generated:

  1. main.png + short.png
  2. main.png + long.png
  3. main.png + (short.png OR long.png) + (funky.png OR square.png OR oversized.png)

Motivation

Users would like to be able to force rarity on certain layers for their collections.

[FEATURE] NFTPort API Addition - Upload Metadata Directory To IPFS

Summary

Add a new script for collection contracts that will allow users to upload a metadata json directory instead of uploading the files one by one.

Basic example

Take the build/json directory, then add all the file paths into an array and then upload that array of files to IPFS.

Motivation

This will allow users to make use of the code base for image generation as well as uploads in an automated way, while handling the one off APIs via the NFTPort website itself.

suggestion

if (selectedElement.name.trim().toLowerCase() !== "blank") {

wont it be better to check if (!selectedElement.name.trim().includes('blank')

this will allow disregarding any asset with 'blank' in its string, allowing maximal flexibility, as long as blank isn't used as a prop name

[FEATURE] Update package.json with latest versions for sell_nfts script

Summary

Update the following packages in the package.json so that the sell_nfts.js script will work out the box.

@chainsafe/dappeteer: 2.4.1
puppeteer: 13.7.0
metamask: v10.8.1

Motivation

Selling script is not working on new code base anymore and struggling to download Metamask v10.1.1 as a work around needs to be in place for it to work.

[FEATURE] Opensea Polygon Script To Auto Sell NFTs

Summary

Create a new script that can be used to automate the selling of NFTs for a specific price. As this is the initial script, only need to cater for a single price for all the NFTs that needs to be put up for sale. Script only needs to cater for putting Polygon NFTs up for sale in the initial build.

Basic example

Add a new script that can take a seed phrase to your wallet that contains the NFTs that needs to be put up for sale, a start edition number, an end edition number, a price and a contract address.

StartEdition: 1
EndEdition: 10
Price: 0.002 (Above $5, as that is the minimum)
Contract: 0x09aa1a14e572e6fc05f64e541699d3e0361c7f2f
Seed Phrase: one two three mountain lion test four five six big small town

Auto login to Opensea with the Seed phrase for the wallet that owns the NFTs that should be sold. Loop through editions 1 through to 10 (both inclusive) on the contract address and put each NFT up for sale if it can find the NFT edition number and your wallet owns it. Should the items be owned by someone else or the edition can't be found, then skip over to the next edition.

Motivation

This will allow users to put their NFTs up for sale automatically by simply running a script instead of manually putting each item up for sale.

[QUESTION] Generate characters with one item in different places

Summary

Hello!
Example, i have a character layer with two items and hats layer with one item.

Character:

1.png
2.png
Hats:
Spike Hat.png

Hat is positioned differently (right / left) in characters, but have the same name item (Spike Hat) in the layer (Hats) when displayed in nft properties. How can this be done?

Thank you
12

[FEATURE] Trait dependencies

New exclusion rule that allows to setup dependencies between traits.
Use it when one trait will require a specific other trait. For those cases it is much shorter to define compared to the exclusion rules. You can also set an option to fix the dependency instead of rejecting those configurations. This can speed up generation dramatically when many dependency rules are set.

[BUG] UploadMetas_Directory Returns 502 Response Error On Windows Operating System

Description

When using the uploadMetas_directory script file, a 502 Response error is returned.

Steps to reproduce

Upload multiple json files (greater than 2000) to experience the 502 HTTP Response error.

Expected result

Uploading of JSON files should be successful and return an IPFS URL.

Actual result

Receive 502 HTTP Response error instead of IPFS URL to uploaded JSON files.

Environment

  • OS Version: Windows 11
  • Browser Version:

Excluding layers in the combination

My NFT project has 11 layers, of which 3 are background layers, these 3 layers are part of a mandatory structure, I have used layer dependency settings and this is great! :D

I don't know if it's possible, but I would like these 3 background layers not to count in the combination layers, I mean, to generate my collection of 1,000 unique NFTs I want only the other 8 layers to be taken into account, this would be the structure:

Layer 1 (mandatory structure, does not count for randomizing the mix)
Layer 2 (mandatory structure, does not count for randomizing the mix)
Layer 3 (mandatory structure, does not count for randomizing the mix)
Layer 4 (Count for randomizing the mix)
Layer 5 (Count for randomizing the mix)
Layer 6 (Count for randomizing the mix)
Layer 7 (Count for randomizing the mix)
Layer 8 (Count for randomizing the mix)
Layer 9 (Count for randomizing the mix)
Layer 10 (Count for randomizing the mix)
Layer 11 (Count for randomizing the mix)

So I would have a collection where the 1,000 NFTs would be unique thanks to the combination of the last 8 layers and, in addition, each of those 1,000 NFTs would have 3 more layers added forcibly.

The 8 layers make up a character and the 3 layers add background to that character.

Thanks in advance, your work are amazing!

[BUG] MODULE_NOT_FOUND

Description

When I download engine, npm run build(or npm run generate), the engine gets an error

Expected result

Error: Cannot find module 'C:\Users\Peter Rutherford\source\repos\create-and-mint-nft-collection\node_modules/sha1'
Require stack:

  • C:\Users\Peter Rutherford\source\repos\create-and-mint-nft-collection\src\main.js
  • C:\Users\Peter Rutherford\source\repos\create-and-mint-nft-collection\index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object. (C:\Users\Peter Rutherford\source\repos\create-and-mint-nft-collection\src\main.js:4:14)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [

Actual result

Environment

  • OS Version: W11
  • Browser Version:

[FEATURE] Generate based on metadata

Summary

Generate based off of metadata json.

Basic example

This would be a great feature if you've already generated a collection and would like another set of the same collection say in a different pose, or maybe if you wanted to make everything pixelated.

Motivation

This would be a great value add to long term holders of your collection.

[QUESTION] Incompotible traits settings not working

Hi, I'm trying to generate collection but incompatible settings not working.

These are my settings for incompatible traits:

incompatibleTraits: {
"Hair/AllTraits": [
"Hat/AllTraits",
]
}

I also also tried to specify the first input but it's still not working and "Hair/Double_Blue" gets generated with "Hat" layer:

incompatibleTraits: {
"Hair/Double_Blue": [
"Hat/AllTraits",
]
}

Am I doing something wrong?

AllTraits - "*"

[FEATURE] Opensea Sell Script Support Different Currency Selection

Summary

As a user I would like to use currencies other than ETH (WETH) when listing my NFT.

Basic example

When listing a NFT, I would like to be able to select USDC instead of ETH.

Motivation

Some projects prefer to list on stable coins instead of ETH for their project and community.

layerItemsMaxRepeatedTraits still returns duplicates

Hello, and thank you for sharing your work with us!

I have 7600 different layers in the folder(s) "Body x", and there will be a total of 7600 NFTs. I want every single layer to appear in the collection, and I want NO duplicates of the layers in the "Body" folders.
So I managed to type 7600 lines of code with "layerItemsMaxRepeatedTraits" and I still have a few items that do NOT appear (ex: Areion 275) and some layers appear multiple times (ex: Areion 292). Am I getting wrong this function, or am I doing something wrong and it's simply not working?
Here is my layer config:

const layerConfigurations = [
{
growEditionSizeTo: 100,
layersOrder: [
{ name: "Background" },
{ name: "Body 3", options: { displayName: "Body", }, },
{ name: "Hair" },
{ name: "Hat" },
{ name: "Beard" },
{ name: "Glasses DR", options: { displayName: "Glasses", }, },
],
layerItemsMaxRepeatedTraits: [
{ name: "Body 3/Areion 275", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 276", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 277", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 278", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 279", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 280", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 281", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 282", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 283", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 284", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 285", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 286", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 287", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 288", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 289", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 290", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 291", layerItemMaxRepeatedTrait: 1 },
{ name: "Body 3/Areion 292", layerItemMaxRepeatedTrait: 1 },
],
},
];

image

Thank you for your time!

[FEATURE] Layer Combination Exclusions

Summary

Add the ability to exclude certain layer item combinations from appearing on the art being generated.

Basic example

If I have a character layer with one item, hair layer with two items and glasses with three items.

Character:
main.png

Hair:
short.png
long.png

Glasses:
funky.png
square.png
oversized.png

I do not want my art generations to contain a combination of long.png and oversized.png, but all other combinations should be able to generate.

Motivation

Users would like to be able to to skip certain combinations as their art work does not look correct when certain combinations are used.

[FEATURE] Opensea Polygon Script To Auto Sell NFTs Additional Fields

Summary

Allow users to choose a timeframe (days or months) from the date picker drop down and also allow users to specify the starting time and ending time.

Basic example

When the automation script gets to the selling of a NFT, then populate the date picker with the values in the script file instead of only making use of the default timeframe.

Motivation

Allow users to change the timeframe of how long the NFTs will be on sale for.

[FEATURE] Randomised Generic Metadata Images

Summary

Add the ability to provide a list of ipfs urls that can be used in the generation of generic metadata.

Basic example

Provide an array of IPFS URLs in the nft_details.js configuration file.

['https://ipfs.io/ipfs/bafkreigye3xz72jp2eskhrgq4blhh5ec3wwbj4isqejv4a6mdhqzcuvquy', 'https://ipfs.io/ipfs/bafkreigye3xz72jp2eskhrgq4blhh5ec3wwbj4isqejv4a6mdhqzcuvqu2', 'https://ipfs.io/ipfs/bafkreigye3xz72jp2eskhrgq4blhh5ec3wwbj4isqejv4a6mdhqzcuvqu3'] ;

Modify the "update_json_to_generic_meta.js" script to look at this URL list and then randomly choose one of the URLs and assign it to the generic JSON metadata.

Motivation

This will allow users to have different generic metadata images instead of a single generic metadata image before their reveal.

[QUESTION]: deploy contract?

hi
can i deploy contract with your script? didnt see it in readme file or didnt see any deploy js file in utils/nftport

thanks

[FEATURE] Opensea Unhide NFTs Script

Summary

As a user. I would like to run a script that will automatically unhide my NFTs.

Basic example

Running the script logs in via my private key onto Opensea and then starts unhiding my NFT collection items.

Motivation

It is very time consuming to manually unhide NFTs

Error when trying to generate for Solana

Getting error when trying to generate for Solana. Currently don't have plans to use NFTPort - and just using your repo / code to bypass Blank from being added to metadata. Everything works perfectly when on network.eth but when I change to network.sol I get this error:

eddies-MBP:create-and-mint-nft-collection-1.3.1 eddie$ node index.js
/Users/eddie/Desktop/Solana/create-and-mint-nft-collection-1.3.1/src/main.js:323
  let metadata = metadataList.find((meta) => meta.custom_fields.edition == _editionCount);
                                                                ^

TypeError: Cannot read properties of undefined (reading 'edition')
    at /Users/eddie/Desktop/Solana/create-and-mint-nft-collection-1.3.1/src/main.js:323:65
    at Array.find (<anonymous>)
    at saveMetaDataSingleFile (/Users/eddie/Desktop/Solana/create-and-mint-nft-collection-1.3.1/src/main.js:323:31)
    at /Users/eddie/Desktop/Solana/create-and-mint-nft-collection-1.3.1/src/main.js:418:11
    at async startCreating (/Users/eddie/Desktop/Solana/create-and-mint-nft-collection-1.3.1/src/main.js:383:9)
eddies-MBP:create-and-mint-nft-collection-1.3.1 eddie$

Any way to fix? Seems to work okay in the original Hashlips Art Engine repo but get this error in yours.

Thanks in advance for your help! :)

[FEATURE] Minting Against Wallet List

Summary

Add the ability to provide an array of objects that contains a wallet address and a list of nft editions that needs to be minted to that wallet address.

Basic example

Provide an array of wallet address with nft editions list to be minted.

[
{
"wallet_address": "12345",
"nft_edition_count": "1"
},
{
"wallet_address": "45678",
"nft_edition_count": "5"
},
{
"wallet_address": "92231",
"nft_edition_count": "10"
}
]

When the mint process runs, it needs to mint 1 edition to wallet 12345, 5 editions to wallet 45678 and mint 10 editions to wallet 92231. This nft editions will then look as follow against the wallets.

Wallet 12345: 1
Wallet 45678: 2, 3, 4, 5, 6
Wallet 92231: 7, 8, 9, 10, 11, 12, 13, 14, 15, 16

Motivation

This will allow users to build up "minting lists" and then mint them directly to the minting wallets instead of to the contract's creator wallet and then having to transfer the items.

[FEATURE] Start Edition From X

Summary

Add the ability to set the starting edition value of the collection so that upon collection creation, editions can start from any number specified.

Basic example

Set the starting edition value to 0 in a settings file, then my editions in the images folder should start with 0 and my json file will also start with 0, along with the edition inside the json file.

Motivation

This is needed to allow users to make use of the art generation scripts when generating art for their NFTPort Collection Contracts.

Rarity percentage not showing up[QUESTION]

Alright, first I am sure I did something wrong. I got my test NFTs on the rinkeby chain and uploaded to the openseas test site. When I view them it shows all the traits but no rarity. I ran the rarity command and have a separate .json that list all the rarities for each trait but how do I get that to show up for everyone else?
Untitled

[FEATURE] Pinata Upload Files API Call

Summary

Add API calls from Pinata for users to make use of when they need to upload images or metadata files.

Basic example

Use a upload-images.js and upload-metas.js script to upload files to Pinata and receive a single CID back for each of the uploads.

Motivation

This will allow users to upload directly from their machines instead of uploading via the Pinata interface.

[FEATURE] Import GIFs as layers

Summary

I see Hashlips’project only allow import static images as layers. I hope a feature can import gifs as layers. After that, it will merge gifs and static image together in output file-- Your document is so great. Thanks for your team

Basic example

Motivation

[FEATURE] Configuration should not be part of repository

The configuration should not be part of the repository.

Rename everything of the template/demo configuration. Those renamed files are part of the repo.

src/config.js -> src/config_demo.js (actually it would be even better to not have that in the src folder at all)
layers -> layer_demo

This would make it easier to contribute to the project without stashing stuff all the time. It is also a cleaner way.

[FEATURE] Opensea Polygon Script To Auto Sell NFTs Added Metamask Account Number

Summary

Users have multiple wallets / accounts on a seed phrase and need the ability to switch to a different one for selling functionality.

Basic example

Provide a seed phrase that contains multiple wallets and then have the ability to choose a specific account number on the seed phrase.

Motivation

Allow selling automation from different wallets, while using a single seed phrase.

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.