Search in sources :

Example 1 with ReceiptTypeEnum

use of io.nem.symbol.sdk.openapi.okhttp_gson.model.ReceiptTypeEnum 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()))));
}
Also used : BigInteger(java.math.BigInteger) Order(io.nem.symbol.sdk.openapi.okhttp_gson.model.Order) TransactionStatementPage(io.nem.symbol.sdk.openapi.okhttp_gson.model.TransactionStatementPage) ReceiptTypeEnum(io.nem.symbol.sdk.openapi.okhttp_gson.model.ReceiptTypeEnum) ReceiptRoutesApi(io.nem.symbol.sdk.openapi.okhttp_gson.api.ReceiptRoutesApi) ApiClient(io.nem.symbol.sdk.openapi.okhttp_gson.invoker.ApiClient) Callable(java.util.concurrent.Callable) Collectors(java.util.stream.Collectors) Order(io.nem.symbol.sdk.openapi.okhttp_gson.model.Order) TransactionStatementSearchCriteria(io.nem.symbol.sdk.api.TransactionStatementSearchCriteria) ReceiptType(io.nem.symbol.sdk.model.receipt.ReceiptType) ReceiptRepository(io.nem.symbol.sdk.api.ReceiptRepository) ResolutionStatementPage(io.nem.symbol.sdk.openapi.okhttp_gson.model.ResolutionStatementPage) List(java.util.List) 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) Observable(io.reactivex.Observable) BigInteger(java.math.BigInteger) Page(io.nem.symbol.sdk.api.Page) TransactionStatementPage(io.nem.symbol.sdk.openapi.okhttp_gson.model.TransactionStatementPage) BigInteger(java.math.BigInteger) ReceiptTypeEnum(io.nem.symbol.sdk.openapi.okhttp_gson.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.okhttp_gson.api.ReceiptRoutesApi)1 ApiClient (io.nem.symbol.sdk.openapi.okhttp_gson.invoker.ApiClient)1 Order (io.nem.symbol.sdk.openapi.okhttp_gson.model.Order)1 ReceiptTypeEnum (io.nem.symbol.sdk.openapi.okhttp_gson.model.ReceiptTypeEnum)1 ResolutionStatementPage (io.nem.symbol.sdk.openapi.okhttp_gson.model.ResolutionStatementPage)1 TransactionStatementPage (io.nem.symbol.sdk.openapi.okhttp_gson.model.TransactionStatementPage)1 Observable (io.reactivex.Observable)1 BigInteger (java.math.BigInteger)1 List (java.util.List)1 Callable (java.util.concurrent.Callable)1 Collectors (java.util.stream.Collectors)1