chia-nft-minter

0.10.3 • Public • Published

chia-nft-minter

Version Version Monthly Downloads Total Downloads

A JS client to encapsulate minting CHIA NFT's.

Heavily informed by mintgarden

Getting Started

npm install
npm test

Check out the examples of using this from with the chia-repl.

Basic Usage

You will need:

The full workflow will:

  • Generate metadata for the NFT
  • Upload a file to nft.storage along with metadata
  • Supply information about the minting process
  • Use the minting information and IPFS data to call nft_mint_nft
import { ChiaDaemon, loadUIConfig } from 'chia-daemon';
import { NftMinter, MetadataFactory } from 'chia-nft-minter';

const dataFileInfo = {
    name: 'test-nft-by-you',
    type: 'image/png',
    filepath: 'C:\\path\\to\\some_file.png'
};

const mintingInfo = {
    wallet_id: 2,
    royalty_address: 'txch10kn82kl6hqv47qzeh4ugmqjr5mmdcnrlymfx8wl9nrhhkyxnzfkspna7l9',
    target_address: 'txch10kn82kl6hqv47qzeh4ugmqjr5mmdcnrlymfx8wl9nrhhkyxnzfkspna7l9',
    royalty_percentage: 250,
};

const factory = new MetadataFactory('chia-nft-minter-tests');
const collectionMetaData = factory.createCollectionMetadata('test-nft-collection-by-you');
const nftMetadata = factory.createNftMetadata('test-nft-by-you', collectionMetaData);

const daemon = new ChiaDaemon(loadUIConfig(), 'your-chia-nft-app');
const connected = await chia.connect();

const minter = new NftMinter(chia.services.wallet, '_YOUR_API_KEY_');
const result = await minter.createNftFromFile(dataFileInfo, mintingInfo, nftMetadata);

console.log(result);

Package Sidebar

Install

npm i chia-nft-minter

Weekly Downloads

2

Version

0.10.3

License

Apache-2.0

Unpacked Size

26.5 kB

Total Files

10

Last publish

Collaborators

  • dkackman