final Map<CurrencyPair, CryptoTradePair> pairs = new HashMap<CurrencyPair, CryptoTradePair>();
for (JsonNode pairInfo : currencyPairs) {
final CryptoTradePairType type = CryptoTradePairType.normal_pair;
String label = pairInfo.fieldNames().next();
final CurrencyPair pair = CurrencyPairDeserializer.getCurrencyPairFromString(label);
final CryptoTradePair info = CryptoTradePairDeserializer.getPairFromJsonNode(pairInfo.elements().next());
final BigDecimal minOrderAMount = info.getMinOrderAmount();
final int decimals = info.getDecimals();
pairs.put(pair, new CryptoTradePair(label, type, minOrderAMount, decimals));
}
for (JsonNode pairInfo : securityPairs) {
/*
* XXX: Currently, no information returned for security_pairs
*/
final CryptoTradePairType type = CryptoTradePairType.security_pair;
final String label = pairInfo.asText();
final CurrencyPair pair = CurrencyPairDeserializer.getCurrencyPairFromString(label);
pairs.put(pair, new CryptoTradePair(label, type, null, 0));
}
return pairs;
}