export type MnemonicRaw = { words: string[]; passphrase?: string; }; /** * Class representing a BIP39 Mnemonic phrase. * Supports 12, 15, 18, 21, and 24 word phrases with optional passphrase. */ export declare class Mnemonic { private mnemonic; static VALID_WORD_COUNTS: Set; /** * Instantiate Mnemonic from a phrase string. * * @param phrase The complete phrase (mnemonic words + optional passphrase). * @param wordList Optional wordlist (defaults to English BIP-39 wordlist). * @throws {Error} If the mnemonic is invalid. */ constructor(mnemonic: MnemonicRaw); /** * Instantiates a mnemonic from a string or array of words * * @param phraseOrWords The mnemonic phrase as a string or array of words * @param dictionary Optional wordlist (defaults to English BIP-39 wordlist). * @throws {Error} If mnemonic could not be generated. * @returns Instance of Mnemonic. */ static from(phraseOrWords: string | Array, wordList?: Array): Mnemonic; /** * Instantiates a mnemonic from a string * * @param phrase The mnemonic phrase as a string * @param dictionary Optional wordlist (defaults to English BIP-39 wordlist). * @throws {Error} If mnemonic could not be generated. * @returns Instance of Mnemonic. */ static fromString(phrase: string, wordList?: Array): Mnemonic; /** * Instantiates a mnemonic from an array of words. * * @param words Array of words (strings) that represent the mnemonic * @param dictionary Optional wordlist (defaults to English BIP-39 wordlist). * @throws {Error} If mnemonic could not be generated. * @returns Instance of Mnemonic. */ static fromWords(words: Array, wordList?: Array): Mnemonic; /** * Instantiates a mnemonic from its raw (serialized) mnemonic representation. * * @remarks this method is unsafe and should only use trusted data. * * @param mnemonicRaw The raw menmonic data. * @throws {Error} If mnemonic could not be generated. * @returns Instance of Mnemonic. */ static fromRaw(mnemonicRaw: MnemonicRaw): Mnemonic; /** * Generates a random mnemonic phrase. * * @param dictionary Optional wordlist (defaults to English BIP-39 wordlist). * @throws {Error} If mnemonic could not be generated. * @returns Instance of Mnemonic. */ static generateRandom(passphrase?: string, dictionary?: string[]): Mnemonic; /** * Validates a mnemonic phrase. * * @param phraseOrWords The mnemonic phrase or words to validate. * @param wordList Optional wordlist (defaults to English BIP-39 wordlist). * @returns boolean indicating if the phrase is valid. */ static isValid(phraseOrWords: string | Array, wordList?: string[]): boolean; /** * Checks if a word exists in the provided dictionary. * * @param word Word to check. * @param dictionary Optional wordlist (defaults to English BIP-39 wordlist). * @returns boolean indicating if the word is valid. */ static isValidWord(word: string, dictionary?: string[]): boolean; /** * Gets the passphrase if one exists. * * @returns The passphrase or undefined if none exists. */ getPassphrase(): string | undefined; /** * Returns the complete phrase as a string. * * @param includePassphrase Whether to include the passphrase in the output. * @returns Complete phrase as a string. */ toString(includePassphrase?: boolean): string; /** * Gets the number of words in the mnemonic (excluding passphrase). * * @returns Number of words. */ toWords(includePassphrase?: boolean): Array; /** * Returns a serializable represntation of the class * * @returns A serializable reprentation of the class. */ toRaw(): MnemonicRaw; }