技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
dflow-phantom-connect【数据与研究】Build Solana wallet-connected apps with Phantom Connect SDKs and DFlow spot 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, or swap/stream tokens with DFlow. Covers @phantom/react-sdk, @phantom/r…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Determine the domain, then route to the right references.
Wallet connection and Solana interactions:
DFlow trading & market data:
Many tasks combine both (for example, a swap UI needs wallet connection AND DFlow trading). Read all relevant references before writing code.
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 JSSolana 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 verificationDFlow (swaps, streaming):
references/dflow-crypto-trading.md: spot swaps via /order (atomic units, base58 mints, quote-without-wallet, priority/platform/sponsor fees)references/dflow-websockets.md: real-time quote, order-book, and priority-fee streaming (browser proxies through the backend)Before implementing, ask questions based on the domain:
For Phantom Connect tasks:
For DFlow tasks:
x-api-key. No: dev host, rate-limited. Prod key: pond.dflow.net/get-started/api-key.) It's one key for everything DFlow.Follow the patterns in the reference files. Key rules by domain:
Phantom Connect:
DFlow:
/order call returns a signed-ready transaction that you sign, submit, and confirm./order serves no CORS) and the WebSocket streams through their backend.dev-quote-api.dflow.net) work without a key but are rate-limited; production requires a key from pond.dflow.net/get-started/api-key. In production, quote and book stream access is granted per key.Each reference file contains domain-specific error handling. Key cross-cutting concerns:
route_not_found from DFlow: a likely cause is insufficient liquidity for the pair at that size; also check the mint addresses and that amount is in atomic unitsUser says: "Add Phantom wallet login to my Next.js app"
Actions:
references/react-sdk.md@phantom/react-sdkuseModal hook for a connect buttonuseAccounts to display the connected wallet addressResult: Working wallet connection with social login and extension support
User says: "Build a page that only BONK holders can see"
Actions:
references/react-sdk.md and references/token-gating.mdResult: Page that checks wallet token balance and gates content
User says: "Add a swap feature using DFlow"
Actions:
references/dflow-crypto-trading.md/order flow: request the order (proxy through the backend in a browser), deserialize the returned transaction, sign, submit, and confirmreferences/transactions.md); server-side, sign with a keypair and submit through your RPCResult: Working swap with DFlow routing
User says: "Build a full swap page with wallet connect and DFlow"
Actions:
references/dflow-crypto-trading.md/order through the backend so the key stays server-sideResult: End-to-end swap page combining Phantom wallet and DFlow trading
User says: "Show a live order book for a token pair"
Actions:
references/dflow-websockets.md/book-stream with the x-api-key header, and relays frames to the browser{ op: "subscribe", base_mint, quote_mint }; render the batched per-slot updates[]Result: Live streaming order book, key kept server-side