import AddressImporter , { Wallet } from './address-importer' ; import Bip39Mnemonic from './bip39-mnemonic' ; export default class AddressGenerator { param { string } entropy param { string } seedPassword generateWallet ( entropy = '' , seedPassword = '' ) { const bip39 = new Bip39Mnemonic ( seedPassword ) ; const mnemonicSeed = bip39 . createWallet ( entropy ) ; const wallet = new AddressImporter ( ) . fromSeed ( mnemonicSeed . seed , 0 , 0 ) ; return { ... wallet , mnemonic : mnemonicSeed . mnemonic , } ; } /**
     * Generates a legacy Nano wallet
     *
     */ generateLegacyWallet ( seed ? ) { const bip39 = new Bip39Mnemonic ( ) ; const mnemonicSeed = bip39 . createLegacyWallet ( seed ) ; const wallet = new AddressImporter ( ) . fromLegacySeed ( mnemonicSeed . seed , 0 , 0 , mnemonicSeed . mnemonic ) ; return wallet ; } }