NostrEventOkCommand.fromRelayMessage constructor
NostrEventOkCommand.fromRelayMessage(
- String data
Implementation
factory NostrEventOkCommand.fromRelayMessage(String data) {
assert(canBeDeserializedNotice(data));
final decoded = jsonDecode(data) as List;
final eventId = decoded[1] as String;
final isEventAccepted = decoded.length > 2 ? decoded[2] as bool : null;
final message = decoded.length > 3 ? decoded[3] as String : null;
return NostrEventOkCommand(
eventId: eventId,
isEventAccepted: isEventAccepted,
message: message,
);
}