EarnWidget when you want Pods yield UX in your app while keeping wallet custody and transaction execution in your infrastructure.
What You Own vs What Pods Owns
Verified integration contract
Install the current widget package set:Use the same SDK package for
DeframeProvider, EarnWidget, and SwapWidget. The Pods Wallet-style widget stack imports them from pods-sdk and uses @deframe-sdk/components for the shared visual system and swap view override.Styles and Theme
Import the published component stylesheet in your app entrypoint before your own app CSS. For Next.js App Router:.deframe-widget as the style boundary owned by the SDK:
- Scope host app styles to your own containers.
- Avoid global resets like
* { ... }or broad element resets that can leak into the widget. - Use
DeframeProvider.config.themeas the source of truth for widget theming. - Use widget-scoped CSS variables only as host-side branding extensions.
- Do not copy internal SDK view overrides into customer integrations unless you own and test those override components.
Environment Variables
Canonical client env names for widget hosts:Step 1: Implement processBytecode
processBytecode is the host bridge between widget actions and wallet execution. Batch all legs
on the same chainId into one atomic wallet submission — see
processBytecode Contract and
Executing Bytecode.
Step 2: Create a Shared Provider Wrapper
Use a single host wrapper forEarnWidget, SwapWidget, and any SDK hooks that need provider context.
Step 3: Mount the Invest View
The Pods Wallet-style Invest page lets the overview use a wider layout and narrows detail or transaction routes.Route Names Exposed by onRouteChange
Common values: overview, details, deposit, withdraw, investment-details, history, history-deposit-details, history-withdraw-details.
Use these to adapt host shell layout, breadcrumbs, and analytics tags.
Host Env and Provider Config Reference
[email protected] still exposes the provider fields as DEFRAME_API_URL, DEFRAME_API_KEY, and DEFRAME_WEBSOCKET_URL. Keep the host env names branded as PODS_*, then map them into those provider fields in the wrapper.
API Endpoints Used in Earn Flows
GET /strategiesfor strategy discoveryGET /strategies/{strategyId}for strategy detailsGET /strategies/{strategyId}/bytecodefor deposit/withdraw transaction dataGET /wallets/{wallet}for portfolio stateGET /wallets/{wallet}/history/{strategyId}for investment activity
Customer Integration Checklist
- Install
pods-sdk,@deframe-sdk/components, and Redux peer packages. - Import
@deframe-sdk/components/styles.cssbefore your host CSS. - Pass the connected wallet or smart-wallet address into
DeframeProvider.config.walletAddress. - Implement
processBytecodewith your wallet stack. - Emit all required tx lifecycle statuses back to the widget.
- Configure
NEXT_PUBLIC_PODS_WEBSOCKET_URLso the widget can recover realtime cross-chain state. - Keep host CSS scoped to containers around
.deframe-widget. - Track completed transactions in your own ledger for reconciliation/support.