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

Update WalletConnect eth_RequestAccounts flow along with update WC deps and add new optional params #1622

Merged
merged 4 commits into from
Apr 3, 2023

Conversation

Adamj1232
Copy link
Member

Description

Update WalletConnect eth_RequestAccounts flow as there was an issue with creating the connect listener after the connect() method was called

Update WC deps:

"@walletconnect/ethereum-provider": "2.4.10" -> "2.5.4"

Add new optional params qrModalOptions?: Web3ModalConfig exposed with the new WC dep:

type WalletConnectOptions = {
  bridge?: string // default = 'https://bridge.walletconnect.org'
  qrcodeModalOptions?: {
    mobileLinks: string[] // set the order and list of mobile linking wallets
  }
  connectFirstChainId?: boolean // if true, connects to the first network chain provided
  /**
   * Optional function to handle WalletConnect URI when it becomes available
   */
  handleUri?: (uri: string) => Promise<unknown>
} & (
  | {
      /**
       * Defaults to version: 1 - this behavior will be deprecated after the WalletConnect v1 sunset
       */
      version?: 1
    }
  | {
      /**
       * Project ID associated with [WalletConnect account](https://cloud.walletconnect.com)
       */
      projectId: string

      /**
       * Defaults to version: 1 - this behavior will be deprecated after the WalletConnect v1 sunset
       */
      version: 2
      /**
       * List of Required Chain(s) ID for wallets to support in number format (integer or hex)
       * Defaults to [1] - Ethereum
       * The chains defined within the web3-onboard config will define the
       * optional chains for the WalletConnect module
       */
      requiredChains?: number[] | undefined
      /**
       * `undefined` by default, see https://docs.walletconnect.com/2.0/web3modal/options
       */
      qrModalOptions?: Web3ModalConfig
    }
)

Fixes #1608

Checklist

  • Increment the version field in package.json of the package you have made changes in following semantic versioning and using alpha release tagging
  • Check the box that allows repo maintainers to update this PR
  • Test locally to make sure this feature/fix works
  • Run yarn check-all to confirm there are not any associated errors
  • Confirm this PR passes Circle CI checks
  • Add or update relevant information in the documentation

@vercel
Copy link

vercel bot commented Mar 31, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
web3-onboard-docs ❌ Failed (Inspect) Mar 31, 2023 at 9:37PM (UTC)

Copy link
Contributor

@leightkt leightkt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When trying to connect an infinity wallet via walletconnect on the demo- I get the following errors in the console:
Screenshot 2023-03-31 at 3 04 50 PM

Is there another way I can test this update?

@Adamj1232
Copy link
Member Author

Adamj1232 commented Mar 31, 2023

When trying to connect an infinity wallet via walletconnect on the demo- I get the following errors in the console: Screenshot 2023-03-31 at 3 04 50 PM

Is there another way I can test this update?

@leightkt
Not all wallets(in fact not very many) support walletconnect v2 fully. You can try Trust Wallet mobile or use the WC teams recommended testing tool: https://react-web3wallet.vercel.app/walletconnect
To do this hit the copy button on the upper right of the QR code within the WC modal and past the URI into the site above.

Judging from Infinity wallets github commit history I would be surprised if they have WC v2 support integrated

@Adamj1232
Copy link
Member Author

@leightkt for a more complete list of larger wallets that do and dont support walletconnect v2 checkout - https://medium.com/walletconnect/weve-reset-the-clock-on-the-walletconnect-v1-0-shutdown-now-scheduled-for-june-28-2023-ead2d953b595

Copy link
Contributor

@leightkt leightkt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was able to successfully connect wallet from https://react-web3wallet.vercel.app/walletconnect to demo

@Adamj1232 Adamj1232 merged commit db2355d into develop Apr 3, 2023
@Adamj1232 Adamj1232 deleted the wc/update_deps branch April 3, 2023 16:04
Adamj1232 added a commit that referenced this pull request Apr 4, 2023
* Yarn docs

* update favicon on docs site (#1611)

* Update Notify section on the docs site and within readme (#1612)

* Update notify docs on docs site and within readme

* Update notify api docs

* Add screenshots

* Update signup link

* Remove export from types in docs

* Update Docs Favicon to Url (#1618)

* Fix broken link in docs (#1616)

* Add Kat to GH issue and notion card generation + Fix doc prop name for connect property (#1593)

* Yarn the docs

* Fix doc prop name for connect property

* Add new notion Flag

* Add Kat to gh issue notion cards

* Update Broken Links on Docs Pages (#1619)

* Update WalletConnect `eth_RequestAccounts` flow along with update WC deps and add new optional params (#1622)

* Update WC packages

* Add logs for testing

* Refactor eth_requestAccounts flow

* Why Don't I See My Wallet Link (#1617)

* Add peer dep required to run package outside of walletconnect eco (#1623)

* Update versions for release

* Bump versions

---------

Co-authored-by: Kat Leight <33187102+leightkt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: walletconnect v2 not connecting or working
2 participants