/ethereum-nft-sales-bot

NFT sales monitoring bot for the Ethereum blockchain. (ERC721, ERC1155)

Primary LanguageJavaScriptMIT LicenseMIT

GitHub license GitHub Workflow Status GitHub issues


Logo

Ethereum-NFT-Sales-Bot

NFT sales monitoring bot for the Ethereum blockchain. (ERC721, ERC1155)



Contents
  1. Market Coverage
  2. GIF Generator
  3. Live Demo
  4. Getting Started
  5. Configuration
  6. Run Test
  7. Usage
  8. Notify Method
  9. Mindmap
  10. Contributing
  11. Contact
  12. Acknowledgments
  13. License

Market Coverage

(back to top)

GIF Generator

gif_1 gif_2


(back to top)

Live Demo

Twitter

Discord

(back to top)

Getting Started

Prerequisites

  • Install Node.js version 16
    • If you are using nvm (recommended) running nvm use will automatically choose the right node version for you.
  • Opensea API Key - apply here
  • Alchemy API Key - apply here
  • Etherscan API Key - apply here

Installation

npm install

(back to top)

Configuration

Create an .env file in the root directory of the project with the following contents:

Mandatory

CONTRACT_ADDRESS=
OPENSEA_API_KEY=
ALCHEMY_API_KEY=
ETHERSCAN_API_KEY=

Optional

TWITTER_ENABLED=
TWITTER_API_KEY=
TWITTER_API_SECRET=
TWITTER_ACCESS_TOKEN=
TWITTER_ACCESS_SECRET=
DISCORD_ENABLED=
WEBHOOK_URL=

Multi Monitoring

For monitoring multiple NFTs at the same time, use CONTRACT_ADDRESSES in the .env file.

Example:

CONTRACT_ADDRESSES=["0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D","0x60E4d786628Fea6478F785A6d7e704777c86a7c6"]

If CONTRACT_ADDRESS and CONTRACT_ADDRESSES are both set, CONTRACT_ADDRESSES will take the priority.


🚨🚨🚨 Do not commit/include your .env file in your repository. 🚨🚨🚨

(back to top)

Run Test

To ensure your configuration(.env) is correct, run the following command:

npm test

The test should take less than a minute to run. If it fails, either APIs are down or your configuration is incorrect.

(back to top)

Usage

Run the following command to start the bot:

node app.js

To test a certain transaction for debugging purposes, run the following command:

node app.js -t <transaction-hash>

(back to top)

Notify Method

Notification is optional. You can turn it on in the ./.env file by setting the TWITTER_ENABLED or DISCORD_ENABLED value to 1.

For example:

TWITTER_ENABLED=1
DISCORD_ENABLED=1

(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)

Mindmap

  • OTC Events

  • Add NFT Trader

  • Add Sudo Swap

(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.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Please make sure to update tests as appropriate. Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Contact

kenryu.eth - @kenryu42 - ken0ryu@gmail.com

(back to top)

Acknowledgments

(back to top)

LICENSE

This project is MIT licensed.

(back to top)