sendCountEventToRelays method

  1. @override
void sendCountEventToRelays(
  1. NostrCountEvent countEvent, {
  2. required void onCountResponse(
    1. String relay,
    2. NostrCountResponse countResponse
    ),
})
override

Implementation

@override
void sendCountEventToRelays(
  NostrCountEvent countEvent, {
  required void Function(String relay, NostrCountResponse countResponse)
      onCountResponse,
}) {
  final serialized = countEvent.serialized();

  _runFunctionOverRelationIteration((relay) {
    _registerOnCountCallBack(
      subscriptionId: countEvent.subscriptionId,
      onCountResponse: onCountResponse,
      relay: relay.url,
    );

    relay.socket.sink.add(serialized);
    utils.log(
      'Count Event with subscription id: ${countEvent.subscriptionId} is sent to relay with url: ${relay.url}',
    );
  });
}