All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.xeiam.xchange.examples.cointrader.CointraderExampleUtils Maven / Gradle / Ivy

Go to download

Provides a set of examples that demonstrate how to use XChange in client applications

The newest version!
package com.xeiam.xchange.examples.cointrader;

import com.xeiam.xchange.Exchange;
import com.xeiam.xchange.ExchangeFactory;
import com.xeiam.xchange.ExchangeSpecification;
import com.xeiam.xchange.cointrader.CointraderExchange;
import com.xeiam.xchange.currency.CurrencyPair;

public class CointraderExampleUtils {

  private CointraderExampleUtils() {
  }

  public static Exchange createTestExchange() {
    Exchange cointraderExchange = ExchangeFactory.INSTANCE.createExchange(CointraderExchange.class.getName());
    ExchangeSpecification spec = cointraderExchange.getExchangeSpecification();
    spec.getExchangeSpecificParameters().put(CointraderExchange.CURRENCY_PAIR, CurrencyPair.BTC_USD);

    // Set your API credentials here.
    spec.setApiKey("your public api key");
    spec.setSecretKey("your private api key");

    cointraderExchange.applySpecification(spec);
    return cointraderExchange;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy