feat(frontend): Enoki zkLogin (Sign in with Google)#92
Open
ewitulsk wants to merge 1 commit into
Open
Conversation
Register Enoki's zkLogin wallets into dapp-kit so social sign-in appears in the existing ConnectModal and works with the app's current useSignAndExecuteTransaction flow unchanged. - Add @mysten/enoki dependency - RegisterEnokiWallets component in main.tsx (inside SuiClientProvider, above WalletProvider); no-ops without keys or on unsupported networks - VITE_ENOKI_API_KEY / VITE_GOOGLE_CLIENT_ID config (both public, optional) - Document the new env vars in the frontend README Gas sponsorship (covering both zkLogin and external-wallet users via a backend + Enoki private key + portal allowlist) is a planned follow-up.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Integrates Enoki zkLogin so users can sign in with Google (social login) and get a Sui address without a browser-extension wallet. Enoki registers zkLogin as a Wallet-Standard wallet, so it appears in the existing
ConnectModaland works with the app's currentuseSignAndExecuteTransactionflow unchanged — no signing code was touched.Changes
@mysten/enoki(^1.0.8, compatible with@mysten/sui ^2.17.0).src/main.tsx: newRegisterEnokiWalletscomponent, rendered insideSuiClientProviderand aboveWalletProvider. Registers the Enoki Google wallet viauseEffectand cleans up withunregister.src/config.ts:VITE_ENOKI_API_KEY+VITE_GOOGLE_CLIENT_ID(both public, both optional).frontend/README.md: documents the two new env vars.Graceful by default
Registration no-ops when the keys aren't set or on a network Enoki doesn't support (e.g.
devnet), so local dev boots with zero setup and only browser-extension wallets are offered. Set both vars (ontestnet/mainnet) to enable the Google option.To enable in an environment
VITE_ENOKI_API_KEYandVITE_GOOGLE_CLIENT_IDin the environment.Verification
npm run build(tsc + vite) passes.Follow-up: universal gas sponsorship (not in this PR)
The end goal is gas sponsorship for all users. Enoki supports this for both zkLogin and external-wallet senders, but it needs infrastructure this PR intentionally omits because it can't be provisioned/tested here:
rust-backend/api-service) holding the Enoki private API key.build gasless → backend sponsors → connected wallet signs → backend executes, wrapping the currentuseSignAndExecuteTransactioncalls. One flow serves zkLogin and extension wallets alike.Happy to do that as the next PR once an Enoki account + private key are available.
https://claude.ai/code/session_015sQfezt6SJNd7w2bns494A
Generated by Claude Code