This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Sui wallet adapter library for SvelteKit and Svelte 5, providing wallet connection and transaction functionality. The library is built as an npm package that integrates with the Mysten Labs wallet standard.
pnpm dev- Start development server for the example apppnpm build- Build the library and package itpnpm package- Package the library for distribution (runssvelte-kit sync && svelte-package && publint)
pnpm lint- Run prettier and eslint checkspnpm format- Format code with prettierpnpm check- Run svelte-check for TypeScript validationpnpm check:watch- Run svelte-check in watch mode
pnpm test- Run all tests (integration + unit)pnpm test:unit- Run unit tests with vitestpnpm test:integration- Run Playwright integration tests
pnpm preview- Preview the built application
src/lib/- Main library codewallet-adapter/- Core wallet adapter functionalitywallet-adapter.svelte.ts- Main wallet adapter implementation using Svelte 5 runeswallet-adapter.type.ts- TypeScript types and interfaceswallet-adapter.constant.ts- Constants and default valueswallet-adapter-tools.ts- Utility functions
components/- Svelte components for UIconnect-button/- Wallet connection buttonconnect-modal/- Wallet selection modalaccount-dropdown-menu/- Account management dropdownui/- Reusable UI components (shadcn-svelte based)
- WalletAdapter - Central state management for wallet connections using Svelte 5 runes
- ConnectButton - Primary UI component for wallet connection
- ConnectModal - Modal for wallet selection and connection flow
src/routes/- Example SvelteKit app demonstrating usage- All routes serve as testing/showcase for the library functionality
- Built on Mysten Labs Sui SDK (
@mysten/sui,@mysten/wallet-standard) - Uses SvelteKit for packaging and Svelte 5 with runes for reactivity
- Styled with Tailwind CSS and shadcn-svelte components
- Requires
tailwindcss,bits-ui, andsvelte-radixas peer dependencies
The adapter supports multiple Sui networks via pre-configured instances:
walletAdapter- Mainnet (default)devnetWalletAdapter- DevnettestnetWalletAdapter- TestnetlocalnetWalletAdapter- Localnet
- No local storage persistence
- Wallet switching issues (manual disconnect required)
- Client-side only, SSR not supported
- Library code lives in
src/lib/- everything else is for examples/showcase - The project uses SvelteKit's library packaging system
- Tailwind content path must include the library:
./node_modules/@builders-of-stuff/svelte-sui-wallet-adapter/**/*.{html,js,svelte,ts}