wagmi icon indicating copy to clipboard operation
wagmi copied to clipboard

feat: cb wallet sdk upgrade

Open nateReiners opened this issue 1 year ago • 15 comments

Description

What changes are made in this PR? Is it a feature or a bug fix?

  • This is just a draft to show what changes are needed in order to upgrade and get the ball rolling
  • Upgrade @coinbase/wallet-sdk from v3 to v4
  • v4 is almost ready and includes Coinbase smart wallets!

Additional Information

Bundle size comparison: 3.9.1 vs 4.0.0-beta.6

Screenshot 2024-04-10 at 3 24 14 PM Screenshot 2024-04-10 at 3 22 54 PM Tested locally using webpack-bundle-analyzer

Before submitting this issue, please make sure you do the following.

  • [ ] Read the contributing guide
  • [ ] Added documentation related to the changes made.
  • [ ] Added or updated tests (and snapshots) related to the changes made.

nateReiners avatar Apr 03 '24 04:04 nateReiners

⚠️ No Changeset found

Latest commit: c50c59388afec66ffbed9f372455703f7559e20e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Apr 03 '24 04:04 changeset-bot[bot]

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

Name Status Preview Comments Updated (UTC)
wagmi ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2024 4:25am

vercel[bot] avatar Apr 03 '24 04:04 vercel[bot]

What are the breaking changes in v4?

jxom avatar Apr 03 '24 04:04 jxom

What are the breaking changes in v4?

Hey @jxom , For most apps there won't be any necessary code changes other than a version bump. However we did remove a bunch of optional SDK options so apps that were passing in any of those will need to remove them. Details here

nateReiners avatar Apr 09 '24 22:04 nateReiners

We need a disableSmartWallet option please - also can you please provide a bundle size comparison @nateReiners ? we have thousands of apps using web3modal and we serve your SDK

arein avatar Apr 10 '24 03:04 arein

hi @nateReiners we are also using enableMobileWalletLink in Web3Modal, do you know if this would cause some sort of error or conflict in the SDK? It would be a bit tricky for us since Wagmi is just a peer dependency and we cannot control which version devs are using.

glitch-txs avatar Apr 10 '24 03:04 glitch-txs

hi @nateReiners we are also using enableMobileWalletLink in Web3Modal, do you know if this would cause some sort of error or conflict in the SDK? It would be a bit tricky for us since Wagmi is just a peer dependency and we cannot control which version devs are using.

Hey @glitch-txs enableMobileWalletLink is gone, but the ability to connect via mobile is enabled by default in v4. When the SDK receives an eth_requestAccounts request, it will open a popup that allows the user to choose between connecting via smart wallet or Coinbase Wallet mobile. You can test out the UX for smart wallet or mobile wallet link here: https://www.smart-wallet.xyz/ Feedback welcome

To remove the option to connect via mobile, dapps can pass in smartWalletOnly: true as an optional SDK option

nateReiners avatar Apr 10 '24 21:04 nateReiners

We need a disableSmartWallet option please - also can you please provide a bundle size comparison @nateReiners ? we have thousands of apps using web3modal and we serve your SDK

Hey Derek can you say more why the disable option is needed?

wilsoncusack avatar Apr 10 '24 21:04 wilsoncusack

@nateReiners thanks for the quick response! My question is if the SDK will throw an error if I pass it down the enableMobileWalletLink option in v4. In which case it would break Web3Modal if the dev is using an "old" version.

glitch-txs avatar Apr 10 '24 22:04 glitch-txs

also can you please provide a bundle size comparison

@arein Yep, just added it to the PR description. gzipped size was reduced by ~20 KB 🎉

nateReiners avatar Apr 10 '24 22:04 nateReiners

We need a disableSmartWallet option please - also can you please provide a bundle size comparison @nateReiners ? we have thousands of apps using web3modal and we serve your SDK

Curious why you'd want to disable smart wallets? Shouldn't Web3Modal be agnostic in this sense? I see iOS Coinbase Wallet via Web3Modal the same as what Coinbase Smart Wallet via Web3Modal would be.

jxom avatar Apr 10 '24 22:04 jxom

@nateReiners thanks for the quick response! My question is if the SDK will throw an error if I pass it down the enableMobileWalletLink option in v4. In which case it would break Web3Modal if the dev is using an "old" version.

No the SDK wont throw an error. All deprecated options including enableMobileWalletLink are just ignored in v4. It would just be a Typescript issue.

nateReiners avatar Apr 10 '24 22:04 nateReiners

@jxom @wilsoncusack I can imagine some dapps not wanting this so I think it makes sense to allow them to configure. What rationale went into the option to exclusively use the smart wallet.

arein avatar Apr 12 '24 04:04 arein

Hey just wanted to drop an update here since I know this has been sitting for some time. We have been making some SDK interface tweaks and I wanted to wait until all of those decisions are solidified before cleaning up this PR.

We are adding the ability to disable smart wallet as part of these tweaks via an 'eoaOnly' option cc: @arein

nateReiners avatar Apr 24 '24 19:04 nateReiners

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@coinbase/[email protected] None 0 0 B

View full report↗︎

socket-security[bot] avatar May 14 '24 00:05 socket-security[bot]

Closing in favor of https://github.com/wevm/wagmi/pull/3928

nateReiners avatar May 14 '24 18:05 nateReiners