Skip to main content

Solana Integration Guide for Farcaster Mini Apps

Guide for using Solana wallet features in your Farcaster Mini App template.

How It Works

Conditional Solana Support

Not all Farcaster clients support Solana wallets, so your app should gracefully handle both scenarios.

Sign Message

Solana message signing requires converting text to bytes and handling the response properly for browser compatibility.

Send Transaction

Solana transactions require proper setup including blockhash, simulation, and error handling.

Key Points

  • Always check useHasSolanaProvider() before rendering Solana UI
  • Use TextEncoder and btoa for browser-compatible message signing
  • Simulate transactions before sending to catch errors early
  • Import Solana hooks from @solana/wallet-adapter-react not @farcaster/mini-app-solana
  • Replace placeholder addresses with real addresses for your app

Custom Program Interactions

For calling your own Solana programs, you’ll need to serialize instruction data and handle program-derived addresses.
For advanced contract interactions, token transfers, and error handling patterns, see the template’s Demo.tsx component.