encode method
Implementation
@override
Future<Map<String, dynamic>> encode(dynamic content) async {
if (content is! TransactionReference) {
throw const FormatException('Content must be TransactionReference');
}
// Canonical flat JSON — interoperable with libxmtp / xmtp-js / Base.
final jsonBytes = utf8.encode(jsonEncode(content.toJson()));
return {
'content': Uint8List.fromList(jsonBytes),
'parameters': <String, dynamic>{},
};
}