npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mintknight

v2.0.3

Published

Scripts to interact with the Mintknight API

Downloads

6

Readme

mintknight

Javascript Library to interact with the Mintknight API

Install

npm install

Now, You have two ways to use this amazing SDK:

  • Javascript API
  • Command line interface (CLI)

Javascript API

cp .env.example .env

Edit .env file with the desired connection parameters:

  • MINTKNIGHT_API_SERVICE=https://api.sandbox.mintknight.com/

We have two APIs, one for management (users, companies, projects...) and one strictly for Blockchain. At Sandbox level it is possible to access the Web API, but in production it is restricted.

Example:

const MintKnight = require('mintknight');
const mintknight = new MintKnight(process.env.MINTKNIGHT_API_SERVICE);

Learn more about Mintknight API: https://mintknight.gitbook.io/

Using the CLI

First steps

With this command, you can see the information of the current setup:

mk

Show all the command options:

mk help

Setup and register

mk register

This will add a new user, setup a company, a project on a certain network. You are now ready to play with contracts.

The Ids for project, campaign, wallets and tokens are stored inside $HOME/.mintknight/

ERC20 tokens

Add a new Wallet to project
mk add wallet

Set a name and reference

Add a new contract
mk add contract

Set a name, symbol and choose the contract type: ERC20 - Mintable

Tips: After that, you could do: mk or mk info contract

Mint tokens
mk mint token

Set the recipient wallet and set the number of tokens to mint

Tips: After that, you could do: mk info contract or mk info token

Transfer tokens
mk transfer token

The origin wallet will be the selected wallet. Type: mk

  • To change the wallet: mk select wallet

Set the recipient wallet and set the number of tokens to mint

Tips: After that, you could do: mk info contract or mk info token

NFT Collection

Add a new Wallet to project
mk add wallet

Set a name and reference

Add a new contract
mk add contract

Set a name, symbol and choose the contract type:

  • ERC721 - Mutable URI (NFT, URI points to MintKnight)
  • ERC721 - Inmutable URI (NFT, URI points to Arweave)

Tips: After that, you could do: mk or mk info contract

Add a media
mk add media <image path>

Example : assets/nft.png

Tips: After that, you could do: mk list media

Mint a NFT
mk mint nft

Set the media ID for the image, name, description, atrributes and choose the recipient wallet

Tips: After that, you could do: mk list nft

Transfer a NFT
mk transfer nft

The origin wallet will be the selected wallet. Type: mk

  • To change the wallet: mk select wallet

Set NFT ID, and the recipient wallet

Drops

Add a new Wallet to project
mk add signer

Set a name and reference

Add a new contract
mk add contract

Set a name, symbol and choose the contract type:

  • ERC721 - Mutable URI (NFT, URI points to MintKnight)
  • ERC721 - Inmutable URI (NFT, URI points to Arweave)

Tips: After that, you could do: mk or mk info contract

Add a new drop
mk add drop

Set a name, description and the next params:

  • Drop type:
    • First come first Served: Mint the first NFT ready to be minted.
    • Raffle: Mint random NFT of drop collection.
  • Uses codes: Yes/No. If 'Yes', create drop codes will be a requirement to mint NFTs.
  • Direct minting: Yes/No. If 'Yes', the NFTs will be free, otherwise the end user, will have to pay de minted cost and the price of the NFT.
  • Price (optional)
  • Coin (optional)
  • Start date and end date: Availability date range of drop

Tips: After that, you could do: mk list drop

Upload NFTs to drop
mk upload nft

Set the path of csv file and images zip collection

  • CSV format example:
tokenId;name;description;image
1;NFT 1;My NFT 1;mynft.png
2;WNFT;Wonderful NFT 2;wonderfulnft.png
  • The zip file must contain inside all the images: mynft.png, wonderfulnft.png, etc.

Tips: After that, you could do: mk list nft

Upload drop codes
mk list drop
mk add/upload dropcode

Set the Drop ID and the csv file which contains the codes

  • CSV format example:
code;maxUsage;
ABCD1;1
ABCD2;1
  • The maxUsage is the number of times, the code could be used

Tips: After that, you could do: mk list dropcode