decrypt method

  1. @override
Future<String?> decrypt(
  1. String msg,
  2. String destPubKey, {
  3. String? id,
})
override

Implementation

@override
Future<String?> decrypt(String msg, String destPubKey, {String? id}) async {
  if (privateKey == null || privateKey!.isEmpty) {
    throw Exception('Private key is required for decryption');
  }
  final crypto = await _getCrypto();
  final result = await crypto
      .nip04Decrypt(privateKey!.toJS, destPubKey.toJS, msg.toJS)
      .toDart;
  return result.toDart;
}