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/WebSocketApiUserDataStream.class */
public class WebSocketApiUserDataStream {
    private WebSocketApiRequestHandler handler;

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

    public void userDataStreamStart(JSONObject parameters) {
        this.handler.apiRequest("userDataStream.start", parameters);
    }

    public void userDataStreamPing(String listenKey, JSONObject parameters) {
        ParameterChecker.checkParameterType(listenKey, String.class, "listenKey");
        this.handler.apiRequest("userDataStream.ping", JSONParser.addKeyValue(parameters, "listenKey", listenKey));
    }

    public void userDataStreamStop(String listenKey, JSONObject parameters) {
        ParameterChecker.checkParameterType(listenKey, String.class, "listenKey");
        this.handler.apiRequest("userDataStream.stop", JSONParser.addKeyValue(parameters, "listenKey", listenKey));
    }
}
