Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const spell = require('spell')
const EventEmitter = require('events')
const HdKeyring = require('eth-hd-keyring')
const words = require('bip39/wordlists/english.json')
const dict = spell()
dict.load(words.join(' '))
class Guesser extends EventEmitter {
constructor(opts) {
super()
const { phrase, getBalance } = opts
this.phrase = phrase
this.getBalance = getBalance
this.cleanup()
}
cleanup () {
this.phrase = this.phrase.split(' ')
.filter((word) => {
return word !== ''
const spell = require('spell')
const EventEmitter = require('events')
const HdKeyring = require('eth-hd-keyring')
const words = require('bip39/wordlists/english.json')
const dict = spell()
dict.load(words.join(' '))
console.log(dict.suggest('scoter'))