Nonlinear Performance Magnification

    nifty-toolkit

    1.0.0 • Public • Published

    nifty-toolkit npm package

    IPFS

    Use 3rd party Pinata platform to manage IPFS, please register Pinata first.

    Installation

    Using npm:

    $ npm install nifty-toolkit

    Using yarn:

    $ yarn add nifty-toolkit

    Wiki

    For more details, check out https://nifty-3.gitbook.io/nifty-toolkit-npm/getting-started

    Code example

    var mintMagiNft = require('nifty-toolkit');
    const fs = require('fs');
    const FormData = require('form-data');
    
    var ipfs = new mintMagiNft.Ipfs({
        pinKey: 'yourPinataApiKey',
        pinSecret: 'yourPinataSecretApiKey',
    });
    
    ipfs.pinJSONToIPFS({
        name: '',
        images: ''
    }).then(res => {
        console.log(res);
    })
    
    var fd = new FormData();
    fd.append("file", fs.createReadStream('png'), Date.now() + ".jpg");
    
    ipfs.pinFileToIPFS(fd).then(res => {
        console.log(res);
    })
    
    var nft = new mintMagiNft.Nft({
        networkName: 'mumbai',
        // rpcUrl: 'https://rpc-mumbai.maticvigil.com',
    });
    
    or
    
    var nft = new mintMagiNft.Nft({
        networkName: 'cronos-testnet',
    });
    
    nft.mint("yourAddress", "yourTokenURI", "yourPrivateKey").then(res => {
        console.log(res);
    });

    Install

    npm i nifty-toolkit

    DownloadsWeekly Downloads

    4

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    394 kB

    Total Files

    11

    Last publish

    Collaborators

    • magi-team