Bip44PublicKey constructor

Bip44PublicKey(
  1. Bip32PublicKey pubKey,
  2. BaseBipCoinConfig<BaseCoinConfig> coinConf
)

Factory constructor to create a Bip44PublicKey from a Bip32PublicKey and a BaseBipCoinConfig. It verifies that the elliptic curve type of the public key matches the coin's configuration.

Implementation

factory Bip44PublicKey(Bip32PublicKey pubKey, BaseBipCoinConfig coinConf) {
  if (pubKey.curveType != coinConf.type) {
    throw ArgumentException.invalidOperationArguments(
      "Bip44PublicKey",
      name: "pubKey",
      reason: "Invalid public key.",
    );
  }
  return Bip44PublicKey._(pubKey, coinConf);
}