Documentation Index
Fetch the complete documentation index at: https://docs.sendai.fun/llms.txt
Use this file to discover all available pages before exploring further.
A modern web application built with TanStack Router, React, and Solana integration, featuring authentication via Crossmint and AI capabilities.
Features
Authentication
Secure wallet authentication powered by Crossmint’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 Radix UI components and Tailwind CSS for a sleek user experience
Type Safety
Full TypeScript support throughout the application codebase
Database Integration
PostgreSQL with Drizzle ORM for efficient data management
Tech Stack
Frontend
- React 19
- TanStack Router for type-safe routing
- Radix UI components
- Tailwind CSS for styling
Authentication
- Crossmint embedded wallet
Blockchain
- Solana Web3.js
- Solana Agent Kit
Backend & Data
AI Integration
- TypeScript
- Biome for linting and formatting
- Vinxi
Installation
Clone the repository
npx gitpick sendaifun/solana-agent-kit/examples/embedded-wallets/crossmint-sak-v2
cd crossmint-sak-v2
Set up environment variables
Create a .env file in the root directory with the following variables:VITE_CROSSMINT_SECRET=your_crossmint_secret
VITE_RPC_URL=your_solana_rpc_url
Run database migrations
pnpm db:generate
pnpm db:migrate
Development
Start the development server:
The application will be available at http://localhost:3000.
Database Management
| Command | Description |
|---|
pnpm db:generate | Generate migrations |
pnpm db:migrate | Run migrations |
pnpm db:studio | Open database studio |
pnpm db:push | Push schema changes |
pnpm db:pull | Pull schema changes |
pnpm db:check | Check schema |
pnpm db:up | Update schema |
Project Structure
src/
├── components/ # React components
├── functions/ # Server-side functions
├── hooks/ # Custom React hooks
├── lib/ # Library code and utilities
├── routes/ # Application routes
├── styles/ # Global styles
└── utils/ # Utility functions
Crossmint Integration
The application uses Crossmint to provide a seamless embedded wallet experience for users. This integration allows users to:
- Create wallets without leaving the application
- Sign transactions securely
- Manage their Solana assets
- Interact with the Solana blockchain through Agent Kit
Crossmint Integration Code Example
import { useCrossmintWallet } from '@/hooks/useCrossmintWallet';
import { SolanaAgentKit, createVercelAITools } from 'solana-agent-kit';
import TokenPlugin from '@solana-agent-kit/plugin-token';
import { PublicKey } from '@solana/web3.js';
// Custom hook to use Solana Agent Kit with Crossmint
export function useSolanaAgent() {
const { wallet, connected } = useCrossmintWallet();
// Create Solana Agent Kit instance when wallet is connected
const agent = useMemo(() => {
if (!connected || !wallet) return null;
// Initialize with the Crossmint wallet
return new SolanaAgentKit(
{
publicKey: new PublicKey(wallet.publicKey),
signTransaction: async (tx) => await wallet.signTransaction(tx),
signMessage: async (msg) => await wallet.signMessage(msg),
sendTransaction: async (tx) => {
return await wallet.sendTransaction(tx);
},
},
process.env.VITE_RPC_URL,
{}
).use(TokenPlugin);
}, [wallet, connected]);
// Create AI tools for the agent
const tools = useMemo(() => {
if (!agent) return null;
return createVercelAITools(agent, agent.actions);
}, [agent]);
return { agent, tools, connected };
}
Key Features
Secure Authentication
The Crossmint integration provides a secure authentication flow that doesn’t require users to manage private keys directly.
Wallet Creation
Users can create a new Solana wallet through Crossmint’s embedded wallet solution with just a few clicks.
Transaction Signing
The application handles transaction signing through Crossmint’s secure interface, providing a seamless experience.
AI-Powered Assistance
The integration of OpenAI with Solana Agent Kit allows for natural language interactions with the blockchain.
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.
Credits