canton-dapp-sdk
Installation
SKILL.md
Canton dApp SDK (CIP-0103)
Overview
The dApp SDK (@canton-network/dapp-sdk) lets a web dApp connect to a user's Canton wallet (e.g. the Wallet Gateway) and request signatures/transactions — the Canton analogue of connecting to MetaMask. It implements CIP-0103 (the dApp Standard). Two layers:
- dApp SDK (recommended) — high-level wrapper with convenient methods + event handlers.
- Provider API — low-level, EIP-1193-style (
window.canton,provider.request({ method, params })); use for direct control or existing provider infra.
Setup & connect
import * as sdk from '@canton-network/dapp-sdk'
await sdk.init() // call once on mount: registers adapters, restores prior session (no picker)
const { isConnected } = await sdk.connect() // opens auth/login flow if needed
await sdk.disconnect() // end the session
Check state without logging in: await sdk.isConnected(); full status: await sdk.status() (result.connection.isConnected); active network: await sdk.getActiveNetwork() (e.g. canton:da-mainnet).