@ledgerhq/hw-app-canton
v0.10.1
Published
Ledger Hardware Wallet Canton Application API
Readme
GitHub, Ledger Devs Discord, Developer Portal
@ledgerhq/hw-app-canton
Ledger Hardware Wallet Canton JavaScript bindings.
Are you adding Ledger support to your software wallet?
You may be using this package to communicate with the Canton Nano App.
For a smooth and quick integration:
- See the developers’ documentation on the Developer Portal and
- Go on Discord to chat with developer support and the developer community.
API
Table of Contents
Canton
Canton BOLOS API
Parameters
transportTransportscrambleKey(optional, default"canton_default_scramble_key")
getAddress
Get a Canton address for a given BIP-32 path.
Parameters
pathstring a path in BIP-32 formatdisplayboolean whether to display the address on the device (optional, defaultfalse)
Returns Promise<CantonAddress> the address and public key
signTransaction
Sign a Canton transaction using the appropriate signing method based on transaction type.
Parameters
pathstring a path in BIP-32 formatdata(CantonPreparedTransaction | CantonUntypedVersionedMessage | string) either prepared transaction components, untyped versioned message, or txHash string (backwards compatibility)
Returns Promise<CantonSignature> the signature
getAppConfiguration
Get the app configuration.
Returns Promise<AppConfig> the app configuration including version
Integration tests
1. Prerequisite
Download latest version of Ledger SDK.
docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latestThe rest of the documentation is about testing on NanoSP.
2. Compile app-canton
You have to compile or retrieve the app binaries. In the following line, the binaries directory is set as <ABSOLUTE_PATH_TO_ELFS>
3. Launch CantonApp within Speculos
docker run --rm -t -d -v "<ABSOLUTE_PATH_TO_ELFS>:/app" -p 5000:5000 ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
docker exec -it speculos bash -c 'speculos --model "nanosp" /app/exchange_nanosp.elf -l /app/ethereum_nanosp.elf --display headless'4. Launch integration tests
From Ledger Live root directory:
pnpm ljs:hw-app-canton test-integYou can take a look at Speculos UI
