canton-network-docs/SDKsdApp SDKAPI Reference
Provider API
The Provider API is the low-level interface the dApp SDK is built on. It follows the
EIP-1193 request/event pattern and implements
CIP-103.
The provider emits
Most dApps should use the high-level SDK.
Use the Provider API directly only when building lower-level infrastructure or adapting an
existing provider-based integration.
OpenRPC specifications
The dApp API is specified in machine-readable OpenRPC documents:- Sync API: openrpc-dapp-api.json
- Async API: openrpc-dapp-remote-api.json
Getting a provider
After connecting, obtain the active CIP-0103 provider from the SDK:Methods
Every operation is arequest({ method, params }) call. The methods mirror the SDK
functions one-to-one.
Events
Subscribe withon and clean up with removeListener.
statusChanged, accountsChanged, and txChanged. The Async API
also emits connected and messageSignature. For payload shapes, see
Events.
Sync and Async APIs
The dApp API comes in two variants for different wallet deployments:- Sync API targets wallets with direct access, such as browser extensions or desktop apps. Methods run in a standard request-response fashion.
- Async API targets server-side or remote wallets, where operations that need user
interaction cannot block. Those methods return a
userUrlfor the user to complete the action (for example login or transaction approval), and the result arrives later as an event.
Key differences in the Async API:
connectreturns{ ...ConnectResult, userUrl }when no session exists; aconnectedevent is emitted after login.prepareExecutereturns{ userUrl }; atxChangedevent is emitted after the prepare phase.
The dApp SDK implements the Sync API interface and relays to an Async API server internally,
so dApp code written against the SDK works with both wallet types without changes.
Provider interface
Both variants are accessed through aProvider interface, following
EIP-1193:
SDK vs Provider API
Related
- SDK Methods — The high-level equivalents of these request methods.
- Errors — Standard error codes returned by the API.