near / wallet-selector

This is a wallet selector modal that allows users to interact with NEAR dApps with a selection of available wallets.
https://near.github.io/wallet-selector/
Apache License 2.0
143 stars 146 forks source link

[Defect] Can't connect using wallet connect #1060

Closed Calcifer1001 closed 7 months ago

Calcifer1001 commented 7 months ago

Describe the bug

Steps To Reproduceå

Steps to reproduce the behavior:

  1. Go to https://www.metapool.app/stake?token=near
  2. Click on 'Connect your wallet'
  3. Select 'Wallet connect'
  4. Scan the QR code with any app like trust wallet or fireblocks.

Error description A ver generic error: 'Failed to sign in with WalletConnect: Something went wrong'

Expected behavior

To log into the account, seeing on top right things like balance.

Screenshots

image

Desktop:

Additional Context

Checking the wallet connect documentation, seems like on near-wallet-selector/wallet-connect/index.js there is a variable WC_METHODS that include 2 methods "near_verifyOwner", "near_signMessage" that are supposed to be optional. Removing them didn't solve the issue, but might be related

kujtimprenkuSQA commented 7 months ago

Hi, @Calcifer1001 thank you for raising this issue.

I downloaded the Trust Wallet on iOS app store and created a new NEAR account then tried connecting via WalletConnect but it looks like NEAR + WalletConnect is not supported on this wallet yet:

https://github.com/near/wallet-selector/assets/95851345/6016f3f7-2f54-47ef-9281-0cf7fcc9cb37

The error message returned is: image


How can I test it with Fireblocks?

Calcifer1001 commented 7 months ago

Have you tried another method? As far as I know, you don't own a fireblocks account, and I'm not able to provide you with one unfortunatelly. Is there another wallet that can use wallet connect to test this?

Thanks

Calcifer1001 commented 7 months ago

Just found out you can use here wallet to log into WC. Yet, it is not working. You can try with that

kujtimprenkuSQA commented 7 months ago

Checked the HERE Wallet but it does not look like they support NEAR (near namespace) through WalletConnect:

image


This is a working wallet example testnet only: https://react-wallet.walletconnect.com/

We are not aware of any other official wallet that supports WalletConnect + NEAR based on the Bridge Wallets Standard

kujtimprenkuSQA commented 7 months ago

@Calcifer1001 We got information that WalletConnect in HERE Wallet is used to connect with Aurora.

Calcifer1001 commented 7 months ago

I was told it was possible. Seems the only one is fireblocks for now. We were able to get you an account, but an email is required. Can you provide me with one?

kujtimprenkuSQA commented 7 months ago

I was told it was possible. Seems the only one is fireblocks for now. We were able to get you an account, but an email is required. Can you provide me with one?

Hi, please send all instructions to Kujtim.Prenku@sqa-consulting.com

kujtimprenkuSQA commented 7 months ago

@Calcifer1001 I got an invitation from Pomixity Labs and created an account just waiting now on the owner to approve the MPC key share.

Calcifer1001 commented 7 months ago

Great! Let me know if I can assist you with anything

kujtimprenkuSQA commented 7 months ago

Hi, I am still seeing this banner on my account:

image

I was able to at least debug the connect with Fireblocks and the issue seems to be that near_signMessage and near_verifyOwner are not supported there, I think that we should make the events and methods configurable from setupWalletConnect(options) that way developers can choose which methods and events to support on a dApp.

Also from the next version, there will be better error handling for WalletConnect: image

kujtimprenkuSQA commented 7 months ago

Hi, we made some changes to the wallet-connect package, and now from the next version it's possible to override the methods and events from the dApp side in setupWalletConnect.

I deployed these changes in gh-pages, can you please try connecting with Fireblocks and see if you can connect successfully?

My account still needs to be approved by the owner so when I try to connect I can not sign transactions and see this error:

image


As shown here the connection shows up in the Web3 Access page but the transaction to addKey failed:

image

kujtimprenkuSQA commented 7 months ago

You can test the connection on this dApp:

https://react-app.walletconnect.com/

kujtimprenkuSQA commented 7 months ago

Was prompted to complete MPC enrollment but still it's not working:

image

Calcifer1001 commented 7 months ago

When following the instructions you shared for the link: https://react-app.walletconnect.com/ I get an error telling me the QR code does not belong to fireblocks. In some sense it makes sense, yet, I've always logged in with the Wallet Connect QR code, so at the same time it doesn't make sense.

You said it was deployed in the gh-pages. Does this mean there is a new version I can try in our code?

Thanks for your help!

kujtimprenkuSQA commented 7 months ago

When following the instructions you shared for the link: https://react-app.walletconnect.com/ I get an error telling me the QR code does not belong to fireblocks. In some sense it makes sense, yet, I've always logged in with the Wallet Connect QR code, so at the same time it doesn't make sense.

You said it was deployed in the gh-pages. Does this mean there is a new version I can try in our code?

Thanks for your help!

Can you try to update the wallet-selector to the latest version v8.9.4 in your dApp and provide these methods to the setupWalletConnect?

kujtimprenkuSQA commented 7 months ago

@Calcifer1001 do you have any contact in Proximity Labs so that they can approve that MPC key share for my account?

kujtimprenkuSQA commented 7 months ago

With the change included in release v8.9.4 specifically on this PR: https://github.com/near/wallet-selector/pull/1068 there should be no problems connecting Fireblocks with WalletConnect option.

Here are two videos that at least demo the connection part I have to emphasize it again since my Fireblocks account does not allow me to sign transactions that's the reason I commented the requestSignIn in the videos below:

From desktop:

fireblocks_desktop.webm

From mobile phone (same video):

https://github.com/near/wallet-selector/assets/95851345/2d1ddacb-2dad-4c6d-8a1d-07f1d44f57c9


I am going to go ahead and close the issue for now, if you still have problems connecting to Fireblocks feel free to re-open it.