isValidNip05Identifier method

  1. @override
bool isValidNip05Identifier(
  1. String identifier
)
override

Wether the given identifier has a valid format.

Example:

final isIdentifierValid = Nostr.instance.utilsService.isValidNip05Identifier("example");
print(isIdentifierValid) // false

Implementation

@override
bool isValidNip05Identifier(String identifier) {
  final emailRegEx =
      RegExp(r'^[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9_\-\.]+\.[a-zA-Z]+$');

  return emailRegEx.hasMatch(identifier);
}