Examples
Chat Interface
AI-powered wallet you can talk to. Just say what you want done.
The Chat Interface is an AI-powered wallet you control entirely through natural language. No buttons, no forms, no complex interfaces — just tell it what you want.
Talk to Your Wallet
You: "What's my SOL balance?"
AI: "You have 2.45 SOL (~$312) in your wallet."
You: "Swap 0.1 SOL for USDC"
AI: "Executing swap... Done! Received $67.23 USDC.
https://solscan.io/tx/..."
You: "What tokens do I hold?"
AI: "You hold:
- 2.45 SOL ($312)
- 1,250 USDC
- 50,000 BONK ($42)
Total: $1,604"What This Is
A modern chat interface that:
- Provides a user-friendly way to interact with your wallet
- Shows tool execution in real-time with collapsible details
- Supports markdown rendering with syntax highlighting
- Stores wallet credentials locally in the browser
- Uses Vercel AI SDK on the backend for LLM interactions
Installation
# Clone and install
git clone https://github.com/Jonathanthedeveloper/agentic-wallet.git
cd agent-wallet
# Install dependencies
bun install
# Build packages (required before running examples)
bun run build
# Go to chat example
cd apps/examples/saw-chat
bun run devThe app will be available at http://localhost:3000.
Configuration
Environment Variables
Create a .env file:
# Required - your LLM provider
OPENROUTER_API_KEY=your_openrouter_api_key
# Your wallet - can also be set via the UI
SOLANA_PRIVATE_KEY=your_base58_private_key
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
JUPITER_API_KEY=your_jupiter_api_keyFeatures
Clickable Example Prompts
When the chat is empty, you'll see clickable example prompts:
- Check SOL balance
- Swap tokens
- View portfolio
- Check token price
Click any example to start the conversation.
Real-Time Tool Execution
Tool calls are displayed with:
- Tool name and status (running/success/error)
- Expandable input/output details
- JSON formatting for easy reading
Markdown Rendering
Messages support full markdown with:
- Headers and bold/italic text
- Code blocks with syntax highlighting
- Links (transaction URLs, etc.)
Available Actions
Through natural language, you can:
| Action | Example |
|---|---|
| Check balance | "What's my SOL balance?" |
| Swap tokens | "Swap 0.1 SOL for USDC" |
| View holdings | "Show me all my tokens" |
| Get prices | "What is the price of BONK?" |
| Transfer | "Send 0.5 SOL to..." |
Architecture
Frontend
Built with:
- TanStack Start - Full-stack React framework
- TanStack Router - File-based routing
- Vercel AI SDK React - AI chat integration
- Tailwind CSS - Styling
Backend
The API route (/api/chat) handles:
- LLM streaming responses
- Tool execution
- Wallet operations
const result = streamText({
model: openrouter('google/gemini-3-flash-preview'),
system: SYSTEM_PROMPT,
messages: modelMessages,
tools: toVercelTools(wallet),
});Security
- Private keys are stored in browser localStorage
- Credentials are only sent to the API route, not third parties
- Use devnet for testing
- Never share your private key
Example Prompts
Try these prompts to get started:
"What's my SOL balance?"
"Swap 0.1 SOL for USDC"
"Show me all my token holdings"
"What is the price of WIF?"
"Transfer 0.5 SOL to..."