Skillpedia
المواقع والواجهات (frontend)7.0k · #13625

dflow-phantom-connect

ما الذي تفعله

تغطي هذه المهارة بناء تطبيقات ويب وجوال على Solana تتصل بمحفظة Phantom. كما تغطي DFlow، التي تتولى تبادل الرموز الفوري والأسعار الحية وبيانات السوق، لمن يضيف تسجيل الدخول بالمحفظة أو الدفع أو التداول إلى تطبيقه.

متى تستخدمها

  • ✓عندما تريد أن يتصل المستخدمون بمحفظة Phantom في تطبيق React أو React Native أو JavaScript عادي.
  • ✓عندما تريد إضافة صفحات مقيّدة بالرموز أو سكّ NFT أو مدفوعات بالعملات الرقمية على Solana.
  • ✓عندما تريد أن يبادل تطبيقك الرموز أو يعرض أسعارًا حية عبر DFlow.

رابط المهارة

https://github.com/internet-court/internet-court-skill/blob/main/vendored/dflow/dflow-phantom-connect/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/internet-court/internet-court-skill/blob/main/vendored/dflow/dflow-phantom-connect/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“أريد أن يتصل المستخدمون في تطبيق الويب الخاص بي بمحفظة Phantom ويبادلوا الرموز عبر DFlow.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يختار الوكيل المرجع المناسب لإطار عملك ومهمتك، ثم يكتب كودًا يربط المحفظة ويطلب منها توقيع الرسائل أو المعاملات، ويستدعي DFlow للعروض والتبادلات. ويقرأ كل المراجع ذات الصلة قبل كتابة الكود.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

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 & market data:

  • Spot token swaps (quote, sign, submit, confirm)
  • Live prices, order-book depth, or priority-fee streaming

Many tasks combine both (for example, 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, PhantomProvider
  • references/react-native-sdk.md: Expo config, polyfills, deep links, mobile auth
  • references/browser-sdk.md: BrowserSDK init, events, wallet discovery, vanilla JS

Solana patterns (transactions, gating, minting, payments):

  • references/transactions.md: SOL/SPL transfers, signing, fee estimation
  • references/token-gating.md: client-side and server-side token-gated access
  • references/nft-minting.md: mint pages, Metaplex Core, compressed NFTs
  • references/payments.md: SOL/USDC payments, checkout with backend verification

DFlow (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)

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 tasks:

  • Do you have a DFlow API key? (Yes: prod host with x-api-key. No: dev host, rate-limited. Prod key: pond.dflow.net/get-started/api-key.) It's one key for everything DFlow.
  • Client environment? (web, mobile, backend, CLI) Browser apps keep the key on the backend and proxy DFlow HTTP and WebSocket through it.
  • Platform fees? If yes, what bps and which builder-owned fee account (which must already exist)?

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:

  • Trades are synchronous: one /order call returns a signed-ready transaction that you sign, submit, and confirm.
  • As a security best practice, keep the DFlow API key on the backend, not in browser code. Browser apps proxy DFlow HTTP (/order serves no CORS) and the WebSocket streams through their backend.
  • Dev endpoints (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.

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_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 units

Examples

Example 1: React wallet connection

User says: "Add Phantom wallet login to my Next.js app"

Actions:

  1. Read references/react-sdk.md
  2. Install @phantom/react-sdk
  3. Wrap app in PhantomProvider with desired auth providers and appId
  4. Use useModal hook for a connect button
  5. Use useAccounts to 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:

  1. Read references/react-sdk.md and references/token-gating.md
  2. Set up wallet connection
  3. Query the BONK token balance for the connected wallet
  4. Conditionally render content based on balance threshold
  5. For production: add server-side signature verification

Result: Pa

الأسئلة الشائعة

أي أطر عمل يدعم ربط المحفظة؟

React وReact Native وJavaScript في المتصفح، ولكل منها حزمة Phantom SDK الخاصة بها.

هل تغطي سكّ NFT والمدفوعات أيضًا؟

نعم. تتضمن المهارة مراجع لسكّ NFT وتقييد الوصول بالرموز ومدفوعات SOL أو USDC.

كيف يعمل تبادل DFlow؟

تتبع المهارة خطوات الحصول على عرض سعر، ثم التوقيع، ثم الإرسال، ثم تأكيد التبادل.

التفاصيل

الوصف الأصلي من المؤلف

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/react-native-sdk, @phantom/browser-sdk, and DFlow spot trading and market-data streaming. Do NOT use for Ethereum or EVM wallet integrations, or non-DFlow DEX routing.

repo: internet-court/internet-court-skill

الشعبية

نجوم GitHub
7.0k
الترتيب
#13625
الترخيص
—
آخر تحديث
26‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة