Skip to main content

Documentation Index

Fetch the complete documentation index at: https://cantonfoundation-add-app-development-module-579.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

The dApp SDK is a TypeScript library for building decentralized applications on the Canton Network. It provides a high-level interface for connecting to Canton wallets, managing accounts, signing messages, and executing transactions. The SDK implements the dApp API as defined in CIP-0103, establishing a vendor-neutral standard that enables any dApp to interoperate with any Canton-compatible wallet. Overview The dApp SDK decouples your application from wallet implementations, allowing users to choose their preferred wallet and signing provider. The SDK handles:
  • Wallet Connectivity - Connect, disconnect, and monitor connection status
  • Account Management - List accounts, get the primary account, and respond to account changes
  • Transaction Signing - Request user approval and signatures for Daml transactions
  • Message Signing - Sign arbitrary messages for authentication or verification
  • Ledger API Access - Proxy authenticated requests to the Canton JSON Ledger API
  • Real-time Events - Subscribe to status changes, account changes, and transaction lifecycle events
Architecture The SDK provides two levels of abstraction:
  1. dApp SDK (recommended) - High-level methods like sdk.connect(), sdk.listAccounts(), and sdk.prepareExecute() for common operations
  2. Provider API - Low-level EIP-1193-compatible interface using provider.request({ method, params }) for direct API access
Both interfaces work with the same underlying dApp API, so you can mix and match as needed. Transport Support The SDK supports multiple transport mechanisms to connect to different wallet types:
  • postMessage - For browser extension wallets that inject a provider into the page
  • HTTP/SSE - For remote wallets and server-side wallet gateways
The SDK automatically handles the transport layer, allowing your dApp to work with both local and remote wallets without code changes. Provider Discovery When using browser extension wallets, the SDK exposes an EIP-1193-compatible provider at window.canton, following the pattern established by Ethereum wallets. This enables wallet discovery and connection in browser environments. For extension authors, the SDK also supports namespace scanning, EIP-6963-style announcement events, and targeted postMessage routing. See the docs section Wallet providers.

Contents