Skip to content

Commit b32e758

Browse files
committed
fix: rename DMK to Dmk
1 parent 1fa477f commit b32e758

6 files changed

Lines changed: 13 additions & 13 deletions

File tree

packages/hw-wallet-sdk/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12-
- Add `DMK_ERROR_TAG_MAPPINGS`, `DMK_MESSAGE_PATTERNS`, and `getDMKErrorFromTag` for parsing Ledger Device Management Kit (DMK) errors by their non-standard `_tag` property ([#597](https://github.com/MetaMask/accounts/pull/597))
12+
- Add `DMK_ERROR_TAG_MAPPINGS`, `DMK_MESSAGE_PATTERNS`, and `getDmkErrorFromTag` for parsing Ledger Device Management Kit (DMK) errors by their non-standard `_tag` property ([#597](https://github.com/MetaMask/accounts/pull/597))
1313
- Add `DMK_ERROR_MAPPINGS` providing full `ErrorMapping` details (severity, category, userMessage) for each DMK `_tag`
1414

1515
## [0.10.0]

packages/hw-wallet-sdk/src/dmk-error-mappings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export type DMKTagResolution = {
137137
* @returns The resolved `ErrorCode` and the original tag string, or `null`
138138
* if no `_tag` is present or the tag is not recognised.
139139
*/
140-
export function getDMKErrorFromTag(error: unknown): DMKTagResolution | null {
140+
export function getDmkErrorFromTag(error: unknown): DMKTagResolution | null {
141141
if (error === null || typeof error !== 'object') {
142142
return null;
143143
}

packages/keyring-eth-ledger-bridge/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12-
- Add `createDMKError` factory function and wire DMK `_tag` resolution into the Ledger DMK bridge ([#597](https://github.com/MetaMask/accounts/pull/597))
13-
- `createDMKError` constructs `HardwareWalletError` instances from DMK `_tag` strings.
12+
- Add `createDmkError` factory function and wire DMK `_tag` resolution into the Ledger DMK bridge ([#597](https://github.com/MetaMask/accounts/pull/597))
13+
- `createDmkError` constructs `HardwareWalletError` instances from DMK `_tag` strings.
1414
- `translateDmkError` now resolves DMK connection/session errors (e.g. `DeviceSessionNotFound`, `DeviceLockedError`) by their `_tag` before falling back to hex APDU status codes.
1515
- `LedgerDmkBridge.#toError` also resolves DMK `_tag` errors so `sendCommand` failures are correctly classified.
1616

packages/keyring-eth-ledger-bridge/src/dmk/dmk-error-translator.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { DeviceExchangeError } from '@ledgerhq/device-management-kit';
22
import { TransportStatusError } from '@ledgerhq/hw-transport';
33
import {
4-
getDMKErrorFromTag,
4+
getDmkErrorFromTag,
55
HardwareWalletError,
66
} from '@metamask/hw-wallet-sdk';
77

8-
import { createDMKError } from '../errors';
8+
import { createDmkError } from '../errors';
99

1010
const GENERIC_ERROR_STATUS_CODE = 0x6f00;
1111

@@ -33,9 +33,9 @@ export function translateDmkError(
3333
error: unknown,
3434
): TransportStatusError | HardwareWalletError {
3535
// 1. DMK connection/session errors identified by _tag
36-
const tagResolution = getDMKErrorFromTag(error);
36+
const tagResolution = getDmkErrorFromTag(error);
3737
if (tagResolution) {
38-
return createDMKError(tagResolution.tag);
38+
return createDmkError(tagResolution.tag);
3939
}
4040

4141
// 2. DeviceExchangeError with hex APDU status code

packages/keyring-eth-ledger-bridge/src/dmk/ledger-dmk-bridge.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type {
1313
} from '@ledgerhq/device-management-kit';
1414
import type { Signature } from '@ledgerhq/device-signer-kit-ethereum';
1515
import type Transport from '@ledgerhq/hw-transport';
16-
import { getDMKErrorFromTag } from '@metamask/hw-wallet-sdk';
16+
import { getDmkErrorFromTag } from '@metamask/hw-wallet-sdk';
1717
import type { Observable } from 'rxjs';
1818
import {
1919
concat,
@@ -33,7 +33,7 @@ import {
3333
switchMap,
3434
} from 'rxjs/operators';
3535

36-
import { createDMKError } from '../errors';
36+
import { createDmkError } from '../errors';
3737
import {
3838
AppConfigurationResponse,
3939
GetAppNameAndVersionResponse,
@@ -482,9 +482,9 @@ export class LedgerDmkBridge implements LedgerBridge<LedgerDmkBridgeOptions> {
482482
// DMK connection/session errors identified by _tag (e.g.
483483
// DeviceSessionNotFound, DeviceLockedError) carry no hex APDU code.
484484
// Resolve them to a HardwareWalletError before falling through.
485-
const tagResolution = getDMKErrorFromTag(error);
485+
const tagResolution = getDmkErrorFromTag(error);
486486
if (tagResolution) {
487-
return createDMKError(tagResolution.tag);
487+
return createDmkError(tagResolution.tag);
488488
}
489489

490490
if (isDeviceExchangeError(error)) {

packages/keyring-eth-ledger-bridge/src/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function createKeyringStateError(code: ErrorCode): HardwareWalletError {
113113
* @returns A HardwareWalletError instance with mapped error details, or a
114114
* fallback error if the tag is not recognised.
115115
*/
116-
export function createDMKError(
116+
export function createDmkError(
117117
tag: string,
118118
context?: string,
119119
): HardwareWalletError {

0 commit comments

Comments
 (0)