broadcastSignedEvent method

Future<void> broadcastSignedEvent(
  1. Nip01Event event,
  2. String url
)

Implementation

Future<void> broadcastSignedEvent(Nip01Event event, String url) async {
  if (isWebSocketOpen(url) && (!blockedRelays.contains(url))) {
    try {
      print("BROADCASTING to $url : kind: ${event.kind} author: ${event
          .pubKey}");
      var webSocket = webSockets[url];
      if (webSocket!=null) {
        send(url,jsonEncode(["EVENT", event.toJson()]));
      }
    } catch (e) {
      print("ERROR BROADCASTING $url -> $e");
    }
  }
}