Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAIP-25 OptionalNamespace #1257

Open
itsallmememe opened this issue Dec 15, 2023 · 2 comments
Open

CAIP-25 OptionalNamespace #1257

itsallmememe opened this issue Dec 15, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@itsallmememe
Copy link

Describe the bug
We implemented the change as stated here - https://medium.com/walletconnect/caip-25-implementation-guidance-migrating-to-empty-undefined-required-namespaces-6aa5626a86d9 - to move “requiredNamespaces” to “optionalNamespaces” for the CAIP-25 update.

In our use case our app needs to confirm that the user can access a certain chain before requesting that the user signs a transaction for that chain.

We do this by performing Sign.instance.connect and passing in the namespace of the chain, however if we move the namespace to optionalNamespaces from requiredNamespaces then the chainId returned in Sign.instance.sessionSettlePublisher is always 1 - Ethereum Mainnet - even if we pass in Base or Zora or Optimism as the optionalNamespace

This results in us being unable to confirm which chain the user has access to.

Can you confirm what the best approach is here? Are we ok keeping our chain in the requiredNamespaces parameter?

SDK Version

  • Client: iOS / Swift
  • Version 1.9.9

Expected behavior
Wallet should respond with optional namespace that is passed in

@itsallmememe itsallmememe added the bug Something isn't working label Dec 15, 2023
@itsallmememe
Copy link
Author

Note:

  • the "Sign.instance.sessionSettlePublisher is always 1 - Ethereum Mainnet" only happens with MetaMask wallet. Rainbow correctly responds with chain id.
  • Trust wallet also does not support the changes yet either.

What is the recommended approach here?

  • Wait until all wallets support this change?
  • how urgent is this change?

@llbartekll
Copy link
Contributor

hey, Metamask will always approve one chain, other wallets should connect to many.
Dapp will usually display the first chain from the chains array(in namespaces) as an active chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants