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

erc721-multi-sales

v0.1.1

Published

This project is a library to sale the ERC721.

Readme

ERC721MultiSale

Summary

This project is a library to sale the ERC721. Two types of Allow list sales are supported: Merkletree and Signature.

It is currently under development and has not been fully tested. Please use at your own risk.

このプロジェクトはERC721のNFTを販売するためのライブラリです。 ALの実現方法は下記二種類に対応しています。

  • マークルツリー
  • 署名

本ライブラリは現在開発中であり、十分なテストは完了していません。 利用する場合は自己責任でお願いします。

Features

ERC721MultiSale

現在のセール内容や購入数の管理を行います。 セール内容として以下の情報を管理します。

  • id : セールのID ※セールを開催するごとに数値をあげる。
  • saleType : 現在のセールが、「請求:0」か「交換:1」かを表す。
  • mintCost : 現在のセールにおける単価。
  • maxSupply : 現在のセールの最大在庫数。

請求(claim)とは、ETHを支払ってNFTを受け取ることを意味します。 交換(exchange)とは、ETHを支払って保有するトークンをburnし、burnしたtoken数だけ新しいトークンを受け取ることを意味します。

開催中のセールはclaimまたはexchangeどちらか一方のみ実行可能です。

ERC721MultiSaleByMerkle

マークルツリーを用いてAL実装する機能を提供します。 セールを保存する際には必ずマークルルートを合わせて保存する必要があります。

マークルツリーの生成にはutils/merkletree.tsをご利用ください。

マークルツリーのリーフは以下から構成されます。

  • claimまたはexchange実行者のアドレス
  • 現在のセールにおける実行者の最大実行回数

claimおよびexchange実行時は上記2つに加えて、マークルプルーフを引数に渡してください。

ERC721MultiSaleBySignature

署名を用いてAL実装する機能を提供します。 運営が署名用のウォレットを用意し、APIで動的に署名を作るケースで利用します。 署名用のウォレットアドレスを事前にセットしておく必要がある点にご注意ください。

署名の生成にはutils/signature.tsをご利用ください。

署名は以下から構成されます。

  • 現在のセールID
  • claimまたはexchange実行者のアドレス
  • 現在のセールにおける実行者の最大実行回数

claimおよびexchange実行時はセールIDを除く上記2つに加えて、署名を引数に渡してください。

Usage

npmを用いて導入可能です。

npm install erc721-multi-sales

基本機能はinternal関数として実装しています。 権限制御は利用するコレクション側の都合で行われるため、権限制御が必要な関数はexternal関数を提供していません。 interfaceのみ提供しているため、各コレクションにて必要な権限制御を加えたうえで実装してください。

Sample

Merkletree

マークルツリーを用いたAL実装サンプルは下記ファイルです。

contracts/sample/SampleERC721MultiSaleByMerkle.sol

Signature

署名を用いたAL実装サンプルは下記ファイルです。

contracts/sample/SampleERC721MultiSaleBySignature.sol

Test

The test code will help you understand this library.

テストコードは本ライブラリの機能を理解するために役立ちます。 是非ご参照ください。