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

Refactor linkProfile and getProfiles API + prepare for ecosystemWallet in React Native #4755

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Sep 23, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR focuses on refactoring the wallet integration for the thirdweb library, specifically improving the handling of user profiles and wallet authentication methods. It updates the structure of API calls and enhances the organization of wallet-related functionalities.

Detailed summary

  • Deleted useAdminAccount.ts and its references.
  • Moved linkProfile and getProfiles functionality to web/lib/auth/index.js and native/auth/index.js.
  • Updated Ecosystem import paths to a unified structure.
  • Refactored profile linking and fetching logic across various files.
  • Standardized usage of ClientScopedStorage for local storage management.
  • Enhanced useProfiles hook to accept client arguments.
  • Updated wallet connectors to support new profile linking methods.
  • Improved error handling and documentation for authentication methods.

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

Copy link

vercel bot commented Sep 23, 2024

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

Name Status Preview Comments Updated (UTC)
docs-v2 ❌ Failed (Inspect) Sep 24, 2024 4:15am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 24, 2024 4:15am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 24, 2024 4:15am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 24, 2024 4:15am

Copy link

changeset-bot bot commented Sep 23, 2024

🦋 Changeset detected

Latest commit: e02d87b

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

This PR includes changesets to release 1 package
Name Type
thirdweb Minor

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

Copy link

graphite-app bot commented Sep 23, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

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

Copy link
Member Author

joaquim-verges commented Sep 23, 2024

Copy link
Contributor

github-actions bot commented Sep 23, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 41.91 KB (0%) 839 ms (0%) 2.9 s (-1.5% 🔽) 3.8 s
thirdweb (cjs) 101.47 KB (0%) 2.1 s (0%) 5.5 s (-18.68% 🔽) 7.5 s
thirdweb (minimal + tree-shaking) 4.82 KB (0%) 97 ms (0%) 282 ms (+46.21% 🔺) 379 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 134 ms (+48.09% 🔺) 144 ms
thirdweb/react (minimal + tree-shaking) 16.73 KB (0%) 335 ms (0%) 664 ms (-21.62% 🔽) 998 ms

Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 17.00000% with 83 lines in your changes missing coverage. Please review.

Project coverage is 49.12%. Comparing base (d531230) to head (e02d87b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...irdweb/src/wallets/in-app/web/lib/web-connector.ts 6.89% 27 Missing ⚠️
.../thirdweb/src/wallets/in-app/web/lib/auth/index.ts 0.00% 23 Missing ⚠️
...hirdweb/src/react/web/hooks/wallets/useProfiles.ts 22.72% 17 Missing ⚠️
...irdweb/src/react/web/wallets/shared/OTPLoginUI.tsx 20.00% 4 Missing ⚠️
...dweb/src/react/web/wallets/shared/PassKeyLogin.tsx 20.00% 4 Missing ⚠️
.../ui/ConnectWallet/screens/LinkedProfilesScreen.tsx 25.00% 3 Missing ⚠️
...irdweb/src/react/web/wallets/in-app/WalletAuth.tsx 33.33% 2 Missing ⚠️
...rdweb/src/react/web/wallets/shared/SocialLogin.tsx 33.33% 2 Missing ⚠️
.../web/wallets/shared/ConnectWalletSocialOptions.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4755      +/-   ##
==========================================
+ Coverage   49.06%   49.12%   +0.05%     
==========================================
  Files        1054     1052       -2     
  Lines       56865    56780      -85     
  Branches     3890     3890              
==========================================
- Hits        27899    27891       -8     
+ Misses      28333    28256      -77     
  Partials      633      633              
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from d531230
packages 45.19% <17.00%> (+0.06%) ⬆️

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

Files with missing lines Coverage Δ
...web/src/react/core/hooks/wallets/useAdminWallet.ts 20.00% <ø> (ø)
...hirdweb/src/react/web/ui/ConnectWallet/Details.tsx 7.31% <100.00%> (ø)
...web/ui/ConnectWallet/screens/LinkProfileScreen.tsx 16.66% <100.00%> (ø)
...eb/ui/ConnectWallet/screens/ManageWalletScreen.tsx 14.03% <100.00%> (ø)
...t/web/ui/ConnectWallet/screens/SignatureScreen.tsx 9.39% <100.00%> (ø)
...irdweb/src/react/web/wallets/shared/oauthSignIn.ts 5.63% <ø> (ø)
packages/thirdweb/src/utils/fetch.ts 90.90% <ø> (ø)
...wallets/in-app/core/authentication/getLoginPath.ts 10.34% <ø> (ø)
...eb/src/wallets/in-app/core/authentication/types.ts 100.00% <ø> (ø)
...b/src/wallets/in-app/core/wallet/ecosystem-core.ts 29.03% <ø> (+4.03%) ⬆️
... and 11 more

... and 3 files with indirect coverage changes

Copy link

graphite-app bot commented Sep 24, 2024

Merge activity

…t in React Native (#4755)

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on refactoring the wallet's profile management system, enhancing the `linkProfile` and `getProfiles` functionalities. It also updates the import paths and improves the organization of wallet-related hooks and types.

### Detailed summary
- Deleted `useAdminAccount.ts` and updated references to `useAdminWallet.ts`.
- Refactored `linkProfile` and `getProfiles` APIs for improved functionality.
- Updated import paths for `Ecosystem` type across multiple files.
- Consolidated wallet profiles logic in `useProfiles` hook.
- Enhanced error handling and type definitions in wallet connectors.
- Added `linkProfile` and `getProfiles` methods to `InAppNativeConnector` and `InAppWebConnector`.

> ✨ 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants