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

@cool-cats/enft

v1.4.0

Published

An ethereum NFT events monitoring sdk.

Downloads

12

Readme

GitHub contributors CI CodeQL Release npm

Table of Contents

Getting Started

Installation

npm install enft

Prerequisites

  • Support Node.js version >= 18
  • Alchemy API Key - apply here (Recommended)
  • OR
  • Infura NFT (Open Beta) API Key and API Key Secret - apply here
  • fontconfig is also required for generating image with text. If your system doesn't have it, please install it first.

Ubuntu/Debian:

sudo apt-get install fontconfig

Fedora/RHEL/CentOS:

sudo yum install fontconfig

Arch Linux:

sudo pacman -S fontconfig

MacOS (Homebrew):

brew install fontconfig

Windows (Chocolatey):

choco install fontconfig

Optional

  • Etherscan API Key for enabling ETH to USD conversion - apply here

Usage

Subscribe to NFT sales events by calling onItemSold method.

import { Auth, ENFT } from 'enft';

const auth = new Auth({
    alchemy: {
        apiKey: 'YOUR_ALCHEMY_API_KEY'
    }
});

const enft = new ENFT(auth);

enft.onItemSold({
    contractAddress: 'NFT_CONTRACT_ADDRESS',
    discordWebhook: 'DISCORD_WEBHOOK_URL', // optional
    etherscanApiKey: 'ETHERSCAN_API_KEY' // optional
});

To debug a specific transaction, call debugTransaction method.

enft.debugTransaction(
    {
        transactionHash: 'THE_TRANSACTION_HASH_TO_DEBUG',
        contractAddress: 'NFT_CONTRACT_ADDRESS',
        discordWebhook: 'DISCORD_WEBHOOK_URL' // optional
    },
    (txData) => {
        console.log(txData);
    }
);

For more concise example, please refer to Example.

Docs

See the auto-generated docs for more info on methods and parameters.

Built-in Notification

Notification is optional. You can enabling it by setting the coresponding argument when calling onItemSold method.

enft.onItemSold({
    discordWebhook: 'YOUR_DISCORD_WEBHOOK_URL',
    twitterConfig: {
        appKey: 'YOUR_TWITTER_APP_KEY',
        appSecret: 'YOUR_TWITTER_APP_SECRET',
        accessToken: 'YOUR_TWITTER_ACCESS_TOKEN',
        accessSecret: 'YOUR_TWITTER_ACCESS_SECRET'
    }
});

Twitter

  1. Register Twitter developer account with Elevated access. 🔗 Link

  2. Create a development app with OAuth 1.0a read-write permissions. 🔗 Link

  3. Install Twurl and run following command:

    twurl authorize --consumer-key <your-app-key> --consumer-secret <your-app-secret>

    This will return an URL that you should open up in your browser. Authenticate to Twitter, and then enter the returned PIN back into the terminal.

    This should create a file called .twurlrc in your home directory with all the necessary information.

Discord

  1. Open the Discord channel you want to receive sales event notifications.
  2. From the channel menu, select Edit channel.
  3. Select Integrations.
  4. Select Create Webhook.
  5. Enter the name of the bot that will post the message.
  6. Copy the URL from the WEBHOOK URL field.
  7. Click Save.

Market Coverage

Live Demo

gif_1 gif_2

Twitter

Discord

Unsupported Features

  • [ ] Uniswap
  • [ ] Sudo Swap OTC

Any contributions are welcome!

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

For more information on how to contribute, check out the contributing guide.

Contact

kenryu.eth - @kenryu42 - [email protected]

Collections

Collections that using this SDK.

Open a Pull Request to add your collection below.

| Collection | Twitter | Discord | | ---------------- | ----------------------------------------- | ------------------------------------------------------ | | Murakami.Flowers | @MFTMKKUS | Murakami.Flowers | | Rumble Kong League | @RumbleKongs | Rumble Kong League |

LICENSE

This project is MIT licensed.