Turnkey Agent Starter
Modern web application with Turnkey wallet integration for Solana Agent Kit
A modern web application built with Next.js and Solana integration, featuring authentication via Turnkey and AI capabilities.
Features
Authentication
Secure user authentication powered by Turnkey’s embedded wallet solution
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
Category | Technologies |
---|---|
Framework | Next.js |
Authentication | Turnkey |
Blockchain | Solana Web3.js, Solana Agent Kit |
Styling | Tailwind CSS |
AI | OpenAI SDK |
Development | TypeScript |
Installation
Clone the repository
Install dependencies
Set up environment variables
Create a .env.local
file in the root directory with the following variables:
Development
Start the development server:
The application will be available at http://localhost:3000
.
Project Structure
Turnkey Integration
This starter uses Turnkey to provide a secure embedded wallet experience. Turnkey offers several advantages for Solana Agent Kit applications:
- Enhanced Security: Private keys are stored in secure enclaves
- Programmatic Control: Fine-grained control over wallet operations
- Customizable Policies: Set rules and limits for transactions
- Multi-user Support: Easily manage wallets for multiple users
Key Benefits
Secure Authentication Flow
With Turnkey, this starter provides a secure authentication flow that protects users’ private keys. Unlike traditional wallets, private keys are never exposed to the application or the user.
Fine-grained Transaction Control
The integration allows for fine-grained control over transactions, making it possible to:
- Implement approval workflows
- Set transaction limits
- Create custom authorization rules
- Apply spending controls
Seamless User Experience
Users can interact with the Solana blockchain through natural language, with the AI assistant handling the technical details. This creates a seamless experience for both blockchain beginners and experienced users.
AI Integration
The starter leverages the OpenAI API to process natural language requests and convert them into Solana Agent Kit actions. This allows users to:
- Check balances
- Transfer tokens
- Swap tokens
- Get token information
- And much more…
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.