isValidHardenedPath function

bool isValidHardenedPath(
  1. String path, [
  2. int purpose = 44
])

purpose is 44 for Ed25519, 94 for ML-DSA-65.

Implementation

bool isValidHardenedPath(String path, [int purpose = 44]) {
  return RegExp("^m/$purpose'/784'/[0-9]+'/[0-9]+'/[0-9]+'+\$").hasMatch(path);
}