Giter Club home page Giter Club logo

fetch-minted-tokenids-nodejs's Introduction

README: Minted TokenIds Fetcher

このスクリプトは、指定されたNFTコントラクトのmintedマッピングを使用して、すでに発行されているtokenIdを取得します。結果はJSON形式でファイルに出力されます。

前提条件

ソフトウェア:

  • Node.jsがインストールされていること
  • ethers.jsライブラリがインストールされていること (npm install ethers でインストール可能)

スマートコントラクト:

  • 対象のスマートコントラクトは以下のインターフェイスを実装している必要があります:
    • function minted(uint) view returns (bool)
    • function tokenByIndex(uint256) view returns (uint256)
    • function totalSupply() view returns (uint256)

使い方

  1. スクリプトのあるディレクトリに移動します。
  2. 以下のコマンドを実行してスクリプトを起動します。
$ node <script-name> YOUR_INFURA_API_KEY YOUR_CONTRACT_ADDRESS
  • <script-name> はスクリプトのファイル名を指定してください。
  • YOUR_INFURA_API_KEY には、Infuraから取得したAPIキーを指定してください。
  • YOUR_CONTRACT_ADDRESS には、対象となるコントラクトのアドレスを指定してください。
  1. スクリプトが実行され、既に発行されているtokenIdがカレントディレクトリのYOUR_CONTRACT_ADDRESS.jsonという名前のファイルに保存されます。

注意

  • このスクリプトは、最大10,000のtokenIdを走査します。この数はコントラクトによって異なる場合がありますので、必要に応じてスクリプトを修正してください。
  • Infura APIの制限に注意してください。大量のリクエストを短時間に送ると、API制限に達する可能性があります。
  • エラーや例外が発生した場合、コンソールに詳細が表示されます。

ライセンス

このスクリプトはMITライセンスのもとで提供されます。詳細はLICENSEを参照してください。

fetch-minted-tokenids-nodejs's People

Contributors

junyatakechi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.