Giter Site home page Giter Site logo

noodleofdeath / eznft Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 1.12 MB

Yet another library for generating NFT artwork, uploading NFT assets and metadata to IPFS, deploying NFT smart contracts, and minting NFT collections

License: MIT License

TypeScript 76.12% JavaScript 20.37% Shell 0.08% Solidity 3.43%

eznft's Introduction

eznft

npm npm


Yet another library for generating NFT artwork, uploading NFT assets and metadata to IPFS, deploying NFT smart contracts, and minting NFT collections


Table of Contents

Quick Start

CLI Tool

Installation (CLI)

Install eznft as a global NPM package to use it in the command line.

$ npm i -g eznft
$ eznft
usage: eznft [-h] [-v] {deploy,d,dep,generate,g,gen,mint,m,upload,u,up} ...
...

Generate Artwork (CLI)

Generate 10 unique pieces of artwork using the HashLips Art Engine.

Note: HashLips is the default generator if the --engine flag is not specified.

$ eznft gen ~/my-nft-project/layers 10 --output ~/my-nft-project/output
...
DONE

Upload to Pinata (CLI)

Generate API keys for Pinata here then add PINATA_API_KEY and PINATA_SECRET_API_KEY to your .env file. See .env-example.

Note: Pinata is the default upload service if the --ipfs flag is not specified.

$ eznft upload ~/my-nft-project/output --very-verbose
...
DONE

Resume Interrupted Session (CLI)

$ eznft resume
multiple sessions exist that were interrupted.
either specfiy a session below, or clean the workspace with "eznft clean"

0 - [5/9/2022, 4:06 PM]
  eznft resume 1
  5 out of 7 tasks completed
1 - [5/9/2022, 4:05 PM]
  eznft up /Users/tmorgan/Desktop/nfts
  3 out of 10 tasks completed
$ eznft resume 0
[ 5/7 -  71%] Uploaded JSON file for "Test #4" to ipfs://QmejjYUqofjvWX7WTg74sPxL6gwQymwiJru9BaSASNCjcR

NPM Module

Installation (Module)

npm i eznft

Generate Artwork (Module)

Generate 10 unique pieces of artwork using the HashLips Art Engine.

Note: HashLips is the default generator if the type option is not specified.

import { GeneratorService } from "eznft";
const generatorService = GeneratorService.load({
  // Number of unique NFTs to create.
  size: 10, 
  // Folder should contain an 'images' and 'json' folder
  layers: '~/my-nft-project/layers', 
  // Names folders in 'images', in order of bottom to top
  layerOrder: ['Background', 'Fur', 'Eyes', 'Eyewear', 'Accessory'], 
  // Where to ouput. default is `${process.cwd()}/.eznft/${service-session}/build`.
  outputDir: '~/my-nft-project/output', 
  // Prefix of each NFT generated in this collection.
  prefix: 'Pomsky Punks',
  // The collection description.
  description: 'The cutest NFT collection ever!', 
  // Options per layer specific to HashLips
  opt: {
    Background: {
      opacity: 0.5,
      displayName: "Background Color",
    },
    Fur: {
      displayName: "Fur Color",
    },
    Eyes: {
      displayName: "Eye Color",
    },
  },
  // Log everything to the console except DEBUG messages.
  logLevel: "most", // VERBOSE = LOG | INFO | WARN | ERROR,
  // Type of generator to use. Defaults to "hashlips"
  type: "hashlips",
});
generatorService.generate();

Upload to Pinata (Module)

Generate API keys for Pinata here then add PINATA_API_KEY and PINATA_SECRET_API_KEY to your .env file. See .env-example.

Note: Pinata is the default upload service if the type option is not specified.

import { UploadService } from 'eznft';
const uploadService = UploadService.load({
  apiKey: process.env.PINATA_API_KEY,
  secretApiKey: process.env.PINATA_SECRET_API_KEY,
  // Log everything to the console except DEBUG messages.
  logLevel: "most", // VERBOSE = LOG | INFO | WARN | ERROR,
  // Type of upload to use. Defaults to "hashlips"
  type: "pinata",
});
uploadService.uploadAssets('~/my-nft-project/output', { uploadJsonAssets: true });

Contribute

Feel free to make a pull request if you want to help me implement the rest of these features, or tweet me on Twitter at @nftofdeath

Development

When developing (on UNIX kernel), you can use the bash script in the root git directory which points to the CLI target in src/cli/eznft.ts.

./eznft

For Windows you will need to run ts-node src/cli/eznft.ts.

Support Us

If you find this library useful for you, you can support it by donating any amount

ETH/MATIC: 0x9FE2e80A2fEFE9d38C4689daB25e37f413C68C43

BTC: 3HNXnygb1HowTBbvhQrQ4vxekfQ2UM83sd

SHIB: 0xBb8f7EbF3D7f54BAcadece3dada9ab2358C90635

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.