Canton Network docsSDKs › Wallet SDK
Quickstart
Updated 27-10-2026
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.
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.
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.- npm
- yarn
- pnpm
npm install @canton-network/wallet-sdk
yarn add @canton-network/wallet-sdk
pnpm add @canton-network/wallet-sdk
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.import {
SDK,
type TokenProviderConfig,
localNetStaticConfig,
} from '@canton-network/wallet-sdk'
export default async function () {
const auth: TokenProviderConfig = {
method: 'self_signed',
issuer: 'unsafe-auth',
credentials: {
clientId: 'ledger-api-user',
clientSecret: 'unsafe',
audience: 'https://canton.network.global',
scope: '',
},
}
/*
if using OAuth, provide a different auth config when initializing the SDK such as:
const auth = {
method: 'client_credentials',
configUrl: 'https://my-oauth-url',
credentials: {
clientId: 'your-client-id',
clientSecret: 'your-client-secret',
audience: `https://daml.com/jwt/aud/participant/${participantId}`,
scope: 'openid daml_ledger_api offline_access',
},
}
*/
const sdk = await SDK.create({
auth,
ledgerClientUrl: localNetStaticConfig.LOCALNET_APP_USER_LEDGER_URL,
synchronizerId: global.LOCALNET_GLOBAL_SYNCHRONIZER,
})
const key = sdk.keys.generate()
// partyHint is optional but recommended to make it easier to identify the party
const partyHint = 'my-wallet-1'
await sdk.party.external
.create(key.publicKey, { partyHint })
.sign(key.privateKey)
.execute()
}
authtells the SDK how to get an access token.self_signedis for local development only. For a real validator use OAuth (client_credentials), as shown in the commented block and in Configuration.localNetStaticConfigholds 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
partyHintmakes the party easier to recognize. It is optional but recommended.
Next steps
- Creating an External Party: the same flow step by step, with key pairs, fingerprints and topology transactions.
- Configuration: connect to other environments and use other authentication methods.
- Preparing and Signing a Transaction: submit your first transaction.
- Transfer Types: one-step and two-step transfers.
- v0 to v1 Migration Guide: if you used the earlier controller-based SDK.