Skip to main content
Once a wallet is connected, your dApp can read the user’s Canton parties, sign messages, submit transactions, and query the ledger through the authenticated session. All examples use the high-level SDK. For the equivalent low-level calls, see the Provider API.

List the user’s parties

A user may have access to multiple Canton parties (accounts). List them and find the one they marked as primary.

Get the primary party

If you only need the primary account, read it directly.
Do not assume the primary party never changes. The user can switch it in their wallet. Subscribe to onAccountsChanged (below) and re-read the primary party rather than caching it indefinitely.

React to account changes

Read the active network

Validate the network before submitting transactions so your dApp does not act against an unexpected network.

Sign a message

Sign an arbitrary human-readable string with the primary account. Show the user what they are signing before you request it.

Execute a transaction

prepareExecute() handles the full lifecycle: it prepares the Daml commands, requests the user’s approval and signature in their wallet, and submits the transaction to the ledger.
For a first end-to-end test you can use the built-in Ping template (#AdminWorkflows:Canton.Internal.Ping:Ping) to prove the round-trip works. For a real dApp, submit commands from your own Daml package.

Track a transaction

Subscribe to onTxChanged to follow a transaction through its lifecycle (pendingsignedexecuted, or failed).

Query the ledger

Proxy authenticated requests to the Canton JSON Ledger API through the user’s session.
Use this to read ledger data (contracts, events, version) without standing up your own authenticated Ledger API client.

Next steps

  • Wallet Discovery — Customize the wallet picker and add WalletConnect or custom remote wallets.
  • API Reference — Full signatures, parameters, and return types.