Skip to content

Conversation

@gregfromstl
Copy link
Contributor

@gregfromstl gregfromstl commented Jan 30, 2025


PR-Codex overview

This PR focuses on improving the handling of smart wallets in the thirdweb ecosystem, ensuring proper chain switching functionality and enhancing type safety and capability checks for smart wallets.

Detailed summary

  • Updated smartWalletGetCapabilities to accept a generic Wallet type.
  • Introduced isSmartWallet function for checking smart wallet status.
  • Refactored capability checks to use wallet.id directly.
  • Enhanced getSmartWallet function to throw errors for non-smart wallets.
  • Added tests for isSmartWallet and getSmartWallet functions.
  • Improved connection manager logic for switching chains with smart wallets.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@gregfromstl gregfromstl requested review from a team as code owners January 30, 2025 20:14
@linear
Copy link

linear bot commented Jan 30, 2025

@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2025

🦋 Changeset detected

Latest commit: b693b78

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
thirdweb Patch
@thirdweb-dev/wagmi-adapter Patch
thirdweb-login Patch

Not sure what this means? Click here to learn what changesets are.

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

@vercel
Copy link

vercel bot commented Jan 30, 2025

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

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2025 0:03am
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2025 0:03am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2025 0:03am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2025 0:03am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2025 0:03am

@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 46.6 KB (0%) 933 ms (0%) 2.3 s (+21.29% 🔺) 3.2 s
thirdweb (cjs) 122.39 KB (0%) 2.5 s (0%) 4.6 s (+7.62% 🔺) 7.1 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 298 ms (+53.59% 🔺) 410 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 84 ms (+23.51% 🔺) 94 ms
thirdweb/react (minimal + tree-shaking) 19.3 KB (+0.13% 🔺) 387 ms (+0.13% 🔺) 860 ms (+103.52% 🔺) 1.3 s

@graphite-app
Copy link
Contributor

graphite-app bot commented Jan 30, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@codecov
Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.90%. Comparing base (daceeed) to head (b693b78).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6119      +/-   ##
==========================================
+ Coverage   56.89%   56.90%   +0.01%     
==========================================
  Files        1153     1155       +2     
  Lines       63896    63915      +19     
  Branches     5184     5192       +8     
==========================================
+ Hits        36353    36372      +19     
- Misses      26815    26816       +1     
+ Partials      728      727       -1     
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from daceeed
packages 55.10% <100.00%> (+0.01%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...s/thirdweb/src/wallets/eip5792/get-capabilities.ts 76.92% <100.00%> (-0.44%) ⬇️
packages/thirdweb/src/wallets/manager/index.ts 90.55% <100.00%> (+3.32%) ⬆️
...rdweb/src/wallets/smart/get-smart-wallet-config.ts 100.00% <100.00%> (ø)
packages/thirdweb/src/wallets/smart/index.ts 59.09% <100.00%> (-0.37%) ⬇️
...ages/thirdweb/src/wallets/smart/is-smart-wallet.ts 100.00% <100.00%> (ø)
...src/wallets/smart/lib/smart-wallet-capabilities.ts 90.90% <ø> (ø)

... and 6 files with indirect coverage changes

Copy link
Contributor Author

gregfromstl commented Jan 31, 2025

Merge activity

  • Jan 31, 5:20 PM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jan 31, 5:20 PM EST: A user added this pull request to the Graphite merge queue.
  • Jan 31, 5:32 PM EST: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI: 'Vercel – thirdweb-www').
  • Jan 31, 5:33 PM EST: The merge label 'merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jan 31, 7:04 PM EST: A user added this pull request to the Graphite merge queue.
  • Jan 31, 7:04 PM EST: A user merged this pull request with the Graphite merge queue.

#6119)

<!--

## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"

If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):

## Notes for the reviewer

Anything important to call out? Be sure to also clarify these in your comments.

## How to test

Unit tests, playground, etc.

-->

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the functionality of smart wallets in the `thirdweb` ecosystem, ensuring they correctly trigger chain switches and improving related wallet checks and configurations.

### Detailed summary
- Fixed smart wallets to trigger chain switch on admin wallets.
- Updated `smartWalletGetCapabilities` to accept a generic `Wallet` type.
- Implemented `isSmartWallet` function to check for smart wallet status.
- Modified `getSmartWallet` to throw an error for non-smart wallets.
- Refactored wallet checks in `createConnectionManager`.
- Added tests for `isSmartWallet` and `getSmartWallet`.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-queue Adds the pull request to Graphite's merge queue. packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants