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.
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
-
Clone the repo
git clone
-
Setup the environment
cp .env.example .env # Fill out the required variables in .env
-
Start the dev server
yarn dev
- Fork this repo
- Create a Twitter developer account
- Setup local development (See Getting Started)
- Deploy the app on Render or similar
- Required environment variables are in
.env.example
- Required environment variables are in
- Create an
NFT_SALE
Helius webhook
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>
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.
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.