class ReceiptRepositoryOkHttpImpl extends AbstractRepositoryOkHttpImpl implements ReceiptRepository {

  @Override
  public Observable<Page<TransactionStatement>> searchReceipts(
      TransactionStatementSearchCriteria criteria) {

    BigInteger height = criteria.getHeight();
    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,
                    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()))));
  }

  public  ReceiptRepositoryOkHttpImpl(ApiClient apiClient);

}