Skip to main content
This page packages the LLM-oriented resources for Deframe API + SDK integrations.
ResourceUse
/llms.txtAPI docs index and key concepts for retrieval-based assistants
/llms-privy-integration.txtFull one-shot prompt for production-grade Privy widget integration
EarnWidget docsUI integration contract and host responsibilities
SwapWidget docsSwap integration patterns and prefill parameters
processBytecode docsRequired tx lifecycle events and error handling

Prompt Template (Copy/Paste)

Implement Deframe EarnWidget and SwapWidget in an existing React app.

Constraints:
- Use deframe-sdk in host mode (no iframe).
- Install peer deps explicitly: @deframe-sdk/components, @reduxjs/toolkit, react-redux, redux.
- Keep custody in host app; implement processBytecode for signing and tx submission.
- Use DEFRAME_API_URL and DEFRAME_API_KEY from environment variables.
- Support both EN and PT language config.
- Add route-safe handling for EarnWidget onRouteChange.
- Add swap prefill support (fromTokenAddress, fromChainId, toTokenAddress, toChainId).
- Emit required tx lifecycle statuses: HOST_ACK, SIGNATURE_PROMPTED, TX_SUBMITTED, TX_CONFIRMED, TX_FINALIZED.
- Map user rejection errors (4001/ACTION_REJECTED) to SIGNATURE_DECLINED.

Deliverables:
1) Host provider wrapper with DeframeProvider config.
2) processBytecode implementation integrated with wallet stack.
3) EarnWidget page and SwapWidget page.
4) Environment variable documentation and integration checklist.

Acceptance Checklist for AI-generated PRs

  1. Uses DeframeProvider with runtime DEFRAME_API_URL and DEFRAME_API_KEY.
  2. Passes walletAddress from authenticated user session.
  3. Implements processBytecode and emits required status events.
  4. Handles rejection and error status paths explicitly.
  5. Does not hardcode API keys or private keys in source.
  6. Includes customer-facing docs and test steps.