com.binance4j.market.dto.ExchangeInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of binance4j-market Show documentation
Show all versions of binance4j-market Show documentation
Connector for the Market endpoints of the Binance API
package com.binance4j.market.dto;
import java.util.List;
import com.binance4j.core.dto.RateLimit;
import com.binance4j.core.exception.NotFoundException;
/**
* The current exchange trading rules and symbol information.
*
* @param timezone The server timezone.
* @param serverTime The server time.
* @param rateLimits The request limits (weight, orders, raw...).
* @param exchangeFilters The trading rules of the exchange.
* @param symbols The available symbols on the exchange.
*/
public record ExchangeInfo(String timezone, long serverTime, List rateLimits, List exchangeFilters, List symbols) {
/**
* @param symbol The symbol we want the infos.
* @return The symbol exchange information.
* @throws NotFoundException Thrown if the symbol was not found
*/
public SymbolInfo getSymbolInfo(String symbol) throws NotFoundException {
return symbols.stream().filter(symbolInfo -> symbolInfo.symbol().equals(symbol)).findFirst().orElseThrow(() -> new NotFoundException());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy