Skip to content

Thedongraphix/Zeon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

447 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

XMTP Fundraiser Agent

An AI-powered fundraising agent built with XMTP protocol and Coinbase AgentKit. This agent helps users create and manage fundraisers through decentralized messaging on the XMTP network.

Features

  • XMTP Messaging: Secure, decentralized messaging protocol
  • Coinbase AgentKit Integration: Blockchain operations on Base Sepolia
  • Fundraiser Creation: Create fundraisers through chat commands
  • QR Code Generation: Generate donation QR codes
  • Multi-conversation Support: Works in both DMs and group chats
  • AI-Powered Responses: Natural language understanding with OpenAI

Quick Start guide

Prerequisites

Installation

  1. Clone and setup:
git clone <your-repo>
cd <your-repo>
npm install
  1. Generate XMTP keys:
npm run gen:keys
  1. Configure your .env file with:
# XMTP Environment Variables (generated by gen:keys)
WALLET_KEY=0x...
ENCRYPTION_KEY=...
XMTP_ENV=dev

# Add your API keys
CDP_API_KEY_NAME=organizations/.../apiKeys/...
CDP_API_KEY_PRIVATE_KEY=-----BEGIN EC...END EC PRIVATE KEY-----\n
OPENAI_API_KEY=sk-...
  1. Start the agent:
npm run dev

Usage

Testing Your Agent on dev and production

  1. Development Environment:

    • Go to xmtp.chat
    • Connect your wallet
    • Switch to "Dev" environment in settings
    • Start a conversation with your agent's address
    • Send test messages
  2. Production Environment:

    • Use Coinbase Wallet mobile app
    • Go to messaging section
    • Start conversation with your agent's address

Available Commands

  • create fundraiser "Name" 0.5 - Create a fundraiser with name and goal amount
  • fundraiser for 0.2 called "Project Name" - Alternative syntax
  • help - Show available commands

Example Conversations

You: create fundraiser "Web3 Ladies" 0.5
Agent: πŸš€ Creating fundraiser "Web3 Ladies" with goal of 0.5 ETH...
       βœ… Fundraiser created successfully! [Details and QR code]

You: help
Agent: πŸš€ **Zeon Fundraiser Agent Commands**
       [Shows all available commands]

Project Structure

β”œβ”€β”€ index.ts                 # Main XMTP agent entry point
β”œβ”€β”€ helpers/
β”‚   └── client.ts            # XMTP and crypto utilities
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ blockchain.ts        # Blockchain utilities
β”‚   β”œβ”€β”€ fundraiser-contract.ts # Fundraiser contract management
β”‚   └── ...
β”œβ”€β”€ scripts/
β”‚   └── generateKeys.ts      # Key generation script
└── package.json

Configuration

Environment Variables

  • WALLET_KEY: Your agent's private key
  • ENCRYPTION_KEY: Database encryption key
  • XMTP_ENV: Environment (dev, production)
  • CDP_API_KEY_NAME: Coinbase CDP API key name
  • CDP_API_KEY_PRIVATE_KEY: Coinbase CDP private key
  • OPENAI_API_KEY: OpenAI API key

Network Support

  • Base Sepolia: Testnet for development
  • XMTP Dev Network: For testing messaging

Agent Behavior

Group Chat Rules

  • Only responds when mentioned with @zeon or @fundraiser
  • Or when someone replies to the agent's message

Direct Messages

  • Responds to all messages automatically
  • Shows typing indicator with "πŸ‘€" reaction

Error Handling

  • Graceful retry mechanism for network issues
  • User-friendly error messages
  • Automatic reconnection

Development

Adding New Features

  1. Custom Commands: Extend processMessageWithAI function
  2. New Tools: Add tools to the AgentKit configuration
  3. Content Types: Support additional XMTP content types

Testing

npm test

Building

npm run build

Deployment

Option 1: Railway

  1. Connect your GitHub repository to Railway
  2. Add environment variables in Railway dashboard
  3. Deploy automatically

Option 2: Other Platforms

  • Heroku, Vercel, or any Node.js hosting
  • Set environment variables in your platform
  • Ensure Node.js 20+ support

Troubleshooting

Common Issues

  1. "Cannot find module '@xmtp/node-sdk'"

    • Run npm install to install dependencies
    • Ensure Node.js version is 20+
  2. "Missing environment variables"

    • Run npm run gen:keys to generate XMTP keys
    • Add your CDP and OpenAI API keys to .env
  3. Agent not responding

    • Check XMTP environment setting
    • Verify agent address is correct
    • Check console logs for errors

Getting Featured in Coinbase Wallet

To get your agent featured in Coinbase Wallet:

  1. Test thoroughly on both dev and production
  2. Ensure proper error handling
  3. Follow XMTP best practices
  4. Submit through the official form

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Support


Built with ❀️ using XMTP protocol and Coinbase AgentKit

About

Onchain ai agent build on base powered by Coinbase and XMTP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors