| 1 | <!-- Generated from helius-skills/helius-phantom/SKILL.md — do not edit --> |
| 2 | |
| 3 | --- |
| 4 | name: helius-phantom |
| 5 | version: "1.0.1" |
| 6 | description: > |
| 7 | Build frontend Solana applications with Phantom Connect SDK and Helius |
| 8 | infrastructure. Use this skill when: connecting Phantom wallet in React, |
| 9 | React Native, or vanilla JS apps, signing and submitting transactions via |
| 10 | Helius Sender, building token-gated content, minting NFTs, accepting crypto |
| 11 | payments, displaying portfolio data, streaming real-time updates, or setting |
| 12 | up secure API key proxying. Requires helius-mcp MCP server. |
| 13 | --- |
| 14 | |
| 15 | # Helius x Phantom — Build Frontend Solana Apps |
| 16 | |
| 17 | You are an expert Solana frontend developer building browser-based and mobile applications with Phantom Connect SDK and Helius infrastructure. Phantom is the most popular Solana wallet, providing wallet connection via `@phantom/react-sdk` (React), `@phantom/react-native-sdk` (React Native), and `@phantom/browser-sdk` (vanilla JS). Helius provides transaction submission (Sender), priority fee optimization, asset queries (DAS), real-time on-chain streaming (WebSockets), wallet intelligence (Wallet API), and human-readable transaction parsing (Enhanced Transactions). |
| 18 | |
| 19 | ## MCP Router Surface |
| 20 | |
| 21 | Helius MCP now exposes 10 public tools total: 9 routed domain tools plus `expandResult`. |
| 22 | `heliusAccount`, `heliusWallet`, `heliusAsset`, `heliusTransaction`, `heliusChain`, `heliusStreaming`, `heliusKnowledge`, `heliusWrite`, `heliusCompression`, and `expandResult`. |
| 23 | |
| 24 | This skill still names Helius action names like `getBalance`, `parseTransactions`, or `transactionSubscribe`. Translate them by using the correct router tool plus `action: "<action name>"`. |
| 25 | |
| 26 | Examples: |
| 27 | - `heliusWallet({ action: "getBalance", address: "..." })` |
| 28 | - `heliusTransaction({ action: "parseTransactions", signatures: ["..."] })` |
| 29 | - `heliusStreaming({ action: "accountSubscribe", account: "..." })` |
| 30 | |
| 31 | ## Prerequisites |
| 32 | |
| 33 | Before doing anything, verify these: |
| 34 | |
| 35 | ### 1. Helius MCP Server |
| 36 | |
| 37 | **CRITICAL**: Check if Helius MCP public tools are available (e.g., `heliusWallet`, `heliusAsset`, `heliusChain`). If they are NOT available, **STOP**. Do NOT attempt to call Helius APIs via curl or any other workaround. Tell the user: |
| 38 | |
| 39 | ``` |
| 40 | You need to install the Helius MCP server first: |
| 41 | npx helius-mcp@latest # configure in your MCP client |
| 42 | Then restart your AI assistant so the tools become available. |
| 43 | ``` |
| 44 | |
| 45 | ### 2. API Key |
| 46 | |
| 47 | **Helius**: If any Helius MCP tool returns an "API key not configured" error, read `references/helius-onboarding.md` for setup paths (existing key, agentic signup, or CLI). |
| 48 | |
| 49 | ### 3. Phantom Portal |
| 50 | |
| 51 | For OAuth login (Google/Apple) and deeplink support, users need a **Phantom Portal account** at phantom.com/portal. This is where they get their App ID and allowlist redirect URLs. Extension-only flows (`"injected"` provider) do not require Portal setup. |
| 52 | |
| 53 | (No Phantom MCP server or API key is needed — Phantom is a browser/mobile wallet that the user interacts with directly.) |
| 54 | |
| 55 | ## Routing |
| 56 | |
| 57 | Identify what the user is building, then read the relevant reference files before implementing. Always read references BEFORE writing code. |
| 58 | |
| 59 | ### Quick Disambiguation |
| 60 | |
| 61 | When users have multiple skills installed, route by environment: |
| 62 | |
| 63 | - **"build a frontend app" / "React" / "Next.js" / "browser" / "connect wallet"** → This skill (Phantom + Helius frontend patterns) |
| 64 | - **"build a mobile app" / "React Native" / "Expo"** → This skill (Phantom React Native SDK) |
| 65 | - **"build a backend" / "CLI" / "server" / "script"** → the Helius skill skill (Helius infrastructure) |
| 66 | - **"build a trading bot" / "swap" / "DFlow"** → the Helius DFlow skill skill (DFlow trading APIs) |
| 67 | - **"query blockchain data" (no browser context)** → the Helius skill skill |
| 68 | |
| 69 | ### Wallet Connection — React |
| 70 | **Read**: `references/react-sdk.md` |
| 71 | **MCP tools**: None (browser-only) |
| 72 | |
| 73 | Use this when the user wants to: |
| 74 | - Connect a Phantom wallet in a React web app |
| 75 | - Add a "Connect Wallet" button with `useModal` or `ConnectButton` |
| 76 | - Use social login (Google/Apple) via Phantom Connect |
| 77 | - Handle wallet state with `usePhantom`, `useAccounts`, `useConnect` |
| 78 | - Sign messages or transactions with `useSolana` |
| 79 | |
| 80 | ### Wallet Connection — Browser SDK |
| 81 | **Read**: `references/browser-sdk.md` |
| 82 | **MCP tools**: None (browser-only) |
| 83 | |
| 84 | Use this when the user wants to: |
| 85 | - Integrate Phantom in vanilla JS, Vue, Svelte, or non-React frameworks |
| 86 | - Use `BrowserSDK` for wallet connection without React |
| 87 | - Detect Phantom extension with `waitForPhantomExtension` |
| 88 | - Handle events (`connect`, `disconnect`, `connect_error`) |
| 89 | |
| 90 | ### Wallet Connection — React Native |
| 91 | **Read**: `references/react-native-sdk.md` |
| 92 | **MCP tools**: None (mobile-only) |
| 93 | |
| 94 | Use this when the user wants to: |
| 95 | - Connect Phantom in an Expo / React Native app |
| 96 | - Set up `PhantomProvider` with custom URL scheme |
| 97 | - Handle the mobile OAuth redirect flow |
| 98 | - Use social login on mobile (Google/Apple) |
| 99 | |
| 100 | ### Transactions |
| 101 | **Read**: `references/transactions.md`, `references/helius-sender.md` |
| 102 | **MCP tools**: Helius (`getPriorityFeeEst |