org.knowm.xchange.coinbaseex.CoinbaseExExchange Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xchange-coinbaseex Show documentation
Show all versions of xchange-coinbaseex Show documentation
XChange implementation for Coinbase (Exchange)
The newest version!
package org.knowm.xchange.coinbaseex;
import org.knowm.xchange.BaseExchange;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.ExchangeSpecification;
import org.knowm.xchange.coinbaseex.service.polling.CoinbaseExAccountService;
import org.knowm.xchange.coinbaseex.service.polling.CoinbaseExMarketDataService;
import org.knowm.xchange.coinbaseex.service.polling.CoinbaseExTradeService;
import org.knowm.xchange.utils.nonce.CurrentTimeNonceFactory;
import si.mazi.rescu.SynchronizedValueFactory;
public class CoinbaseExExchange extends BaseExchange implements Exchange {
private SynchronizedValueFactory nonceFactory = new CurrentTimeNonceFactory();
@Override
protected void initServices() {
this.pollingMarketDataService = new CoinbaseExMarketDataService(this);
this.pollingAccountService = new CoinbaseExAccountService(this);
this.pollingTradeService = new CoinbaseExTradeService(this);
}
@Override
public ExchangeSpecification getDefaultExchangeSpecification() {
ExchangeSpecification exchangeSpecification = new ExchangeSpecification(this.getClass().getCanonicalName());
exchangeSpecification.setSslUri("https://api.exchange.coinbase.com");
exchangeSpecification.setHost("api.exchange.coinbase.com");
exchangeSpecification.setPort(80);
exchangeSpecification.setExchangeName("CoinbaseEx");
exchangeSpecification.setExchangeDescription("Coinbase Exchange is a Bitcoin exchange recently launched in January 2015");
return exchangeSpecification;
}
@Override
public SynchronizedValueFactory getNonceFactory() {
return nonceFactory;
}
}