-
Notifications
You must be signed in to change notification settings - Fork 202
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
feat(templates): integrate external wallet into React template #2314
Conversation
|
746847b
to
80ac48f
Compare
This PR is ready for review. I've addressed the previous feedback, organized the structure, and added comments. @holic I'd appreciate your feedback on this when you're available. I can update the approach and code as needed. Also, please point out anything that may be difficult to understand or requires further explanation. 🙇 |
The CI failed because turbo used the main branch's build cache and did "cache hit" for packages changed on main for some reason. 🤔 I'll merge main at some point. |
I've removed |
closing as we're taking a different approach for onboarding |
Summary
This pull request introduces the ability to use external wallets with the React template. In addition to the existing standalone burner account option, users can now opt for external wallets in the client UI. Regardless of whether they choose the standalone burner account setup or the external wallet with a delegated burner account setup, they can use the app without feeling any difference.
This PR aims to allow developers to integrate external wallets easily, which is necessary for non-development chains. It also maintains the standalone burner account experience to avoid the frictions of using external wallets during local development.
Experience
After the client is launched, users first choose between a standalone burner account and an external wallet with a delegated burner account. Selecting the former allows immediate use of the app, while the latter guides users to connect their external wallets and register delegation to their burner accounts. Afterward, they can start using the app.
When editing
App.ts
andcreateSystemCalls.ts
, there's no need to account for these differences because the code manages them under the hood.Structure
Below is the structure of the React components:
mud/templates/react/packages/client/src/index.tsx
Lines 16 to 26 in af147bb
To explain this, here is the expanded version with comments:
Demo
demo.mp4
Misc.
This PR includes the same code as #2366. Once the PR is merged,
callFrom.ts
and its associated dependencies (protocol-parser
andstore
) can be removed.