feat(chat-app): migrate to @mysten/dapp-kit-react#74
Open
ioannischtz wants to merge 9 commits into
Open
Conversation
- Replace deprecated @mysten/dapp-kit (JSON-RPC) with @mysten/dapp-kit-react + @mysten/dapp-kit-core (gRPC-native); bump @mysten/sui to ^2.17.0 and drop the now-unused @tanstack/react-query. - New src/lib/dapp-kit.ts: createDAppKit instance (testnet + devstack localnet networks, SuiGrpcClient factory) and a signAndExecute helper that throws on FailedTransaction, since the new kit returns a $kind union instead of throwing. - Swap the provider stack to DAppKitProvider and the removed hooks to their replacements (useCurrentClient, useDAppKit, imperative sign methods); delete network-config.ts. - Register the devstack dev-wallet through devWalletInitializer / walletInitializers instead of the manual DevWallet + register + mountDevWallet shim, pinning the panel's active network to localnet. - Keep the queued-sign serialization: dApp Kit does not queue wallet requests and the dev-wallet rejects concurrent signs. Verified on devstack localnet (connect, create group, send, fresh-session decrypt via Playwright) and on testnet (create, send, fresh-client decrypt over the same gRPC client config, plus browser gRPC-Web CORS probe). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- README: new package names, dependency table, gRPC endpoint note for VITE_SUI_RPC_URL. - DEVSTACK.md: shim now hands a walletInitializers entry to createDAppKit; drop the completed migration follow-up note. - SYSTEM_DESIGN.md: provider stack, client-init flow, and session-key ADR updated to the createDAppKit/DAppKitProvider architecture. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- spin-up-local-devstack: dev-wallet wiring now goes through devWalletInitializer / walletInitializers; refresh the mountDevWallet troubleshooting entries and mark the migration follow-up done. - configure-session-keys / integrate-sui-stack-messaging: fix stale dapp-kit-next / CurrentAccountSigner package references. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Replace the hand-rolled DappKitSigner + onSign callback with dApp Kit's
CurrentAccountSigner, subclassed as QueuedCurrentAccountSigner to serialize
personal-message signs (dApp Kit doesn't queue wallet requests; the devstack
dev-wallet rejects concurrent signs).
- Switch the SDK session-key config from Tier 2 (address + onSign) to Tier 1
({ signer }) — Seal certifies the session key through the queued signer, so
the ceremony and relayer request signing share one queue.
- Drop the queuedSign promise-chain plumbing from MessagingClientContext.
Verified on devstack localnet (send + fresh-session decrypt) and testnet
(Tier-1 create -> send -> fresh-client decrypt, digest 32fGQrMpszmSHVM9...).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- chat-app README / DEVSTACK / SYSTEM_DESIGN: Tier-1 signer-based session keys, queued-signer file map entry, ADR-2 rewritten for the queued CurrentAccountSigner decision. - Skills: point the sign-serialization guidance at the queued-signer pattern and the worked example in chat-app/src/lib/queued-signer.ts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Examples.md: tx.* wallet integration now uses useDAppKit() + signAndExecuteTransaction, with a note on the $kind result union. - Setup.md / Encryption.md: CurrentAccountSigner is @mysten/dapp-kit-core's (was attributed to dapp-kit / dapp-kit-next). - APIRef.md / Setup.md: neutral "dApp Kit" wording for tx.* signing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
After a reload, dApp Kit's autoConnect restores the account before the messaging client finishes initializing (in devstack mode it waits on the generated-config load). CreateGroupModal mounted on `account` alone and calls useRequiredMessagingClient before its `open` check, so the init window threw "Wallet must be connected to use messaging client" into the ErrorBoundary — unrecoverable across reloads since the race reproduces every time. Render the body and modal only once the client exists, with an interim "Setting up the messaging client" state while an account is connected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Callers read back the state they just changed (permissions after group creation, member lists after admin actions), but fullnode reads lag execution until the transaction is indexed. The most visible symptom: right after creating a group, the auto-selected chat showed "You don't have permission to send messages" until the group was re-selected. Wait on dAppKit.getClient().waitForTransaction(digest) before resolving, so every call site gets read-your-writes ordering. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
nikos-kitmeridis
approved these changes
Jun 12, 2026
Collaborator
Style Guide AuditAudited 4 file(s) against the Sui Documentation Style Guide. 2 violation(s) found. All must be fixed before merge.
|
- Examples.md: remove em dash and use "onchain" per the Sui docs style guide. - vite.config.ts: fix an inaccurate comment — devstackVitePlugin() aliases @generated only; the dev wallet is registered via the shim's walletInitializers entry (SHIM_ACTIVE_SOURCE), not the plugin. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Migrates the chat-app off the deprecated
@mysten/dapp-kit(JSON-RPC-only) to@mysten/dapp-kit-react+@mysten/dapp-kit-core(gRPC-native). Closes SEW-1003.createDAppKit+DAppKitProviderreplace the three-provider stack; removed hooks swapped foruseCurrentClient/useDAppKitimperative methods;@mysten/suibumped to^2.17.0(peer requirement); unused TanStack Query dropped.signAndExecutehelper: throws on the$kind: 'FailedTransaction'result union (the new kit doesn't throw) and waits for tx indexing before resolving, so call sites get read-your-writes ordering.devWalletInitializer({ mountUI: true })inwalletInitializers— drops the manualDevWallet+register()+mountDevWallet()shim from feat(chat-app): fully-local devstack stack with local Seal #73; panel pinned to localnet viaonWalletCreated.QueuedCurrentAccountSignersubclasses dapp-kit-core'sCurrentAccountSignerand serializessignPersonalMessage(dApp Kit doesn't queue wallet requests; the dev-wallet rejects concurrent signs). Hand-rolledDappKitSignerdeleted.Verified: devstack localnet create → send → fresh-session decrypt (Playwright-driven, incl. dev-wallet approvals); testnet create → send → fresh-client decrypt over the same gRPC client config; browser gRPC-Web CORS probe against the testnet fullnode.
Done via Fable 5 + dynamic-workflows + manual steering.
🤖 Generated with Claude Code