@octaflowlabs/onchain-sdk 1.3.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -25,15 +25,16 @@ class EvmWalletService {
|
|
|
25
25
|
this.validateMnemonic(mnemonic);
|
|
26
26
|
const wallets = [];
|
|
27
27
|
const mnemonicObject = ethers_1.Mnemonic.fromPhrase(mnemonic);
|
|
28
|
+
const rootNode = ethers_1.HDNodeWallet.fromMnemonic(mnemonicObject, this.DEFAULT_DERIVATION_PATH);
|
|
28
29
|
for (let i = 0; i < count; i++) {
|
|
29
30
|
const accountIndex = startIndex + i;
|
|
31
|
+
const child = rootNode.deriveChild(accountIndex);
|
|
30
32
|
const path = `${this.DEFAULT_DERIVATION_PATH}/${accountIndex}`;
|
|
31
|
-
const hdNode = ethers_1.HDNodeWallet.fromMnemonic(mnemonicObject, path);
|
|
32
33
|
wallets.push({
|
|
33
|
-
address:
|
|
34
|
-
privateKey:
|
|
34
|
+
address: child.address,
|
|
35
|
+
privateKey: child.privateKey,
|
|
35
36
|
path,
|
|
36
|
-
publicKey:
|
|
37
|
+
publicKey: child.publicKey,
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
40
|
return wallets;
|
|
@@ -22,15 +22,16 @@ export class EvmWalletService {
|
|
|
22
22
|
this.validateMnemonic(mnemonic);
|
|
23
23
|
const wallets = [];
|
|
24
24
|
const mnemonicObject = Mnemonic.fromPhrase(mnemonic);
|
|
25
|
+
const rootNode = HDNodeWallet.fromMnemonic(mnemonicObject, this.DEFAULT_DERIVATION_PATH);
|
|
25
26
|
for (let i = 0; i < count; i++) {
|
|
26
27
|
const accountIndex = startIndex + i;
|
|
28
|
+
const child = rootNode.deriveChild(accountIndex);
|
|
27
29
|
const path = `${this.DEFAULT_DERIVATION_PATH}/${accountIndex}`;
|
|
28
|
-
const hdNode = HDNodeWallet.fromMnemonic(mnemonicObject, path);
|
|
29
30
|
wallets.push({
|
|
30
|
-
address:
|
|
31
|
-
privateKey:
|
|
31
|
+
address: child.address,
|
|
32
|
+
privateKey: child.privateKey,
|
|
32
33
|
path,
|
|
33
|
-
publicKey:
|
|
34
|
+
publicKey: child.publicKey,
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
return wallets;
|