A X (Twitter) AI agent (@XoninNFT) that analyzes user blockchain activity and awards unique generative NFTs based on their (onchain reputation score). This project connects to Xonin, a fully onchain generative art project (GitHub), and is built using CDP AgentKit.
XoninBot is an autonomous AI agent with the following features:
- Twitter Integration: Automatically monitors mentions and processes NFT mint requests
- Onchain Analysis: Evaluates wallet addresses to determine reputation score
- Generative NFT: Mints unique SVG-based NFTs
- Address Resolution: Support for ENS domains and direct Ethereum addresses
- Autonomous Operation: Fully automated workflow from Twitter interaction to NFT minting, with response messages containing transaction details and NFT preview images
The agents runs on a daily schedule via GitHub Actions (limited by X free tier API calls) and can also be triggered manually.
XoninBot uses:
- LangChain: For building the AI agent capabilities
- CDP AgentKit: Coinbase Developer Platform for blockchain interactions
- Tweepy: For X API integration
- Pydantic: For data validation
- Poetry: For dependency management
-
Clone the repository
-
Install dependencies:
cd agentkit/cdp-langchain/examples/chatbot-python poetry install
-
Set required environment variables:
NETWORK_ID=<blockchain_network> ETHERSCAN_API_KEY=<your_api_key> TWITTER_API_KEY=<your_api_key> TWITTER_API_SECRET=<your_api_secret> TWITTER_ACCESS_TOKEN=<your_access_token> TWITTER_ACCESS_TOKEN_SECRET=<your_access_token_secret> CDP_WALLET_DATA=<your_wallet_data> OPENAI_API_KEY=<your_openai_api_key>
The bot runs automatically via GitHub Actions every day at 12:00 UTC.
You can run the bot manually with:
cd agentkit/cdp-langchain/examples/chatbot-python
poetry run python chatbot.py
The script provides two modes:
- Chat mode - for interactive testing
- Autonomous mode - for monitoring Twitter mentions and processing requests
- Xonin Generative Art - View the generative art NFTs
This project is based on CPD AgentKit, which is licensed under the Apache-2.0 license.