/claynoscorz

A Twitter bot for posting Claynosaurz purchases

Primary LanguageTypeScriptMIT LicenseMIT

Claynoscorz

A Claynosaurz Twitter sales bot

Claynosaurz is a 10k pfp project built on Solana. Any time someone scores a Claynosaur (a sale is made), this bot will tweet about it.

Getting Started

To run this project, you'll need a Twitter account with elevated access to the API. This is required because the project uses OAuth 1.0a User Context

  1. Clone the repo

    git clone
  2. Setup the environment

    cp .env.example .env
    # Fill out the required variables in .env
  3. Start the dev server

    yarn dev

Make your own Twitter bot

  1. Fork this repo
  2. Create a Twitter developer account
  3. Setup local development (See Getting Started)
  4. Deploy the app on Render or similar
    1. Required environment variables are in .env.example
  5. Create an NFT_SALE Helius webhook

Helius

Helius provides webhooks based on transactions that occur on the Solana network. After you've deployed your Twitter bot, you'll need to create a Helius webhook. This bot was built to handle NFT_SALE events.

For the accounts on the webhook, you need every address of every NFT in your collection. You can do this using the Metaboss. As an example: ❯ metaboss collections get-items --collection-mint 9jnJWH9F9t1xAgw5RGwswVKY4GvY2RXhzLSJgpBAhoaR --api-key <API_KEY>

Tweet Content

The tweets are constructed inside the buildTweet function in tweet.ts. Modify this function to change the content of the tweet to fit your project's needs.

Caching

There is an optional REDIS_URL environment variable. It's recommended you setup a Redis instance to cache requests from Helius. This prevents processing NFT sales multiple times. If you don't use Redis, the caching will be done in memory. Render has a generous free-tier for an LRU Redis instance that fits the bill nicely.