encrypt method

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

Implementation

@override
Future<String?> encrypt(String msg, String destPubKey, {String? id}) async {
  final npub = publicKey.startsWith('npub')
      ? publicKey
      : Nip19.encodePubKey(publicKey);
  Map<dynamic, dynamic> map = await amberFlutterDS.amber.nip04Encrypt(
      plaintext: msg, currentUser: npub, pubKey: destPubKey, id: id);
  return map['signature'];
}