use of org.knowm.xchange.ExchangeSpecification in project XChange by knowm.
the class OkexOrdersDemo method main.
public static void main(String[] args) throws IOException {
ExchangeSpecification exSpec = new ExchangeSpecification(OkexExchange.class);
exSpec.setSecretKey("");
exSpec.setApiKey("");
exSpec.setExchangeSpecificParametersItem("passphrase", "");
Exchange okexExchange = ExchangeFactory.INSTANCE.createExchange(exSpec);
generic(okexExchange);
}
use of org.knowm.xchange.ExchangeSpecification in project XChange by knowm.
the class InteractiveAuthenticatedExchange method createInstanceFromDefaultInput.
public static Exchange createInstanceFromDefaultInput() {
Exchange mercadoBitcoin = ExchangeFactory.INSTANCE.createExchange(MercadoBitcoinExchange.class);
ExchangeSpecification exchangeSpecification = mercadoBitcoin.getExchangeSpecification();
Scanner s = new Scanner(System.in);
System.out.println("Enter your API key (chave):");
exchangeSpecification.setApiKey(s.next().trim().toLowerCase());
System.out.println("Enter your secret code (código):");
exchangeSpecification.setSecretKey(s.next().trim().toLowerCase());
System.out.println("Enter your PIN (IMPORTANT: This is your PIN, not your user password):");
exchangeSpecification.setPassword(s.next().trim().toLowerCase());
exchangeSpecification.setUserName("<optional username>");
System.out.println("Please wait...");
return mercadoBitcoin;
}
use of org.knowm.xchange.ExchangeSpecification in project XChange by knowm.
the class LgoEnv method prod.
public static ExchangeSpecification prod() {
ExchangeSpecification result = baseSpecification();
result.setSslUri("https://exchange-api.exchange.lgo.markets");
result.setHost("exchange-api.exchange.lgo.markets");
result.setExchangeSpecificParametersItem(KEYS_URL, "https://storage.googleapis.com/lgo-markets-keys");
result.setExchangeSpecificParametersItem(WS_URL, "wss://ws.exchange.lgo.markets/");
return result;
}
use of org.knowm.xchange.ExchangeSpecification in project XChange by knowm.
the class LgoEnv method sandbox.
public static ExchangeSpecification sandbox() {
ExchangeSpecification result = baseSpecification();
result.setSslUri("https://exchange-api.sandbox.lgo.markets");
result.setHost("exchange-api.sandbox.lgo.markets");
result.setExchangeSpecificParametersItem(KEYS_URL, "https://storage.googleapis.com/lgo-sandbox_batch_keys");
result.setExchangeSpecificParametersItem(WS_URL, "wss://ws.sandbox.lgo.markets/");
return result;
}
use of org.knowm.xchange.ExchangeSpecification in project XChange by knowm.
the class dydxStreamingExchange method connect.
@Override
public Completable connect(ProductSubscription... args) {
if (args == null || args.length == 0)
throw new UnsupportedOperationException("The ProductSubscription must be defined!");
ExchangeSpecification exchangeSpec = getExchangeSpecification();
switch((String) exchangeSpec.getExchangeSpecificParametersItem("version")) {
case V3:
this.streamingService = new dydxStreamingService(API_URI_V3);
this.streamingMarketDataService = new info.bitrich.xchangestream.dydx.service.v3.dydxStreamingMarketDataService(streamingService);
break;
case V3_ROPSTEN:
this.streamingService = new dydxStreamingService(API_URI_ROPSTEN_V3);
this.streamingMarketDataService = new info.bitrich.xchangestream.dydx.service.v3.dydxStreamingMarketDataService(streamingService);
break;
default:
this.streamingService = new dydxStreamingService(API_URI_V1);
this.streamingMarketDataService = new dydxStreamingMarketDataService(streamingService);
break;
}
streamingService.subscribeMultipleCurrencyPairs(args);
return streamingService.connect();
}
Aggregations