/**\r
* Derives a mnemonic phrase from source of entropy or seed.\r
*\r
- * The entropy must be between 32-64 characters to stay within the defined\r
- * limit of 128-256 bits. Typically wallets use the maximum entropy allowed.\r
+ * The entropy must be between 16-32 bytes (32-64 characters) to stay within\r
+ * the limit of 128-256 bits defined in BIP-39. Typically, wallets use the\r
+ * maximum entropy allowed.\r
*\r
- * @param {string} entropy - Hexadecimal string\r
+ * @param {(string|Uint8Array<ArrayBuffer>)} entropy - Cryptographically secure random value\r
* @returns {string} Mnemonic phrase created using the BIP-39 wordlist\r
*/\r
static async fromEntropy (entropy: string | Uint8Array<ArrayBuffer>): Promise<Bip39Mnemonic> {\r
/**\r
* Imports and validates an existing mnemonic phrase.\r
*\r
- * The phrase must be valid according to the BIP-39 specification. Typically\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
}\r
\r
/**\r
- * Validates a mnemonic phrase.\r
+ * Validates a mnemonic phrase meets the BIP-39 specification.\r
*\r
* @param {string} mnemonic - Mnemonic phrase to validate\r
* @returns {boolean} True if the mnemonic phrase is valid\r
}\r
\r
/**\r
- * Erases seed bytes and releases variable references to allow garbage\r
- * collection.\r
+ * Erases seed bytes and releases variable references.\r
*/\r
destroy () {\r
bytes.erase(this.#bip39Seed)\r
this.#phrase = undefined\r
}\r
\r
+ /**\r
+ * Converts the mnemonic phrase to a BIP-39 seed.\r
+ *\r
+ * A passphrase string can be specified. If the passphrase is undefined, null,\r
+ * or not a string, the empty string ("") is used instead.\r
+ *\r
+ * @param {string} [passphrase=''] - Used as the PBKDF2 salt. Default: ""\r
+ * @returns {Promise<Uint8Array<ArrayBuffer>>} Promise for seed as bytes\r
+ */\r
async toBip39Seed (passphrase: string): Promise<Uint8Array<ArrayBuffer>>\r
/**\r
* Converts the mnemonic phrase to a BIP-39 seed.\r
* or not a string, the empty string ("") is used instead.\r
*\r
* @param {string} [passphrase=''] - Used as the PBKDF2 salt. Default: ""\r
- * @returns {string} Hexadecimal seed\r
+ * @returns {Promise<string>} Promise for seed as hexadecimal string\r
*/\r
async toBip39Seed (passphrase: string, format: 'hex'): Promise<string>\r
- async toBip39Seed (passphrase: string, format?: 'hex'): Promise<string | Uint8Array> {\r
+ async toBip39Seed (passphrase: string, format?: 'hex'): Promise<string | Uint8Array<ArrayBuffer>> {\r
if (this.phrase == null) {\r
throw new Error('BIP-39 mnemonic phrase not found')\r
}\r
/**\r
* Converts the mnemonic phrase to a BLAKE2b seed.\r
*\r
+ * @param {string} format\r
* @returns {Promise<string>} Promise for seed as hexadecimal string\r
*/\r
async toBlake2bSeed (format: 'hex'): Promise<string>\r