validatePubKey static method

void validatePubKey(
  1. List<int> pubKeyBytes,
  2. EllipticCurveTypes curveType
)

Validate address length.

Implementation

static void validatePubKey(
  List<int> pubKeyBytes,
  EllipticCurveTypes curveType,
) {
  try {
    IPublicKey.fromBytes(pubKeyBytes, curveType);
  } catch (e) {
    throw ArgumentException(
        "Invalid $curveType public key (${BytesUtils.toHexString(pubKeyBytes)})");
  }
}