New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@metamask/eth-hd-keyring

Package Overview
Dependencies
Maintainers
7
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/eth-hd-keyring - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

9

CHANGELOG.md

@@ -9,2 +9,7 @@ # Changelog

## [4.0.2]
### Added
- Add parameter validation for constructor / `deserialize` method ([#65](https://github.com/MetaMask/eth-hd-keyring/pull/65))
- As of v4.0.0, the `deserialize` method (which is also called by the constructor) can no longer generate accounts with the `numberOfAccounts` option without a `mnemonic`. Prior to v4.0.0, a mnemonic was generated automatically if it was missing, but we now want to ensure a mnemonic is never implicitly generated without the caller knowing.
## [4.0.1]

@@ -26,6 +31,8 @@ ### Added

- Class variable `mnemonic` on `HdKeyring` can now be either type `Buffer` or type `string`.
- Deserialize method (and `HdKeyring` constructor by extension) can no longer be passed an options object containing a value for `numberOfAccounts` if it is not also containing a value for `mnemonic`.
- Package name changed from `eth-hd-keyring` to `@metamask/eth-hd-keyring`.
[Unreleased]: https://github.com/MetaMask/eth-hd-keyring/compare/v4.0.1...HEAD
[Unreleased]: https://github.com/MetaMask/eth-hd-keyring/compare/v4.0.2...HEAD
[4.0.2]: https://github.com/MetaMask/eth-hd-keyring/compare/v4.0.1...v4.0.2
[4.0.1]: https://github.com/MetaMask/eth-hd-keyring/compare/v4.0.0...v4.0.1
[4.0.0]: https://github.com/MetaMask/eth-hd-keyring/releases/tag/v4.0.0

@@ -36,2 +36,8 @@ const { hdkey } = require('ethereumjs-wallet');

deserialize(opts = {}) {
if (opts.numberOfAccounts && !opts.mnemonic) {
throw new Error(
'Eth-Hd-Keyring: Deserialize method cannot be called with an opts value for numberOfAccounts and no menmonic',
);
}
if (this.root) {

@@ -38,0 +44,0 @@ throw new Error(

2

package.json
{
"name": "@metamask/eth-hd-keyring",
"version": "4.0.1",
"version": "4.0.2",
"description": "A simple standard interface for a seed phrase generated set of Ethereum accounts.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -70,2 +70,13 @@ const {

});
it('throws when numberOfAccounts is passed with no mnemonic', () => {
expect(
() =>
new HdKeyring({
numberOfAccounts: 2,
}),
).toThrow(
'Eth-Hd-Keyring: Deserialize method cannot be called with an opts value for numberOfAccounts and no menmonic',
);
});
});

@@ -72,0 +83,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc