show all crypto rates in tester
This commit is contained in:
parent
c098e33971
commit
b54ecca1ca
|
@ -397,50 +397,46 @@ public class Tester {
|
||||||
final String preferredFiatCurrency = rs.getPreferredFiatCurrency();
|
final String preferredFiatCurrency = rs.getPreferredFiatCurrency();
|
||||||
final Set<String> fiatCurrencies = rs.getFiatCurrencies();
|
final Set<String> fiatCurrencies = rs.getFiatCurrencies();
|
||||||
final Set<String> cryptoCurrencies = rs.getCryptoCurrencies();
|
final Set<String> cryptoCurrencies = rs.getCryptoCurrencies();
|
||||||
|
System.out.println("Preferred Fiat Currency = " + preferredFiatCurrency);
|
||||||
|
System.out.println("Fiat Currencies:");
|
||||||
|
for (String fiatCurrency : fiatCurrencies) {
|
||||||
|
System.out.println(" " + fiatCurrency);
|
||||||
|
}
|
||||||
|
for (int j = 0; j < cryptoCurrencies.size(); j++) {
|
||||||
|
System.out.println("Crypto Currencies:");
|
||||||
|
String selectedCryptoCurrency = cryptoCurrencies[i];
|
||||||
|
|
||||||
System.out.println("Preferred Fiat Currency = " + preferredFiatCurrency);
|
final BigDecimal exchangeRateLast = rs.getExchangeRateLast(selectedCryptoCurrency, preferredFiatCurrency);
|
||||||
System.out.println("Fiat Currencies:");
|
if (exchangeRateLast != null) {
|
||||||
for (String fiatCurrency : fiatCurrencies) {
|
System.out.println("Exchange Rate Last: 1 " + selectedCryptoCurrency + " = " + exchangeRateLast.stripTrailingZeros().toPlainString() + " " + preferredFiatCurrency);
|
||||||
System.out.println(" " + fiatCurrency);
|
}else{
|
||||||
}
|
System.err.println("Rate source returned NULL.");
|
||||||
System.out.println("Crypto Currencies:");
|
}
|
||||||
String selectedCryptoCurrency = params;
|
|
||||||
for (String cryptoCurrency : cryptoCurrencies) {
|
|
||||||
if (selectedCryptoCurrency == null) {
|
|
||||||
selectedCryptoCurrency = cryptoCurrency;
|
|
||||||
}
|
|
||||||
System.out.println(" " + cryptoCurrency);
|
|
||||||
}
|
|
||||||
final BigDecimal exchangeRateLast = rs.getExchangeRateLast(selectedCryptoCurrency, preferredFiatCurrency);
|
|
||||||
if (exchangeRateLast != null) {
|
|
||||||
System.out.println("Exchange Rate Last: 1 " + selectedCryptoCurrency + " = " + exchangeRateLast.stripTrailingZeros().toPlainString() + " " + preferredFiatCurrency);
|
|
||||||
}else{
|
|
||||||
System.err.println("Rate source returned NULL.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rs instanceof IRateSourceAdvanced) {
|
if (rs instanceof IRateSourceAdvanced) {
|
||||||
IRateSourceAdvanced rsa = (IRateSourceAdvanced)rs;
|
IRateSourceAdvanced rsa = (IRateSourceAdvanced)rs;
|
||||||
|
|
||||||
for (String fiatCurrency : fiatCurrencies) {
|
for (String fiatCurrency : fiatCurrencies) {
|
||||||
System.out.println("Checking price for " + fiatCurrency);
|
System.out.println("Checking price for " + fiatCurrency);
|
||||||
|
|
||||||
final BigDecimal buyPrice = rsa.getExchangeRateForBuy(selectedCryptoCurrency, fiatCurrency);
|
final BigDecimal buyPrice = rsa.getExchangeRateForBuy(selectedCryptoCurrency, fiatCurrency);
|
||||||
if (buyPrice != null) {
|
if (buyPrice != null) {
|
||||||
System.out.println("Buy Price: 1 " + selectedCryptoCurrency + " = " + buyPrice.stripTrailingZeros().toPlainString() + " " + fiatCurrency);
|
System.out.println("Buy Price: 1 " + selectedCryptoCurrency + " = " + buyPrice.stripTrailingZeros().toPlainString() + " " + fiatCurrency);
|
||||||
}else{
|
}else{
|
||||||
System.err.println("Rate source returned NULL on Buy Price.");
|
System.err.println("Rate source returned NULL on Buy Price.");
|
||||||
}
|
}
|
||||||
|
|
||||||
final BigDecimal sellPrice = rsa.getExchangeRateForSell(selectedCryptoCurrency, fiatCurrency);
|
final BigDecimal sellPrice = rsa.getExchangeRateForSell(selectedCryptoCurrency, fiatCurrency);
|
||||||
if (sellPrice != null) {
|
if (sellPrice != null) {
|
||||||
System.out.println("Sell Price: 1 " + selectedCryptoCurrency + " = " + sellPrice.stripTrailingZeros().toPlainString() + " " + fiatCurrency);
|
System.out.println("Sell Price: 1 " + selectedCryptoCurrency + " = " + sellPrice.stripTrailingZeros().toPlainString() + " " + fiatCurrency);
|
||||||
}else{
|
}else{
|
||||||
System.err.println("Rate source returned NULL on Sell Price.");
|
System.err.println("Rate source returned NULL on Sell Price.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue