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

utilsnft

v1.0.4

Published

Sample CLI NFT utils demo interaction with IOTA Shimmer Testnet L2 and L1

Downloads

1

Readme

utilsnft

Sample CLI NFT utils demo interaction with IOTA Shimmer Testnet L2 and L1 using iota-sdk and web3js

Install

npm i -g utilsnft

Usage

utilsnft --help
Usage: utilsnft [options] [command]

Sample CLI NFT utils demo interaction with IOTA Shimmer Testnet L2 and L1. v1.0.0

Options:
  -V, --version                                                           output the version number
  -h, --help                                                              display help for command

Commands:
  createAccountL2                                                         Create an account with address and private key on L2 (i.e. ShimmerEVM testnet)
  deployL2 <privateKey> <name> <symbol> <baseURI>                         Deploy NFT collection with the specified name, symbol and base URI on L2 (i.e. ShimmerEVM testnet)
  mintL2 <privateKey> <contractAddress>                                   Mint NFT token of the specified collection contract address on L2 (i.e. ShimmerEVM testnet)
  swapL2L1 <privateKey> <contractAddress> <tokenId> <receivingAddressL1>  Swap NFT token on L2 (i.e. ShimmerEVM testnet) to an equivalent one on L1 (Shimmer testnet)
  help [command]                                                          display help for command

Commands and outputs

Create an account with address and private key on L2 (i.e. ShimmerEVM testnet)

Command:

utilsnft createAccountL2

Output:

Created account with address: 0x7Dd17F1C195864AA321F7680FbFdF23C85117DA3 and privateKey: 0x2dd8deca0b51423a324d46d7ee549d7abfd595cf602faeebfa6947b44aea795f
Done in 0.53s.

Deploy NFT collection with the specified name, symbol and base URI on L2 (i.e. ShimmerEVM testnet)

Command:

utilsnft deployL2 <privateKey> <name> <symbol> <baseURI>
  • privateKey: Private key of the wallet address (on L2) to be the NFT collection owner. This private key pays for the transaction fee.
  • name: NFT collection name
  • symbol: NFT collection symbol
  • baseURI: NFT collection base URI for the token image

Example:

utilsnft deployL2 0x2dd8deca0b51423a324d46d7ee549d7abfd595cf602faeebfa6947b44aea795f name1 sym1 http://my-token-img-link/

Output:

sendTransaction failed. Please fund the account on this Faucet:  https://evm-toolkit.evm.testnet.shimmer.network
Done in 1.31s.

After having funded the newly-created account, run again the command.

Output:

Deployed contract address of the NFT collection:  0xdC37E536c45947DBddA1C35f1D11E84d1900d52A
Transaction link: https://explorer.evm.testnet.shimmer.network/tx/0x93abbbd0f0f46b8066d55f105c6402b5c850b33f975cecc2fb0c267b8b66da3d
Done in 2.25s.

Mint NFT token of the specified collection contract address on L2 (i.e. ShimmerEVM testnet)

Here we mint the token of the above-deployed NFT collection. The specified private key can be of any wallet address to receive the minted NFT token.

Command:

utilsnft mintL2 <privateKey> <contractAddress>
  • privateKey: Private key of any wallet address (on L2) to receive the minted NFT token. This private key pays for the transaction fee.
  • contractAddress: Contract address (on L2) of the NFT collection of the NFT token to be minted

Example:

utilsnft mintL2 0x2dd8deca0b51423a324d46d7ee549d7abfd595cf602faeebfa6947b44aea795f 0xdC37E536c45947DBddA1C35f1D11E84d1900d52A

Output:

Minted NFT tokenId:  1
Transaction link: https://explorer.evm.testnet.shimmer.network/tx/0xc9483470853ca6743298e3aab5fa6226130dde21646ef41eaebe311e53ec0781
Done in 2.31s.

Swap NFT token on L2 (i.e. ShimmerEVM testnet) to an equivalent one on L1 (Shimmer testnet)

Command:

utilsnft swapL2L1 <privateKey> <contractAddress> <tokenId> <receivingAddressL1>
  • privateKey: Private key of the wallet address (on L2) owning the NFT token to be swapped. This private key pays for the transaction fee on L2.
  • contractAddress: Contract address (on L2) of the NFT collection of the NFT token to be swapped
  • tokenId: ID the NFT token (on L2) to be swapped
  • receivingAddressL1: Receiving address of any account on L1

Example:

utilsnft swapL2L1 0x2dd8deca0b51423a324d46d7ee549d7abfd595cf602faeebfa6947b44aea795f 0xdC37E536c45947DBddA1C35f1D11E84d1900d52A 5 rms1qrzauw6g0xpk77ww6kwa33lart0jwqt7fdvrrgzt3mcka7m2nd3f69hgqmy

Output:

NFT token link: http://my-token-img-link/5.json
transferNftTokenToAdmin success
Transaction link: https://explorer.evm.testnet.shimmer.network/tx/0xa3c0375d0494fe2fc2bcaa2a1af045ca792a5aaea845306f5cdb0aff4d14882b
NFT token minted on L1
Transaction link: https://explorer.shimmer.network/testnet/transaction/0xc848e673afa79b0d94d3b0f1e5c00365fbda4da19b3d0583845166b87b811db1

How it work:

For sake of simplicity, the token on L2 to be swapped to L1 will be transferred to an admin wallet on L2.
An NFT token on L1 with the same token metadata link will be minted.