serialize method
Serialize to nostr event message
"EVENT", event JSON as defined above
"EVENT", subscription_id, event JSON as defined above
Implementation
String serialize() {
if (subscriptionId != null) {
return jsonEncode(["EVENT", subscriptionId, toJson()]);
} else {
return jsonEncode(["EVENT", toJson()]);
}
}