A sophisticated domain intelligence platform powered by AI that enables seamless domain tokenization, portfolio management, and cross-chain operations through the Doma Protocol ecosystem with intuitive conversational interfaces.
Nexus combines the power of AI conversation flows with blockchain technology to create an intuitive platform for domain intelligence and management. Users interact with an AI assistant that guides them through domain tokenization, portfolio analysis, and cross-chain operations within the Doma Protocol ecosystem.
- AI-Powered Domain Intelligence: Advanced conversation flow with Google Gemini AI specialized in domain analysis
- Domain Tokenization: Seamless domain tokenization through Doma Protocol integration
- Cross-Chain Portfolio Management: Multi-chain domain portfolio tracking and management
- Mobile-Responsive Design: Optimized for all device sizes
- Secure Wallet Integration: Privy authentication with embedded wallets
- Real-time Analytics: Live domain scoring and market insights
- Automated Domain Operations: Smart triggering of domain transactions after conversation milestones
- Comprehensive Domain Intelligence: Advanced analytics, scoring, and market trend analysis
The project consists of two main components:
- Blockchain: Morph Holesky Testnet
- Main Contract: FiatBridge.sol - Handles USDT to fiat conversions
- Framework: Foundry for development, testing, and deployment
- Key Features: Multi-token support, fee management, liquidity pools
- Framework: Next.js 15 with TypeScript
- Styling: Tailwind CSS
- Blockchain Integration: Wagmi + Viem
- Authentication: Privy wallet connection
- AI Integration: Google Gemini API
- Payment Processing: Paystack API for Nigerian banking
- Next.js 15.3.5 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Wagmi 2.16.0 - Ethereum development framework
- Viem 2.33.1 - Low-level Ethereum interactions
- Privy - Wallet authentication and management
- React Query - Server state management
- Lucide React - Icon library
- Solidity ^0.8.19 - Smart contract language
- Foundry - Development toolkit
- OpenZeppelin - Security libraries
- Morph Holesky - Testnet deployment
- Google Gemini AI - Conversational AI
- Paystack API - Nigerian payment processing
- Morph RPC - Blockchain connectivity
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- npm or yarn
- Git
- Foundry (for smart contract development)
git clone https://github.com/leojay-net/DEX-CHAT.git
cd DEX-CHATcd contracts
# Install Foundry dependencies
forge install
# Compile contracts
forge build
# Run tests
forge test
# Deploy to testnet (configure .env first)
forge script script/DeployFiatBridge.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcastcd dex_with_fiat_frontend
# Install dependencies
npm install
# Copy environment variables
cp .env.example .env.localCreate .env.local in the frontend directory:
# AI Configuration
NEXT_PUBLIC_GEMINI_API_KEY=your_gemini_api_key
# Wallet Authentication
NEXT_PUBLIC_PRIVY_APP_ID=your_privy_app_id
# Blockchain Configuration
NEXT_PUBLIC_CHAIN_ID=2810
NEXT_PUBLIC_RPC_URL=https://rpc-holesky.morphl2.io
# Contract Addresses
NEXT_PUBLIC_USDT_ADDRESS=0x3Dc887F12aF3565A2D28FC06492Aa698E6313Cf7
NEXT_PUBLIC_FIAT_BRIDGE_ADDRESS=0xf59Dd62E5721425ca86666060dD66B8d4fA5E900
# Payment Processing
PAYSTACK_SECRET_KEY=your_paystack_secret_key
NEXT_PUBLIC_PAYSTACK_PUBLIC_KEY=your_paystack_public_key
# Application Settings
NEXT_PUBLIC_APP_NAME=Fiat Off-ramping
NEXT_PUBLIC_APP_URL=http://localhost:3000# Start development server
npm run dev
# Build for production
npm run build
# Start production server
npm startThe application will be available at http://localhost:3000
- Connect Wallet: Use the wallet connection interface to authenticate
- Start Conversation: Begin chatting with the AI assistant about your conversion needs
- Provide Details: Share your USDT amount and Nigerian bank account details
- Automatic Trigger: After 5 consecutive chat messages, the system will prompt for transaction confirmation
- Bank Verification: Your bank account will be verified via Paystack API
- Execute Transaction: Confirm the smart contract transaction
- Receive Funds: NGN will be transferred to your verified bank account
SimpleEthereumChatInterface: Main chat interface with AI integrationSimpleEthereumFiatModal: USDT to fiat conversion modalSimpleEthereumWalletConnection: Wallet authentication componentuseChat: Custom hook for conversation managementethereumContract: Smart contract interaction utilities
// Conversation state tracking
interface ConversationState {
messageCount: number;
hasUserCancelled: boolean;
usdtAmount: string;
bankDetails: BankDetails;
shouldTriggerTransaction: boolean;
}The main contract handles:
- USDT token approvals and transfers
- Fee calculations and deductions
- Request lifecycle management
- Event emission for frontend tracking
function initiateOfframp(
address token,
uint256 amount,
string memory bankAccount,
string memory bankCode,
string memory accountName
) external;- USDT Token:
0x3Dc887F12aF3565A2D28FC06492Aa698E6313Cf7 - FiatBridge:
0xf59Dd62E5721425ca86666060dD66B8d4fA5E900
The application integrates with Paystack for:
- Bank List Retrieval: Get all supported Nigerian banks
- Account Verification: Verify account numbers and names
- Real-time Validation: Instant feedback during form completion
// Get list of banks
GET /bank
// Verify account number
GET /bank/resolve?account_number=${accountNumber}&bank_code=${bankCode}- Wallet Security: Privy-powered authentication with embedded wallets
- Smart Contract Security: OpenZeppelin security libraries
- Input Validation: Comprehensive form validation and sanitization
- Error Handling: Graceful error handling with user feedback
- Type Safety: Full TypeScript implementation
cd contracts
forge test --gas-reportcd dex_with_fiat_frontend
npm run testThe application is fully responsive with:
- Hamburger Menu: Collapsible navigation for mobile
- Touch-Optimized: Large touch targets and smooth interactions
- Responsive Layouts: Adaptive design for all screen sizes
- Mobile-First: Progressive enhancement approach
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel --prodcd contracts
forge script script/DeployFiatBridge.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast --verify- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow TypeScript best practices
- Use ESLint and Prettier for code formatting
- Write comprehensive tests for new features
- Update documentation for significant changes
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub Issues: Report bugs or request features
- Documentation: Check the individual README files in
/contractsand/dex_with_fiat_frontend - Community: Join our discussions in GitHub Discussions
- Morph Network - For providing the L2 infrastructure
- Paystack - For Nigerian payment processing
- Google Gemini - For AI conversation capabilities
- Privy - For seamless wallet authentication
- OpenZeppelin - For secure smart contract libraries
Built with love for the future of decentralized finance in Africa