allConnectedRelays method

Map<String, List<PubkeyMapping>> allConnectedRelays(
  1. List<String> pubKeys
)

Implementation

Map<String, List<PubkeyMapping>> allConnectedRelays(List<String> pubKeys) {
  Map<String, List<PubkeyMapping>> map = {};
  for (var relay in relays.keys) {
    if (isWebSocketOpen(relay)) {
      map[relay] = pubKeys
          .map((pubKey) => PubkeyMapping(
              pubKey: pubKey, rwMarker: ReadWriteMarker.readWrite))
          .toList();
    }
  }
  return map;
}