@metamask-previews/keyring-controller 19.0.1-preview-5db6a424 → 19.0.1-preview-953c11ad
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.
- package/dist/KeyringController.cjs +10 -4
- package/dist/KeyringController.cjs.map +1 -1
- package/dist/KeyringController.d.cts +2 -1
- package/dist/KeyringController.d.cts.map +1 -1
- package/dist/KeyringController.d.mts +2 -1
- package/dist/KeyringController.d.mts.map +1 -1
- package/dist/KeyringController.mjs +10 -4
- package/dist/KeyringController.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -450,12 +450,18 @@ class KeyringController extends base_controller_1.BaseController {
|
|
|
450
450
|
* Gets the seed phrase of the HD keyring.
|
|
451
451
|
*
|
|
452
452
|
* @param password - Password of the keyring.
|
|
453
|
+
* @param typeIndex - Hd keyring identifier
|
|
453
454
|
* @returns Promise resolving to the seed phrase.
|
|
454
455
|
*/
|
|
455
|
-
async exportSeedPhrase(password) {
|
|
456
|
+
async exportSeedPhrase(password, typeIndex) {
|
|
456
457
|
await this.verifyPassword(password);
|
|
457
|
-
|
|
458
|
-
|
|
458
|
+
const keyring = this.getKeyringsByType(KeyringTypes.hd).find((innerKeyring) => innerKeyring
|
|
459
|
+
.opts.typeIndex === typeIndex);
|
|
460
|
+
if (!keyring) {
|
|
461
|
+
throw new Error(constants_1.KeyringControllerError.KeyringNotFound);
|
|
462
|
+
}
|
|
463
|
+
assertHasUint8ArrayMnemonic(keyring);
|
|
464
|
+
return keyring.mnemonic;
|
|
459
465
|
}
|
|
460
466
|
/**
|
|
461
467
|
* Gets the private key from the keyring controlling an address.
|
|
@@ -1420,7 +1426,7 @@ async function _KeyringController_newKeyring(type, data) {
|
|
|
1420
1426
|
if (type === KeyringTypes.hd) {
|
|
1421
1427
|
await keyring.deserialize({
|
|
1422
1428
|
...(data ?? {}),
|
|
1423
|
-
typeIndex: lastIndexOfType,
|
|
1429
|
+
typeIndex: lastIndexOfType + 1,
|
|
1424
1430
|
id: (0, ulid_1.ulid)(),
|
|
1425
1431
|
});
|
|
1426
1432
|
}
|