Skip to content

Commit

Permalink
remove bip39 package and hardcode the English words
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Johnson committed Apr 6, 2024
1 parent b18809e commit c91b7a1
Showing 4 changed files with 2,053 additions and 37 deletions.
33 changes: 0 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@
"dependencies": {
"@emotion/react": "^11.11.3",
"@table-library/react-table-library": "^4.1.7",
"bip39": "^3.1.0",
"bootstrap": "^5.3.2",
"classnames": "^2.5.1",
"formik": "^2.4.5",
6 changes: 3 additions & 3 deletions src/components/MnemonicWordInput.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as rb from 'react-bootstrap'
import { wordlists } from 'bip39'
import { useTranslation } from 'react-i18next'
import styles from './MnemonicWordInput.module.css'
import { MNEMONIC_WORDS } from '../constants/bip39words'

interface MnemonicWordInputProps {
forwardRef: (el: HTMLInputElement) => void
@@ -36,8 +36,8 @@ const MnemonicWordInput = ({
onChange={(e) => setValue(e.target.value.trim(), index)}
className={styles.input}
disabled={disabled}
isInvalid={(isValid === false && value.length > 0) || (value !== '' && !wordlists.EN.includes(value))}
isValid={isValid === true || wordlists.EN.includes(value)}
isInvalid={(isValid === false && value.length > 0) || (value !== '' && !MNEMONIC_WORDS.includes(value))}
isValid={isValid === true || MNEMONIC_WORDS.includes(value)}
onFocus={onFocus}
autoFocus={autoFocus}
required
Loading

0 comments on commit c91b7a1

Please sign in to comment.