Skip to content

Conversation

@bakoushin
Copy link
Contributor

@bakoushin bakoushin commented Sep 29, 2025

Description

Send wallet capabilities within the session data to avoid an extra wallet_getCapabilities request that would otherwise require an extra user interaction.

By including capabilities directly in the session, WalletConnect can respond to wallet_getCapabilities without prompting the user to switch to their wallet. This makes capability extraction seamless and improves the overall UX.

WalletConnect capabilities support

WalletConnect currently supports two approaches for including capabilities in session data:

  1. Recommended: in sessionProperties or scopedProperties. Docs
  2. Legacy: in the capabilities prop inside sessionProperties. Source

We do support both approaches for maximal compatibility.

Notes

Test plan

Simulator.Screen.Recording.-.iPhone.17.Pro.Max.-.2025-10-01.at.14.35.21.mov

Related issues

Backwards compatibility

Y

Network scalability

If a new NetworkId and/or Network are added in the future, the changes in this PR will:

  • Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)

github-merge-queue bot pushed a commit that referenced this pull request Oct 1, 2025
### Description

Implement support for `wallet_getCapabilities` request (EIP-5792)
through WalletConnect.

EIP-5792:
* https://eips.ethereum.org/EIPS/eip-5792#wallet_getcapabilities
* https://www.eip5792.xyz/reference/getCapabilities

### Note on mobile UX

Whenever a dapp sends a WalletConnect request, the user must open their
wallet app to respond. The mobile app can’t process the request quietly
in the background. This means the user has to do an extra app switch,
which adds friction to the experience (see video below).

For instance, when using `useCapabilities` together with a WalletConnect
provider, as soon as the connection succeeds, `useCapabilities` will
automatically request the wallet’s capabilities. That triggers another
deep link into the wallet without any explanation to the user. From
their perspective, it might feel like the app is bouncing them around
for no clear reason, even like a bug.

To mitigate this, WalletConnect recommends sending the supported
capabilities within session data. They will be cached, and no extra
action from the user will be required. It will be addressed separately:
* #262


https://github.com/user-attachments/assets/473a6915-fc72-450c-8843-593a501718a5

### Test plan

* Tested manually using
https://bakoushin.github.io/wallet-connect-tester/
* Updated unit test

### Related issues

- Part of ENG-644

### Backwards compatibility

Y

### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- [x] Continue to work without code changes, OR trigger a compilation
error (guaranteeing we find it when a new network is added)
@bakoushin bakoushin marked this pull request as ready for review October 1, 2025 13:03
Copy link
Contributor

@jophish jophish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic -- tested out with a simulator against the tester site and worked well

@bakoushin bakoushin enabled auto-merge October 2, 2025 08:43
@bakoushin bakoushin added this pull request to the merge queue Oct 2, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 2, 2025
@bakoushin bakoushin added this pull request to the merge queue Oct 2, 2025
Merged via the queue into main with commit f52f26e Oct 2, 2025
15 checks passed
@bakoushin bakoushin deleted the alex/wc-capabilities branch October 2, 2025 11:39
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.

4 participants