WalletConnect / WalletConnectModalFlutter

The WalletConnectModal for WalletConnect built using Flutter.
https://pub.dev/packages/walletconnect_modal_flutter
Apache License 2.0
20 stars 18 forks source link

[Example] The example is not working #36

Open AyushBherwani1998 opened 10 months ago

AyushBherwani1998 commented 10 months ago

Describe the bug I have updated the project id in the sample, upon clicking the wallet, it does open the wallet but no request for connection is shown in the wallet.

To Reproduce Steps to reproduce the behavior:

  1. Add project id
  2. Click on any wallet of your choice, tried with Metamask, Trust, and Rainbow.
  3. See the wallet open but no connection request is shown

Screenshot As you can see, it says connecting, but it never shows any connection request. IMG_C7CE215DE74E-1

Expected behavior A connection request should be shown when the wallet opens.

Smartphone (please complete the following information):

quetool commented 10 months ago

Hello @AyushBherwani1998, is this still happening? Just to understand better, what you have done is:

  1. Clone the repo
  2. Set your projectId in /example/lib/home_page.dart
  3. Ran the app and tried to connect with those wallets Is that correct? Coz I have been doing the same and I'm able to connect properly.
AyushBherwani1998 commented 10 months ago

Hey @quetool, yes I did the same but apparently the connection request is not shown. Moreover, I tried those wallets with https://react-app.walletconnect.com/ and it works fine.

quetool commented 10 months ago

Do you mind trying Web3Modal? https://github.com/WalletConnect/Web3ModalFlutter

quetool commented 10 months ago

https://pub.dev/packages/web3modal_flutter/versions/3.0.0-beta09

AyushBherwani1998 commented 10 months ago

Sure, let me go through it.

AyushBherwani1998 commented 10 months ago

@quetool web3modal_flutter is working fine. Tried the 3.0.0-beta09 version.

quetool commented 10 months ago

Great! Web3Modal is almost on release version, it's quite safe to use it already but I'd understand if you prefer to use WalletConnectModalFlutter. However it might take some time before I'm able to take a look at that repo.

AyushBherwani1998 commented 10 months ago

@quetool got the issue, apparently the WalletConnectModalService accepts both IWeb3App and projectId along with metadata. I was setting the projectId inside the home_page but since the example passes the IWeb3App it was causing the issue. It was working fine to show me the list of wallet, because it uses local variable projectId in the Explorer service, and for the pairing and auth it uses IWeb3App.

Just curious, we should only keep IWeb3App instead of also accepting the projectId and metadata or vice versa to avoid confusion. Happy to raise the PR if it make sense to you.

quetool commented 10 months ago

@AyushBherwani1998 thats great! AFAIK it should be either the web3app instance (which requieres a projectId) OR the projectId into the service. So, should be either one or the other. We might need to take a look sooner than I thought.

AyushBherwani1998 commented 10 months ago

@quetool would be happy to contribute. IMO we can deprecate the web3App and only take the projectId and metaData. WDYT? In the more upcoming releases we can remove the web3App once users have migrated to the remove the usage of web3App. Since it's already published, we can do a soft migration.

quetool commented 10 months ago

That could be a good idea, I might need to check the impact. Btw by "we" I meant we at WalletConnect but I really appreciate the willingness! I will get back to you ASAP!

AyushBherwani1998 commented 8 months ago

@quetool any updates?

quetool commented 8 months ago

Hey @AyushBherwani1998 ! Sorry for the delay on this! If you are asking about removing web3App object from the constructor I haven't had time to talk discuss this with the team but in any case is not a priority for us. Also, having the ability to pass a web3app as well allows the dev to have a bit more of flexibility since Web3App() accepts a Core() object itself.

What I can do right now to avoid your described issue is to add a check to validate web3App.core.projectId over projectId.

quetool commented 8 months ago

Also, I strongly recommend to try Web3Modal out, it has been released for production since we last spoken 👌