Repository navigation
feat(react-dapp-v2): auto-connect and wallet fee when opened from a wallet (H2b) - #1053
Draft
ignaciosantise wants to merge 8 commits into
Draft
ignaciosantise wants to merge 8 commits into
ignaciosantise wants to merge 8 commits into
Conversation
When a wallet opens the React App from its Explore section, it injects window.walletConnectHost. On that host launch the app now connects once on load with no QR or modal: Universal Provider hands the pairing URI to the wallet, which auto-approves it. A card above Accounts shows the session's wallet_guide_id. - Bump @walletconnect/* to 2.25.1-canary-0 (deps and pnpm.overrides) for UniversalProvider.isHostLaunch(). - Skip authentication on a host launch: the canary only routes pair() to the wallet, not authenticate() (WCP4-186). - Request Sepolia, Ethereum and Base when no chains are selected. Part of WCP4-185. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
A loading toast at the top says "Connecting to your wallet…" during the host-launch auto-connect, then turns into "Connected to <wallet>". On failure it's dismissed, since connect() already shows the error toast. Part of WCP4-185. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…launch - Don't create the AppKit modal on a host launch; it can open itself on startup and the app only uses it as the QR modal. - Mark host auto-connect as done once startup finishes, so a restored session followed by Disconnect doesn't auto-connect again. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Bump @walletconnect/* to 2.25.1-canary-1, which adds getWalletFee(), wallet_fee_changed and the walletFeeApiUrl option to Universal Provider. - Pass NEXT_PUBLIC_WALLET_FEE_API_URL as walletFeeApiUrl (defaults to production). - Keep the fee for the active chain in state and show it in the "Opened from your wallet" card: bps, recipient, referral code, and what the demo transaction pays. - eth_sendTransaction makes its chain active, then pays the wallet fee on a 0.001 ETH demo amount (amount x feeBps / 10000) to the recipient. - On a host launch, request Ethereum, Optimism and Arbitrum, which both this app and the sample wallet support. - Fix the result modal on long pages: the overlay is fixed to the viewport, so the card is centered on screen, and next.config enables the styled-components compiler so class names match between server and client (they didn't, which left the modal card unstyled after hydration). - Card title at 18px; only IDs and addresses wrap anywhere. Part of WCP4-185. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of WCP4-185 (H2b in-wallet flow, parent WCP4-181).
What
When a wallet opens the React App from its Explore section, it injects
window.walletConnectHostbefore the page loads. On that host launch the app:connect()if no session was restored. Universal Provider sends the pairing URI to the wallet (wc_session_offer) instead of emittingdisplay_uri, and the wallet auto-approves it with itswallet_guide_id. A toast says "Connecting to your wallet…" and then "Connected to {wallet}".eth_sendTransactionmakes its chain active, then asks for the fee. If there is one, it sends0.001 ETH × feeBps / 10000to the recipient.Opened in a normal browser, nothing changes: same modal, same QR, and authentication as before.
Changes
@walletconnect/*package goes from 2.23.10 to2.25.1-canary-1, in the dependencies and inpnpm.overrides. That's the canary of walletconnect-monorepo#7361 plus WCP4-183, which bringisHostLaunch(), the bridge hand-off,getWalletFee(),wallet_fee_changedandwalletFeeApiUrl.NEXT_PUBLIC_WALLET_FEE_API_URLis passed aswalletFeeApiUrl. It defaults to production, which doesn't have the endpoint yet; set it to the staging or a local API for testing.pair()to the wallet, notauthenticate()(WCP4-186).next.config.jsenables the styled-components compiler, so class names match between server and client; they didn't, which left the modal card unstyled after hydrationTesting
Local end to end, with:
What we checked:
wallet_guide_id.eth_sendTransactionsends 0 ETH.value: 0x48c27395000) to the configured recipient.tsc --noEmitpasses.Known CI failure: the
pr_checkslint/prettier job fails on every recent PR. It runsyarn install --immutablein an app with noyarn.lock, andnext lintno longer exists in Next.js 16. Not caused by this PR.🤖 Generated with Claude Code