use of info.bitrich.xchangestream.coinmate.v2.dto.CoinmateWebSocketUserTrade in project XChange by knowm.
the class CoinmateStreamingTradeService method getUserTrades.
@Override
public Observable<UserTrade> getUserTrades(CurrencyPair currencyPair, Object... args) {
String channelName = "private-user-trades-" + coinmateStreamingService.getUserId() + "-" + CoinmateStreamingAdapter.getChannelPostfix(currencyPair);
ObjectReader reader = StreamingObjectMapperHelper.getObjectMapper().readerFor(new TypeReference<List<CoinmateWebSocketUserTrade>>() {
});
return coinmateStreamingService.subscribeChannel(channelName, true).map((message) -> {
List<CoinmateWebSocketUserTrade> webSocketUserTrades = reader.readValue(message.get("payload"));
return CoinmateStreamingAdapter.adaptWebSocketUserTrades(webSocketUserTrades, currencyPair);
}).concatMapIterable(UserTrades::getUserTrades);
}
Aggregations