This is a simple Next.js application that demonstrates how to use the Phantom React SDK to connect to Phantom wallet and sign Solana messages.
- Connect/disconnect Phantom wallet
- Display wallet addresses when connected
- Sign Solana messages
- Modern UI with Tailwind CSS
- Install dependencies:
yarn install- Run the development server:
yarn dev-
Open http://localhost:3000 in your browser
-
Install Phantom browser extension if you haven't already
-
Click "Connect Phantom Wallet" and follow the prompts
-
Once connected, you can view your Solana address and sign a test message
- Uses
PhantomProviderfrom@phantom/react-sdkto wrap the app useConnecthook provides connection state and methodsuseSolanahook gives access to Solana-specific functionality- Configured for Solana only in this example
- Next.js 15.5.3 with App Router
- TypeScript
- Tailwind CSS
- @phantom/react-sdk