estonlabs.cxtl.exchanges.mexc.spot.v3.MEXCExchangeFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cxtl Show documentation
Show all versions of cxtl Show documentation
CXTL – Crypto eXchange Trading Library
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);
}
}