diff --git a/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/CoinFloor.kt b/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/CoinFloor.kt index 0f05b9f5..21bd7b42 100644 --- a/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/CoinFloor.kt +++ b/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/CoinFloor.kt @@ -9,20 +9,18 @@ import com.aneonex.bitcoinchecker.datamodule.model.currency.VirtualCurrency import org.json.JSONObject class CoinFloor : Market(NAME, TTS_NAME, CURRENCY_PAIRS) { + // API info: https://github.com/coinfloor/API/blob/master/BIST_v2.md companion object { private const val NAME = "Coinfloor" private const val TTS_NAME = "Coin Floor" - private const val URL = "https://webapi.coinfloor.co.uk:8090/bist/%1\$s/%2\$s/ticker/" + private const val URL = "https://webapi.coinfloor.co.uk/v2/bist/%1\$s/%2\$s/ticker/" private val CURRENCY_PAIRS: CurrencyPairsMap = CurrencyPairsMap() init { CURRENCY_PAIRS[VirtualCurrency.XBT] = arrayOf( Currency.GBP, Currency.EUR, - Currency.USD - ) - CURRENCY_PAIRS[VirtualCurrency.BCH] = arrayOf( - Currency.GBP +// Currency.USD ) } } @@ -33,11 +31,13 @@ class CoinFloor : Market(NAME, TTS_NAME, CURRENCY_PAIRS) { @Throws(Exception::class) override fun parseTickerFromJsonObject(requestId: Int, jsonObject: JSONObject, ticker: Ticker, checkerInfo: CheckerInfo) { - ticker.bid = jsonObject.getDouble("bid") - ticker.ask = jsonObject.getDouble("ask") - ticker.vol = jsonObject.getDouble("volume") - ticker.high = jsonObject.getDouble("high") - ticker.low = jsonObject.getDouble("low") - ticker.last = jsonObject.getDouble("last") + ticker.apply { + bid = jsonObject.getDouble("bid") + ask = jsonObject.getDouble("ask") + vol = jsonObject.getDouble("volume") + high = jsonObject.getDouble("high") + low = jsonObject.getDouble("low") + last = jsonObject.getDouble("last") + } } } \ No newline at end of file