Sigilry
Sigilry is a chain-agnostic dApp infrastructure library that standardizes how dApps talk to wallet extensions. It provides a typed JSON-RPC protocol, validation schemas, and React hooks for fast integration.
Packages
Section titled “Packages”@sigilry/dapp: Core provider, RPC client and server, message schemas, and transports.@sigilry/react: React Query powered hooks andCantonReactProvider.@sigilry/cli: CLI and programmatic API for generating TypeScript types from DAML DARs.@sigilry/canton-json-api: Generated Canton JSON API v2 types and Zod schemas for typed ledger endpoint contracts.
New to Canton?
Section titled “New to Canton?”Start with the Demo App before package internals. It shows the full flow in one place:
- DAML templates and choices (
TodoListfactory +TodoItemcontracts) - DAR build and typed codegen via Sigilry CLI
- dApp-side React hooks calling a typed
window.cantonprovider - Event-driven wallet/ledger logs plus
txChangedupdates after approvals
Fastest way to run it from the repo root:
nix developyarn installyarn --cwd examples/demo-app devChoose your starting path:
- Building a real dApp integration against an installed wallet extension: go to Quick Start.
- Learning the full flow locally without extension setup: go to Demo App.
SDK Flow
Section titled “SDK Flow”The provider injected at window.canton follows an EIP-1193 style pattern. Requests use typed, canonical
method names from the OpenRPC schema, methods with void params omit the params field, and the provider
emits accountsChanged and txChanged events to signal wallet and ledger state changes. See the
@sigilry/dapp and @sigilry/react pages for the full contract.
Quick start
Section titled “Quick start”- Start with the basics in Introduction.
- Follow the 10-minute integration in Quick Start.
- Run the full newcomer flow in Demo App.
- Go deeper in Architecture and RPC Protocol.
CLI Codegen
Section titled “CLI Codegen”Use sigilry init to create sigilry.config.ts, then run sigilry codegen to generate TypeScript types.
The CLI requires the DAML SDK so dpm is available, and it wraps dpm codegen-alpha-typescript under the
hood. See the @sigilry/cli page for the full configuration reference.
Minimal dApp request
Section titled “Minimal dApp request”async function connect() { const status = await window.canton.request({ method: "status" }); if (!status.isConnected) { await window.canton.request({ method: "connect" }); }
const accounts = await window.canton.request({ method: "listAccounts" }); console.log("Accounts:", accounts); return accounts;}Ledger API Patterns
Section titled “Ledger API Patterns”ledgerApi requests map directly to Daml JSON Ledger API v2 endpoints. Hooks like useLedgerApi and
useActiveContracts call /v2/state/ledger-end and /v2/state/active-contracts to resolve the current
offset and fetch active contracts.
await window.canton.request({ method: "ledgerApi", params: { requestMethod: "GET", resource: "/v2/state/ledger-end", },});Architecture at a glance
Section titled “Architecture at a glance”dApp UI -> window.canton (EIP-1193 style provider) -> JSON-RPC (OpenRPC + Zod validation) -> WindowTransport (postMessage) -> Wallet extension (RPC server) -> Canton Ledger API / DAMLFor AI agents
Section titled “For AI agents”- A concise integration summary is available at
llms.txt. - All examples are copy-paste ready and include explicit method names.
- Use the package pages for complete API coverage.