Bankr Twitter bot guide
This guide will walk through building a Twitter bot on top of the Clanker protocol similar to Bankr, Dealr, Beamr, and others. This bot will use an LLM to interpret user requests, Privy managed wallets to manage EVM accounts, and the Clanker protocol to deploy tokens on Base.
Resources
Clanker API docs
Learn how to deploy tokens on Base using the Clanker API.
Privy Wallets
Privy server wallets for secure EVM wallet management.
Twitter API
Reference for building bots on Twitter.
Set up your Twitter bot
To interact with users, you’ll need a Twitter developer account and a bot. Learn more here.
Set up Privy server wallets
If your app does not have access to managed wallets, request managed wallets access on your dashboard here
Privy managed wallets let you create and control EVM wallets programmatically. Learn more about getting started with managed wallets.
Using wallets
In our example application, we will build two basic interactions with Privy wallets:
- Create a wallet
- Get a user’s wallet
Using these core building blocks, we can allow our bot to seamlessly and securely create and manage wallets for users.
Create a wallet for a user
This function creates a new wallet for a user and saves the wallet ID to the database.
Get a user wallet
This function checks if a user has a wallet and returns it if it exists.
Get or create a wallet
A higher level function that uses the getUserWallet
and createUserWallet
functions to get or create a wallet for a user.
Integrate LLM for intent detection
Use an LLM to interpret user messages and decide what action to take. Treat the LLM as a black box that receives a prompt and returns a structured intent.
Getting set up with Clanker API
To deploy tokens via the Clanker API, you first need to obtain an API key.
Request API access
- Visit the Clanker API documentation.
- Follow the instructions or contact the Clanker team via their documentation or contact page to request API access.
- Once approved, you’ll receive an
x-api-key
to use in your API requests.
Next: Deploy a token
Once you have your API key, you can use it to deploy tokens via the Clanker API. See the next section for a full deployment code example.
Example Interactions
Deploy a token
Let users deploy tokens on Base by simply messaging the bot. The LLM interprets the intent, and the bot handles wallet lookup/creation and token deployment.
Send tokens to another Twitter user with LLM
Let users send tokens (e.g., ETH on Base) to other Twitter users by simply messaging the bot. The LLM interprets the intent, and the bot handles wallet lookup/creation and transaction sending.