Architecture
Sigilry defines a thin, typed layer between dApps and wallet extensions. The primary contract is JSON-RPC over a transport such as postMessage.
System diagram
Section titled “System diagram”dApp UI -> @sigilry/react (hooks) or @sigilry/dapp (provider) -> WindowTransport (postMessage) -> Wallet extension (RPC server) -> Canton Ledger API / DAML
Developer tooling -> @sigilry/cli (DAML DAR to TypeScript types)Responsibilities
Section titled “Responsibilities”- dApp: Calls
window.canton.request({ method, params })and reacts to events. - Provider: Implements EIP-1193 style
requestand event subscription. - RPC server: Validates params with Zod and routes to handlers.
- Transport: Moves requests and responses between contexts.
- Schemas: Generated from OpenRPC and used for runtime validation.
Data flow
Section titled “Data flow”- dApp sends JSON-RPC request to the provider.
- Transport serializes the message (for example,
postMessage). - Extension receives the request and routes it through
createCantonServer. - The server validates params and calls the handler.
- Response is returned to the dApp and validated by the client.
Versioning and specs
Section titled “Versioning and specs”CANTON_DAPP_API_VERSIONexposes the dApp API version in@sigilry/dapp.- OpenRPC specs live in
specs/andpackages/dapp/api-specs/. - Zod schemas are generated in
packages/dapp/src/generated.