notifyVirtualDaaScoreChanged method

Stream<Int64> notifyVirtualDaaScoreChanged()

Implementation

Stream<Int64> notifyVirtualDaaScoreChanged() {
  final message = KaspadMessage(
    notifyVirtualDaaScoreChangedRequest:
        NotifyVirtualDaaScoreChangedRequestMessage(),
  );

  final response = _streamRequest(message);

  final result = response.map((event) {
    final error = event.notifyVirtualDaaScoreChangedResponse.error;
    if (error.message.isNotEmpty) {
      throw RpcException(error);
    }
    return event.virtualDaaScoreChangedNotification.virtualDaaScore;
  }).skip(1);

  return result;
}