How to use the @ethersproject/hdnode.isValidMnemonic function in @ethersproject/hdnode

To help you get started, we’ve selected a few @ethersproject/hdnode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Mrtenz / FindETH / src / wallets / MnemonicPhrase.ts View on Github external
public async initialize(): Promise {
    if (!isValidMnemonic(this.mnemonicPhrase)) {
      throw new Error('The mnemonic phrase you provided is invalid.');
    }
  }
github Mrtenz / FindETH / packages / common / src / components / MnemonicFlow / EnterMnemonicPhrase / EnterMnemonicPhrase.tsx View on Github external
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);
      }
    }
github Mrtenz / FindETH / packages / web / src / wallets / MnemonicPhrase.ts View on Github external
public async initialize(): Promise {
    if (!isValidMnemonic(this.mnemonicPhrase)) {
      throw new Error('The mnemonic phrase you provided is invalid.');
    }
  }
github Mrtenz / FindETH / packages / common / src / components / MnemonicFlow / EnterMnemonicPhrase / EnterMnemonicPhrase.tsx View on Github external
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]);