Search in sources :

Example 1 with ReceiptTypeEnum

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

the class ReceiptRepositoryVertxImpl 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());
    Consumer<Handler<AsyncResult<TransactionStatementPage>>> callback = (handler) -> getClient().searchReceipts(height, fromHeight, toHeight, receiptTypes, recipientAddress, senderAddress, targetAddress, artifactId, pageSize, pageNumber, offset, order, handler);
    return exceptionHandling(call(callback).map(page -> this.toPage(page.getPagination(), page.getData().stream().map(mapper::createTransactionStatement).collect(Collectors.toList()))));
}
Also used : BigInteger(java.math.BigInteger) Order(io.nem.symbol.sdk.openapi.vertx.model.Order) ApiClient(io.nem.symbol.sdk.openapi.vertx.invoker.ApiClient) Collectors(java.util.stream.Collectors) TransactionStatementSearchCriteria(io.nem.symbol.sdk.api.TransactionStatementSearchCriteria) ReceiptType(io.nem.symbol.sdk.model.receipt.ReceiptType) TransactionStatementPage(io.nem.symbol.sdk.openapi.vertx.model.TransactionStatementPage) ReceiptRepository(io.nem.symbol.sdk.api.ReceiptRepository) Consumer(java.util.function.Consumer) List(java.util.List) Order(io.nem.symbol.sdk.openapi.vertx.model.Order) ReceiptRoutesApi(io.nem.symbol.sdk.openapi.vertx.api.ReceiptRoutesApi) TransactionStatement(io.nem.symbol.sdk.model.receipt.TransactionStatement) ResolutionStatementSearchCriteria(io.nem.symbol.sdk.api.ResolutionStatementSearchCriteria) AddressResolutionStatement(io.nem.symbol.sdk.model.receipt.AddressResolutionStatement) MosaicResolutionStatement(io.nem.symbol.sdk.model.receipt.MosaicResolutionStatement) ReceiptRoutesApiImpl(io.nem.symbol.sdk.openapi.vertx.api.ReceiptRoutesApiImpl) ResolutionStatementPage(io.nem.symbol.sdk.openapi.vertx.model.ResolutionStatementPage) ReceiptTypeEnum(io.nem.symbol.sdk.openapi.vertx.model.ReceiptTypeEnum) Observable(io.reactivex.Observable) BigInteger(java.math.BigInteger) AsyncResult(io.vertx.core.AsyncResult) Handler(io.vertx.core.Handler) Page(io.nem.symbol.sdk.api.Page) TransactionStatementPage(io.nem.symbol.sdk.openapi.vertx.model.TransactionStatementPage) BigInteger(java.math.BigInteger) Handler(io.vertx.core.Handler) ReceiptTypeEnum(io.nem.symbol.sdk.openapi.vertx.model.ReceiptTypeEnum)

Aggregations

Page (io.nem.symbol.sdk.api.Page)1 ReceiptRepository (io.nem.symbol.sdk.api.ReceiptRepository)1 ResolutionStatementSearchCriteria (io.nem.symbol.sdk.api.ResolutionStatementSearchCriteria)1 TransactionStatementSearchCriteria (io.nem.symbol.sdk.api.TransactionStatementSearchCriteria)1 AddressResolutionStatement (io.nem.symbol.sdk.model.receipt.AddressResolutionStatement)1 MosaicResolutionStatement (io.nem.symbol.sdk.model.receipt.MosaicResolutionStatement)1 ReceiptType (io.nem.symbol.sdk.model.receipt.ReceiptType)1 TransactionStatement (io.nem.symbol.sdk.model.receipt.TransactionStatement)1 ReceiptRoutesApi (io.nem.symbol.sdk.openapi.vertx.api.ReceiptRoutesApi)1 ReceiptRoutesApiImpl (io.nem.symbol.sdk.openapi.vertx.api.ReceiptRoutesApiImpl)1 ApiClient (io.nem.symbol.sdk.openapi.vertx.invoker.ApiClient)1 Order (io.nem.symbol.sdk.openapi.vertx.model.Order)1 ReceiptTypeEnum (io.nem.symbol.sdk.openapi.vertx.model.ReceiptTypeEnum)1 ResolutionStatementPage (io.nem.symbol.sdk.openapi.vertx.model.ResolutionStatementPage)1 TransactionStatementPage (io.nem.symbol.sdk.openapi.vertx.model.TransactionStatementPage)1 Observable (io.reactivex.Observable)1 AsyncResult (io.vertx.core.AsyncResult)1 Handler (io.vertx.core.Handler)1 BigInteger (java.math.BigInteger)1 List (java.util.List)1