dflow-phantom-connect
Build Solana wallet-connected apps with Phantom Connect SDKs and DFlow trading. Use when user asks to connect a Phantom wallet, integrate Phantom in React, React Native, or vanilla JS, sign messages or transactions, build token-gated pages, mint NFTs, accept crypto payments, swap tokens with DFlow, trade prediction markets, or integrate Proof KYC verification. Covers @phantom/react-sdk, @phantom/react-native-sdk, @phantom/browser-sdk, DFlow spot trading, DFlow prediction markets, and DFlow Proof identity verification. Do NOT use for Ethereum or EVM wallet integrations, or non-DFlow DEX routing.
- License 许可
- MIT
- 最近更新
- 2026-11-02
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- dflow-phantom-connect
- license
- MIT
- metadata
- { "tags": [ "solana", "phantom", "wallet", "trading", "prediction-markets", "kyc" ], "author": "DFlow & Phantom Connect", "version": "1.0.0", "mcp-server": "pond.dflow.net/mcp" }
- description
- Build Solana wallet-connected apps with Phantom Connect SDKs and DFlow trading. Use when user asks to connect a Phantom wallet, integrate Phantom in React, React Native, or vanilla JS, sign messages or transactions, build token-gated pages, mint NFTs, accept crypto payments, swap tokens with DFlow, trade prediction markets, or integrate Proof KYC verification. Covers @phantom/react-sdk, @phantom/react-native-sdk, @phantom/browser-sdk, DFlow spot trading, DFlow prediction markets, and DFlow Proof identity verification. Do NOT use for Ethereum or EVM wallet integrations, or non-DFlow DEX routing.
02 资源文件 13
- 参考文档metadata.json789 B
- 参考文档references/browser-sdk.md8.1 KB
- 参考文档references/dflow-crypto-trading.md5.7 KB
- 参考文档references/dflow-prediction-markets.md9.9 KB
- 参考文档references/dflow-proof.md2.5 KB
- 参考文档references/dflow-websockets.md2.3 KB
- 参考文档references/nft-minting.md4.6 KB
- 参考文档references/payments.md5.5 KB
- 参考文档references/react-native-sdk.md7.2 KB
- 参考文档references/react-sdk.md7.1 KB
- 参考文档references/token-gating.md4.9 KB
- 参考文档references/transactions.md5.1 KB
- 参考文档verification.json3.3 KB
03 SKILL.md 正文
Phantom Connect + DFlow Skill
Instructions
Step 1: Identify What the User Wants to Build
Determine the domain, then route to the right references.
Wallet connection and Solana interactions:
- Connecting a Phantom wallet (React, React Native, vanilla JS)
- Signing messages or transactions
- Token-gated access
- NFT minting
- Crypto payments
- Solana transfers (SOL or SPL tokens)
DFlow trading:
- Spot token swaps (imperative or declarative)
- Prediction market discovery, trading, and redemption
- Proof KYC identity verification
Many tasks combine both (e.g., a swap UI needs wallet connection AND DFlow trading). Read all relevant references before writing code.
Step 2: Read the Relevant References
Phantom Connect SDKs (wallet connection, signing, auth):
references/react-sdk.md— React hooks, components, theming, PhantomProviderreferences/react-native-sdk.md— Expo config, polyfills, deep links, mobile authreferences/browser-sdk.md— BrowserSDK init, events, wallet discovery, vanilla JS
Solana patterns (transactions, gating, minting, payments):
references/transactions.md— SOL/SPL transfers, signing, fee estimationreferences/token-gating.md— client-side and server-side token-gated accessreferences/nft-minting.md— mint pages, Metaplex Core, compressed NFTsreferences/payments.md— SOL/USDC payments, checkout with backend verification
DFlow trading (swaps, prediction markets, KYC):
references/dflow-crypto-trading.md— spot token swaps, imperative vs declarative trades, slippage, priority fees, platform feesreferences/dflow-prediction-markets.md— market discovery, trading, redemption, maintenance windows, fee modelsreferences/dflow-websockets.md— real-time price, trade, and orderbook streaming via WebSocketreferences/dflow-proof.md— Proof KYC verification (required for prediction market trades, usable for any gated feature)
Step 3: Ask the Right Questions
Before implementing, ask questions based on the domain:
For Phantom Connect tasks:
- Which platform? (React, React Native, vanilla JS)
- Do they need social login (Google/Apple) or extension only?
For DFlow spot trades:
- Imperative or declarative? If unsure, suggest starting with imperative.
- Dev or production endpoints? If production, remind them to apply for an API key at pond.dflow.net/build/api-key.
- Platform fees? If yes, what bps and what fee account?
- Client environment? (web, mobile, backend, CLI)
For DFlow prediction markets:
- Settlement mint? (USDC or CASH — these are the only two)
- Dev or production endpoints? If production, remind them to apply for an API key at pond.dflow.net/build/api-key.
- Platform fees? If yes, use
platformFeeScalefor dynamic fees. - Client environment? (web, mobile, backend, CLI)
Step 4: Implement
Follow the patterns in the reference files. Key rules by domain:
Phantom Connect:
- All SDK details (provider setup, hooks, components, auth providers) are in the SDK reference files. Read them before writing Phantom integration code.
DFlow Trading:
- Dev endpoints (
dev-quote-api.dflow.net,dev-prediction-markets-api.dflow.net,wss://dev-prediction-markets-api.dflow.net/api/v1/ws) work without an API key but are rate-limited. Production requires a key from pond.dflow.net/build/api-key. - Prediction market trades require Proof KYC before buying or selling outcome tokens. Browsing and discovery do not require KYC.
- Prediction markets also require geoblocking for restricted jurisdictions.
Step 5: Handle Errors
Each reference file contains domain-specific error handling. Key cross-cutting concerns:
- User rejects a transaction or signature request
- Wallet not connected when a signed action is attempted
- DFlow API returns 429 (rate limited) — retry with backoff or get a production API key
route_not_foundfrom DFlow — check amount units (must be atomic), check liquidity, check mint addresses
Examples
Example 1: React wallet connection
User says: "Add Phantom wallet login to my Next.js app"
Actions:
- Read
references/react-sdk.md - Install
@phantom/react-sdk - Wrap app in PhantomProvider with desired auth providers and appId
- Use
useModalhook for a connect button - Use
useAccountsto display the connected wallet address
Result: Working wallet connection with social login and extension support
Example 2: Token-gated page
User says: "Build a page that only BONK holders can see"
Actions:
- Read
references/react-sdk.mdandreferences/token-gating.md - Set up wallet connection
- Query the BONK token balance for the connected wallet
- Conditionally render content based on balance threshold
- For production: add server-side signature verification
Result: Page that checks wallet token balance and gates content
Example 3: DFlow token swap
User says: "Add a swap feature using DFlow"
Actions:
- Ask: imperative or declarative? Platform fees? Client environment?
- Read
references/dflow-crypto-trading.md - If unsure on trade type, suggest imperative
/orderflow (simpler, synchronous) - Connect wallet with Phantom, sign and submit transaction to Solana RPC
Result: Working swap UI with DFlow routing
Example 4: Prediction market trade
User says: "Let users buy YES/NO positions on prediction markets"
Actions:
- Ask: settlement mint (USDC or CASH)? Platform fees? Client environment?
- Read
references/dflow-prediction-markets.mdandreferences/dflow-proof.md - Build market discovery UI from Metadata API
- Gate trades behind Proof KYC verification
- Use /order endpoint to trade settlement mint into outcome tokens
Result: Prediction market UI with KYC-gated trading
Example 5: Swap UI with wallet connection
User says: "Build a full swap page with wallet connect and DFlow"
Actions:
- Ask: which platform? Imperative or declarative swap? Platform fees?
- Read the relevant SDK reference AND
references/dflow-crypto-trading.md - Set up wallet connection with Phantom
- Build swap form, proxy
/ordercalls through backend - Sign transaction with connected wallet, submit to RPC
Result: End-to-end swap page combining Phantom wallet and DFlow trading
Resources
- Phantom Portal: phantom.com/portal
- Phantom Docs: docs.phantom.com
- SDK Examples: github.com/phantom/wallet-sdk/tree/main/examples
- Phantom MCP Server: docs.phantom.com/resources/mcp-server
- DFlow MCP Server: pond.dflow.net/mcp
- DFlow MCP Docs: pond.dflow.net/build/mcp
- DFlow Docs: pond.dflow.net/introduction
- DFlow Cookbook: github.com/DFlowProtocol/cookbook
04 同仓库更多 Skills
youtube-clipper
YouTube 视频智能剪辑工具。下载视频和字幕,AI 分析生成精细章节(几分钟级别), 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频,并生成总结文案。 使用场景:当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词:视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video
viem-integration
Integrate EVM blockchains using viem. Use when user says "read blockchain data", "send transaction", "interact with smart contract", "connect to Ethereum", "use viem", "use wagmi", "wallet integration", "viem setup", or mentions blockchain/EVM development with TypeScript.
v4-security-foundations
Security-first Uniswap v4 hook development. Use when user mentions "v4 hooks", "hook security", "PoolManager", "beforeSwap", "afterSwap", or asks about V4 hook best practices, vulnerabilities, or audit requirements.
v4-sdk-integration
App-layer SDK guide for building swap and liquidity experiences directly with the Uniswap v4 SDK. Use when user asks about "v4 sdk", "uniswap v4", "v4 swap", "v4 liquidity", "PoolManager", "V4Planner", "StateView", "PositionManager", "pool state", "v4 position", "uniswap sdk", or when building swap/liquidity UX directly with SDKs rather than via the Trading API.
v4-hook-generator
Generate Uniswap v4 hook contracts via OpenZeppelin MCP. Use when building custom swap logic, async swaps, hook-owned liquidity, custom curves, dynamic fees, MEV protection, limit orders, or oracle hooks.
testing
For testing with Light Protocol programs and clients on localnet, devnet, and mainnet validation.