package com.binance.connector.client.impl.websocketapi;

import com.binance.connector.client.utils.JSONParser;
import com.binance.connector.client.utils.ParameterChecker;
import com.binance.connector.client.utils.websocketapi.WebSocketApiRequestHandler;
import org.json.JSONObject;

/* loaded from: binance-connector-java-3.0.0rc3.jar:com/binance/connector/client/impl/websocketapi/WebSocketApiMarket.class */
public class WebSocketApiMarket {
    private WebSocketApiRequestHandler handler;

    public WebSocketApiMarket(WebSocketApiRequestHandler handler) {
        this.handler = handler;
    }

    public void depth(String symbol, JSONObject parameters) {
        ParameterChecker.checkParameterType(symbol, String.class, "symbol");
        this.handler.publicRequest("depth", JSONParser.addKeyValue(parameters, "symbol", symbol));
    }

    public void recentTrades(String symbol, JSONObject parameters) {
        ParameterChecker.checkParameterType(symbol, String.class, "symbol");
        this.handler.publicRequest("trades.recent", JSONParser.addKeyValue(parameters, "symbol", symbol));
    }

    public void historicalTrades(String symbol, JSONObject parameters) {
        ParameterChecker.checkParameterType(symbol, String.class, "symbol");
        this.handler.apiRequest("trades.historical", JSONParser.addKeyValue(parameters, "symbol", symbol));
    }

    public void aggTrades(String symbol, JSONObject parameters) {
        ParameterChecker.checkParameterType(symbol, String.class, "symbol");
        this.handler.publicRequest("trades.aggregate", JSONParser.addKeyValue(parameters, "symbol", symbol));
    }

    public void klines(String symbol, String interval, JSONObject parameters) {
        ParameterChecker.checkParameterType(symbol, String.class, "symbol");
        ParameterChecker.checkParameterType(interval, String.class, "interval");
        this.handler.publicRequest("klines", JSONParser.addKeyValue(JSONParser.addKeyValue(parameters, "symbol", symbol), "interval", interval));
    }

    public void uiKlines(String symbol, String interval, JSONObject parameters) {
        ParameterChecker.checkParameterType(symbol, String.class, "symbol");
        ParameterChecker.checkParameterType(interval, String.class, "interval");
        this.handler.publicRequest("uiKlines", JSONParser.addKeyValue(JSONParser.addKeyValue(parameters, "symbol", symbol), "interval", interval));
    }

    public void avgPrice(String symbol, JSONObject parameters) {
        ParameterChecker.checkParameterType(symbol, String.class, "symbol");
        this.handler.publicRequest("avgPrice", JSONParser.addKeyValue(parameters, "symbol", symbol));
    }

    public void ticker24H(JSONObject parameters) {
        ParameterChecker.checkOnlyOneOfParameters(parameters, "symbol", "symbols");
        this.handler.publicRequest("ticker.24hr", parameters);
    }

    public void ticker(JSONObject parameters) {
        ParameterChecker.checkOnlyOneOfParameters(parameters, "symbol", "symbols");
        ParameterChecker.checkOneOfParametersRequired(parameters, "symbol", "symbols");
        this.handler.publicRequest("ticker", parameters);
    }

    public void tickerPrice(JSONObject parameters) {
        ParameterChecker.checkOnlyOneOfParameters(parameters, "symbol", "symbols");
        this.handler.publicRequest("ticker.price", parameters);
    }

    public void tickerBook(JSONObject parameters) {
        ParameterChecker.checkOnlyOneOfParameters(parameters, "symbol", "symbols");
        this.handler.publicRequest("ticker.book", parameters);
    }
}
