Search in sources :

Example 1 with PaginationStreamer

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)));
}
Also used : NamespaceRepository(io.nem.symbol.sdk.api.NamespaceRepository) NamespaceId(io.nem.symbol.sdk.model.namespace.NamespaceId) Hashes(io.nem.symbol.core.crypto.Hashes) MultisigAccountInfo(io.nem.symbol.sdk.model.account.MultisigAccountInfo) StateProofService(io.nem.symbol.sdk.api.StateProofService) StateMerkleProof(io.nem.symbol.sdk.model.state.StateMerkleProof) SecretLockInfo(io.nem.symbol.sdk.model.transaction.SecretLockInfo) NamespaceInfo(io.nem.symbol.sdk.model.namespace.NamespaceInfo) MosaicInfo(io.nem.symbol.sdk.model.mosaic.MosaicInfo) ConvertUtils(io.nem.symbol.core.utils.ConvertUtils) NamespaceRepository(io.nem.symbol.sdk.api.NamespaceRepository) PaginationStreamer(io.nem.symbol.sdk.api.PaginationStreamer) MosaicId(io.nem.symbol.sdk.model.mosaic.MosaicId) RepositoryFactory(io.nem.symbol.sdk.api.RepositoryFactory) NamespaceRegistrationType(io.nem.symbol.sdk.model.namespace.NamespaceRegistrationType) MosaicRestriction(io.nem.symbol.sdk.model.restriction.MosaicRestriction) NamespaceSearchCriteria(io.nem.symbol.sdk.api.NamespaceSearchCriteria) AccountRestrictions(io.nem.symbol.sdk.model.account.AccountRestrictions) AccountInfo(io.nem.symbol.sdk.model.account.AccountInfo) MerkleStateInfo(io.nem.symbol.sdk.model.blockchain.MerkleStateInfo) HashLockInfo(io.nem.symbol.sdk.model.transaction.HashLockInfo) Observable(io.reactivex.Observable) Address(io.nem.symbol.sdk.model.account.Address) Metadata(io.nem.symbol.sdk.model.metadata.Metadata) NamespaceId(io.nem.symbol.sdk.model.namespace.NamespaceId) NamespaceInfo(io.nem.symbol.sdk.model.namespace.NamespaceInfo) NamespaceSearchCriteria(io.nem.symbol.sdk.api.NamespaceSearchCriteria)

Aggregations

Hashes (io.nem.symbol.core.crypto.Hashes)1 ConvertUtils (io.nem.symbol.core.utils.ConvertUtils)1 NamespaceRepository (io.nem.symbol.sdk.api.NamespaceRepository)1 NamespaceSearchCriteria (io.nem.symbol.sdk.api.NamespaceSearchCriteria)1 PaginationStreamer (io.nem.symbol.sdk.api.PaginationStreamer)1 RepositoryFactory (io.nem.symbol.sdk.api.RepositoryFactory)1 StateProofService (io.nem.symbol.sdk.api.StateProofService)1 AccountInfo (io.nem.symbol.sdk.model.account.AccountInfo)1 AccountRestrictions (io.nem.symbol.sdk.model.account.AccountRestrictions)1 Address (io.nem.symbol.sdk.model.account.Address)1 MultisigAccountInfo (io.nem.symbol.sdk.model.account.MultisigAccountInfo)1 MerkleStateInfo (io.nem.symbol.sdk.model.blockchain.MerkleStateInfo)1 Metadata (io.nem.symbol.sdk.model.metadata.Metadata)1 MosaicId (io.nem.symbol.sdk.model.mosaic.MosaicId)1 MosaicInfo (io.nem.symbol.sdk.model.mosaic.MosaicInfo)1 NamespaceId (io.nem.symbol.sdk.model.namespace.NamespaceId)1 NamespaceInfo (io.nem.symbol.sdk.model.namespace.NamespaceInfo)1 NamespaceRegistrationType (io.nem.symbol.sdk.model.namespace.NamespaceRegistrationType)1 MosaicRestriction (io.nem.symbol.sdk.model.restriction.MosaicRestriction)1 StateMerkleProof (io.nem.symbol.sdk.model.state.StateMerkleProof)1