Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab/src/hooks/useWallet.js
Show All 13 Lines | import { | ||||
getWalletBalanceFromUtxos, | getWalletBalanceFromUtxos, | ||||
toHash160, | toHash160, | ||||
} from 'utils/cashMethods'; | } from 'utils/cashMethods'; | ||||
import { | import { | ||||
isValidCashtabSettings, | isValidCashtabSettings, | ||||
isValidCashtabCache, | isValidCashtabCache, | ||||
isValidContactList, | isValidContactList, | ||||
parseInvalidSettingsForMigration, | parseInvalidSettingsForMigration, | ||||
validateMnemonicWordList, | |||||
} from 'utils/validation'; | } from 'utils/validation'; | ||||
import localforage from 'localforage'; | import localforage from 'localforage'; | ||||
import { currency } from 'components/Common/Ticker'; | import { currency } from 'components/Common/Ticker'; | ||||
import { | import { | ||||
xecReceivedNotification, | xecReceivedNotification, | ||||
xecReceivedNotificationWebsocket, | xecReceivedNotificationWebsocket, | ||||
eTokenReceivedNotification, | eTokenReceivedNotification, | ||||
} from 'components/Common/Notifications'; | } from 'components/Common/Notifications'; | ||||
▲ Show 20 Lines • Show All 871 Lines • ▼ Show 20 Lines | ) => { | ||||
) { | ) { | ||||
console.log( | console.log( | ||||
'bip39 english wordlist matches BCH.Mnemonic english wordlist', | 'bip39 english wordlist matches BCH.Mnemonic english wordlist', | ||||
); | ); | ||||
} | } | ||||
try { | try { | ||||
mnemonicTestOutput = BCH.Mnemonic.validate(mnemonic, wordlist); | mnemonicTestOutput = BCH.Mnemonic.validate(mnemonic, wordlist); | ||||
const localMnemonicTestOutput = validateMnemonicWordList( | |||||
mnemonic, | |||||
wordlist, | |||||
); | |||||
if (mnemonicTestOutput === localMnemonicTestOutput) { | |||||
console.log( | |||||
'mnemonicTestOutput matches localMnemonicTestOutput', | |||||
); | |||||
} | |||||
if (mnemonicTestOutput === 'Valid mnemonic') { | if (mnemonicTestOutput === 'Valid mnemonic') { | ||||
return true; | return true; | ||||
} else { | } else { | ||||
return false; | return false; | ||||
} | } | ||||
} catch (err) { | } catch (err) { | ||||
console.log(err); | console.log(err); | ||||
▲ Show 20 Lines • Show All 640 Lines • Show Last 20 Lines |