use of org.knowm.xchange.bleutrade.dto.marketdata.BleutradeCurrency in project XChange by knowm.
the class BleutradeMarketDataServiceIntegration method shouldGetCurrencies.
@Test
public void shouldGetCurrencies() throws IOException {
// given
final List<BleutradeCurrency> expectedBleutradeCurrencies = expectedBleutradeCurrencies();
final String[] expectedBleutradeCurrenciesStr = expectedBleutradeCurrenciesStr();
BleutradeCurrenciesReturn currenciesReturn = new BleutradeCurrenciesReturn();
currenciesReturn.setSuccess(true);
currenciesReturn.setMessage("test message");
currenciesReturn.setResult(expectedBleutradeCurrencies);
when(bleutrade.getBleutradeCurrencies()).thenReturn(currenciesReturn);
// when
List<BleutradeCurrency> currencies = marketDataService.getBleutradeCurrencies();
// then
assertThat(currencies).hasSize(2);
for (int i = 0; i < currencies.size(); i++) {
BleutradeAssert.assertEquals(currencies.get(i), expectedBleutradeCurrencies.get(i));
assertThat(currencies.get(i).toString()).isEqualTo(expectedBleutradeCurrenciesStr[i]);
}
}
use of org.knowm.xchange.bleutrade.dto.marketdata.BleutradeCurrency in project XChange by knowm.
the class BleutradeAdapters method adaptToExchangeMetaData.
public static ExchangeMetaData adaptToExchangeMetaData(List<BleutradeCurrency> bleutradeCurrencies, List<BleutradeMarket> bleutradeMarkets) {
Map<CurrencyPair, CurrencyPairMetaData> marketMetaDataMap = new HashMap<>();
Map<Currency, CurrencyMetaData> currencyMetaDataMap = new HashMap<>();
for (BleutradeCurrency bleutradeCurrency : bleutradeCurrencies) {
// the getTxFee parameter is the withdrawal charge in the currency in question
currencyMetaDataMap.put(Currency.getInstance(bleutradeCurrency.getCurrency()), new CurrencyMetaData(8, null));
}
// https://bleutrade.com/help/fees_and_deadlines 11/25/2015 all == 0.25%
BigDecimal txFee = new BigDecimal("0.0025");
for (BleutradeMarket bleutradeMarket : bleutradeMarkets) {
CurrencyPair currencyPair = CurrencyPairDeserializer.getCurrencyPairFromString(bleutradeMarket.getMarketName());
CurrencyPairMetaData marketMetaData = new CurrencyPairMetaData(txFee, bleutradeMarket.getMinTradeSize(), null, 8, null);
marketMetaDataMap.put(currencyPair, marketMetaData);
}
return new ExchangeMetaData(marketMetaDataMap, currencyMetaDataMap, null, null, null);
}
use of org.knowm.xchange.bleutrade.dto.marketdata.BleutradeCurrency in project XChange by knowm.
the class BleutradeServiceTestSupport method createBleutradeCurrency.
protected static BleutradeCurrency createBleutradeCurrency(String currency, String currencyLong, Integer minConfirmation, BigDecimal txFee, Boolean isActive, String coinType) {
BleutradeCurrency bleutradeCurrency = new BleutradeCurrency();
bleutradeCurrency.setCurrency(currency);
bleutradeCurrency.setCurrencyLong(currencyLong);
bleutradeCurrency.setMinConfirmation(minConfirmation);
bleutradeCurrency.setTxFee(txFee);
bleutradeCurrency.setIsActive(isActive);
bleutradeCurrency.setCoinType(coinType);
return bleutradeCurrency;
}
Aggregations