Skip to main content
The AI chat interface is the core of Synto Mobile, providing an intelligent conversational experience that understands your blockchain intents and executes them seamlessly. Built with React Native and powered by AI SDK, it offers real-time responses with tool execution capabilities.

Overview

The chat interface combines natural language processing with Solana blockchain operations, allowing users to:
  • Swap tokens using conversational commands
  • Check balances and token information
  • Lend and stake assets through DeFi protocols
  • Execute complex blockchain operations without technical knowledge
All blockchain operations require wallet connection and user confirmation through the Mobile Wallet Adapter protocol.

Chat architecture

The chat system is built on three core components:

Multi-chat manager

Handles multiple conversation threads with persistent storage

AI agent

Processes natural language and executes blockchain tools

Tool manager

Orchestrates tool invocations with visual feedback

Multi-chat system

The useMultiChat hook manages conversation history and persistence:
const {
  currentChat,
  currentChatId,
  chatList,
  createNewChat,
  loadChat,
  deleteChat,
  updateChatTitle,
  syncMessages,
  isLoadingChat,
  isLoadingList
} = useMultiChat();
Key capabilities:
  • Persistent storage: All conversations are saved locally using AsyncStorage
  • Auto-titling: Chat titles are automatically generated from the first user message
  • Smart sync: Messages sync automatically without race conditions
  • Metadata tracking: Last message, message count, and timestamps are maintained
Chats are stored in AsyncStorage with automatic title generation. Default title “New Chat” updates after the first message.

Starting a conversation

Users can begin interacting with the AI through multiple entry points:
1

Launch the app

Open Synto Mobile and navigate to the chat tab. The most recent conversation loads automatically.
2

Use suggestion cards

Tap one of the pre-built suggestion cards to instantly start a blockchain operation:
  • “Swap 0.001 SOL to USDC” (Jupiter)
  • “Lend 0.01 sol, against USDC” (Rainfi)
  • “Stake 0.01 SOL with Jupiter”
Some suggestion cards may reference features in development.
3

Type your query

Enter any blockchain-related question or command in the input field. The AI understands natural language.

Suggestion cards

Suggestion cards provide quick access to common operations:
const suggestionCards = [
  {
    text: "Swap 0.001 SOL to USDC",
    image: require("@/assets/tool-logos/jupiter-logo.png"),
  },
  {
    text: "Lend 0.01 sol, against USDC",
    image: require("@/assets/tool-logos/rainfi-logo.png"),
  },
  {
    text: "Deposit 5 USDC on Lulo",
    image: require("@/assets/tool-logos/lulo-logo.png"),
  },
  {
    text: "Stake 0.01 SOL with Jupiter",
    image: require("@/assets/tool-logos/jupiter-logo.png"),
  },
];
Each card displays the protocol logo and a descriptive action, making it easy for users to discover capabilities.

Message handling

Messages flow through a sophisticated rendering pipeline:

User messages

  • Right-aligned bubbles: Displayed with dark background (#202020)
  • 85% max width: Ensures readability on all screen sizes
  • Fade-in animation: Smooth entrance using react-native-reanimated

Assistant messages

  • Left-aligned bubbles: Card background with subtle border
  • Interactive actions: Copy and regenerate buttons
  • Tool invocations: Embedded execution UI with protocol logos
const renderActionButtons = () => {
  if (message.role !== "assistant") return null;
  
  return (
    <View style={{ flexDirection: "row", gap: 8, marginTop: 12 }}>
      {!isLoading && (
        <TouchableOpacity onPress={handleCopy}>
          <UiIconSymbol 
            name={isCopied ? "checkmark" : "doc.on.doc"} 
            size={14} 
          />
        </TouchableOpacity>
      )}
      
      {!isLoading && isLast && (
        <TouchableOpacity onPress={handleRegenerate}>
          <UiIconSymbol 
            name="arrow.clockwise" 
            size={14} 
          />
        </TouchableOpacity>
      )}
    </View>
  );
};
Users can copy any assistant message to the clipboard by tapping the document icon. A checkmark appears for 2 seconds to confirm.

Tool execution workflow

When the AI determines a blockchain operation is needed, it invokes tools:
1

Tool invocation

The AI returns a tool call with parameters extracted from the conversation:
{
  toolCallId: "call_123",
  toolName: "TRADE",
  args: {
    inputMint: "So11111111111111111111111111111111111111112",
    outputMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    amount: 0.001
  }
}
2

Visual confirmation

A tool card appears showing:
  • Protocol logo (Jupiter, Lulo, Rainfi, etc.)
  • Tool name formatted for readability
  • All parameters with values
  • “Execute Tool” button
3

User approval

User taps “Execute Tool” to proceed. The button shows a loading spinner during execution.
4

Blockchain execution

The tool manager calls the Solana agent to:
  • Build the transaction
  • Request wallet signature via Mobile Wallet Adapter
  • Send to blockchain
  • Wait for confirmation
5

Result display

Success or error result is displayed inline with the tool card, including transaction signatures.

Tool manager component

The ToolManager component handles the execution lifecycle:
const handleToolExecution = async () => {
  if (!agent || !addToolResult) return;
  
  setIsExecuting(true);
  try {
    const action = agent.actions.find((a) => a.name === toolName);
    if (!action) throw new Error(`Tool not found: ${toolName}`);
    
    const result = await executeAction(action, agent, args);
    
    addToolResult({
      toolCallId,
      result: JSON.stringify({ ...result, success: true })
    });
  } catch (error) {
    addToolResult({
      toolCallId,
      result: JSON.stringify({ success: false, error })
    });
  } finally {
    setIsExecuting(false);
  }
};
Tool execution requires user interaction. The AI cannot execute transactions without explicit user approval through the “Execute Tool” button.

Supported tools

Synto Mobile currently integrates with the following Solana protocols:
ProtocolToolsStatus
JupiterToken swaps, staking, price fetching✅ Fully implemented
RainfiLoan quotes, transaction builder, loan management, repayment✅ Fully implemented
DexScreenerToken data and analytics✅ Fully implemented
SolanaBalance checks, transfers, airdrops, TPS✅ Fully implemented
The UI includes suggestion cards and tool registry entries for additional protocols (Lulo, Pyth, Rugcheck, Mayan, deBridge), but these integrations are not yet fully implemented in the current version.

Chat history

Users can manage multiple conversations through the history overlay:

Opening history

Tap the menu icon in the chat header to reveal the history panel, which slides in from the left.

History features

Search conversations

Filter chats by title or message content using the search bar

Create new chat

Start fresh conversations while preserving existing ones

Switch chats

Tap any conversation to load it instantly

Delete chats

Remove conversations with confirmation dialog

Chat list display

Each conversation card shows:
  • Title: Auto-generated or custom name
  • Last message: Preview of most recent content
  • Message count: Total messages in the thread
  • Timestamp: Relative time (e.g., “2h ago”, “Mon”, “Mar 3”)
  • Active indicator: Blue highlight for current chat
const formatDate = (timestamp: number) => {
  const date = new Date(timestamp);
  const now = new Date();
  const diffInHours = (now.getTime() - date.getTime()) / (1000 * 60 * 60);
  
  if (diffInHours < 24) {
    return date.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
  } else if (diffInHours < 168) {
    return date.toLocaleDateString([], { weekday: "short" });
  } else {
    return date.toLocaleDateString([], { month: "short", day: "numeric" });
  }
};

Input methods

The chat input supports multiple interaction modes:

Text input

  • Multiline support: Automatically expands up to 120px height
  • Smart placeholder: “Ask anything” prompt
  • Auto-trimming: Leading/trailing whitespace removed
  • Submit on send: Tap the waveform icon to send

Voice input (coming soon)

The microphone icon is present but voice recognition is not yet implemented.

Attachments (coming soon)

The plus icon is present but file attachments are not yet implemented.
The input field uses TextInput with multiline enabled and textAlignVertical="center" for optimal mobile UX.

Loading states

The interface provides clear feedback during operations:

Chat loading

  • Conversation list loads with isLoadingList state
  • Individual chat loads with isLoadingChat state
  • Empty state shown for no conversations

Message streaming

  • Assistant messages appear word-by-word during AI generation
  • Typing indicators during processing
  • Action buttons disabled while loading

Tool execution

  • Loading spinner replaces the execute button
  • Parameters remain visible during execution
  • Result section appears with colored border (green for success)

Animations

Smooth animations enhance the user experience:
import Animated, { FadeIn, FadeInDown, FadeInUp } from "react-native-reanimated";

// Message entrance
<Animated.View entering={FadeIn.duration(300)}>
  {/* Message content */}
</Animated.View>

// Suggestion cards
<Animated.View entering={FadeInUp.delay(200).duration(600)}>
  {/* Suggestions */}
</Animated.View>

// Input field
<Animated.View entering={FadeInDown.delay(400).duration(600)}>
  {/* Chat input */}
</Animated.View>
All animations use react-native-reanimated for 60fps performance.

Error handling

The chat interface gracefully handles failures:
  • Tool execution errors: Displayed inline with error details
  • Network failures: Error messages in assistant responses
  • Invalid parameters: AI explains what went wrong
  • Wallet disconnection: Prompts user to reconnect
If a tool execution fails due to authorization errors, the wallet may be automatically disconnected and require reconnection.

Best practices

1

Be specific

Include amounts, token symbols, and protocol names for faster execution:
  • Good: “Swap 0.5 SOL to USDC on Jupiter”
  • Vague: “Swap some tokens”
2

Review parameters

Always check the tool parameters before executing. The AI may misunderstand complex requests.
3

Use suggestions

Start with suggestion cards to learn the AI’s capabilities and command patterns.
4

Organize conversations

Create new chats for different types of operations to keep history organized.

Next steps

Wallet operations

Learn about balance management and token transfers

Mobile Wallet Adapter

Understand how transactions are signed securely

Build docs developers (and LLMs) love