
org.knowm.xchange.binance.service.BinanceMarketDataServiceRaw Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xchange-binance Show documentation
Show all versions of xchange-binance Show documentation
Development fork. Not for general use.
The newest version!
package org.knowm.xchange.binance.service;
import java.io.IOException;
import java.util.List;
import java.util.stream.Collectors;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.binance.BinanceAdapters;
import org.knowm.xchange.binance.dto.marketdata.BinanceAggTrades;
import org.knowm.xchange.binance.dto.marketdata.BinanceKline;
import org.knowm.xchange.binance.dto.marketdata.BinanceOrderbook;
import org.knowm.xchange.binance.dto.marketdata.BinancePrice;
import org.knowm.xchange.binance.dto.marketdata.BinancePriceQuantity;
import org.knowm.xchange.binance.dto.marketdata.BinanceTicker24h;
import org.knowm.xchange.binance.dto.marketdata.KlineInterval;
import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.utils.StreamUtils;
public class BinanceMarketDataServiceRaw extends BinanceBaseService {
protected BinanceMarketDataServiceRaw(Exchange exchange) {
super(exchange);
}
public void ping() throws IOException {
binance.ping();
}
public BinanceOrderbook getBinanceOrderbook(CurrencyPair pair, Integer limit) throws IOException {
return binance.depth(BinanceAdapters.toSymbol(pair), limit);
}
public List aggTrades(
CurrencyPair pair, Long fromId, Long startTime, Long endTime, Integer limit)
throws IOException {
return binance.aggTrades(BinanceAdapters.toSymbol(pair), fromId, startTime, endTime, limit);
}
public BinanceKline lastKline(CurrencyPair pair, KlineInterval interval) throws IOException {
return klines(pair, interval, 1, null, null).stream().collect(StreamUtils.singletonCollector());
}
public List klines(CurrencyPair pair, KlineInterval interval) throws IOException {
return klines(pair, interval, null, null, null);
}
public List klines(
CurrencyPair pair, KlineInterval interval, Integer limit, Long startTime, Long endTime)
throws IOException {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy