Package com.xeiam.xchange.bitfinex.v1

Source Code of com.xeiam.xchange.bitfinex.v1.BitfinexExchange

package com.xeiam.xchange.bitfinex.v1;

import com.xeiam.xchange.BaseExchange;
import com.xeiam.xchange.Exchange;
import com.xeiam.xchange.ExchangeSpecification;
import com.xeiam.xchange.bitfinex.v1.service.polling.BitfinexAccountService;
import com.xeiam.xchange.bitfinex.v1.service.polling.BitfinexMarketDataService;
import com.xeiam.xchange.bitfinex.v1.service.polling.BitfinexTradeService;

/**
* <p>
* Exchange implementation to provide the following to applications:
* </p>
* <ul>
* <li>A wrapper for the Bitfinex exchange API</li>
* </ul>
*/
public class BitfinexExchange extends BaseExchange implements Exchange {

  /**
   * Default constructor for ExchangeFactory
   */
  public BitfinexExchange() {

  }

  @Override
  public void applySpecification(ExchangeSpecification exchangeSpecification) {

    super.applySpecification(exchangeSpecification);

    this.pollingMarketDataService = new BitfinexMarketDataService(exchangeSpecification);
    this.pollingAccountService = new BitfinexAccountService(exchangeSpecification);
    this.pollingTradeService = new BitfinexTradeService(exchangeSpecification);
  }

  @Override
  public ExchangeSpecification getDefaultExchangeSpecification() {

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

    return exchangeSpecification;
  }
}
TOP

Related Classes of com.xeiam.xchange.bitfinex.v1.BitfinexExchange

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.