feat: cb wallet sdk upgrade
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-sdkfrom 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
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.
⚠️ 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
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 |
What are the breaking changes in v4?
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
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
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.
hi @nateReiners we are also using
enableMobileWalletLinkin 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
We need a
disableSmartWalletoption 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?
@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.
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 🎉
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.
@nateReiners thanks for the quick response! My question is if the SDK will throw an error if I pass it down the
enableMobileWalletLinkoption 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.
@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.
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
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 |
Closing in favor of https://github.com/wevm/wagmi/pull/3928