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

estonlabs.cxtl.exchanges.mexc.spot.v3.MEXCExchangeFactory Maven / Gradle / Ivy

There is a newer version: 1.4.14
Show newest version
package estonlabs.cxtl.exchanges.mexc.spot.v3;

import estonlabs.cxtl.common.AbstractExchangeFactory;
import estonlabs.cxtl.common.EnvironmentType;
import estonlabs.cxtl.exchanges.a.specification.domain.Exchange;
import estonlabs.cxtl.exchanges.mexc.spot.v3.domain.*;

import java.net.Proxy;
import java.net.URI;
import java.util.List;
import java.util.Map;

public class MEXCExchangeFactory extends AbstractExchangeFactory {

    public static final URI PROD = URI.create("https://api.mexc.com/api/v3");

    public static Map> ENVIRONMENTS = Map.of(
            EnvironmentType.PROD, List.of(PROD)
    );

    private final URI baseURI;

    public MEXCExchangeFactory(URI baseURI) {
        super(Exchange.MEXC, ENVIRONMENTS);
        this.baseURI = baseURI;
    }

    @Override
    protected MEXCExchangeFactory me() {
        return this;
    }

    @Override
    public MEXCCex buildEdi() {
        return buildCex();
    }

    @Override
    public MEXCCex buildEdi(Proxy httpProxy) {
        return buildCex(httpProxy);
    }

    @Override
    public MEXCCex buildCex() {
        return new MEXCCex(createJsonRestClient(baseURI), metricsLogger);
    }

    @Override
    public MEXCCex buildCex(Proxy httpProxy) {
        return new MEXCCex(createJsonRestClient(baseURI, httpProxy), metricsLogger);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy