Merge pull request #54 from vsobalski/master
Added support for Flashcoin in coinMarketCap
This commit is contained in:
commit
d303cc5946
|
@ -43,6 +43,8 @@ public class CoinmarketcapRateSource implements IRateSource {
|
|||
result.add(ICurrencies.DASH);
|
||||
result.add(ICurrencies.XMR);
|
||||
result.add(ICurrencies.POT);
|
||||
result.add(ICurrencies.FLASH);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -66,7 +68,12 @@ public class CoinmarketcapRateSource implements IRateSource {
|
|||
if (!getFiatCurrencies().contains(fiatCurrency)) {
|
||||
return null;
|
||||
}
|
||||
CMCTicker[] tickers = api.getTickers(fiatCurrency);
|
||||
CMCTicker[] tickers;
|
||||
if(ICurrencies.FLASH.equalsIgnoreCase(cryptoCurrency)){
|
||||
tickers = api.getTickers(cryptoCurrency,fiatCurrency);
|
||||
}else
|
||||
tickers = api.getTickers(fiatCurrency);
|
||||
|
||||
for (int i = 0; i < tickers.length; i++) {
|
||||
CMCTicker ticker = tickers[i];
|
||||
if (cryptoCurrency.equalsIgnoreCase(ticker.getSymbol())) {
|
||||
|
|
|
@ -17,10 +17,7 @@
|
|||
************************************************************************************/
|
||||
package com.generalbytes.batm.server.extensions.extra.dash.sources.coinmarketcap;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
@Path("/v1/ticker")
|
||||
|
@ -29,4 +26,8 @@ public interface ICoinmarketcapAPI {
|
|||
@GET
|
||||
@Path("/")
|
||||
CMCTicker[] getTickers(@QueryParam("convert") String fiatCurrency);
|
||||
|
||||
@GET
|
||||
@Path("/{cryptoToGet}/?convert={convert}")
|
||||
CMCTicker[] getTickers(@PathParam("cryptoToGet") String cryptoToGet,@QueryParam("convert") String fiatCurrency);
|
||||
}
|
||||
|
|
|
@ -404,7 +404,7 @@ public class Tester {
|
|||
System.out.println(" " + fiatCurrency);
|
||||
}
|
||||
System.out.println("Crypto Currencies:");
|
||||
String selectedCryptoCurrency = null;
|
||||
String selectedCryptoCurrency = params;
|
||||
for (String cryptoCurrency : cryptoCurrencies) {
|
||||
if (selectedCryptoCurrency == null) {
|
||||
selectedCryptoCurrency = cryptoCurrency;
|
||||
|
|
Loading…
Reference in New Issue