checkKeychain method

Future<bool> checkKeychain(
  1. String endpoint,
  2. Uint8List pubkey
)

Checks if a keychain exists for the given public key on the specified endpoint.

  • endpoint: The API endpoint to query.
  • pubkey: The public key as a Uint8List.

Returns true if the keychain exists, false otherwise.

Implementation

Future<bool> checkKeychain(String endpoint, Uint8List pubkey) async {
  final genesisAddress = await _findKeychainGenesisAddress(endpoint, pubkey);
  if (genesisAddress == null || genesisAddress.isEmpty) {
    return false;
  }
  final transaction = await _searchKeychain(endpoint, genesisAddress);
  if (transaction == null) {
    return false;
  }

  return true;
}