GitHub, Ledger Devs Discord, Developer Portal
Ledger Hardware Wallet Exchange app.
Adapt ExchangeTypes following partner info. For "legacy" partner, we don't change the provided type. For new one, we call the new APDU commands (Ng, Next Gen).
-
type
ExchangeTypes -
partnerVersion
number?
Returns ExchangeTypes
Those values map the one defined in the app-exchange code (@see protocol.md and swap_errors.h)
Type: number
Download latest version of Ledger SDK.
docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
The rest of the documentation is about testing on NanoSP.
docker run --privileged -v '<ABSOLUTE_PATH_TO_APP_EXCHANGE_SRC>:/app' -t -d --name ledger-app-dev-tools ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools
docker exec -it ledger-app-dev-tools bash -c 'export BOLOS_SDK="$NANOSP_SDK" && make -j DEBUG=1 TESTING=1 TEST_PUBLIC_KEY=1'
It is important to set the value of DEBUG
to 1, as we need the fake Ledger private key in our test.
You can compile only the app-exchange
, but it can be useful to compile a coin-app like app-ethereum
.
In the documentation, we assume the following name for the apps binary:
- app-exchange:
exchange_nanosp.elf
- app-ethereum:
ethereum_nanosp.elf
docker run -v '<ABSOLUTE_PATH_TO_ELFS>:/app' -p 5000:5000 -t -d --name speculos ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools
docker exec -it speculos bash -c 'speculos --model "nanosp" /app/exchange_nanosp.elf -l /app/ethereum_nanosp.elf --display headless'
From Ledger Live root directory:
pnpm ljs:hw-app-exchange test-integ