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 {
  final userPubkey = publicKey.startsWith('npub')
      ? publicKey
      : Nip19.encodePubKey(publicKey);
  final amberResult = await amberFlutterDS.amber.nip44Decrypt(
    ciphertext: ciphertext,
    currentUser: userPubkey,
    pubKey: senderPubKey,
  );

  return amberResult['signature'];
}