I'd like to get only the BTC pairs of Binance. I use this code to get all currencies current prices
List<TickerPrice> allPrices = client.getAllPrices();
System.out.println(allPrices);
How do I turn only BTC pairs?
Try and catch BinanceAPIException around .. example of grabbing a pair
BinanceApiClientFactory factory = BinanceApiClientFactory.newInstance();
BinanceApiRestClient client = factory.newRestClient();
// BinanceApiAsyncRestClient client = factory.newAsyncRestClient();
// Test connectivity
client.ping();
long serverTime = client.getServerTime();
out.println("<p> Time of ticker from Binance - its Servertime : " + serverTime + "</p>");
TickerStatistics tickerStatistics = client.get24HrPriceStatistics("NEOETH");
out.println("<p> NEO ETH : " + tickerStatistics.getLastPrice() + "</p>");
String price = tickerStatistics.getLastPrice().toString();
out.println("<p> as string .. " + price + "</p>");
TickerStatistics tickerStatistics2 = client.get24HrPriceStatistics("HBARUSDT");
out.println("<p> HBAR USDT : " + tickerStatistics2.getLastPrice() + "</p>");