Skip to content

feat(rn_cli_wallet): H2b POC — Explore dapp picker with wallet-originated auto-connect - #611

Draft
jakubuid wants to merge 6 commits into
mainfrom
dapp-picker-poc
Draft

feat(rn_cli_wallet): H2b POC — Explore dapp picker with wallet-originated auto-connect#611
jakubuid wants to merge 6 commits into
mainfrom
dapp-picker-poc

Conversation

@jakubuid

@jakubuid jakubuid commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What

Wallet-side implementation of the H2b in-wallet originated fee flow pilot (technical design). Adds an Explore tab that opens supported dapps in a webview with the auto-connect signal, so the session attributes to this wallet and carries fee terms.

How it works (per the design's wallet checklist)

  • Bridge injection: DappBrowser injects window.walletConnectHost = { autoConnect: true, postMessage } at document start on every page load (Explorer launches only — a generic in-wallet browser must not set the flag).
  • URI handoff: the dapp posts {type: 'wc_session_offer', uri} back through the bridge; a wc: navigation intercept covers pages where postMessage fails.
  • Topic-scoped auto-approve: the pairing topic is recorded before pair(), and only proposals arriving on a recorded topic are auto-approved (PickerUtil); everything else keeps the normal proposal modal.
  • User consent: auto-approval is gated by a one-time, revocable toggle (SettingsStore.pickerAutoConnect, Settings + first-run prompt). Without consent the dapp still connects through the normal modal.
  • Fee terms: approvals carry wc_feeTerms in sessionProperties (interim carrier until the Dashboard /walletFee endpoint + wallet_guide_id lookup exist).
  • Signing unchanged: every transaction/message request keeps the normal approval UI.

Tiles

Jupiter / 1inch / KyberSwap / Uniswap point at the session-fees POC dapp (PICKER_DAPP_URL); the WalletConnect Stake WCT tile points at EXPO_PUBLIC_STAKE_DAPP_URL — set it to the portal preview (see .env.example) until the dapp-side auto-connect ships to production (WalletConnectFoundation/walletconnect-apps#508).

Verified end-to-end (Galaxy S25 Ultra)

Offer → topic-scoped pair → auto-approve → session settled with fee terms readable dapp-side; session restore on reopen; disconnect no longer auto-reverts (dapp-side one-shot fix in #508). Known SDK issue found while testing: AppKit 1.8.23 leaves stale UI state when disconnecting a restored session (bug is in AppKit's disconnect cascade, not this PR — ticket to follow).

Known gaps (before pilot)

  • Origin validation (design item 6): DappBrowser.onMessage doesn't yet verify the webview is on the registered dapp origin before treating an offer as picker-initiated.
  • wallet_guide_id session property + Dashboard fee lookup (blocked on the Dashboard piece).

🤖 Generated with Claude Code

jakubuid and others added 5 commits July 20, 2026 17:34
…netized sessions (H2b POC)

- Explore tab: four fee-honoring dapp tiles (same POC dapp, different
  default aggregator via URL param); one-time auto-connect consent (MMKV)
- DappBrowser webview host: receives wc_session_offer postMessage (wc:
  navigation intercept as fallback), registers the pairing topic, pairs
- Picker-scoped auto-approval in onSessionProposal — only pairings the
  Explore webview initiated; errors fall back to the normal modal
- wc_feeTerms attached to every session approval (shared
  PickerUtil.buildSessionProperties; demo recipients, env-overridable)
- Settings toggle: headless vs provider-direct connect variant

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…w' consent is per-run

'Not now' on the consent alert no longer persists across app starts —
only 'Allow' is remembered. A Settings switch can grant/revoke
auto-connect at any time.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…iew (web-examples work consolidated on one branch)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…(H2b)

Adds app.walletconnect.com/stake to the Explore picker as the first real
dapp. DappBrowser now injects the H2b bridge wrapper at document start
(walletConnectHost with autoConnect: true + postMessage), the design's
primary auto-connect signal for native wallets — the stake tile URL carries
no wc_auto/aggregator params. Legacy POC tiles keep the URL signal.
EXPO_PUBLIC_STAKE_DAPP_URL overrides the tile URL for preview builds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019qEcbnmCpX3vq2fMxboNr4
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pos-demo Ready Ready Preview Sep 1, 2026 10:17am UTC
react-native-appkit Error Error Sep 1, 2026 10:17am UTC
react-native-walletkit Ready Ready Preview Sep 1, 2026 10:17am UTC

Request Review

…link

CI release builds write the env from the WALLETKIT_ENV_FILE secret, which has
no EXPO_PUBLIC_STAKE_DAPP_URL — the tile then fell back to the production
stake page, which has no auto-connect code. Default to the preview (share
link tracks the walletconnect-apps#508 branch) so internal builds test the
H2b flow out of the box; the env var still overrides for local dev.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant