public static Exchange createExchange() { // Use the factory to get Bitmex exchange API using default settings Exchange bitmex = ExchangeFactory.INSTANCE.createExchange(BitmexExchange.class.getName()); ExchangeSpecification bitmexSpec = bitmex.getDefaultExchangeSpecification(); // bitmexSpec.setApiKey(""); // bitmexSpec.setSecretKey(""); bitmex.applySpecification(bitmexSpec); return bitmex; } }
public static Exchange createExchange() { // Use the factory to get BFX exchange API using default settings Exchange bfx = ExchangeFactory.INSTANCE.createExchange(BitfinexExchange.class.getName()); ExchangeSpecification bfxSpec = bfx.getDefaultExchangeSpecification(); bfxSpec.setApiKey(""); bfxSpec.setSecretKey(""); bfx.applySpecification(bfxSpec); return bfx; } }
public static Exchange createExchange() { Exchange exchange = ExchangeFactory.INSTANCE.createExchange(BithumbExchange.class.getName()); ExchangeSpecification bithumbSpec = exchange.getDefaultExchangeSpecification(); bithumbSpec.setApiKey(""); bithumbSpec.setSecretKey(""); exchange.applySpecification(bithumbSpec); return exchange; } }
public static Exchange getExchange() { Exchange bleutrade = ExchangeFactory.INSTANCE.createExchange(BleutradeExchange.class.getName()); ExchangeSpecification exchangeSpecification = bleutrade.getDefaultExchangeSpecification(); exchangeSpecification.setApiKey(""); exchangeSpecification.setSecretKey(""); bleutrade.applySpecification(exchangeSpecification); return bleutrade; } }
public static Exchange createExchange() { // Use the factory to get BitFlyer exchange API using default settings Exchange exchange = ExchangeFactory.INSTANCE.createExchange(BitflyerExchange.class.getName()); ExchangeSpecification bfxSpec = exchange.getDefaultExchangeSpecification(); bfxSpec.setApiKey(""); bfxSpec.setSecretKey(""); exchange.applySpecification(bfxSpec); return exchange; } }
/** * Create an Exchange object with default ExchangeSpecification with authentication info and API * keys provided through parameters * * <p>The factory is parameterized with the name of the exchange implementation class. This must * be a class extending {@link org.knowm.xchange.Exchange}. * * @param exchangeClass the class of the exchange * @param apiKey the public API key * @param secretKey the secret API key * @return a new exchange instance configured with the default {@link * org.knowm.xchange.ExchangeSpecification} */ public <T extends Exchange> T createExchange( Class<T> exchangeClass, String apiKey, String secretKey) { Assert.notNull(exchangeClass, "exchange cannot be null"); log.debug("Creating default exchange from class name"); T exchange = createExchangeWithoutSpecification(exchangeClass); ExchangeSpecification defaultExchangeSpecification = exchange.getDefaultExchangeSpecification(); if (apiKey != null) defaultExchangeSpecification.setApiKey(apiKey); if (secretKey != null) defaultExchangeSpecification.setSecretKey(secretKey); exchange.applySpecification(defaultExchangeSpecification); return exchange; }
/** * Create an Exchange object with default ExchangeSpecification with authentication info and API * keys provided through parameters * * <p>The factory is parameterized with the name of the exchange implementation class. This must * be a class extending {@link org.knowm.xchange.Exchange}. * * @param exchangeClassName the fully-qualified class name of the exchange * @param apiKey the public API key * @param secretKey the secret API key * @return a new exchange instance configured with the default {@link * org.knowm.xchange.ExchangeSpecification} */ public Exchange createExchange(String exchangeClassName, String apiKey, String secretKey) { Assert.notNull(exchangeClassName, "exchangeClassName cannot be null"); log.debug("Creating default exchange from class name"); Exchange exchange = createExchangeWithoutSpecification(exchangeClassName); ExchangeSpecification defaultExchangeSpecification = exchange.getDefaultExchangeSpecification(); if (apiKey != null) defaultExchangeSpecification.setApiKey(apiKey); if (secretKey != null) defaultExchangeSpecification.setSecretKey(secretKey); exchange.applySpecification(defaultExchangeSpecification); return exchange; }
public IdexMarketDataService(IdexExchange idexExchange) { super(idexExchange); returnTickerApi = RestProxyFactory.createProxy( ReturnTickerApi.class, exchange.getExchangeSpecification().getSslUri(), getClientConfig()); returnOrderBookApi = RestProxyFactory.createProxy( ReturnOrderBookApi.class, exchange.getDefaultExchangeSpecification().getSslUri(), getClientConfig()); returnTradeHistoryApi = RestProxyFactory.createProxy( ReturnTradeHistoryApi.class, exchange.getDefaultExchangeSpecification().getSslUri(), getClientConfig()); }
/** * Create an Exchange object with default ExchangeSpecification with authentication info and API * keys provided through parameters * * <p>The factory is parameterized with the name of the exchange implementation class. This must * be a class extending {@link org.knowm.xchange.Exchange}. * * @param exchangeClass the class of the exchange * @param apiKey the public API key * @param secretKey the secret API key * @return a new exchange instance configured with the default {@link * org.knowm.xchange.ExchangeSpecification} */ public <T extends Exchange> T createExchange( Class<T> exchangeClass, String apiKey, String secretKey) { Assert.notNull(exchangeClass, "exchange cannot be null"); log.debug("Creating default exchange from class name"); T exchange = createExchangeWithoutSpecification(exchangeClass); ExchangeSpecification defaultExchangeSpecification = exchange.getDefaultExchangeSpecification(); if (apiKey != null) defaultExchangeSpecification.setApiKey(apiKey); if (secretKey != null) defaultExchangeSpecification.setSecretKey(secretKey); exchange.applySpecification(defaultExchangeSpecification); return exchange; }
/** * Create an Exchange object with default ExchangeSpecification with authentication info and API * keys provided through parameters * * <p>The factory is parameterized with the name of the exchange implementation class. This must * be a class extending {@link org.knowm.xchange.Exchange}. * * @param exchangeClassName the fully-qualified class name of the exchange * @param apiKey the public API key * @param secretKey the secret API key * @return a new exchange instance configured with the default {@link * org.knowm.xchange.ExchangeSpecification} */ public Exchange createExchange(String exchangeClassName, String apiKey, String secretKey) { Assert.notNull(exchangeClassName, "exchangeClassName cannot be null"); log.debug("Creating default exchange from class name"); Exchange exchange = createExchangeWithoutSpecification(exchangeClassName); ExchangeSpecification defaultExchangeSpecification = exchange.getDefaultExchangeSpecification(); if (apiKey != null) defaultExchangeSpecification.setApiKey(apiKey); if (secretKey != null) defaultExchangeSpecification.setSecretKey(secretKey); exchange.applySpecification(defaultExchangeSpecification); return exchange; }