Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions .changeset/ledger-evm-dmk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@swapkit/wallet-hardware": major
---

Migrate Ledger connections to the Device Management Kit by default.

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.

EVM, Bitcoin, Cosmos, and transparent Zcash signing use stable Device Signer Kits. THORChain uses its app-v2 protocol in one atomic DMK action, while chains without a stable signer kit run their existing Ledger app client through an operation-scoped DMK bridge. An explicitly injected LedgerJS `transport` remains available as a temporary non-EVM compatibility path, but cannot be combined with `dmkSession`.

EVM message, transaction, and full EIP-712 signing now use the current signer APIs. Bitcoin signs PSBTs with the Bitcoin signer kit, and Zcash transfer signing produces the transparent v5 transaction required by the current Zcash app. Legacy Zcash PCZT v4 signing is no longer exposed as a supported Ledger path.

THORChain Amino signing keeps a compatibility normalizer for object-shaped deposit assets emitted by toolboxes 4.x while signing the canonical string form expected on-chain.
473 changes: 272 additions & 201 deletions bun.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@swapkit/wallet-keystore": "^4.5.2",
"@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
3 changes: 2 additions & 1 deletion packages/wallet-extensions/test/evm-extensions.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { beforeEach, describe, expect, mock, test } from "bun:test";
import { Chain, WalletOption } from "@swapkit/helpers";
import * as ethersModule from "ethers";

let balanceAddressCalls: string[] = [];

Expand Down Expand Up @@ -56,7 +57,7 @@ class MockBrowserProvider {
}
}

mock.module("ethers", () => ({ BrowserProvider: MockBrowserProvider }));
mock.module("ethers", () => ({ ...ethersModule, 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 });
36 changes: 18 additions & 18 deletions packages/wallet-hardware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
"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/context-module": "~2.4.0",
"@ledgerhq/device-management-kit": "~1.8.0",
"@ledgerhq/device-signer-kit-bitcoin": "~1.3.3",
"@ledgerhq/device-signer-kit-cosmos": "~1.0.1",
"@ledgerhq/device-signer-kit-ethereum": "~1.16.0",
"@ledgerhq/device-signer-kit-zcash": "~0.7.0",
"@ledgerhq/device-transport-kit-web-hid": "~1.2.4",
"@ledgerhq/hw-app-btc": "~10.17.0",
"@ledgerhq/hw-app-cosmos": "~6.33.0",
"@ledgerhq/hw-app-eth": "~7.4.2",
"@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",
"@near-js/crypto": "~2.5.0",
"@near-js/transactions": "~2.5.0",
"@scure/base": "2.2.0",
Expand All @@ -27,41 +27,41 @@
"@swapkit/utxo-signer": "^2.3.0",
"@swapkit/wallet-core": "^4.3.19",
"@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/context-module": "2.4.0",
"@ledgerhq/device-management-kit": "1.8.0",
"@ledgerhq/device-signer-kit-bitcoin": "1.3.3",
"@ledgerhq/device-signer-kit-cosmos": "1.0.1",
"@ledgerhq/device-signer-kit-ethereum": "1.16.0",
"@ledgerhq/device-signer-kit-zcash": "0.7.0",
"@ledgerhq/device-transport-kit-web-hid": "1.2.4",
"@ledgerhq/hw-app-btc": "10.17.0",
"@ledgerhq/hw-app-cosmos": "6.33.0",
"@ledgerhq/hw-app-eth": "7.4.2",
"@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",
"@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