[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GQ1YM4JQGK7BF343MDD2BP":3,"skill-same:01M6GQ1YM4JQGK7BF343MDD2BP":118},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":6,"ownerHtmlUrl":54,"ownerBlogUrl":55,"ownerDescription":56,"updatedAt":57,"install":58,"resources":71},"01M6GQ1YM4JQGK7BF343MDD2BP","frontend-apps",null,"Sui frontend \u002F dApp development with @mysten\u002Fdapp-kit-react (React) and @mysten\u002Fdapp-kit-core (Vue, vanilla JS, Svelte, Web Components, other frameworks). Use when building browser apps that connect Sui wallets, query on-chain state, or submit transactions. Covers wallet connection, network switching, transaction execution, query patterns with TanStack React Query, and the specific pitfalls of browser + wallet + async-indexer environments. Pair with the `sui-sdks` skill for @mysten\u002Fsui Transaction construction patterns and the `ptbs` skill for PTB semantics.","jiayaoqijia\u002Fcryptoskill","jiayaoqijia","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1453879?v=4","01M6GMYTX7Q7S504VC6E756ENR","YQ","01M6GMYV1QKJ1CC75MTTGT9PR0",81,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fmystenlabs-frontend-apps\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fmystenlabs-frontend-apps\u002FSKILL.md",[],[20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"frontend","frontend apps","apps","react query","when","sdks","sui frontend","on-chain","dapp","kit","pitfalls","submit","chain","indexer","switching","svelte","query","Wallet","transactions","browser","connect","web components","react","components","2026-11-10 10:12:30",false,"---\nname: frontend-apps\ndescription: >\n  Sui frontend \u002F dApp development with @mysten\u002Fdapp-kit-react (React) and\n  @mysten\u002Fdapp-kit-core (Vue, vanilla JS, Svelte, Web Components, other\n  frameworks). Use when\n  building browser apps that connect Sui wallets, query on-chain state, or\n  submit transactions. Covers wallet connection, network switching, transaction\n  execution, query patterns with TanStack React Query, and the specific\n  pitfalls of browser + wallet + async-indexer environments. Pair with the\n  `sui-sdks` skill for @mysten\u002Fsui Transaction construction patterns and the\n  `ptbs` skill for PTB semantics.\n---\n\n# Sui Frontend \u002F dApp Kit\n\n> **MCP tool:** When available in your environment, also query the Sui documentation MCP server (`https:\u002F\u002Fsui.mcp.kapa.ai`) for up-to-date answers. Use it for verification and for details not covered by these reference files.\n\nBrowser Sui apps fail for a consistent set of reasons:\n\n1. **Wrong package.** `@mysten\u002Fdapp-kit` (no suffix) is the legacy JSON-RPC-only package — **deprecated**. New code uses `@mysten\u002Fdapp-kit-react` or `@mysten\u002Fdapp-kit-core`.\n2. **Wrong client.** dApp Kit takes a `SuiGrpcClient` (recommended) in `createDAppKit`'s `createClient`. Do not pass `SuiJsonRpcClient` — JSON-RPC is deprecated.\n3. **Old provider stack.** Code often tries the v1 pattern: `QueryClientProvider` → `SuiClientProvider` → `WalletProvider`. That's gone. New pattern: `createDAppKit` factory + `DAppKitProvider` (or a non-React equivalent).\n4. **Dead hooks.** `useSuiClientQuery`, `useSuiClientInfiniteQuery`, `useSignAndExecuteTransaction` (mutation hook), `useConnectWallet`, `useDisconnectWallet`, `useSuiClient`, `useSuiClientContext` — **removed**. Replaced by `useCurrentClient` \u002F `useCurrentNetwork` \u002F `useDAppKit()` (imperative methods) + your own TanStack Query wrappers.\n5. **Skipping `waitForTransaction` between execute and refetch.** Fullnodes index transactions asynchronously — invalidating TanStack caches immediately after `signAndExecuteTransaction` refetches stale data.\n6. **Building PTBs in app code with `tx.build()` before handing to the wallet.** Defeats the wallet's gas selection. Always pass the `Transaction` instance to the wallet.\n\nAll patterns in this skill are derived from:\n- https:\u002F\u002Fsdk.mystenlabs.com\u002Fdapp-kit (landing)\n- https:\u002F\u002Fsdk.mystenlabs.com\u002Fdapp-kit\u002Fgetting-started\u002Freact\n- https:\u002F\u002Fsdk.mystenlabs.com\u002Fdapp-kit\u002Fgetting-started\u002Fnext-js\n- https:\u002F\u002Fsdk.mystenlabs.com\u002Fdapp-kit\u002Fgetting-started\u002Fvue\n- https:\u002F\u002Fdocs.sui.io\u002Fstandards\u002Fwallet-standard\n\nIf unsure about any API, fetch from the relevant page — do not extrapolate from the legacy `@mysten\u002Fdapp-kit` or the pre-v2 hook surface. Many outdated tutorials exist.\n\n---\n\n## Reference files\n\n### setup — Install, factory, provider\n**Path:** `setup.md`\n**Load when:** starting a new dApp project, scaffolding React\u002FNext.js\u002FVue setup, or migrating from the old three-provider pattern. Covers package choice, `createDAppKit({ networks, createClient })`, `DAppKitProvider` (React), and the `declare module` TypeScript augmentation.\n\n### react — React hooks & patterns\n**Path:** `react.md`\n**Load when:** writing React components. Covers every current hook (`useCurrentAccount`, `useCurrentWallet`, `useCurrentNetwork`, `useCurrentClient`, `useDAppKit`, `useWallets`, `useWalletConnection`), standard components (`ConnectButton`), and wallet-gated UI idioms.\n\n### non-react — Vue, vanilla JS, Web Components\n**Path:** `non-react.md`\n**Load when:** building Vue \u002F Svelte \u002F vanilla JS dApps. Covers `@mysten\u002Fdapp-kit-core`, nanostores reactive state (`dAppKit.stores.$connection` etc.), Web Components registration, Vue bindings via `@nanostores\u002Fvue`.\n\n### queries — TanStack Query patterns\n**Path:** `queries.md`\n**Load when:** fetching on-chain data (balances, owned objects, coins, dynamic fields, transactions) in a dApp. Covers `useQuery` + `useCurrentClient`, `useInfiniteQuery` for paginated results, `enabled` guards, and cache invalidation after writes.\n\n### transactions — Signing and executing\n**Path:** `transactions.md`\n**Load when:** submitting any transaction from a dApp. Covers `dAppKit.signAndExecuteTransaction`, the `$kind`-based result discriminant, `signTransaction` (wallet signs but doesn't execute — for sponsored flows), `signPersonalMessage`, the `waitForTransaction` + `invalidateQueries` sequence, and common wallet UX failures.\n\n### limitations — What frontends can't or shouldn't do\n**Path:** `limitations.md`\n**Load when:** a user is designing something that feels like it crosses a browser-environment boundary. Covers: no backend-only features (gas station internals, validator keys), browser\u002FSSR caveats, auto-connect reliability, and the \"don't put secrets in the browser\" rules.\n\n## Routing guide\n\n| Task | Load |\n|------|------|\n| New React dApp from scratch | setup + react + queries + transactions |\n| New Vue \u002F vanilla \u002F Svelte dApp | setup + non-react |\n| \"How do I connect a wallet?\" | react (or non-react) |\n| \"How do I query a balance \u002F owned objects?\" | queries |\n| \"How do I send a transaction?\" | transactions + (sui-sdks for PTB construction) |\n| Sponsored tx flow | transactions (front-end side) + ptbs (PTB side) |\n| Migrating from `@mysten\u002Fdapp-kit` (no suffix) | setup + limitations + all as needed |\n| Why is my UI stale after a tx? | transactions + queries |\n| Dealing with SSR \u002F Next.js | setup + limitations |\n| Full code review of a dApp | **all reference files** + the code-review checklist below |\n| \"Review this code\" \u002F \"what's wrong with this snippet\" | the code-review checklist below + relevant reference files |\n\n## Skill Content\n\n### Key concepts\n\n- **Two packages, one API.** `@mysten\u002Fdapp-kit-react` wraps `@mysten\u002Fdapp-kit-core`. `createDAppKit` exists in both; actions (`signAndExecuteTransaction`, `signTransaction`, `switchNetwork`, `connectWallet`, `disconnectWallet`) are identical. What differs is how you read reactive state: React uses hooks; non-React reads nanostores stores.\n- **One instance, many networks.** `createDAppKit({ networks: [...], createClient })` creates one dApp Kit instance that knows about multiple networks. `dAppKit.switchNetwork(name)` changes the active one. The `createClient` factory is called once per network, lazily.\n- **gRPC by default.** The new dApp Kit is built for `SuiGrpcClient`. JSON-RPC is deprecated; use `SuiGrpcClient` in `createClient`.\n- **Wallets are browser-only.** Wallet detection uses `window.navigator.wallets` and CustomEvents. Any component that touches wallet state must be client-side rendered. In Next.js \u002F SSR frameworks this means `'use client'` on wallet-aware components.\n- **The wallet owns gas.** Apps build the `Transaction` and pass it to the wallet. The wallet picks gas coins, sets budget (via dry-run), and signs. Never call `tx.build()` + pass bytes unless it's a sponsored flow — see `transactions.md`.\n- **Fullnodes are eventually consistent.** `signAndExecuteTransaction` returns a digest before the data is queryable. Always `waitForTransaction` before refetching.\n\n### Rules\n\n1. **Use `@mysten\u002Fdapp-kit-react` or `@mysten\u002Fdapp-kit-core`** — never the bare `@mysten\u002Fdapp-kit` in new code. That package is JSON-RPC-only and deprecated.\n2. **Use `SuiGrpcClient` in `createClient`.** Not `SuiClient` — `SuiClient` is removed in v2; use `SuiGrpcClient` from `@mysten\u002Fsui\u002Fgrpc`.\n3. **Use `createDAppKit` + `DAppKitProvider`.** Not the three-provider stack (`QueryClientProvider` + `SuiClientProvider` + `WalletProvider`). You still wrap with `QueryClientProvider` if you use TanStack Query for data fetching, but dApp Kit itself doesn't need it.\n4. **Include the `declare module` TypeScript augmentation** so hooks get proper types without passing the instance manually.\n5. **Do not use the removed hooks.** `useSuiClientQuery` \u002F `useSuiClientInfiniteQuery` \u002F `useSuiClientContext` \u002F `useSuiClient` \u002F `useSignAndExecuteTransaction` (mutation hook) \u002F `useConnectWallet` \u002F `useDisconnectWallet` — gone. Use `useCurrentClient` + `useQuery`\u002F`useInfiniteQuery` + `useDAppKit()` imperative methods.\n6. **Null-check the current account.** `useCurrentAccount()` returns `null` before connection. Always `if (!account) return` \u002F gate with `enabled: !!account` in queries.\n7. **`waitForTransaction` before cache invalidation.** `await client.waitForTransaction({ digest: result.Transaction.digest })` then `queryClient.invalidateQueries(...)`. Reversing this fetches stale data.\n8. **Pass the `Transaction` instance to the wallet, not `await tx.build(...)` bytes.** The wallet needs to own gas selection. Exception: sponsored flows that use `tx.build({ client, onlyTransactionKind: true })` — see `ptbs` skill.\n9. **Check `result.$kind === 'FailedTransaction'` (or `result.FailedTransaction`).** Don't assume success. Don't use v1's `result.effects?.status?.status`.\n10. **Wallet-gated UI must client-render.** SSR without a client-side guard renders wallet buttons before wallets are detectable. Use `'use client'` \u002F dynamic imports \u002F effect-based hydration.\n11. **Vue: `useStore` returns a Vue ref — use `.value` in script code.** `const connection = useStore(dAppKit.stores.$connection)` returns a ref. Access state as `connection.value.account` in `\u003Cscript setup>`. Vue auto-unwraps refs in templates, but always show the `.value` pattern in script examples.\n\n### Code-review checklist\n\nWhen the user asks you to review a code snippet, do not stop at the first 2–3 issues you spot. Walk this checklist explicitly and call out **every** match. Browser Sui code typically has 5–10 issues stacked in a single component because it was copied from a v1 tutorial.\n\n**Imports \u002F packages**\n- `@mysten\u002Fsui.js` (anywhere) — frozen v1 package; replace with `@mysten\u002Fsui`.\n- `@mysten\u002Fdapp-kit` (no suffix) — deprecated JSON-RPC-only package; replace with `@mysten\u002Fdapp-kit-react` (React) or `@mysten\u002Fdapp-kit-core` (other frameworks).\n- `import { ConnectButton } from '@mysten\u002Fdapp-kit-react'` — wrong path; `ConnectButton` and `ConnectModal` are exported from `@mysten\u002Fdapp-kit-react\u002Fui`. Using the wrong path causes a silent white screen.\n- `import { SuiClient }` — `SuiClient` is removed in v2 — use `SuiGrpcClient` from `@mysten\u002Fsui\u002Fgrpc` (or `useCurrentClient()` inside components).\n- `import { TransactionBlock }` — renamed to `Transaction` in v2.\n\n**Removed hooks (any of these = bug)**\n- `useSuiClientQuery`, `useSuiClientInfiniteQuery`, `useSuiClientContext`, `useSuiClient` — replace with `useCurrentClient()` + TanStack `useQuery` \u002F `useInfiniteQuery`.\n- `useSignAndExecuteTransaction` (mutation hook) — replace with `useDAppKit().signAndExecuteTransaction(...)` called imperatively in event handlers.\n- `useConnectWallet`, `useDisconnectWallet` — replace with `useDAppKit().connectWallet()` \u002F `disconnectWallet()`.\n\n**Provider stack**\n- `SuiClientProvider` + `WalletProvider` (the v1 three-provider stack) — replace with `createDAppKit(...)` + `\u003CDAppKitProvider>`. `QueryClientProvider` from TanStack is still allowed.\n\n**Client construction inside components**\n- `new SuiClient(...)` \u002F `new SuiGrpcClient(...)` inside a component body — breaks network switching and re-creates a client per render. Use `useCurrentClient()`.\n- Missing `enabled: !!account` on queries that need a connected wallet — fires on undefined owner and errors.\n\n**Transaction construction**\n- `tx.pure(value)` (untyped) — replace with the typed helper matching the Move type: `tx.pure.u64(n)`, `tx.pure.address(addr)`, `tx.pure.string(s)`, etc.\n- `tx.build()` before handing to the wallet — defeats wallet gas selection. Pass the `Transaction` instance directly.\n\n**Execute \u002F wait \u002F status**\n- `signAndExecuteTransactionBlock(...)` (v1 method) — replace with `signAndExecuteTransaction(...)`.\n- `{ transactionBlock: tx }` parameter shape — replace with `{ transaction: tx }`.\n- `result.effects?.status?.status === 'success'` — v1 shape; replace with `result.$kind !== 'FailedTransaction'` (or check `result.FailedTransaction`).\n- `result.digest` direct access — on success the digest is at `result.Transaction.digest`; on failure there's no digest.\n- Cache invalidation immediately after execute — must `await client.waitForTransaction({ digest })` first, then `queryClient.invalidateQueries(...)`.\n\n**SSR \u002F Next.js**\n- Wallet-aware component without `'use client'` — wallet detection uses browser-only APIs.\n\nAfter walking the list, count the distinct issues you found. If it's fewer than 5 on a typical multi-line snippet pulled from an outdated tutorial, re-read the snippet — you almost certainly missed something.\n\n### Common mistakes\n\n- **Using `@tanstack\u002Freact-query`'s `useQuery` without `enabled: !!account`** for queries that require a connected wallet. The query fires with undefined owner and errors.\n- **Returning a `Transaction` from a React-Query `queryFn`.** Transactions aren't queries — use them in mutations or event handlers via `useDAppKit()`.\n- **`dAppKit.signAndExecuteTransaction({ transactionBlock: tx })`.** It's `{ transaction: tx }` in the new API.\n- **Reading `result.digest` directly.** On success the digest is at `result.Transaction.digest`. On failure there's no digest — check `result.FailedTransaction` first.\n- **Invalidating queries before `waitForTransaction`.** Classic stale-UI bug. Always wait first.\n- **Calling `new SuiGrpcClient(...)` inside components.** Breaks network switching. Use `useCurrentClient()`.\n- **Instantiating `SuinsClient` \u002F `DeepBookClient` directly.** Use `client.$extend(suins(), deepbook({ address }))` on the client returned from `createClient`.\n- **Leaving `autoConnect: true` with a confusing UX.** Auto-reconnect restores the last wallet on load. If the app handles permissions\u002Fnonces, account for the async nature of that restore (pending \u002F reconnecting states).\n- **Hardcoding testnet \u002F mainnet URLs in multiple places.** Keep them in a single `GRPC_URLS` map keyed by network name and reference from `createClient`.\n- **Using wallet-standard APIs directly.** dApp Kit wraps the wallet standard — don't call `window.navigator.wallets` yourself; use `useWallets()` \u002F `dAppKit.stores.$wallets`.\n- **Storing private keys or secrets in the browser.** Never. dApps sign via wallets; backends hold keys.\n","# Sui Frontend \u002F dApp Kit\n\n> **MCP tool:** When available in your environment, also query the Sui documentation MCP server (`https:\u002F\u002Fsui.mcp.kapa.ai`) for up-to-date answers. Use it for verification and for details not covered by these reference files.\n\nBrowser Sui apps fail for a consistent set of reasons:\n\n1. **Wrong package.** `@mysten\u002Fdapp-kit` (no suffix) is the legacy JSON-RPC-only package — **deprecated**. New code uses `@mysten\u002Fdapp-kit-react` or `@mysten\u002Fdapp-kit-core`.\n2. **Wrong client.** dApp Kit takes a `SuiGrpcClient` (recommended) in `createDAppKit`'s `createClient`. Do not pass `SuiJsonRpcClient` — JSON-RPC is deprecated.\n3. **Old provider stack.** Code often tries the v1 pattern: `QueryClientProvider` → `SuiClientProvider` → `WalletProvider`. That's gone. New pattern: `createDAppKit` factory + `DAppKitProvider` (or a non-React equivalent).\n4. **Dead hooks.** `useSuiClientQuery`, `useSuiClientInfiniteQuery`, `useSignAndExecuteTransaction` (mutation hook), `useConnectWallet`, `useDisconnectWallet`, `useSuiClient`, `useSuiClientContext` — **removed**. Replaced by `useCurrentClient` \u002F `useCurrentNetwork` \u002F `useDAppKit()` (imperative methods) + your own TanStack Query wrappers.\n5. **Skipping `waitForTransaction` between execute and refetch.** Fullnodes index transactions asynchronously — invalidating TanStack caches immediately after `signAndExecuteTransaction` refetches stale data.\n6. **Building PTBs in app code with `tx.build()` before handing to the wallet.** Defeats the wallet's gas selection. Always pass the `Transaction` instance to the wallet.\n\nAll patterns in this skill are derived from:\n- https:\u002F\u002Fsdk.mystenlabs.com\u002Fdapp-kit (landing)\n- https:\u002F\u002Fsdk.mystenlabs.com\u002Fdapp-kit\u002Fgetting-started\u002Freact\n- https:\u002F\u002Fsdk.mystenlabs.com\u002Fdapp-kit\u002Fgetting-started\u002Fnext-js\n- https:\u002F\u002Fsdk.mystenlabs.com\u002Fdapp-kit\u002Fgetting-started\u002Fvue\n- https:\u002F\u002Fdocs.sui.io\u002Fstandards\u002Fwallet-standard\n\nIf unsure about any API, fetch from the relevant page — do not extrapolate from the legacy `@mysten\u002Fdapp-kit` or the pre-v2 hook surface. Many outdated tutorials exist.\n\n---\n\n## Reference files\n\n### setup — Install, factory, provider\n**Path:** `setup.md`\n**Load when:** starting a new dApp project, scaffolding React\u002FNext.js\u002FVue setup, or migrating from the old three-provider pattern. Covers package choice, `createDAppKit({ networks, createClient })`, `DAppKitProvider` (React), and the `declare module` TypeScript augmentation.\n\n### react — React hooks & patterns\n**Path:** `react.md`\n**Load when:** writing React components. Covers every current hook (`useCurrentAccount`, `useCurrentWallet`, `useCurrentNetwork`, `useCurrentClient`, `useDAppKit`, `useWallets`, `useWalletConnection`), standard components (`ConnectButton`), and wallet-gated UI idioms.\n\n### non-react — Vue, vanilla JS, Web Components\n**Path:** `non-react.md`\n**Load when:** building Vue \u002F Svelte \u002F vanilla JS dApps. Covers `@mysten\u002Fdapp-kit-core`, nanostores reactive state (`dAppKit.stores.$connection` etc.), Web Components registration, Vue bindings via `@nanostores\u002Fvue`.\n\n### queries — TanStack Query patterns\n**Path:** `queries.md`\n**Load when:** fetching on-chain data (balances, owned objects, coins, dynamic fields, transactions) in a dApp. Covers `useQuery` + `useCurrentClient`, `useInfiniteQuery` for paginated results, `enabled` guards, and cache invalidation after writes.\n\n### transactions — Signing and executing\n**Path:** `transactions.md`\n**Load when:** submitting any transaction from a dApp. Covers `dAppKit.signAndExecuteTransaction`, the `$kind`-based result discriminant, `signTransaction` (wallet signs but doesn't execute — for sponsored flows), `signPersonalMessage`, the `waitForTransaction` + `invalidateQueries` sequence, and common wallet UX failures.\n\n### limitations — What frontends can't or shouldn't do\n**Path:** `limitations.md`\n**Load when:** a user is designing something that feels like it crosses a browser-environment boundary. Covers: no backend-only features (gas station internals, validator keys), browser\u002FSSR caveats, auto-connect reliability, and the \"don't put secrets in the browser\" rules.\n\n## Routing guide\n\n| Task | Load |\n|------|------|\n| New React dApp from scratch | setup + react + queries + transactions |\n| New Vue \u002F vanilla \u002F Svelte dApp | setup + non-react |\n| \"How do I connect a wallet?\" | react (or non-react) |\n| \"How do I query a balance \u002F owned objects?\" | queries |\n| \"How do I send a transaction?\" | transactions + (sui-sdks for PTB construction) |\n| Sponsored tx flow | transactions (front-end side) + ptbs (PTB side) |\n| Migrating from `@mysten\u002Fdapp-kit` (no suffix) | setup + limitations + all as needed |\n| Why is my UI stale after a tx? | transactions + queries |\n| Dealing with SSR \u002F Next.js | setup + limitations |\n| Full code review of a dApp | **all reference files** + the code-review checklist below |\n| \"Review this code\" \u002F \"what's wrong with this snippet\" | the code-review checklist below + relevant reference files |\n\n## Skill Content\n\n### Key concepts\n\n- **Two packages, one API.** `@mysten\u002Fdapp-kit-react` wraps `@mysten\u002Fdapp-kit-core`. `createDAppKit` exists in both; actions (`signAndExecuteTransaction`, `signTransaction`, `switchNetwork`, `connectWallet`, `disconnectWallet`) are identical. What differs is how you read reactive state: React uses hooks; non-React reads nanostores stores.\n- **One instance, many networks.** `createDAppKit({ networks: [...], createClient })` creates one dApp Kit instance that knows about multiple networks. `dAppKit.switchNetwork(name)` changes the active one. The `createClient` factory is called once per network, lazily.\n- **gRPC by default.** The new dApp Kit is built for `SuiGrpcClient`. JSON-RPC is deprecated; use `SuiGrpcClient` in `createClient`.\n- **Wallets are browser-only.** Wallet detection uses `window.navigator.wallets` and CustomEvents. Any component that touches wallet state must be client-side rendered. In Next.js \u002F SSR frameworks this means `'use client'` on wallet-aware components.\n- **The wallet owns gas.** Apps build the `Transaction` and pass it to the wallet. The wallet picks gas coins, sets budget (via dry-run), and signs. Never call `tx.build()` + pass bytes unless it's a sponsored flow — see `transactions.md`.\n- **Fullnodes are eventually consistent.** `signAndExecuteTransaction` returns a digest before the data is queryable. Always `waitForTransaction` before refetching.\n\n### Rules\n\n1. **Use `@mysten\u002Fdapp-kit-react` or `@mysten\u002Fdapp-kit-core`** — never the bare `@mysten\u002Fdapp-kit` in new code. That package is JSON-RPC-only and deprecated.\n2. **Use `SuiGrpcClient` in `createClient`.** Not `SuiClient` — `SuiClient` is removed in v2; use `SuiGrpcClient` from `@mysten\u002Fsui\u002Fgrpc`.\n3. **Use `createDAppKit` + `DAppKitProvider`.** Not the three-provider stack (`QueryClientProvider` + `SuiClientProvider` + `WalletProvider`). You still wrap with `QueryClientProvider` if you use TanStack Query for data fetching, but dApp Kit itself doesn't need it.\n4. **Include the `declare module` TypeScript augmentation** so hooks get proper types without passing the instance manually.\n5. **Do not use the removed hooks.** `useSuiClientQuery` \u002F `useSuiClientInfiniteQuery` \u002F `useSuiClientContext` \u002F `useSuiClient` \u002F `useSignAndExecuteTransaction` (mutation hook) \u002F `useConnectWallet` \u002F `useDisconnectWallet` — gone. Use `useCurrentClient` + `useQuery`\u002F`useInfiniteQuery` + `useDAppKit()` imperative methods.\n6. **Null-check the current account.** `useCurrentAccount()` returns `null` before connection. Always `if (!account) return` \u002F gate with `enabled: !!account` in queries.\n7. **`waitForTransaction` before cache invalidation.** `await client.waitForTransaction({ digest: result.Transaction.digest })` then `queryClient.invalidateQueries(...)`. Reversing this fetches stale data.\n8. **Pass the `Transaction` instance to the wallet, not `await tx.build(...)` bytes.** The wallet needs to own gas selection. Exception: sponsored flows that use `tx.build({ client, onlyTransactionKind: true })` — see `ptbs` skill.\n9. **Check `result.$kind === 'FailedTransaction'` (or `result.FailedTransaction`).** Don't assume success. Don't use v1's `result.effects?.status?.status`.\n10. **Wallet-gated UI must client-render.** SSR without a client-side guard renders wallet buttons before wallets are detectable. Use `'use client'` \u002F dynamic imports \u002F effect-based hydration.\n11. **Vue: `useStore` returns a Vue ref — use `.value` in script code.** `const connection = useStore(dAppKit.stores.$connection)` returns a ref. Access state as `connection.value.account` in `\u003Cscript setup>`. Vue auto-unwraps refs in templates, but always show the `.value` pattern in script examples.\n\n### Code-review checklist\n\nWhen the user asks you to review a code snippet, do not stop at the first 2–3 issues you spot. Walk this checklist explicitly and call out **every** match. Browser Sui code typically has 5–10 issues stacked in a single component because it was copied from a v1 tutorial.\n\n**Imports \u002F packages**\n- `@mysten\u002Fsui.js` (anywhere) — frozen v1 package; replace with `@mysten\u002Fsui`.\n- `@mysten\u002Fdapp-kit` (no suffix) — deprecated JSON-RPC-only package; replace with `@mysten\u002Fdapp-kit-react` (React) or `@mysten\u002Fdapp-kit-core` (other frameworks).\n- `import { ConnectButton } from '@mysten\u002Fdapp-kit-react'` — wrong path; `ConnectButton` and `ConnectModal` are exported from `@mysten\u002Fdapp-kit-react\u002Fui`. Using the wrong path causes a silent white screen.\n- `import { SuiClient }` — `SuiClient` is removed in v2 — use `SuiGrpcClient` from `@mysten\u002Fsui\u002Fgrpc` (or `useCurrentClient()` inside components).\n- `import { TransactionBlock }` — renamed to `Transaction` in v2.\n\n**Removed hooks (any of these = bug)**\n- `useSuiClientQuery`, `useSuiClientInfiniteQuery`, `useSuiClientContext`, `useSuiClient` — replace with `useCurrentClient()` + TanStack `useQuery` \u002F `useInfiniteQuery`.\n- `useSignAndExecuteTransaction` (mutation hook) — replace with `useDAppKit().signAndExecuteTransaction(...)` called imperatively in event handlers.\n- `useConnectWallet`, `useDisconnectWallet` — replace with `useDAppKit().connectWallet()` \u002F `disconnectWallet()`.\n\n**Provider stack**\n- `SuiClientProvider` + `WalletProvider` (the v1 three-provider stack) — replace with `createDAppKit(...)` + `\u003CDAppKitProvider>`. `QueryClientProvider` from TanStack is still allowed.\n\n**Client construction inside components**\n- `new SuiClient(...)` \u002F `new SuiGrpcClient(...)` inside a component body — breaks network switching and re-creates a client per render. Use `useCurrentClient()`.\n- Missing `enabled: !!account` on queries that need a connected wallet — fires on undefined owner and errors.\n\n**Transaction construction**\n- `tx.pure(value)` (untyped) — replace with the typed helper matching the Move type: `tx.pure.u64(n)`, `tx.pure.address(addr)`, `tx.pure.string(s)`, etc.\n- `tx.build()` before handing to the wallet — defeats wallet gas selection. Pass the `Transaction` instance directly.\n\n**Execute \u002F wait \u002F status**\n- `signAndExecuteTransactionBlock(...)` (v1 method) — replace with `signAndExecuteTransaction(...)`.\n- `{ transactionBlock: tx }` parameter shape — replace with `{ transaction: tx }`.\n- `result.effects?.status?.status === 'success'` — v1 shape; replace with `result.$kind !== 'FailedTransaction'` (or check `result.FailedTransaction`).\n- `result.digest` direct access — on success the digest is at `result.Transaction.digest`; on failure there's no digest.\n- Cache invalidation immediately after execute — must `await client.waitForTransaction({ digest })` first, then `queryClient.invalidateQueries(...)`.\n\n**SSR \u002F Next.js**\n- Wallet-aware component without `'use client'` — wallet detection uses browser-only APIs.\n\nAfter walking the list, count the distinct issues you found. If it's fewer than 5 on a typical multi-line snippet pulled from an outdated tutorial, re-read the snippet — you almost certainly missed something.\n\n### Common mistakes\n\n- **Using `@tanstack\u002Freact-query`'s `useQuery` without `enabled: !!account`** for queries that require a connected wallet. The query fires with undefined owner and errors.\n- **Returning a `Transaction` from a React-Query `queryFn`.** Transactions aren't queries — use them in mutations or event handlers via `useDAppKit()`.\n- **`dAppKit.signAndExecuteTransaction({ transactionBlock: tx })`.** It's `{ transaction: tx }` in the new API.\n- **Reading `result.digest` directly.** On success the digest is at `result.Transaction.digest`. On failure there's no digest — check `result.FailedTransaction` first.\n- **Invalidating queries before `waitForTransaction`.** Classic stale-UI bug. Always wait first.\n- **Calling `new SuiGrpcClient(...)` inside components.** Breaks network switching. Use `useCurrentClient()`.\n- **Instantiating `SuinsClient` \u002F `DeepBookClient` directly.** Use `client.$extend(suins(), deepbook({ address }))` on the client returned from `createClient`.\n- **Leaving `autoConnect: true` with a confusing UX.** Auto-reconnect restores the last wallet on load. If the app handles permissions\u002Fnonces, account for the async nature of that restore (pending \u002F reconnecting states).\n- **Hardcoding testnet \u002F mainnet URLs in multiple places.** Keep them in a single `GRPC_URLS` map keyed by network name and reference from `createClient`.\n- **Using wallet-standard APIs directly.** dApp Kit wraps the wallet standard — don't call `window.navigator.wallets` yourself; use `useWallets()` \u002F `dAppKit.stores.$wallets`.\n- **Storing private keys or secrets in the browser.** Never. dApps sign via wallets; backends hold keys.\n",{"name":5,"description":7},"main","3df1d0d67b30ff15236561f8c0f9f06d33f42dfd","skills\u002Fchains\u002Fmystenlabs-frontend-apps",17,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia","https:\u002F\u002Feth2030.com","Hardcore infra. Building @alt-research and applied cryptography.","2026-11-15 02:28:10",{"source":8,"skillName":5,"commands":59,"prompt":69,"zipAvailable":70},[60,63,66],{"tool":61,"command":62},"npx","npx skills add jiayaoqijia\u002Fcryptoskill --skill frontend-apps",{"tool":64,"command":65},"bunx","bunx skills add jiayaoqijia\u002Fcryptoskill --skill frontend-apps",{"tool":67,"command":68},"pnpm","pnpm dlx skills add jiayaoqijia\u002Fcryptoskill --skill frontend-apps","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fmystenlabs-frontend-apps\u002FSKILL.md",true,[72,78,82,86,90,94,98,102,106,110,114],{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"evals\u002Fcode-evals.json","REFERENCE","参考文档",1962,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fmystenlabs-frontend-apps\u002Fevals\u002Fcode-evals.json",{"path":79,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":80,"sourceHtmlUrl":81},"evals\u002Fevals.json",14192,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fmystenlabs-frontend-apps\u002Fevals\u002Fevals.json",{"path":83,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":85,"sourceHtmlUrl":16},"LICENSE","许可证",11357,{"path":87,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":88,"sourceHtmlUrl":89},"limitations.md",6315,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fmystenlabs-frontend-apps\u002Flimitations.md",{"path":91,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":92,"sourceHtmlUrl":93},"non-react.md",6334,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fmystenlabs-frontend-apps\u002Fnon-react.md",{"path":95,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":96,"sourceHtmlUrl":97},"queries.md",10956,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fmystenlabs-frontend-apps\u002Fqueries.md",{"path":99,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":100,"sourceHtmlUrl":101},"react.md",6350,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fmystenlabs-frontend-apps\u002Freact.md",{"path":103,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":104,"sourceHtmlUrl":105},"setup.md",7182,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fmystenlabs-frontend-apps\u002Fsetup.md",{"path":107,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":108,"sourceHtmlUrl":109},"SOURCE.md",329,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fmystenlabs-frontend-apps\u002FSOURCE.md",{"path":111,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":112,"sourceHtmlUrl":113},"transactions.md",11355,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fmystenlabs-frontend-apps\u002Ftransactions.md",{"path":115,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":116,"sourceHtmlUrl":117},"TRUST.auto.yaml",2100,"https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fchains\u002Fmystenlabs-frontend-apps\u002FTRUST.auto.yaml",[119,129,137,145,153,161],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":124,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":128},"01M7DTKCERMV0RNX3HZJP4CZ26","troves","Deposit and withdraw from Troves DeFi yield vault strategies on Starknet. View available strategies, check positions, and manage vault deposits. Use this skill when the user mentions Troves, vault, yield vault, DeFi vault, strategy, yield farming, vault deposit, vault withdraw, earning yield through vaults, passive yield strategies, or wants to deposit into or withdraw from a yield strategy — even if they don't say \"Troves\" explicitly.","MIT","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-troves\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-troves\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":133,"sourceHtmlUrl":134,"categories":135,"keywords":136,"publishedAt":128},"01M7DTK6CJSMGC8KCQHGNYFZBD","trade","Swap tokens on Starknet via Fibrous DEX aggregator. Supports per-provider selection (avnu, ekubo, or auto to race all). Use this skill when the user wants to swap, exchange, trade, convert, buy, or sell one token for another on Starknet. Also use when the user asks about token prices, exchange rates, DEX routing, best swap route, or wants to check how much they would receive for a given amount — even if they don't explicitly say \"swap\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-trade\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-trade\u002FSKILL.md",[],[],{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":141,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":128},"01M7DTJZ6A0X4PAW3Y8W4J9K64","staking","Stake, unstake, claim, and compound rewards for STRK, WBTC, tBTC, SolvBTC, and LBTC on Starknet. View validators, pools, and staking positions. Use this skill when the user mentions staking, delegating, validators, staking pools, rewards, compounding, unstaking, earning yield, passive income on crypto, or wants to earn on their STRK or BTC tokens — even if they don't say \"stake\" explicitly.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-staking\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-staking\u002FSKILL.md",[],[],{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":149,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":128},"01M7DTJSDZJKCDMW7GHRF4BRH5","send","Send STRK, ETH, or any ERC-20 token to a Starknet address. Supports simulation (dry-run) before execution. Use this skill when the user wants to send, transfer, pay, tip, or move tokens to another wallet address on Starknet. Also trigger when the user mentions sending funds to someone, making a payment, transferring assets, or moving crypto to a specific address — even if they just say \"pay 10 STRK to 0x...\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-send\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-send\u002FSKILL.md",[],[],{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":157,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":128},"01M7DTJG1E480D51ZQ7WKDQ26K","portfolio","View a comprehensive DeFi portfolio dashboard and optimize portfolio allocation via automated rebalancing. Use this skill when the user wants an overview, summary, dashboard, total value, net worth, portfolio rebalancing, target allocation, or wants to see all their DeFi positions across Starknet at once. Also trigger when the user asks \"what do I have\", \"show me everything\", \"how much am I worth\", \"my positions\", \"my investments\", \"rebalance my portfolio\", \"I want 50% ETH\", \"optimize my holdings\", or any request for a holistic view of their Starknet holdings — even if they don't explicitly say \"portfolio\".","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-portfolio\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-portfolio\u002FSKILL.md",[],[],{"skillNo":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":123,"licenseFileUrl":165,"sourceHtmlUrl":166,"categories":167,"keywords":168,"publishedAt":128},"01M7DTJ7M8TE9R2N36HFBZDGVD","multi-swap","Execute multiple token swaps in a single Starknet transaction via Fibrous (default). Supports per-provider selection (avnu, ekubo, or auto to race all). Supports 2-3 swap pairs bundled into one multicall. Use this skill when the user wants to swap multiple token pairs at once, do batch swaps, execute several trades simultaneously, perform parallel swaps, or do bulk trading in one transaction. Also trigger when the user mentions \"two swaps\", \"three swaps\", \"swap X and Y at the same time\", or wants to convert multiple tokens in a single call.","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-multi-swap\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjiayaoqijia\u002Fcryptoskill\u002Fblob\u002Fmain\u002Fskills\u002Fmcp-servers\u002Fahmetenesdur-multi-swap\u002FSKILL.md",[],[]]