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 {
      Logger.log.i(
          "🛈 BROADCASTING to $url : kind: ${event.kind} author: ${event.pubKey}");
      var webSocket = transports[url];
      if (webSocket != null) {
        send(url, jsonEncode(["EVENT", event.toJson()]));
      }
    } catch (e) {
      print("ERROR BROADCASTING $url -> $e");
    }
  }
}