Skip to content
Merged
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
4 changes: 4 additions & 0 deletions packages/keyring-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Make BIP-44 capabilities optional in `KeyringCapabilities` ([#453](https://github.com/MetaMask/accounts/pull/453))
- The `derivePath`, `deriveIndex`, `deriveIndexRange`, and `discover` capabilities are now optional.
- A capability set to `true` indicates support, while `false` or `undefined` indicates no support.
- Keyrings no longer need to explicitly set unsupported capabilities to `false`.
- Change `KeyringWrapper.capabilities` from a readonly property to a getter ([#447](https://github.com/MetaMask/accounts/pull/447))
- Allows subclasses to override and return capabilities dynamically based on runtime state.
- Refine `EthAddressStruct` in order to make it compatible with the `Hex` type from `@metamask/utils` ([#405](https://github.com/MetaMask/accounts/pull/405))
Expand Down
8 changes: 4 additions & 4 deletions packages/keyring-api/src/api/v2/keyring-capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ export const KeyringCapabilitiesStruct = object({
/**
* Whether the keyring supports deriving accounts from a specific BIP-44 path.
*/
derivePath: boolean(),
derivePath: exactOptional(boolean()),
/**
* Whether the keyring supports deriving accounts from a BIP-44 account index.
*/
deriveIndex: boolean(),
deriveIndex: exactOptional(boolean()),
/**
* Whether the keyring supports deriving accounts from a range of BIP-44 account indices.
*/
deriveIndexRange: boolean(),
deriveIndexRange: exactOptional(boolean()),
/**
* Whether the keyring supports BIP-44 account discovery.
*/
discover: boolean(),
discover: exactOptional(boolean()),
}),
),
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/keyring-eth-hd/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add `HdKeyringV2` class implementing `KeyringV2` interface ([#398](https://github.com/MetaMask/accounts/pull/398)), ([#404](https://github.com/MetaMask/accounts/pull/404)), ([#410](https://github.com/MetaMask/accounts/pull/410)), ([#413](https://github.com/MetaMask/accounts/pull/413)), ([#451](https://github.com/MetaMask/accounts/pull/451))
- Add `HdKeyringV2` class implementing `KeyringV2` interface ([#398](https://github.com/MetaMask/accounts/pull/398)), ([#404](https://github.com/MetaMask/accounts/pull/404)), ([#410](https://github.com/MetaMask/accounts/pull/410)), ([#413](https://github.com/MetaMask/accounts/pull/413)), ([#451](https://github.com/MetaMask/accounts/pull/451)), ([#453](https://github.com/MetaMask/accounts/pull/453))
- Wraps legacy `HdKeyring` to expose accounts via the unified `KeyringV2` API and the `KeyringAccount` type.
- Extends `EthKeyringWrapper` for common Ethereum logic.

Expand Down
6 changes: 3 additions & 3 deletions packages/keyring-eth-hd/src/hd-keyring-v2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ describe('HdKeyringV2', () => {
expect(wrapper.type).toBe(KeyringType.Hd);
expect(wrapper.capabilities.scopes).toStrictEqual([EthScope.Eoa]);
expect(wrapper.capabilities.bip44?.deriveIndex).toBe(true);
expect(wrapper.capabilities.bip44?.derivePath).toBe(false);
expect(wrapper.capabilities.bip44?.deriveIndexRange).toBe(false);
expect(wrapper.capabilities.bip44?.discover).toBe(false);
expect(wrapper.capabilities.bip44?.derivePath).toBeUndefined();
expect(wrapper.capabilities.bip44?.deriveIndexRange).toBeUndefined();
expect(wrapper.capabilities.bip44?.discover).toBeUndefined();
});
});

Expand Down
3 changes: 0 additions & 3 deletions packages/keyring-eth-hd/src/hd-keyring-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ const hdKeyringV2Capabilities: KeyringCapabilities = {
scopes: [EthScope.Eoa],
bip44: {
deriveIndex: true,
derivePath: false,
deriveIndexRange: false,
discover: false,
},
privateKey: {
exportFormats: [{ encoding: PrivateKeyEncoding.Hexadecimal }],
Expand Down
2 changes: 1 addition & 1 deletion packages/keyring-eth-ledger-bridge/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add `LedgerKeyringV2` class implementing `KeyringV2` interface ([#416](https://github.com/MetaMask/accounts/pull/416)), ([#451](https://github.com/MetaMask/accounts/pull/451))
- Add `LedgerKeyringV2` class implementing `KeyringV2` interface ([#416](https://github.com/MetaMask/accounts/pull/416)), ([#451](https://github.com/MetaMask/accounts/pull/451)), ([#453](https://github.com/MetaMask/accounts/pull/453))
- Wraps legacy `LedgerKeyring` to expose accounts via the unified `KeyringV2` API and the `KeyringAccount` type.
- Extends `EthKeyringWrapper` for common Ethereum logic.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,6 @@ describe('LedgerKeyringV2', () => {
bip44: {
deriveIndex: true,
derivePath: true,
deriveIndexRange: false,
discover: false,
},
});
});
Expand Down
2 changes: 0 additions & 2 deletions packages/keyring-eth-ledger-bridge/src/ledger-keyring-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ const ledgerKeyringV2Capabilities: KeyringCapabilities = {
bip44: {
deriveIndex: true,
derivePath: true,
deriveIndexRange: false,
discover: false,
},
};

Expand Down
2 changes: 1 addition & 1 deletion packages/keyring-eth-qr/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add `QrKeyringV2` class implementing `KeyringV2` interface ([#411](https://github.com/MetaMask/accounts/pull/411)), ([#447](https://github.com/MetaMask/accounts/pull/447)), ([#451](https://github.com/MetaMask/accounts/pull/451))
- Add `QrKeyringV2` class implementing `KeyringV2` interface ([#411](https://github.com/MetaMask/accounts/pull/411)), ([#447](https://github.com/MetaMask/accounts/pull/447)), ([#451](https://github.com/MetaMask/accounts/pull/451)), ([#453](https://github.com/MetaMask/accounts/pull/453))
- Wraps legacy `QrKeyring` to expose accounts via the unified `KeyringV2` API and the `KeyringAccount` type.
- Extends `EthKeyringWrapper` for common Ethereum logic.

Expand Down
9 changes: 0 additions & 9 deletions packages/keyring-eth-qr/src/qr-keyring-v2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,6 @@ describe('QrKeyringV2', () => {
scopes: [EthScope.Eoa],
bip44: {
deriveIndex: true,
derivePath: false,
deriveIndexRange: false,
discover: false,
},
});
});
Expand Down Expand Up @@ -355,9 +352,6 @@ describe('QrKeyringV2', () => {
scopes: [EthScope.Eoa],
bip44: {
deriveIndex: true,
derivePath: false,
deriveIndexRange: false,
discover: false,
},
});
});
Expand Down Expand Up @@ -403,9 +397,6 @@ describe('QrKeyringV2', () => {
scopes: [EthScope.Eoa],
bip44: {
deriveIndex: true,
derivePath: false,
deriveIndexRange: false,
discover: false,
},
});
});
Expand Down
3 changes: 0 additions & 3 deletions packages/keyring-eth-qr/src/qr-keyring-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ const HD_MODE_CAPABILITIES: KeyringCapabilities = {
scopes: [EthScope.Eoa],
bip44: {
deriveIndex: true,
derivePath: false,
deriveIndexRange: false,
discover: false,
},
};

Expand Down
2 changes: 1 addition & 1 deletion packages/keyring-eth-trezor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add `TrezorKeyringV2` and `OneKeyKeyringV2` classes implementing `KeyringV2` interface ([#412](https://github.com/MetaMask/accounts/pull/412)), ([#451](https://github.com/MetaMask/accounts/pull/451))
- Add `TrezorKeyringV2` and `OneKeyKeyringV2` classes implementing `KeyringV2` interface ([#412](https://github.com/MetaMask/accounts/pull/412)), ([#451](https://github.com/MetaMask/accounts/pull/451)), ([#453](https://github.com/MetaMask/accounts/pull/453))
- Wraps legacy `TrezorKeyring` and `OneKeyKeyring` to expose accounts via the unified `KeyringV2` API and the `KeyringAccount` type.
- Extends `EthKeyringWrapper` for common Ethereum logic.

Expand Down
2 changes: 0 additions & 2 deletions packages/keyring-eth-trezor/src/trezor-keyring-v2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,6 @@ describe('TrezorKeyringV2', () => {
bip44: {
deriveIndex: true,
derivePath: true,
deriveIndexRange: false,
discover: false,
},
});
});
Expand Down
2 changes: 0 additions & 2 deletions packages/keyring-eth-trezor/src/trezor-keyring-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ const trezorKeyringV2Capabilities: KeyringCapabilities = {
bip44: {
deriveIndex: true,
derivePath: true,
deriveIndexRange: false,
discover: false,
},
};

Expand Down
Loading