Git Product home page Git Product logo

twitternftsalesbot's Introduction

image

๐Ÿฆ† Website ๐Ÿฆ† Twitter ๐Ÿฆ† Discord ๐Ÿฆ†

TwitterNFTSalesBot

About

Powering the Secret Duck Society Twitter sales bot https://twitter.com/Secretducksales.

The is a javascript implementation for a Twitter Solana NFT collection sales bot. It monitors secondary marketplaces for sales from a given collection and tweets about them. As of now, the bot only monitors Magic Eden and Alpha Art, but functionality for other marketplaces is on the way.

Along with the bot comes a Collection Fetcher that will generate a json file of the metadata from your NFT collection. Here is an example of the format the metadata for each NFT comes in.

    "id": 1968,
    "updateAuthority": "8yvshU8TYtg3c5TwmvJEzRRUgRGZSuWkghv1ZXP9UQUb",
    "mint": "Ezp7t9Mg1yuAu37AV7WAKTVjEGDhmF2beZm31imTdoR4",
    "name": "Duck #1968",
    "uri": "https://arweave.net/jZiFIUvG8cS9nAgiJ34mKxjGmvO8mfdKHsNaD4hEjhA",
    "address": "376bvNdBLagKgqmL7RcWnL3DeCUgk1ND2b4GRnc5NAKj"

The scanner works by monitoring the addresses of secondary marketplaces. It continously uses the function getConfirmedSignaturesForAddress2 to pull a list of the recent transactions for each marketplace address, and then filters these for transactions that are sales involving the desired NFT collection.

If the scanner detects a sale from the collection, it passes the appropriate information to tweet.js to handle Twitter functionality.

Prerequisites

You must download some prerequisite software to be able to run this code:

And set up Twitter Developer Accounts

Installation

git clone https://github.com/SecretDuckSociety/TwitterNFTSalesBot.git
yarn install

How to run the bot

  1. Fill in your .env file with the appropriate values. Note that due to rate limits, if you try to use the public endpoints (https://api.mainnet-beta.solana.com) for RPC_ENDPOINT you will likely be throttled. To use the current iteration of the code you need to use a custom endpoint that doesn't include rate limits.
  2. Visit the constants file and change the NUM_CREATORS variable to match the number of creators for your collection. Your candy machine counts as a creator.
  3. Run node -r dotenv/config CollectionFetcher.js to fetch the metadata associated with your collection.
  4. Run node -r dotenv/config Scanner.js to fire up the bot. It will keep running until the process is killed (ctrl-c). Using tmux to run your bot is recommended. Alternatively, you could run it as a Heroku app (see Heroku Remote).

twitternftsalesbot's People

Contributors

secretducksociety avatar whoelsebutsb 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.