Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
aca8087
feat(wallet-hardware): migrate Ledger integrations to DMK
ice-chillios Aug 20, 2026
bc13221
test(wallet-hardware): cover Ledger DMK migration
ice-chillios Aug 20, 2026
9ef0c19
docs(wallet-hardware): document Ledger DMK migration
ice-chillios Aug 20, 2026
7787418
chore(wallet-hardware): remove obsolete Ledger dependencies
ice-chillios Aug 20, 2026
475c0c8
refactor(wallet-hardware): simplify Ledger dispatch
ice-chillios Aug 20, 2026
1531b21
fix(wallet-hardware): keep Trezor CJS entrypoint loadable
ice-chillios Aug 20, 2026
02c09f3
refactor(wallet-hardware): exhaust Ledger wallet routing
ice-chillios Aug 20, 2026
50964c2
fix(wallet-hardware): resolve Ledger prev txs concurrently
ice-chillios Aug 20, 2026
250f530
fix(wallet-hardware): address Ledger review regressions
ice-chillios Aug 21, 2026
6bba1fb
test: preserve ethers exports in Bun module mocks
ice-chillios Aug 21, 2026
5b842ee
fix(wallet-hardware): adapt Ledger clients to SDK 5.x
ice-chillios Sep 23, 2026
c686376
chore: update @swapkit/* dependencies to latest SDK release
ice-chillios Sep 23, 2026
6067490
chore(wallet-hardware): update Ledger dependencies to latest
ice-chillios Sep 23, 2026
4d74e5c
fix(wallet-hardware): produce valid Bitcoin transactions from Ledger …
ice-chillios Sep 23, 2026
da7b647
fix(wallet-hardware): refuse Zcash Ledger signing over a legacy trans…
ice-chillios Sep 23, 2026
4ab7ad8
refactor(wallet-hardware): remove unreachable legacy Zcash PCZT signing
ice-chillios Sep 23, 2026
bb4e43b
fix(wallet-hardware): accept memo outputs in Ledger legacy UTXO signing
ice-chillios Sep 23, 2026
ed9303a
fix(wallet-hardware): send only the referenced EIP-712 types to Ledger
ice-chillios Sep 23, 2026
022d93b
fix(wallet-hardware): stop forwarding hw-transport's default timeout …
ice-chillios Sep 23, 2026
353389c
fix(wallet-hardware): map Ledger device errors to typed SwapKit errors
ice-chillios Sep 23, 2026
22c8d86
fix(wallet-hardware): recover Ledger signers after the device session…
ice-chillios Sep 23, 2026
bf653fe
fix(wallet-hardware): reject hardened THORChain change and index segm…
ice-chillios Sep 23, 2026
9aac925
fix(wallet-hardware): normalise Ledger Cosmos and THORChain signature…
ice-chillios Sep 23, 2026
d764f76
chore(playground): drop removed Ledger transports from Vite optimizeDeps
ice-chillios Sep 23, 2026
afa8dbc
docs(wallet-hardware): document Ledger DMK breaking changes and downs…
ice-chillios Sep 23, 2026
e835e03
fix(wallet-hardware): disable Ledger blind-signing telemetry
ice-chillios Sep 23, 2026
c00e582
fix(wallet-hardware): pay the toolbox Cosmos fee for Ledger transfers
ice-chillios Sep 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .changeset/ledger-evm-dmk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
"@swapkit/wallet-hardware": major
"@swapkit/wallets": minor
"@swapkit/sdk": minor
---

Migrate Ledger connections to the Device Management Kit by default. `@swapkit/wallets` and `@swapkit/sdk` re-export the Ledger wallet, so they carry these changes too.

Browser connections now discover and reuse one WebHID DMK session. Consumers that manage the device lifecycle can pass a caller-owned `dmkSession`; `originToken` enables EVM Transaction Checks, and `onDeviceActionState` exposes device prompts to the UI. New exports: `getLedgerDMKSession`, `preloadLedgerDMK`, `disconnectLedgerDMKSession` and the `LedgerDMKSession`, `LedgerDeviceActionState` and `LedgerDeviceActionStateHandler` types.

Breaking changes:

- WebUSB is no longer used. The default connection requires WebHID, so browsers without it (Android Chrome) can no longer connect a Ledger, and opening the device picker needs a user gesture. Call `preloadLedgerDMK()` ahead of the click to keep the gesture window.
- Device errors are now `SwapKitError`s: `wallet_connection_rejected_by_user`, `wallet_ledger_device_locked`, `wallet_ledger_app_not_open`, `wallet_ledger_connection_error` or `wallet_ledger_transport_error`, with the DMK tag, status word and message in `info`. Code that matched hw-transport's `TransportStatusError` or `statusCode` must switch to `errorKey`.
- EVM chains require a DMK session; passing a LedgerJS `transport` for them throws `wallet_ledger_invalid_params`. The injected `transport` remains a temporary compatibility path for other chains, cannot be combined with `dmkSession`, and no longer signs Zcash (hw-app-btc picks a pre-Ironwood branch id). Bitcoin `signTransaction` over it returns the finalised transaction from the legacy app, like the other legacy UTXO chains.
- Legacy Zcash PCZT v4 signing is no longer a supported Ledger path.

EVM, Bitcoin, Cosmos and transparent Zcash signing use the Ledger Device Signer Kits (the Zcash kit is still pre-1.0). THORChain uses its app-v2 protocol in one atomic DMK action, and chains without a signer kit run their existing Ledger app client through an operation-scoped DMK bridge. A default session that was lost (device unplugged, `disconnectLedgerDMKSession()`) is re-established on the next operation instead of failing until the wallet reconnects.

EVM message, transaction and full EIP-712 signing use the current signer APIs, sending only the types the primary type references. Arc keeps Ledger support: the Ethereum signer kit loads the network certificate and Ledger-signed network descriptor itself, replacing the `PROVIDE_NETWORK_INFORMATION` APDUs added in 4.11.0. When clear-signing metadata cannot be loaded or is rejected, the signer kit falls back to blind signing on every chain rather than only on Arc; the device still requires blind signing to be enabled and the user to confirm. The signer kit's blind-signing telemetry, which reports the chain, target address and device model to Ledger on every signature, is disabled.

Bitcoin requests PSBT signatures from the signer kit and finalises the transaction locally, keeping the transaction version the toolbox built. Inputs carry the full previous transaction, checked against the input txid and fetched when missing, so the device can verify input amounts; nested SegWit inputs also carry the spent output. Zcash transfer signing produces the transparent v5 transaction required by the current Zcash app.

Cosmos and THORChain signatures are normalised to low-S, THORChain rejects hardened change or address-index path segments instead of silently clearing them, and memo (OP_RETURN) outputs no longer break legacy UTXO signing. THORChain Amino signing keeps a compatibility normaliser for object-shaped deposit assets while signing the canonical string form expected on-chain.
17 changes: 17 additions & 0 deletions .changeset/swapkit-sdk-1ice5rq4kml65.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@swapkit/sdk": patch
"@swapkit/wallet-extensions": patch
"@swapkit/wallet-hardware": patch
"@swapkit/wallet-mobile": patch
"@swapkit/wallets": patch
---

Update SwapKit SDK dependencies:

- @swapkit/core: 5.0.8 → 5.0.9
- @swapkit/helpers: 5.4.1 → 5.4.2
- @swapkit/plugins: 5.0.8 → 5.0.9
- @swapkit/server: 5.2.1 → 5.2.2
- @swapkit/toolboxes: 5.4.1 → 5.4.2
- @swapkit/wallet-core: 5.0.8 → 5.0.9
- @swapkit/wallet-keystore: 5.2.0 → 5.2.1
539 changes: 297 additions & 242 deletions bun.lock

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@
"@cosmjs/proto-signing": "0.37.0",
"@cosmjs/stargate": "0.37.0",
"@scure/bip32": "2.2.0",
"@swapkit/core": "^5.0.8",
"@swapkit/helpers": "^5.4.1",
"@swapkit/plugins": "^5.0.8",
"@swapkit/server": "^5.2.1",
"@swapkit/toolboxes": "^5.4.1",
"@swapkit/wallet-core": "^5.0.8",
"@swapkit/wallet-keystore": "^5.2.0",
"@swapkit/core": "^5.0.9",
"@swapkit/helpers": "^5.4.2",
"@swapkit/plugins": "^5.0.9",
"@swapkit/server": "^5.2.2",
"@swapkit/toolboxes": "^5.4.2",
"@swapkit/wallet-core": "^5.0.9",
"@swapkit/wallet-keystore": "^5.2.1",
"@types/bun": "1.3.13",
"@types/node": "25.6.0",
"ledger-bitcoin": "0.3.0",
"typescript": "6.0.3",
"zod": "4.4.3"
},
Expand Down
14 changes: 7 additions & 7 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"author": "swapkit-dev",
"dependencies": {
"@stricahq/typhonjs": "~3.0.1",
"@swapkit/core": "^5.0.8",
"@swapkit/helpers": "^5.4.1",
"@swapkit/plugins": "^5.0.8",
"@swapkit/server": "^5.2.1",
"@swapkit/toolboxes": "^5.4.1",
"@swapkit/wallet-core": "^5.0.8",
"@swapkit/wallet-keystore": "^5.2.0",
"@swapkit/core": "^5.0.9",
"@swapkit/helpers": "^5.4.2",
"@swapkit/plugins": "^5.0.9",
"@swapkit/server": "^5.2.2",
"@swapkit/toolboxes": "^5.4.2",
"@swapkit/wallet-core": "^5.0.9",
"@swapkit/wallet-keystore": "^5.2.1",
"@swapkit/wallets": "workspace:*",
"cosmjs-types": "0.10.1"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/wallet-extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"@near-js/transactions": "~2.5.0",
"@scure/base": "~2.2.0",
"@solana/web3.js": "~1.98.4",
"@swapkit/helpers": "^5.4.1",
"@swapkit/toolboxes": "^5.4.1",
"@swapkit/helpers": "^5.4.2",
"@swapkit/toolboxes": "^5.4.2",
"@swapkit/utxo-signer": "^3.1.0",
"@swapkit/wallet-core": "^5.0.8",
"@swapkit/wallet-core": "^5.0.9",
"@wallet-standard/app": "^1.1.1",
"cosmjs-types": "0.10.1",
"ethers": "^6.14.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-extensions/test/evm-extensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class MockBrowserProvider {
const realEthersSnapshot = { ...realEthers };
const realEvmToolboxSnapshot = { ...realEvmToolbox };

mock.module("ethers", () => ({ BrowserProvider: MockBrowserProvider }));
mock.module("ethers", () => ({ ...realEthersSnapshot, BrowserProvider: MockBrowserProvider }));

mock.module("@swapkit/toolboxes/evm", () => ({
getEvmToolboxAsync: async () => ({
Expand Down
12 changes: 11 additions & 1 deletion packages/wallet-hardware/build.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
import { buildPackage } from "../../tools/builder";

void buildPackage();
const nodeIncompatibleLedgerPackages = [
"@ledgerhq/context-module",
"@ledgerhq/device-management-kit",
"@ledgerhq/device-signer-kit-bitcoin",
"@ledgerhq/device-signer-kit-cosmos",
"@ledgerhq/device-signer-kit-ethereum",
"@ledgerhq/device-signer-kit-zcash",
"@ledgerhq/device-transport-kit-web-hid",
];

void buildPackage({ bundlePackages: nodeIncompatibleLedgerPackages });
70 changes: 35 additions & 35 deletions packages/wallet-hardware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,65 @@
"dependencies": {
"@cosmjs/amino": "~0.37.0",
"@cosmjs/crypto": "0.37.0",
"@cosmjs/proto-signing": "~0.37.0",
"@keepkey/keepkey-sdk": "~0.2.62",
"@ledgerhq/devices": "~8.10.0",
"@ledgerhq/errors": "~6.29.0",
"@ledgerhq/hw-app-btc": "~10.17.0",
"@ledgerhq/hw-app-cosmos": "~6.33.0",
"@ledgerhq/hw-app-eth": "~7.8.18",
"@ledgerhq/hw-app-near": "~6.32.0",
"@ledgerhq/hw-app-sui": "~1.5.0",
"@ledgerhq/hw-app-trx": "~6.32.0",
"@ledgerhq/hw-app-xrp": "~6.33.0",
"@ledgerhq/hw-transport": "~6.32.0",
"@ledgerhq/hw-transport-webhid": "~6.31.0",
"@ledgerhq/hw-transport-webusb": "~6.30.0",
"@ledgerhq/wallet-api-client": "~1.13.1",
"@ledgerhq/context-module": "~2.6.0",
"@ledgerhq/device-management-kit": "~1.9.1",
"@ledgerhq/device-signer-kit-bitcoin": "~1.3.3",
"@ledgerhq/device-signer-kit-cosmos": "~1.0.1",
"@ledgerhq/device-signer-kit-ethereum": "~1.18.1",
"@ledgerhq/device-signer-kit-zcash": "~0.7.1",
"@ledgerhq/device-transport-kit-web-hid": "~1.2.4",
"@ledgerhq/hw-app-btc": "~10.22.1",
"@ledgerhq/hw-app-cosmos": "~6.36.7",
"@ledgerhq/hw-app-near": "~6.35.7",
"@ledgerhq/hw-app-sui": "~1.11.4",
"@ledgerhq/hw-app-trx": "~6.36.6",
"@ledgerhq/hw-app-xrp": "~6.37.7",
"@ledgerhq/hw-transport": "~6.35.7",
"@near-js/crypto": "~2.5.0",
"@near-js/transactions": "~2.5.0",
"@scure/base": "2.2.0",
"@scure/bip32": "2.2.0",
"@swapkit/helpers": "^5.4.1",
"@swapkit/toolboxes": "^5.4.1",
"@swapkit/helpers": "^5.4.2",
"@swapkit/toolboxes": "^5.4.2",
"@swapkit/utxo-signer": "^3.1.0",
"@swapkit/wallet-core": "^5.0.8",
"@swapkit/wallet-core": "^5.0.9",
"@trezor/connect-web": "~9.7.3",
"cosmjs-types": "~0.10.1",
"bitcoinjs-lib": "~6.1.7",
"ethers": "^6.14.0",
"ledger-bitcoin": "~0.3.0",
"ripple-binary-codec": "2.7.0",
"rxjs": "~7.8.2",
"ts-pattern": "^5.9.0",
"xrpl": "~4.6.0"
},
"description": "SwapKit - Wallet Hardware",
"devDependencies": {
"@cosmjs/amino": "0.37.0",
"@cosmjs/crypto": "0.37.0",
"@cosmjs/proto-signing": "0.37.0",
"@keepkey/keepkey-sdk": "0.2.62",
"@ledgerhq/devices": "8.10.0",
"@ledgerhq/errors": "6.29.0",
"@ledgerhq/hw-app-btc": "10.17.0",
"@ledgerhq/hw-app-cosmos": "6.33.0",
"@ledgerhq/hw-app-eth": "7.8.18",
"@ledgerhq/hw-app-near": "6.32.0",
"@ledgerhq/hw-app-sui": "1.5.0",
"@ledgerhq/hw-app-trx": "6.32.0",
"@ledgerhq/hw-app-xrp": "6.33.0",
"@ledgerhq/hw-transport": "6.32.0",
"@ledgerhq/hw-transport-webhid": "6.31.0",
"@ledgerhq/hw-transport-webusb": "6.30.0",
"@ledgerhq/wallet-api-client": "1.13.1",
"@ledgerhq/context-module": "2.6.0",
"@ledgerhq/device-management-kit": "1.9.1",
"@ledgerhq/device-signer-kit-bitcoin": "1.3.3",
"@ledgerhq/device-signer-kit-cosmos": "1.0.1",
"@ledgerhq/device-signer-kit-ethereum": "1.18.1",
"@ledgerhq/device-signer-kit-zcash": "0.7.1",
"@ledgerhq/device-transport-kit-web-hid": "1.2.4",
"@ledgerhq/hw-app-btc": "10.22.1",
"@ledgerhq/hw-app-cosmos": "6.36.7",
"@ledgerhq/hw-app-near": "6.35.7",
"@ledgerhq/hw-app-sui": "1.11.4",
"@ledgerhq/hw-app-trx": "6.36.6",
"@ledgerhq/hw-app-xrp": "6.37.7",
"@ledgerhq/hw-transport": "6.35.7",
"@near-js/crypto": "2.5.0",
"@near-js/transactions": "2.5.0",
"@scure/base": "2.2.0",
"@scure/bip32": "2.2.0",
"@trezor/connect-web": "9.7.3",
"cosmjs-types": "0.10.1",
"bitcoinjs-lib": "6.1.7",
"ethers": "6.16.0",
"ledger-bitcoin": "0.3.0",
"ripple-binary-codec": "2.7.0",
"rxjs": "7.8.2",
"ts-pattern": "^5.9.0",
"xrpl": "4.6.0"
},
Expand Down
Loading
Loading