SubstratePrvKey.fromPrivateKey constructor

SubstratePrvKey.fromPrivateKey(
  1. IPrivateKey<ISignature, ISigningParams, IPublicKey<IVerifiyingParams>> privateKey,
  2. SubstrateCoinConf coinConf
)

Implementation

factory SubstratePrvKey.fromPrivateKey(
  IPrivateKey privateKey,
  SubstrateCoinConf coinConf,
) {
  if (privateKey.type != coinConf.type) {
    throw CoreErrors.invalidOperationArguments(
      "SubstratePrvKey.fromPrivateKey",
      reason: "Mismatch private key type.",
    );
  }
  return SubstratePrvKey._(privateKey, coinConf);
}