Search in sources :

Example 1 with AccountIds

use of io.nem.symbol.sdk.openapi.okhttp_gson.model.AccountIds in project nem2-sdk-java by nemtech.

the class AccountRepositoryOkHttpImpl method getAccountsInfo.

@Override
public Observable<List<AccountInfo>> getAccountsInfo(List<Address> addresses) {
    AccountIds accountIds = new AccountIds().addresses(addresses.stream().map(Address::plain).collect(Collectors.toList()));
    Callable<List<AccountInfoDTO>> callback = () -> getClient().getAccountsInfo(accountIds);
    return exceptionHandling(call(callback).flatMapIterable(item -> item).map(this::toAccountInfo).toList().toObservable());
}
Also used : AccountIds(io.nem.symbol.sdk.openapi.okhttp_gson.model.AccountIds) MapperUtils.toAddress(io.nem.symbol.core.utils.MapperUtils.toAddress) Address(io.nem.symbol.sdk.model.account.Address) List(java.util.List)

Aggregations

MapperUtils.toAddress (io.nem.symbol.core.utils.MapperUtils.toAddress)1 Address (io.nem.symbol.sdk.model.account.Address)1 AccountIds (io.nem.symbol.sdk.openapi.okhttp_gson.model.AccountIds)1 List (java.util.List)1