Skip to main content
This is the shortest working path with the Wallet SDK: install it, connect to a validator, and create an external party. The example runs against a local validator. To use DevNet, TestNet or MainNet, change the configuration as described in Configuration.

Prerequisites

  • Node.js. The SDK currently supports NodeJS environments only.
  • A running Canton validator. Splice LocalNet is convenient for development and testing, but DevNet, TestNet and MainNet validators work as well.

Install the SDK

The Wallet SDK is available as a package on the NPM registry. Install it with your preferred package manager.
To build only a dApp, the dApp SDK can be used instead. It has a smaller bundle size and is optimized for browser usage. Both SDKs use the same underlying core packages. Where only part of the code is needed, for example transaction visualization or hash verification, those packages can be used independently.

Connect and create a party

Create the SDK with an auth configuration and the URL of the ledger API, generate a key pair, and create the party. An external party is controlled by a key pair: its ID is made of a hint and the fingerprint of the public key. The SDK creates the party’s topology transactions, signs them with the private key, and submits them.
  • auth tells the SDK how to get an access token. self_signed is for local development only. For a real validator use OAuth (client_credentials), as shown in the commented block and in Configuration.
  • localNetStaticConfig holds the default endpoints of a Splice LocalNet.
  • sdk.keys.generate() creates the key pair. Keep the private key safe: it signs everything the party does.
  • The partyHint makes the party easier to recognize. It is optional but recommended.

Next steps