package org.knowm.xchange.gemini.v1;

import java.io.IOException;
import java.util.List;

import org.knowm.xchange.BaseExchange;
import org.knowm.xchange.ExchangeSpecification;
import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.exceptions.ExchangeException;
import org.knowm.xchange.gemini.v1.service.GeminiAccountService;
import org.knowm.xchange.gemini.v1.service.GeminiMarketDataService;
import org.knowm.xchange.gemini.v1.service.GeminiMarketDataServiceRaw;
import org.knowm.xchange.gemini.v1.service.GeminiTradeService;
import org.knowm.xchange.utils.nonce.AtomicLongIncrementalTime2013NonceFactory;

import si.mazi.rescu.SynchronizedValueFactory;

public class GeminiExchange extends BaseExchange {

  private SynchronizedValueFactory<Long> nonceFactory = new AtomicLongIncrementalTime2013NonceFactory();

  @Override
  protected void initServices() {
    this.marketDataService = new GeminiMarketDataService(this);
    this.accountService = new GeminiAccountService(this);
    this.tradeService = new GeminiTradeService(this);
  }

  @Override
  public ExchangeSpecification getDefaultExchangeSpecification() {

    ExchangeSpecification exchangeSpecification = new ExchangeSpecification(this.getClass().getCanonicalName());
    exchangeSpecification.setSslUri("https://api.Gemini.com/");
    exchangeSpecification.setHost("api.Gemini.com");
    exchangeSpecification.setPort(80);
    exchangeSpecification.setExchangeName("Gemini");
    exchangeSpecification.setExchangeDescription("Gemini is a bitcoin exchange.");

    return exchangeSpecification;
  }

  @Override
  public SynchronizedValueFactory<Long> getNonceFactory() {

    return nonceFactory;
  }

  @Override
  public void remoteInit() throws IOException, ExchangeException {

    GeminiMarketDataServiceRaw dataService = (GeminiMarketDataServiceRaw) this.marketDataService;
    List<CurrencyPair> currencyPairs = dataService.getExchangeSymbols();
    exchangeMetaData = GeminiAdapters.adaptMetaData(currencyPairs, exchangeMetaData);

  }

}

@@ -37,63 +37,8 @@
 %0D%0A%0D%0A
-import java.io.IOException;%0D%0Aimport java.util.List;%0D%0A%0D%0A
 impo
@@ -537,32 +537,43 @@
 nonce.AtomicLong
+CurrentTime
 IncrementalTime2
@@ -563,32 +563,24 @@
 eIncremental
-Time2013
 NonceFactory
@@ -582,18 +582,16 @@
 ctory;%0D%0A
-%0D%0A
 import s
@@ -632,16 +632,71 @@
 ory;%0D%0A%0D%0A
+import java.io.IOException;%0D%0Aimport java.util.List;%0D%0A%0D%0A
 public c
@@ -811,16 +811,27 @@
 omicLong
+CurrentTime
 Incremen
@@ -837,16 +837,8 @@
 ntal
-Time2013
 Nonc

Use AtomicLongCurrentTimeIncrementalNonceFactory