Package com.xeiam.xchange.cryptonit.v2.service.polling

Source Code of com.xeiam.xchange.cryptonit.v2.service.polling.CryptonitMarketDataServiceRaw

package com.xeiam.xchange.cryptonit.v2.service.polling;

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

import com.xeiam.xchange.ExchangeSpecification;
import com.xeiam.xchange.cryptonit.v2.Cryptonit;
import com.xeiam.xchange.cryptonit.v2.dto.marketdata.CryptonitOrders;
import com.xeiam.xchange.cryptonit.v2.dto.marketdata.CryptonitTicker;
import com.xeiam.xchange.currency.CurrencyPair;

/**
* <p>
* Implementation of the market data service for Cryptonit
* </p>
* <ul>
* <li>Provides access to various market data values</li>
* </ul>
*/

public class CryptonitMarketDataServiceRaw extends CryptonitBasePollingService<Cryptonit> {

  /**
   * Constructor
   *
   * @param exchangeSpecification The {@link ExchangeSpecification}
   */
  public CryptonitMarketDataServiceRaw(ExchangeSpecification exchangeSpecification) {

    super(Cryptonit.class, exchangeSpecification);
  }

  public List<List<String>> getCryptonitTradingPairs() throws IOException {

    final List<List<String>> tradingPairs = cryptonit.getPairs();
    return tradingPairs;
  }

  public CryptonitTicker getCryptonitTicker(CurrencyPair currencyPair) throws IOException {

    // Request data
    CryptonitTicker cryptonitTicker = cryptonit.getTicker(currencyPair.counterSymbol, currencyPair.baseSymbol);

    // Adapt to XChange DTOs
    return cryptonitTicker;
  }

  public CryptonitOrders getCryptonitAsks(CurrencyPair currencyPair, int limit) throws IOException {

    // Request data
    CryptonitOrders cryptonitDepth = cryptonit.getOrders(currencyPair.baseSymbol, currencyPair.counterSymbol, "placed", String.valueOf(limit));

    return cryptonitDepth;
  }

  public CryptonitOrders getCryptonitBids(CurrencyPair currencyPair, int limit) throws IOException {

    // Request data
    CryptonitOrders cryptonitDepth = cryptonit.getOrders(currencyPair.counterSymbol, currencyPair.baseSymbol, "placed", String.valueOf(limit));

    return cryptonitDepth;
  }

  public CryptonitOrders getCryptonitTrades(CurrencyPair currencyPair, int limit) throws IOException {

    // Request data
    CryptonitOrders cryptonitTrades = cryptonit.getOrders(currencyPair.baseSymbol, currencyPair.counterSymbol, "filled", String.valueOf(limit));

    return cryptonitTrades;
  }

}
TOP

Related Classes of com.xeiam.xchange.cryptonit.v2.service.polling.CryptonitMarketDataServiceRaw

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.