Skip to main content
Version: 1.18.1

Type Alias: CantonRpcProvider

CantonRpcProvider = Provider<DappRpcTypes>

Defined in: canton/types.ts:35

Canton connectivity provider, as defined by the Canton dApp SDK (@canton-network/dapp-sdk): a Provider over the dApp wallet RPC methods (@canton-network/core-wallet-dapp-rpc-client).

The SDK never dials a Canton Ledger API itself — all Canton connectivity and authentication flows through provider.request(...):

  • getActiveNetwork / getPrimaryAccount — network + party detection (used by CantonChain.fromProvider)
  • ledgerApi / prepareExecuteAndWait — Ledger API requests and interactive submissions (prepare → sign → execute)
  • accountsChanged / txChanged events — wallet state changes

Construct it with the environment that matches your runtime:

  • Browser (dApp SDK) — connect to the user's Canton wallet and take the provider from it: new DappSDK(config) / getConnectedProvider(). This provider proxies ledgerApi requests through the validator wallet.
  • Node.js — use the SDK's CantonJsonRpcProvider (canton/provider.ts), which talks to the Canton JSON Ledger API directly (JWT-authenticated wire-format pass-through, optional external signer e.g. Ledger). Hand it to CantonChain.fromProvider.
  • Bring your own — implement the Provider interface over DappRpcTypes and pass it to CantonChain.fromProvider.