chainapsis / keplr-wallet

The most powerful wallet for the Cosmos ecosystem and the Interchain
https://www.keplr.app
Other
764 stars 456 forks source link

Keplr Mobile not responding to WalletConnect intent #867

Open alexandru-g opened 11 months ago

alexandru-g commented 11 months ago

Describe the bug Keplr Android does not register an Intent filter to respond to WalletConnect v2 connections, so it cannot be integrated in mobile dapps.

To Reproduce Steps to reproduce the behavior:

  1. Implement WalletConnect v2 in dapp
  2. Launch connect intent
  3. Keplr is not displayed in app list (intent chooser)

Expected behavior Keplr should be displayed in app list (intent chooser)

Device details (please complete the following information):

HeesungB commented 11 months ago

@alexandru-g Hello. Usually, there are many web pages related to ethereum, so there are many ethereum users, but I thought that if there is a keplr app, these users may feel confused when using it, so I did not register.

If you want to use it, you can use cosmos-kit or refer to the code at the address below! https://github.com/chainapsis/keplr-wallet/tree/master/packages/wc-client https://github.com/chainapsis/keplr-wallet/tree/master/packages/wc-client-example

alexandru-g commented 10 months ago

Hey @HeesungB. Sorry for the late reply, we're kind of swamped.

I'm not entirely sure how the wc-client examples in the keplr wallet will help. I've noticed that the Android app contains an intent filter for the scheme "keplrwallet://wcV2" that opens the app. I'm guessing that's for receiving WalletConnect V2 intents. But I'm not sure how to encode the WalletConnect data required to establish the connection. Any insights?

alexandru-g commented 10 months ago

Also I think I wasn't clear in the first post, so that's my bad. We want to integrate Keplr in a native mobile app, not a web app.

alexandru-g commented 10 months ago

@HeesungB we analyzed the mobile app a bit and figured out how to send the WalletConnect data to Keplr. It all works fine now with one exception: after a random amount of time, Keplr refuses to show the Sign Transaction popup. It just doesn't appear. Only disconnecting from our dapp and reconnecting fixes it.

From the logs, we are sending the WC request but we get no response back (seeing as we can't approve the tx). Is Keplr disconnecting from the WC session after a while for some reason?

HeesungB commented 10 months ago

@alexandru-g Hi, I was wondering if I could see some example code for SIGN? I think it would help me to understand.

alexandru-g commented 9 months ago

@HeesungB the code is rather large. We are using the WalletConnect V2 Kotlin SDK to create a session with Keplr Mobile and then send requests (like signing). Everything works correctly, it's just that after a while (1 day?) Keplr stops displaying the sign window. My belief is that it stops listening for events from the WalletConnect v2 relay for the session we set up. I'm going to try to replicate this with a web dapp to verify this claim.