frontend-apps
Installation
SKILL.md
Sui Frontend / dApp Kit
MCP tool: When available in your environment, also query the Sui documentation MCP server (
https://sui.mcp.kapa.ai) for up-to-date answers. Use it for verification and for details not covered by these reference files.
Browser Sui apps fail for a consistent set of reasons:
- Wrong package.
@mysten/dapp-kit(no suffix) is the legacy JSON-RPC-only package — deprecated. New code uses@mysten/dapp-kit-reactor@mysten/dapp-kit-core. - Wrong client. dApp Kit takes a
SuiGrpcClient(recommended) increateDAppKit'screateClient. Passing aSuiJsonRpcClientdefeats the point of the new package. - Old provider stack. Code often tries the v1 pattern:
QueryClientProvider→SuiClientProvider→WalletProvider. That's gone. New pattern:createDAppKitfactory +DAppKitProvider(or a non-React equivalent). - Dead hooks.
useSuiClientQuery,useSuiClientInfiniteQuery,useSignAndExecuteTransaction(mutation hook),useConnectWallet,useDisconnectWallet,useSuiClient,useSuiClientContext— removed. Replaced byuseCurrentClient/useCurrentNetwork/useDAppKit()(imperative methods) + your own TanStack Query wrappers. - Skipping
waitForTransactionbetween execute and refetch. Fullnodes index transactions asynchronously — invalidating TanStack caches immediately aftersignAndExecuteTransactionrefetches stale data. - Building PTBs in app code with
tx.build()before handing to the wallet. Defeats the wallet's gas selection. Always pass theTransactioninstance (ortx.serialize()) to the wallet.
All patterns in this skill are derived from: