Prerequisites
- Node.js (v18+)
- A running Canton validator node (either self-hosted or via a node-as-a-service provider). Any network validator can be used — Splice LocalNet is convenient for development and testing, but DevNet, TestNet, or MainNet validators work as well.
Installation
Install the full Wallet SDK from the NPM registry:- npm
- yarn
- pnpm
Configuration
The SDK requires configuration for authentication, ledger access, and token standard connectivity. For local development against a Splice LocalNet, you can use the built-in defaults:Key pair and party creation
Before performing any operations, you need to create a key pair and allocate an external party on your validator.Token operations
The SDK exposes token standard operations throughsdk.tokenStandard. These follow CIP-0056, the Canton Network token standard.
Querying holdings (UTXOs)
Canton uses a UTXO model where active contracts represent unspent holdings. You can list all holdings for a party:Monitoring transactions
To stream transaction events as they occur on ledger, uselistHoldingTransactions. It accepts a start offset and a step size, and returns a nextOffset for pagination so that you never receive the same transaction twice:
TransferIn, TransferOut, MergeSplit, or Mint, with full details about holdings changes and memo tags.
Creating and submitting a transfer
Token transfers follow a prepare-sign-submit flow. The SDK handles command construction, but transaction preparation happens on your validator node (unlike chains where you construct transactions fully offline).Transfer modes
By default, all token transfers follow a two-step process: the sender initiates the transfer, and the receiver must accept or reject it. This matches traditional finance settlement patterns. To enable one-step transfers (similar to other blockchains), the receiving party can set up a transfer pre-approval, which auto-accepts all incoming transfers:Authentication
For local development, the SDK uses a self-signed HMAC token with default credentials. When deploying to a production environment, configure an OAuth-based auth controller:AuthController that satisfies the interface:
dApp integration
Third-party dApps can submit transactions to your wallet for signing through a standardized API. The SDK supports receiving prepared transactions from dApps, visualizing them for user approval, and signing and submitting them. The dApp API follows an OpenRPC specification. A dApp callsprepareExecute or prepareExecuteAndWait, and the wallet provider prepares, signs, and submits the transaction on the user’s behalf.
The SDK can decode prepared transactions into human-readable JSON for display to users before signing. For details on this flow, see CIP-0103 (the dApp Standard).
Further resources
- Wallet Gateway GitHub repository — contains the Wallet SDK source, API specs, and example scripts
- Token standard documentation — full token standard reference
- CIP-0056 — Canton Network token standard specification
- External party signing tutorial — step-by-step external signing walkthrough
- CN Quickstart — reference application for getting started with Canton Network development