use of org.knowm.xchange.latoken.dto.exchangeinfo.LatokenPair in project XChange by knowm.
the class LatokenExchange method remoteInit.
@Override
public void remoteInit() {
try {
// Load the static meta-data and override with the dynamic one
Map<Currency, CurrencyMetaData> currenciesMetaData = exchangeMetaData.getCurrencies();
Map<CurrencyPair, CurrencyPairMetaData> pairsMetaData = exchangeMetaData.getCurrencyPairs();
List<LatokenPair> allPairs = latoken.getAllPairs();
List<LatokenCurrency> allCurrencies = latoken.getAllCurrencies();
// Save pairs map on the exchange
this.exchangeSpecification.setExchangeSpecificParametersItem("pairs", allPairs);
// Update Currency meta-data
for (LatokenCurrency latokenCurrency : allCurrencies) {
Currency currency = LatokenAdapters.adaptCurrency(latokenCurrency);
addCurrencyMetadata(currenciesMetaData, currency, PRECISION);
}
// Update CurrencyPair meta-data
for (LatokenPair latokenPair : allPairs) {
CurrencyPair pair = LatokenAdapters.adaptCurrencyPair(latokenPair);
CurrencyPairMetaData pairMetadata = LatokenAdapters.adaptPairMetaData(latokenPair);
addCurrencyPairMetadata(pairsMetaData, pair, pairMetadata);
}
} catch (Exception e) {
throw new ExchangeException("Failed to initialize: " + e.getMessage(), e);
}
}
Aggregations