Skip to content

Commit

Permalink
Add PoloniexExchangeInfoDemo
Browse files Browse the repository at this point in the history
  • Loading branch information
mmazi committed Jun 19, 2017
1 parent e6ed01b commit 2e40f95
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.knowm.xchange.examples.poloniex.marketdata;

import java.util.Map;

import org.knowm.xchange.Exchange;
import org.knowm.xchange.ExchangeFactory;
import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.dto.meta.CurrencyPairMetaData;
import org.knowm.xchange.poloniex.PoloniexExchange;
import org.knowm.xchange.utils.CertHelper;

/**
* Retrieves and prints information about supported currency pairs.
*/

public class PoloniexExchangeInfoDemo {

public static void main(String[] args) throws Exception {

CertHelper.trustAllCerts();

Exchange poloniex = ExchangeFactory.INSTANCE.createExchange(PoloniexExchange.class.getName());

final Map<CurrencyPair, CurrencyPairMetaData> currencyPairs = poloniex.getExchangeMetaData().getCurrencyPairs();

for (CurrencyPair pair : currencyPairs.keySet()) {
final CurrencyPairMetaData pairMetaData = currencyPairs.get(pair);
System.out.printf("%s: %s%nn", pair, pairMetaData);
}
}
}

0 comments on commit 2e40f95

Please sign in to comment.