Skip to content

pythinking/onchain-agent-demo

 
 

Repository files navigation

Onchain Agent Demo

Screenshot 2024-11-07 at 9 26 56 AM

A web app that enables onchain interactions through a conversational UI using AgentKit, a collaboration between CDP SDK and OnchainKit.

Overview

This project features a Next.js frontend designed to work seamlessly with CDP's AgentKit backend. Together, they enable the creation of an AI agent capable of performing onchain operations on Base. The agent uses GPT-4 for natural language understanding and AgentKit for onchain interactions.

Key Features

  • AI-Powered Chat Interface: Interactive chat interface for natural language interactions onchain
  • Onchain Operations: Ability to perform various blockchain operations through Agentkit:
    • Deploy and interact with ERC-20 tokens
    • Create and manage NFTs
    • Check wallet balances
    • Request funds from faucet
  • Real-time Updates: Server-Sent Events (SSE) for streaming responses
  • Responsive Design: Modern UI built with Tailwind CSS
  • Wallet Integration: Secure wallet management through CDP Agentkit

Tech Stack

  • Frontend: Next.js 14, React, Tailwind CSS
  • Development: TypeScript, Biome for formatting/linting

Prerequisites

  • Bun for package management

Environment Setup

Create a .env.local file with the following variables:

NEXT_PUBLIC_API_URL= # The base URL for API requests. This must be set to the endpoint of your backend service.

Installation

  1. Install dependencies:
bun i
  1. Start the development server:
bun dev

Development

  • Format code: bun run format
  • Lint code: bun run lint
  • Run CI checks: bun run ci:check

License

See LICENSE.md for details.

Contributing

See CONTRIBUTING.md for guidelines on how to contribute to this project.

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.0%
  • CSS 1.5%
  • JavaScript 0.5%