Giter VIP home page Giter VIP logo

ethereum-nft-sales-bot's Introduction

GitHub contributors CI CodeQL Release npm


Logo

Ethereum NFT

Ethereum NFT sale events monitoring SDK with built-in Discord and Twitter notification.



Table of Contents

Click to expand
  1. Getting Started
  2. Usage
  3. Built-in Notification
  4. Market Coverage
  5. Live Demo
  6. Unsupported Features
  7. Contributing
  8. Contact
  9. Collections
  10. License

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

(back to top)

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.

(back to top)

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'
    }
});

(back to top)

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.

(back to top)

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.

(back to top)

Market Coverage

Logo

(back to top)

Live Demo

Logo

gif_1 gif_2

Twitter

Discord

(back to top)

Unsupported Features

  • Uniswap
  • Sudo Swap OTC

Any contributions are welcome!

(back to top)

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.

(back to top)

Contact

kenryu.eth - @kenryu42 - [email protected]

(back to top)

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

(back to top)

LICENSE

This project is MIT licensed.

(back to top)

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.