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

WalletConnect v2 support #129

Closed
re2005 opened this issue May 11, 2023 · 11 comments
Closed

WalletConnect v2 support #129

re2005 opened this issue May 11, 2023 · 11 comments
Labels
enhancement New feature or request released

Comments

@re2005
Copy link
Collaborator

re2005 commented May 11, 2023

Seems like we a using a deprecated version of WalletConnect

We should use @walletconnect/web3wallet

@re2005 re2005 added the enhancement New feature or request label May 11, 2023
@re2005
Copy link
Collaborator Author

re2005 commented May 30, 2023

@johnson86tw
Copy link
Member

@re2005 Got it. Will prepare to migrate to the new version before the expiration date

@re2005
Copy link
Collaborator Author

re2005 commented Jun 1, 2023

Awesome, I've tried quickly to make it work. Lots of typing and other stuff to fix:
#133

Also don't see metamask option in here.

@re2005
Copy link
Collaborator Author

re2005 commented Jun 2, 2023

@johnson86tw
Copy link
Member

@johnson86tw
Copy link
Member

@re2005 Hey, thanks for starting PR #133 and helping with the testing. To show my appreciation, I'd like to sponsor you with 10 DAI from the funds we collected for vue-dapp. All you need to provide is your ETH address and let me know which network you prefer for the transaction (Ethereum or Polygon). Once I have that, I'll take care of the reward. Thank you for your contributions!

@tempe-techie
Copy link

@re2005 great job! 😎 I can also send you some DAI if you provide the address 🤘

@re2005
Copy link
Collaborator Author

re2005 commented Jun 25, 2023

@chnejohnson @tempe-techie I really appreciate it. Will DM @chnejohnson with the 0x..
Once again thanks, I'm looking forward to keep improving this lib!

@goums
Copy link

goums commented Jun 27, 2023

Thanks @re2005 ❤️ & @chnejohnson for adding WalletConnect v2 support
We just integrated it, but came across few issues, so I'm sharing here our workarounds.

It seems that EthereumProviderOptions is expecting rpcMap and not rpc, see here:
https://www.npmjs.com/package/@walletconnect/ethereum-provider
Maybe rpc was in an older version?

We had to updates these 2 lines to replace rpc with rpcMap:

Also, the onChainChanged receives an hex value for the chainId, see here:
https://github.com/WalletConnect/walletconnect-monorepo/blob/v2.0/providers/ethereum-provider/src/EthereumProvider.ts#L425

So we had to replace this line:

this.#provider.on('chainChanged', (chainId: number) => {

with:

this.#provider.on('chainChanged', (hexChainId: string) => {
    const chainId = parseInt(hexChainId, 16);

@johnson86tw
Copy link
Member

@goums Nice! I will fix it. Thanks for your sharing!

johnson86tw added a commit that referenced this issue Jul 3, 2023
fix: fix some bugs about walletconnect v2, resolve #129
@github-actions
Copy link

github-actions bot commented Jul 3, 2023

🎉 This issue has been resolved in version 0.9.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

No branches or pull requests

4 participants