NFT Kit

Easy NFT SDK Methods is a set of functions provided by the Easy NFT SDK in the KrypCore Web3 SDK. This SDK simplifies the process of creating and interacting with NFTs (Non-Fungible Tokens) on the blockchain. With the Easy NFT SDK, developers can easily deploy ERC-721 and ERC-1155 NFT collections, as well as mint NFTs within those collections.

To use the Easy NFT SDK, import the required modules and initialize the necessary objects:

Table of Contents

  • Create Collection

  • Mint NFT

Bootstrapping the SDK for NFT kit

const krypcore_web3_sdk = require("@krypc/krypcore-web3-sdk");
const EasyNftService = new krypcore_web3_sdk.Services.EasyNft(configFilePath);

Now, let's explore the available methods and their usage:

SDK Methods

createNFTCollection (ERC-721)

Deploys an ERC-721 or ERC-1155 NFT collection on a specific blockchain network.

Parameters:

  • standard (string): The NFT standard to deploy ("ERC721" or "ERC1155").

  • chainId (string): The ID of the blockchain network where the collection will be deployed.

  • name (string): The name of the NFT collection.

  • description (string): The description of the NFT collection.

  • symbol (string): The symbol or ticker of the NFT collection.

  • accessToken (string): The access token for wallet authentication.

  • isPublic (boolean, optional): Flag indicating if the collection is public (default: false).

Usage:

const createERC721CollectionStatus = await EasyNftService.createNFTCollection("ERC721", "80001", "Bored Apes", "Its an NFT collection", "APE", process.env.WALLET_ACCESS_TOKEN, false);
console.log(createERC721CollectionStatus);

mintNFT (ERC-721)

Mints a new ERC-721 or ERC-1155 NFT.

Parameters:

  • chainId (string): The ID of the blockchain network where the NFT will be minted.

  • contractAddress (string): The address of the NFT contract.

  • standard (string): The NFT standard ("ERC721" or "ERC1155").

  • name (string): The name of the NFT.

  • description (string): The description of the NFT.

  • quantity (number or null): The quantity of NFTs to mint (set to null for ERC-721).

  • attributes (array): An array of NFT attributes.

  • file (File): The file object of the NFT image or media.

  • recipientAddress (string): The address of the recipient.

  • accessToken (string): The access token for wallet authentication.

Usage:

const file = fs.readFileSync("test.png");
const mintERC721NftStatus = await EasyNftService.mintNFT("80001", "0x8beF71d2443812D907986295e3878dFBc03Ad141", "ERC721", "Sample Token", "This is a sample token", null, [], file, "0x5A5D02cdb3D8904d996feD9911EdfFe070d6E6EF", process.env.WALLET_ACCESS_TOKEN);
console.log(mintERC721NftStatus);

createNFTCollection (ERC-1155)

Deploys an ERC-1155 NFT collection on a specific blockchain network.

Parameters:

  • standard (string): The NFT standard to deploy ("ERC1155").

  • chainId (string): The ID of the blockchain network where the collection will be deployed.

  • name (string): The name of the NFT collection.

  • description (string): The description of the NFT collection.

  • symbol (string): The symbol or ticker of the NFT collection.

  • accessToken (string): The access token for wallet authentication.

  • isPublic (boolean, optional): Flag indicating if the collection is public (default: false).

Usage:

const createERC1155CollectionStatus = await EasyNftService.createNFTCollection("ERC1155", "80001", "Bored Apes 1155", "Its an NFT collection", "APE", process.env.WALLET_ACCESS_TOKEN, false);
console.log(createERC1155CollectionStatus);

mintNFT (ERC-1155)

Mints a new ERC-1155 NFT.

Parameters:

  • chainId (string): The ID of the blockchain network where the NFT will be minted.

  • contractAddress (string): The address of the NFT contract.

  • standard (string): The NFT standard ("ERC1155").

  • name (string): The name of the NFT.

  • description (string): The description of the NFT.

  • quantity (number): The quantity of NFTs to mint.

  • attributes (array): An array of NFT attributes.

  • file (File): The file object of the NFT image or media.

  • recipientAddress (string): The address of the recipient.

  • accessToken (string): The access token for wallet authentication.

Usage:

const file = fs.readFileSync("test.png");
const mintERC1155NftStatus = await EasyNftService.mintNFT("80001", "0x795807CCB4F1286528bD33e4Ff2ef5Cb1432655B", "ERC1155", "Sample Token", "This is a sample token", 20, [], file, "0x5A5D02cdb3D8904d996feD9911EdfFe070d6E6EF", process.env.WALLET_ACCESS_TOKEN);
console.log(mintERC1155NftStatus);

These methods allow you to deploy and mint ERC-721 and ERC-1155 NFTs on the specified blockchain network. Make sure to provide the necessary parameters based on your requirements and utilize the returned data as needed.

Last updated