Canton dAppBooster
    Preparing search index...

    Module @bootnodedev/canton-dappbooster

    @bootnodedev/canton-dappbooster

    Canton dAppBooster is an open-source stack by BootNode for building Canton dApps on your own machine: a local Canton Network stack, wagmi-style hooks, UI components and CIP-0103 wallet support, wired together from the local network up to the UI. The installer, the guides and the rest of the stack live at dappbooster.cc.

    Reusable UI components for Canton dApps: reading Canton identifiers (display, truncation, copy-to-clipboard, explorer links) and entering them (validated party-id input). Amounts are the other half: a token-amount field, plus the exact-decimal utilities under it, because a number cannot carry a Canton amount without losing digits.

    The API reference is at components.dappbooster.cc.

    With npm:

    npm install @bootnodedev/canton-dappbooster @bootnodedev/canton-connect @canton-network/dapp-sdk @walletconnect/sign-client
    

    With pnpm:

    pnpm add @bootnodedev/canton-dappbooster @bootnodedev/canton-connect @canton-network/dapp-sdk @walletconnect/sign-client
    

    It needs React 19.

    Important

    An app that also uses Ark UI or Zag has to stay on Zag 1.47.0, which is @ark-ui/react 5.40.0. This package pins that version, and two Zag versions on one page freeze <TokenInput>'s token dialog when it opens inside another dialog.

    The components (L2) have no styling opinion at all. Styling comes from the separate @bootnodedev/canton-theme package (L3), which you import yourself:

    import '@bootnodedev/canton-theme/tokens.css'
    import '@bootnodedev/canton-theme/default.css'

    The contract between the two is the DOM each component renders, not code. The reasoning is in architecture.md.

    <ThemeProvider> owns the mode: light, dark or system, the default, which follows the OS. It writes the resolved value, light or dark, to data-theme on <html>, the attribute canton-theme keys its dark values on.

    useTheme() reads and sets the mode from any component inside the provider:

    import { ThemeProvider, useTheme } from '@bootnodedev/canton-dappbooster'

    const ModeToggle = () => {
    const { resolved, toggle } = useTheme()

    return <button onClick={toggle}>{resolved === 'dark' ? 'Light' : 'Dark'}</button>
    }

    const App = () => (
    <ThemeProvider>
    <ModeToggle />
    </ThemeProvider>
    )
    Warning

    Client only: the provider reads the OS preference when it mounts, so a server render throws.

    Script What it does
    pnpm build tsdown build into dist/: ESM index.js and connect.js, each with its .d.ts
    pnpm test vitest with jsdom and Testing Library, run against src
    pnpm typecheck tsc --noEmit

    An app in this repo runs against src in dev, with no build. Its production build reads dist, so run pnpm build here first, or from the repo root to build every workspace in order. How the build works is in Build & packaging.

    Main