Skip to content
Draft
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
23 changes: 23 additions & 0 deletions packages/keyring-api/src/api/account-options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,27 @@ describe('api', () => {
`At path: entropy.type -- Expected the literal \`"mnemonic"\`, but received: "${options.entropy.type}"`,
);
});

it('throws if options.entropy.type is Hardware (not implemented)', () => {
const options = {
entropy: { type: KeyringAccountEntropyTypeOption.Hardware },
};

expect(() => assert(options, KeyringAccountOptionsStruct)).toThrow(
`At path: entropy.type -- Expected the literal \`"mnemonic"\`, but received: "${KeyringAccountEntropyTypeOption.Hardware}"`,
);
});

it('throws if options.entropy.type is Hardware with additional fields', () => {
const options = {
entropy: {
type: KeyringAccountEntropyTypeOption.Hardware,
deviceId: 'some-device-id',
},
};

expect(() => assert(options, KeyringAccountOptionsStruct)).toThrow(
`At path: entropy.type -- Expected the literal \`"mnemonic"\`, but received: "${KeyringAccountEntropyTypeOption.Hardware}"`,
);
});
});
5 changes: 5 additions & 0 deletions packages/keyring-api/src/api/account-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ export enum KeyringAccountEntropyTypeOption {
*/
PrivateKey = 'private-key',

/**
* Indicates that the account was created from a hardware wallet.
*/
Hardware = 'hardware',

/**
* Indicates that the account was created with custom, keyring-specific entropy.
* This is an opaque type where the entropy source is managed internally by the keyring.
Expand Down
9 changes: 9 additions & 0 deletions packages/keyring-eth-ledger-bridge/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Implement `getAppConfiguration` in `LedgerMobileDMKBridge` to retrieve actual app configuration from the device ([#TODO](https://github.com/MetaMask/accounts/pull/TODO))
- Parse device flags to determine blind signing support (`arbitraryDataEnabled`).
- Return actual app version from the device instead of hardcoded value.
- Configure `LedgerMobileDMKBridge` to use the React Native BLE `mobile` transport and expose DMK device discovery helpers ([#TODO](https://github.com/MetaMask/accounts/pull/TODO))
- Register `@ledgerhq/device-transport-kit-react-native-ble` with the DMK builder.
- Add DMK discovery and connect passthroughs on the transport middleware and bridge.

## [11.3.0]

### Changed
Expand Down
8 changes: 4 additions & 4 deletions packages/keyring-eth-ledger-bridge/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ module.exports = merge(baseConfig, {
// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
branches: 93.36,
functions: 98.29,
lines: 97.86,
statements: 97.88,
branches: 93.95,
functions: 98.63,
lines: 98.18,
statements: 98.19,
},
},
});
9 changes: 7 additions & 2 deletions packages/keyring-eth-ledger-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,17 @@
"@ethereumjs/rlp": "^5.0.2",
"@ethereumjs/tx": "^5.4.0",
"@ethereumjs/util": "^9.1.0",
"@ledgerhq/context-module": "^1.14.1",
"@ledgerhq/device-management-kit": "^1.1.0",
"@ledgerhq/device-signer-kit-ethereum": "^1.11.1",
"@ledgerhq/device-transport-kit-react-native-ble": "^1.3.2",
"@ledgerhq/hw-app-eth": "^6.42.0",
"@metamask/eth-sig-util": "^8.2.0",
"@metamask/hw-wallet-sdk": "workspace:^",
"@metamask/keyring-api": "workspace:^",
"@metamask/keyring-utils": "workspace:^",
"hdkey": "^2.1.0"
"hdkey": "^2.1.0",
"rxjs": "^7.8.2"
},
"devDependencies": {
"@ethereumjs/common": "^4.4.0",
Expand All @@ -72,8 +77,8 @@
"@types/ethereumjs-tx": "^1.0.1",
"@types/hdkey": "^2.0.1",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.12",
"@types/web": "^0.0.69",
"@types/ws": "^8.18.1",
"deepmerge": "^4.2.2",
"depcheck": "^1.4.7",
"ethereumjs-tx": "^1.3.7",
Expand Down
2 changes: 2 additions & 0 deletions packages/keyring-eth-ledger-bridge/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ export * from './ledger-keyring';
export * from './ledger-keyring-v2';
export * from './ledger-iframe-bridge';
export * from './ledger-mobile-bridge';
export * from './ledger-dmk-bridge';
export * from './ledger-dmk-transport-middleware';
export type * from './ledger-bridge';
export * from './ledger-transport-middleware';
export type * from './type';
Expand Down
Loading
Loading