All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.binance4j.market.dto.ExchangeInfo Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
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