Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async initialize(): Promise {
if (!isValidMnemonic(this.mnemonicPhrase)) {
throw new Error('The mnemonic phrase you provided is invalid.');
}
}
useEffect(() => {
setSwapped(false);
setPossibleSwapped(false);
const swappedPhrase = swapMnemonicPhrase(mnemonicPhrase);
const isSwappedValid = isValidMnemonic(swappedPhrase);
if (!isValidMnemonic(mnemonicPhrase)) {
setValid(false);
if (isSwappedValid) {
setSwapped(true);
setMessageMnemonicPhrase(mnemonicPhrase);
}
} else {
setValid(true);
if (isSwappedValid) {
setPossibleSwapped(true);
setMessageMnemonicPhrase(mnemonicPhrase);
}
}
public async initialize(): Promise {
if (!isValidMnemonic(this.mnemonicPhrase)) {
throw new Error('The mnemonic phrase you provided is invalid.');
}
}
useEffect(() => {
setSwapped(false);
setPossibleSwapped(false);
const swappedPhrase = swapMnemonicPhrase(mnemonicPhrase);
const isSwappedValid = isValidMnemonic(swappedPhrase);
if (!isValidMnemonic(mnemonicPhrase)) {
setValid(false);
if (isSwappedValid) {
setSwapped(true);
setMessageMnemonicPhrase(mnemonicPhrase);
}
} else {
setValid(true);
if (isSwappedValid) {
setPossibleSwapped(true);
setMessageMnemonicPhrase(mnemonicPhrase);
}
}
}, [mnemonicPhrase]);