trufflesuite/truffle

View on GitHub
packages/hdwallet-provider/src/constructor/getMnemonic.ts

Summary

Maintainability
A
0 mins
Test Coverage
import type { SigningAuthority } from "./Constructor";
import type { Mnemonic } from "./types";

// extract the mnemonic if that's the style used, or return undefined
export const getMnemonic = (
  signingAuthority: SigningAuthority
): Mnemonic | undefined => {
  if ("mnemonic" in signingAuthority) {
    return signingAuthority.mnemonic;
  }
};