use of io.nem.symbol.sdk.openapi.vertx.model.MosaicIds in project nem2-sdk-java by nemtech.
the class MosaicRepositoryVertxImpl method getMosaics.
@Override
public Observable<List<MosaicInfo>> getMosaics(List<MosaicId> ids) {
MosaicIds mosaicIds = new MosaicIds();
mosaicIds.mosaicIds(ids.stream().map(MosaicId::getIdAsHex).collect(Collectors.toList()));
Consumer<Handler<AsyncResult<List<MosaicInfoDTO>>>> callback = handler -> getClient().getMosaics(mosaicIds, handler);
return exceptionHandling(call(callback).flatMapIterable(item -> item).map(this::createMosaicInfo).toList().toObservable());
}
use of io.nem.symbol.sdk.openapi.vertx.model.MosaicIds in project nem2-sdk-java by nemtech.
the class NamespaceRepositoryVertxImpl method getMosaicsNames.
@Override
public Observable<List<MosaicNames>> getMosaicsNames(List<MosaicId> ids) {
MosaicIds mosaicIds = new MosaicIds();
mosaicIds.mosaicIds(ids.stream().map(MosaicId::getIdAsHex).collect(Collectors.toList()));
Consumer<Handler<AsyncResult<MosaicsNamesDTO>>> callback = handler -> getClient().getMosaicsNames(mosaicIds, handler);
return exceptionHandling(call(callback).map(MosaicsNamesDTO::getMosaicNames).flatMapIterable(item -> item).map(this::toMosaicNames).toList().toObservable());
}
Aggregations