Open itsallmememe opened 9 months ago
Note:
What is the recommended approach here?
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.
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 tooptionalNamespaces
fromrequiredNamespaces
then the chainId returned inSign.instance.sessionSettlePublisher
is always1
- Ethereum Mainnet - even if we pass in Base or Zora or Optimism as theoptionalNamespace
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
Expected behavior Wallet should respond with optional namespace that is passed in