Demo

Features

Phantom Authentication

Secure user authentication powered by Phantom wallet

Solana Integration

Built with Solana Agent Kit for blockchain interactions and transactions

AI Capabilities

OpenAI integration for intelligent features and natural language interactions

Modern UI

Built with modern UI components and Tailwind CSS for a sleek user experience

Type Safety

Full TypeScript support throughout the application codebase

Tech Stack

CategoryTechnologies
FrameworkNext.js
AuthenticationPhantom
BlockchainSolana Web3.js, Solana Agent Kit
StylingTailwind CSS
AIOpenAI SDK
DevelopmentTypeScript

Installation

1

Create a new project using gitpick

npx gitpick sendaifun/solana-agent-kit/examples/phantom-agent-starter -b v2
cd phantom-agent-starter
2

Install dependencies

pnpm install
3

Set up environment variables

Create a .env.local file in the root directory with the following variables:

# Solana configuration
NEXT_PUBLIC_RPC_URL=your_solana_rpc_url

# OpenAI API key
OPENAI_API_KEY=your_openai_api_key

Development

Start the development server:

pnpm dev

The application will be available at http://localhost:3000.

Project Structure

src/app
├── components/     # UI components
├── chat/           # /chat route
└── utils/          # Utility functions

Phantom Integration

This starter uses Phantom wallet to provide a seamless authentication experience. Phantom is one of the most popular wallets in the Solana ecosystem and offers several advantages:

  • Wide Adoption: Millions of users already have Phantom installed
  • Simple Connection: Connect with just a few clicks
  • Built-in Security: Hardware wallet support and security features
  • Mobile Support: Works across desktop and mobile

Wallet Adapter Setup

This starter utilizes the Solana Wallet Adapter library to connect with Phantom. The setup includes configuration for the wallet adapter provider:

Chat Implementation

The starter includes a chat interface that allows users to interact with the Solana blockchain through natural language:

AI Integration

The starter uses the OpenAI API to process natural language requests and execute Solana transactions:

This is a starter template and may not include all features or optimizations for production use (e.g the use of the OpenAI API key on the client). Please review and modify as necessary for your specific use case.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.