Search in sources :

Example 6 with NamespaceSearchCriteria

use of io.nem.symbol.sdk.api.NamespaceSearchCriteria 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)

Example 7 with NamespaceSearchCriteria

use of io.nem.symbol.sdk.api.NamespaceSearchCriteria in project nem2-sdk-java by nemtech.

the class MerkleLoaderIntegrationTest method namespaces.

public List<Arguments> namespaces() {
    RepositoryFactory repositoryFactory = getRepositoryFactory(DEFAULT_REPOSITORY_TYPE);
    NamespaceRepository repository = repositoryFactory.createNamespaceRepository();
    return getArguments(repository, new NamespaceSearchCriteria().order(ORDER_BY).registrationType(NamespaceRegistrationType.ROOT_NAMESPACE));
}
Also used : NamespaceRepository(io.nem.symbol.sdk.api.NamespaceRepository) RepositoryFactory(io.nem.symbol.sdk.api.RepositoryFactory) NamespaceSearchCriteria(io.nem.symbol.sdk.api.NamespaceSearchCriteria)

Aggregations

NamespaceSearchCriteria (io.nem.symbol.sdk.api.NamespaceSearchCriteria)7 NamespaceInfo (io.nem.symbol.sdk.model.namespace.NamespaceInfo)6 Address (io.nem.symbol.sdk.model.account.Address)5 NamespaceRepository (io.nem.symbol.sdk.api.NamespaceRepository)4 MerkleStateInfo (io.nem.symbol.sdk.model.blockchain.MerkleStateInfo)3 MosaicId (io.nem.symbol.sdk.model.mosaic.MosaicId)3 NamespaceId (io.nem.symbol.sdk.model.namespace.NamespaceId)3 NamespaceRegistrationType (io.nem.symbol.sdk.model.namespace.NamespaceRegistrationType)3 Observable (io.reactivex.Observable)3 MapperUtils (io.nem.symbol.core.utils.MapperUtils)2 MapperUtils.toNamespaceId (io.nem.symbol.core.utils.MapperUtils.toNamespaceId)2 Page (io.nem.symbol.sdk.api.Page)2 RepositoryFactory (io.nem.symbol.sdk.api.RepositoryFactory)2 AccountNames (io.nem.symbol.sdk.model.account.AccountNames)2 MosaicNames (io.nem.symbol.sdk.model.mosaic.MosaicNames)2 AddressAlias (io.nem.symbol.sdk.model.namespace.AddressAlias)2 Alias (io.nem.symbol.sdk.model.namespace.Alias)2 AliasType (io.nem.symbol.sdk.model.namespace.AliasType)2 EmptyAlias (io.nem.symbol.sdk.model.namespace.EmptyAlias)2 MosaicAlias (io.nem.symbol.sdk.model.namespace.MosaicAlias)2