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

ecosystem refactor part 4: react native edition #4783

Merged

Conversation

joaquim-verges
Copy link
Member

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

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR focuses on enhancing wallet functionalities in the thirdweb SDK, particularly for ecosystem wallets, with improvements in authentication processes and the introduction of new wallet interfaces for better integration in both web and native environments.

Detailed summary

  • Removed web-wallet.ts.changeset/chilled-dancers-cheer.md.
  • Updated useAutoConnect.ts to include createWallet.
  • Modified ecosystem.ts to add auth options in createOptions.
  • Introduced IWebWallet interface in web-wallet.ts for wallet methods.
  • Enhanced EcosystemWalletCreationOptions with optional auth properties.
  • Improved useAutoConnectCore to accept a createWalletFn parameter.
  • Updated getUserStatus to log responses and handle errors better.
  • Integrated customJwt and authEndpoint functions for improved authentication.
  • Refactored native connector to utilize new wallet interfaces and streamline user authentication.
  • Removed outdated methods from InAppNativeConnector and replaced them with new implementations.

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

Copy link

vercel bot commented Sep 24, 2024

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 Sep 25, 2024 1:57am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 1:57am
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 1:57am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 1:57am

Copy link

changeset-bot bot commented Sep 24, 2024

🦋 Changeset detected

Latest commit: 944d56f

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 24, 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 24, 2024

Copy link
Contributor

github-actions bot commented Sep 24, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 41.93 KB (0%) 839 ms (0%) 250 ms (+59.63% 🔺) 1.1 s
thirdweb (cjs) 101.56 KB (0%) 2.1 s (0%) 327 ms (-12.76% 🔽) 2.4 s
thirdweb (minimal + tree-shaking) 4.82 KB (0%) 97 ms (0%) 20 ms (-7.52% 🔽) 117 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 5 ms (-70.61% 🔽) 15 ms
thirdweb/react (minimal + tree-shaking) 16.78 KB (0%) 336 ms (0%) 48 ms (+62.66% 🔺) 383 ms

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 45.00000% with 11 lines in your changes missing coverage. Please review.

Project coverage is 49.12%. Comparing base (1f1f99d) to head (944d56f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...irdweb/src/wallets/in-app/web/lib/web-connector.ts 9.09% 10 Missing ⚠️
...web/src/react/core/hooks/wallets/useAutoConnect.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4783   +/-   ##
=======================================
  Coverage   49.12%   49.12%           
=======================================
  Files        1051     1051           
  Lines       56670    56679    +9     
  Branches     3887     3888    +1     
=======================================
+ Hits        27840    27846    +6     
- Misses      28197    28200    +3     
  Partials      633      633           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 1f1f99d
packages 45.19% <45.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
...dweb/src/react/web/hooks/wallets/useAutoConnect.ts 100.00% <100.00%> (ø)
...kages/thirdweb/src/wallets/in-app/web/ecosystem.ts 77.77% <100.00%> (+5.05%) ⬆️
...web/src/react/core/hooks/wallets/useAutoConnect.ts 56.07% <50.00%> (ø)
...irdweb/src/wallets/in-app/web/lib/web-connector.ts 4.35% <9.09%> (-0.04%) ⬇️

storage,
}: {
storedToken: AuthStoredTokenWithCookieReturnType["storedToken"];
client: ThirdwebClient;
recoveryCode?: string;
encryptionKey?: string;
Copy link
Member

Choose a reason for hiding this comment

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

Do we still want/need this? Prevents custom auth from being used with ecosystem wallets

Copy link

graphite-app bot commented Sep 25, 2024

Merge activity

## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing wallet functionalities and authentication processes in the `thirdweb` library, particularly for ecosystem wallets in React Native. It introduces new wallet interfaces, updates existing methods, and improves error handling for user authentication.

### Detailed summary
- Removed obsolete `web-wallet.ts.changeset/chilled-dancers-cheer.md` file.
- Added support for ecosystem wallets in `useAutoConnect` hook.
- Updated `createInAppWallet` to include new `createOptions` structure.
- Defined `IWebWallet` interface with methods for wallet setup and user status.
- Expanded `EcosystemWalletCreationOptions` to include authentication options.
- Modified `getUserStatus` to handle user status retrieval with better error logging.
- Updated `InAppWebConnector` to utilize the new wallet interfaces and methods.
- Implemented `ShardedWallet` class with user wallet status and account retrieval.
- Enhanced error handling in the authentication processes across various modules.
- Removed deprecated methods from `native-auth.ts`.

> ✨ 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.

2 participants