use of io.nem.symbol.sdk.api.PaginationStreamer in project nem2-sdk-java by nemtech.
the class StateProofServiceImpl method namespace.
@Override
public Observable<StateMerkleProof<NamespaceInfo>> namespace(NamespaceInfo state) {
NamespaceId id = state.getId();
NamespaceRepository namespaceRepository = this.repositoryFactory.createNamespaceRepository();
PaginationStreamer<NamespaceInfo, NamespaceSearchCriteria> streamer = namespaceRepository.streamer();
return namespaceRepository.getNamespaceMerkle(id).flatMap(merkle -> streamer.search(new NamespaceSearchCriteria().level0(state.getId().getIdAsHex()).registrationType(NamespaceRegistrationType.SUB_NAMESPACE)).toList().toObservable().map(state::serialize).map(s -> toStateMerkleProof(state, merkle, s)));
}
Aggregations