use of io.nem.symbol.sdk.openapi.okhttp_gson.model.TransactionStatementPage in project nem2-sdk-java by nemtech.
the class ReceiptRepositoryOkHttpImpl method searchReceipts.
@Override
public Observable<Page<TransactionStatement>> searchReceipts(TransactionStatementSearchCriteria criteria) {
BigInteger height = criteria.getHeight();
BigInteger fromHeight = criteria.getFromHeight();
BigInteger toHeight = criteria.getToHeight();
List<ReceiptTypeEnum> receiptTypes = toDto(criteria.getReceiptTypes());
String recipientAddress = toDto(criteria.getRecipientAddress());
String senderAddress = toDto(criteria.getSenderAddress());
String targetAddress = toDto(criteria.getTargetAddress());
String artifactId = criteria.getArtifactId();
Integer pageSize = criteria.getPageSize();
Integer pageNumber = criteria.getPageNumber();
String offset = criteria.getOffset();
Order order = toDto(criteria.getOrder());
Callable<TransactionStatementPage> callback = () -> getClient().searchReceipts(height, fromHeight, toHeight, receiptTypes, recipientAddress, senderAddress, targetAddress, artifactId, pageSize, pageNumber, offset, order);
return exceptionHandling(call(callback).map(page -> this.toPage(page.getPagination(), page.getData().stream().map(mapper::createTransactionStatement).collect(Collectors.toList()))));
}
Aggregations