0.1.3 • Published 2 years ago
micro-bip39 v0.1.3
micro-bip39
Create BIP39 mnemonic phrases with minimum dependencies.
Developed for, and then extracted from js-ethereum-cryptography. The source code is the same, the files have been copied for convenience.
Usage
npm install micro-bip39
Or, yarn add micro-bip39
API
This submodule contains the word lists defined by BIP39 for Czech, English, French, Italian, Japanese, Korean, Simplified and Traditional Chinese, and Spanish. These are not imported by default, as that would increase bundle sizes too much. Instead, you should import and use them explicitly.
To import a particular wordlist, use:
import { wordlist } from 'micro-bip39/wordlists/english';
import { wordlist as spanish } from 'micro-bip39/wordlists/spanish';
function generateMnemonic(wordlist: string[], strength?: number): string;
function mnemonicToEntropy(mnemonic: string, wordlist: string[]): Uint8Array;
function entropyToMnemonic(entropy: Uint8Array, wordlist: string[]): string;
function validateMnemonic(mnemonic: string, wordlist: string[]): boolean;
function mnemonicToSeed(mnemonic: string, passphrase?: string): Promise<Uint8Array>;
function mnemonicToSeedSync(mnemonic: string, passphrase?: string): Uint8Array;
License
Copyright (c) 2021 Patricio Palladino, Paul Miller, ethereum-cryptography contributors