trufflesuite/truffle

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

Summary

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

// extract the private keys if that's the style used, or return undefined
export const getPrivateKeys = (
  signingAuthority: SigningAuthority
): PrivateKey[] | undefined => {
  if ("privateKeys" in signingAuthority) {
    return signingAuthority.privateKeys;
  } else {
    return undefined;
  }
};