use of org.knowm.xchange.ExchangeSpecification in project XChange by knowm.
the class BaseServiceTest method setUpBaseClass.
@BeforeClass
public static void setUpBaseClass() {
exchangeSpecification = new ExchangeSpecification(HitbtcExchange.class);
exchange = ExchangeFactory.INSTANCE.createExchange(exchangeSpecification);
}
use of org.knowm.xchange.ExchangeSpecification in project XChange by knowm.
the class BaseAuthenticatedServiceTest method setUpBaseClass.
@BeforeClass
public static void setUpBaseClass() {
exchangeSpecification = new ExchangeSpecification(HitbtcExchange.class);
exchangeSpecification.setApiKey(getApiKey());
exchangeSpecification.setSecretKey(getSecret());
exchange = ExchangeFactory.INSTANCE.createExchange(exchangeSpecification);
}
use of org.knowm.xchange.ExchangeSpecification in project XChange by knowm.
the class GlobitexExchange method getDefaultExchangeSpecification.
@Override
public ExchangeSpecification getDefaultExchangeSpecification() {
ExchangeSpecification exchangeSpecification = new ExchangeSpecification(this.getClass());
exchangeSpecification.setSslUri("https://api.globitex.com");
exchangeSpecification.setHost("api.globitex.com");
exchangeSpecification.setPort(80);
exchangeSpecification.setExchangeName("Globitex");
exchangeSpecification.setExchangeDescription("Globitex is a Bitcoin exchange based in UK.");
return exchangeSpecification;
}
use of org.knowm.xchange.ExchangeSpecification in project XChange by knowm.
the class RippleServerTrustTest method localServerTest.
/**
* The recommended method for sending private transactions with a secret key is to use a trusted
* REST API server, e.g. one running locally.
*/
@Test
public void localServerTest() {
final ExchangeSpecification specification = new ExchangeSpecification(RippleExchange.class);
// remove the default api.ripple.com connection
specification.setSslUri("");
specification.setPlainTextUri(RippleExchange.REST_API_LOCALHOST_PLAIN_TEXT);
specification.setSecretKey("s****************************");
final Exchange exchange = ExchangeFactory.INSTANCE.createExchange(specification);
assertThat(exchange).isInstanceOf(RippleExchange.class);
assertThat(exchange.getExchangeSpecification().getSecretKey()).isEqualTo("s****************************");
assertThat(exchange.getExchangeSpecification().getSslUri()).isEqualTo("");
assertThat(exchange.getExchangeSpecification().getPlainTextUri()).isEqualTo(RippleExchange.REST_API_LOCALHOST_PLAIN_TEXT);
}
use of org.knowm.xchange.ExchangeSpecification in project XChange by knowm.
the class RippleServerTrustTest method safetyNetTest.
/**
* It should not be possible to initialise a RippleExchange with URL https://api.ripple.com/ using
* a secret key if trust has not been explicitly enabled - an IllegalStateException should be
* thrown when attempting to create the exchange.
*/
@Test(expected = IllegalStateException.class)
public void safetyNetTest() {
final ExchangeSpecification specification = new ExchangeSpecification(RippleExchange.class);
specification.setSslUri(RippleExchange.REST_API_RIPPLE_LABS);
specification.setSecretKey("s****************************");
ExchangeFactory.INSTANCE.createExchange(specification);
}
Aggregations