encryptString method

BuBytes encryptString(
  1. List<int> peerPublicKey,
  2. String message, {
  3. List<int>? nonce,
})

Encrypts a UTF-8 message for peerPublicKey (TON Connect encrypt takes a string). Returns raw NONCE || TAG || CIPHERTEXT bytes; base64-encode them for the bridge POST /message body.

Implementation

BuBytes encryptString(
  List<int> peerPublicKey,
  String message, {
  List<int>? nonce,
}) {
  return encrypt(peerPublicKey, StringUtils.encode(message), nonce: nonce);
}