decryptNip44 method

  1. @override
Future<String?> decryptNip44({
  1. required String ciphertext,
  2. required String senderPubKey,
})
override

Implementation

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