Example Integration
Example app
This repo includes an example app that integrates the widget
Stack
React 18 + TypeScript + Vite
@zofai/trading-widget β ZO trading UI and components
@mysten/dapp-kit-react + @mysten/sui β Sui wallet connection (mainnet)
UnoCSS β styling (Tailwind-style utilities + shadcn preset)
Jotai β state (via widget
appStore)TanStack Query β data fetching
Setup
pnpm installScripts
pnpm dev
Start dev server (Vite)
pnpm build
Production build
pnpm preview
Preview production build
Project structure
src/main.tsxβ App bootstrap: Jotai, React Query, DAppKit, and root<App />src/App.tsxβ Layout with header (brand, RPC settings, connect button) and full-height<TradingWidget />src/dapp-kit.tsβ Mysten dApp Kit config (Sui mainnet/testnet gRPC URLs and type registration)
Requirements
The widget expects to run inside the providers set up in
main.tsx:JotaiProvider(withappStore),QueryClientProvider, andDAppKitProvider.Import the widget styles:
@zofai/trading-widget/style.css
Last updated