diff --git a/packages/keyring-eth-hd/index.js b/packages/keyring-eth-hd/index.js index 46a634e1..1e8a45f9 100644 --- a/packages/keyring-eth-hd/index.js +++ b/packages/keyring-eth-hd/index.js @@ -1,6 +1,3 @@ -const { HDKey } = require('ethereum-cryptography/hdkey'); -const { keccak256 } = require('ethereum-cryptography/keccak'); -const { bytesToHex } = require('ethereum-cryptography/utils'); const { privateToPublic, publicToAddress, @@ -8,8 +5,6 @@ const { arrToBufArr, bufferToHex, } = require('@ethereumjs/util'); -const bip39 = require('@metamask/scure-bip39'); -const { wordlist } = require('@metamask/scure-bip39/dist/wordlists/english'); const { concatSig, decrypt, @@ -19,7 +14,12 @@ const { signTypedData, SignTypedDataVersion, } = require('@metamask/eth-sig-util'); +const bip39 = require('@metamask/scure-bip39'); +const { wordlist } = require('@metamask/scure-bip39/dist/wordlists/english'); const { assertIsHexString, remove0x } = require('@metamask/utils'); +const { HDKey } = require('ethereum-cryptography/hdkey'); +const { keccak256 } = require('ethereum-cryptography/keccak'); +const { bytesToHex } = require('ethereum-cryptography/utils'); // Options: const hdPathString = `m/44'/60'/0'/0`; diff --git a/packages/keyring-eth-hd/test/index.js b/packages/keyring-eth-hd/test/index.js index 465e5983..30f7edfd 100644 --- a/packages/keyring-eth-hd/test/index.js +++ b/packages/keyring-eth-hd/test/index.js @@ -1,3 +1,16 @@ +const { + TransactionFactory, + Transaction: EthereumTx, +} = require('@ethereumjs/tx'); +const { + isValidAddress, + bufferToHex, + toBuffer, + ecrecover, + pubToAddress, +} = require('@ethereumjs/util'); +const oldMMForkBIP39 = require('@metamask/bip39'); +const OldHdKeyring = require('@metamask/eth-hd-keyring'); const { normalize, personalSign, @@ -8,21 +21,8 @@ const { encrypt, } = require('@metamask/eth-sig-util'); const { wordlist } = require('@metamask/scure-bip39/dist/wordlists/english'); -const oldMMForkBIP39 = require('@metamask/bip39'); -const { - isValidAddress, - bufferToHex, - toBuffer, - ecrecover, - pubToAddress, -} = require('@ethereumjs/util'); -const { - TransactionFactory, - Transaction: EthereumTx, -} = require('@ethereumjs/tx'); - -const OldHdKeyring = require('@metamask/eth-hd-keyring'); const { keccak256 } = require('ethereum-cryptography/keccak'); + const HdKeyring = require('..'); // Sample account: