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 🙏

© 2026 – Pkg Stats / Ryan Hefner

create-nil-hardhat-project

v1.5.0

Published

<h1 align="center">create-nil-hardhat-project</h1>

Readme

Table of contents

🚀 Overview

This project houses create-nil-hardhat-project, a generator of Hardhat projects that work on top of =nil;.

🔧 Installation

Clone the repository:

git clone https://github.com/NilFoundation/nil.git
cd ./nil/create-nil-hardhat-project

Install dependencies:

pnpm install

⚙️ Configuration

  1. Create a .env file in the root directory based on the given .env.example file.
  2. Update the .env file with the RPC URL. The default value corresponds to a locally running =nil; node.
  3. Generate a private key and a new smart account using the hardhat default task
  npx hardhat wallet create
  1. Update the .env file with the private key and the smart account address.

🎯 Usage

To compile all smart contracts:

  npx hardhat compile

Create a task for deploying the Incrementer.sol contract in ./tasks/deploy-incrementer.ts:

import { task } from "hardhat/config";

task("deploy-incrementer").setAction(async (taskArgs, hre) => {
   const contract = await hre.nil.deployContract("Incrementer", []);

   console.log("Incrementer contract deployed at address: " + contract.address);

   await contract.write.increment([]);

   const value = await contract.read.getValue([]);

   console.log("Incrementer contract value: " + value);
});

Import the task inside hardhat.config.ts:

import "./tasks/deploy-incrementer";

To deploy the contract:

  npx hardhat deploy-incrementer

To run all tests:

  npm run tests

Methods

Get default client:

const client = await hre.nil.getPublicClient();

Get default smart account:

const smartAccount = await hre.nil.getSmartAccount();

Create new smart account:

const smartAccount = await hre.nil.createSmartAccount({
  topUp: true, // top up the account with tokens
});

Contact deployment with params:

const contract = await hre.nil.deployContract("Incrementer", [0n], {
  shardId: 1, // optionally set shard manually
  feeCredits: 100_000_000n, // optionally set max fee credits
});

Get and call deployed contract:

import { waitTillCompleted } from "./receipt";

const tokenContract = await hre.nil.getContractAt("Token", token0Address, {
  smartAccount: smartAccount, // optionally set smart account for method calls
});

const txHash = await tokenContract.write.sendToken(["<to_addr", 1000n]);

// wait for the transaction to be completed
await waitTillCompleted(client, tx, {
  waitTillMainShard: true, // wait for the main shard (useful for cross-shard transactions)
});

const balanace: bigint = await tokenContract.read.getTokenBalanceOf(["<address>"]);

💪 Contributing

Contributions are always welcome! Feel free to submit pull requests or open issues to discuss potential changes or improvements.

🚧 Work in Progress

This project is currently under active development. Not all features are fully implemented and the project may behave unexpectedly in certain cases. If an issue arises when interacting with the project, open a new GitHub issue and detail the problem.

License

MIT