getAlias method

Future<AliasDoc?> getAlias(
  1. String handle
)

Retrieves an alias by its handle.

This method searches for an alias with the given handle and returns its details.

Parameters:

  • handle: The handle of the alias to retrieve.

Returns:

  • A Future that completes with the AliasDoc object if found, or null if not found.

Implementation

Future<AliasDoc?> getAlias(String handle) async {
  final aliases = await searchAliases(handle, 1);
  try {
    return aliases.firstWhere((alias) => alias.handle == handle);
  } catch (e) {
    return null;
  }
}