wcEncodeType2 function

String wcEncodeType2({
  1. required String message,
})

Encode a type-2 (link-mode) envelope: base64url( 0x02 || plaintext ).

Type-2 envelopes are NOT encrypted - they carry the JSON-RPC plaintext for out-of-band (deep-link / universal-link) delivery, where the OS link routing is the trust boundary rather than the relay symKey.

Implementation

String wcEncodeType2({required String message}) {
  final out = <int>[2, ...utf8.encode(message)];
  return base64Url.encode(out);
}