use of org.knowm.xchange.kucoin.dto.response.CurrenciesResponse in project XChange by knowm.
the class KucoinAdapters method adaptCurrencyMetaData.
static HashMap<String, CurrencyMetaData> adaptCurrencyMetaData(List<CurrenciesResponse> list) {
HashMap<String, CurrencyMetaData> stringCurrencyMetaDataMap = new HashMap<>();
for (CurrenciesResponse currenciesResponse : list) {
BigDecimal precision = currenciesResponse.getPrecision();
BigDecimal withdrawalMinFee = null;
BigDecimal withdrawalMinSize = null;
if (currenciesResponse.getWithdrawalMinFee() != null) {
withdrawalMinFee = new BigDecimal(currenciesResponse.getWithdrawalMinFee());
}
if (currenciesResponse.getWithdrawalMinSize() != null) {
withdrawalMinSize = new BigDecimal(currenciesResponse.getWithdrawalMinSize());
}
WalletHealth walletHealth = getWalletHealth(currenciesResponse);
CurrencyMetaData currencyMetaData = new CurrencyMetaData(precision.intValue(), withdrawalMinFee, withdrawalMinSize, walletHealth);
stringCurrencyMetaDataMap.put(currenciesResponse.getCurrency(), currencyMetaData);
}
return stringCurrencyMetaDataMap;
}
use of org.knowm.xchange.kucoin.dto.response.CurrenciesResponse in project XChange by knowm.
the class KucoinExchange method remoteInit.
@Override
public void remoteInit() throws IOException, ExchangeException {
// fetch fee only if authenticated
TradeFeeResponse fee = null;
if (exchangeSpecification.getApiKey() != null) {
fee = getMarketDataService().getKucoinBaseFee();
}
List<CurrenciesResponse> currenciesResponses = getMarketDataService().getKucoinCurrencies();
List<SymbolResponse> symbolsResponse = getMarketDataService().getKucoinSymbols();
this.exchangeMetaData = KucoinAdapters.adaptMetadata(this.exchangeMetaData, currenciesResponses, symbolsResponse, fee);
}
Aggregations