return checksum\r
}\r
\r
- /**\r
- * Imports and validates an existing mnemonic phrase.\r
- *\r
- * The phrase must be valid according to the BIP-39 specification. Typically\r
- * wallets use the maximum of 24 words.\r
- *\r
- * @param {string} phrase - String of 12, 15, 18, 21, or 24 words\r
- * @returns {string} Mnemonic phrase validated using the BIP-39 wordlist\r
- */\r
- static async fromPhrase (phrase: string): Promise<Bip39Mnemonic> {\r
- this.#isInternal = true\r
- const self = new this()\r
- const isValid = await this.validate(phrase)\r
- if (isValid) {\r
- self.#phrase = phrase.normalize('NFKD').split(' ')\r
- return self\r
- } else {\r
- throw new Error('Invalid mnemonic phrase.')\r
- }\r
- }\r
-\r
/**\r
* Derives a mnemonic phrase from source of entropy or seed.\r
*\r
return this.fromPhrase(sentence)\r
}\r
\r
+ /**\r
+ * Imports and validates an existing mnemonic phrase.\r
+ *\r
+ * The phrase must be valid according to the BIP-39 specification. Typically\r
+ * wallets use the maximum of 24 words.\r
+ *\r
+ * @param {string} phrase - String of 12, 15, 18, 21, or 24 words\r
+ * @returns {string} Mnemonic phrase validated using the BIP-39 wordlist\r
+ */\r
+ static async fromPhrase (phrase: string): Promise<Bip39Mnemonic> {\r
+ this.#isInternal = true\r
+ const self = new this()\r
+ const isValid = await this.validate(phrase)\r
+ if (isValid) {\r
+ self.#phrase = phrase.normalize('NFKD').split(' ')\r
+ return self\r
+ } else {\r
+ throw new Error('Invalid mnemonic phrase.')\r
+ }\r
+ }\r
+\r
/**\r
* Validates a mnemonic phrase.\r
*\r