From 2cce6b7b91d2bcbd3972e8dcb19745564ea8f7ee Mon Sep 17 00:00:00 2001 From: aneonex Date: Sun, 1 Nov 2020 01:15:11 +0300 Subject: [PATCH] Deleted Quoine exchange (renamed to Liquid) --- .../datamodule/config/MarketsConfig.kt | 2 +- .../datamodule/model/market/Quoine.kt | 58 ------------------- 2 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/Quoine.kt diff --git a/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/config/MarketsConfig.kt b/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/config/MarketsConfig.kt index f5e2adab..2ab52b90 100644 --- a/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/config/MarketsConfig.kt +++ b/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/config/MarketsConfig.kt @@ -95,7 +95,7 @@ object MarketsConfig { // addMarket(new FoscEx()); // addMarket(CoinSecure()) // addMarket(Dashcurex()) - addMarket(Quoine()) +// addMarket(Quoine()) addMarket(Livecoin()) addMarket(Gemini()) // addMarket(Coinapult()) diff --git a/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/Quoine.kt b/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/Quoine.kt deleted file mode 100644 index 2da6ee4f..00000000 --- a/dataModule/src/main/java/com/aneonex/bitcoinchecker/datamodule/model/market/Quoine.kt +++ /dev/null @@ -1,58 +0,0 @@ -package com.aneonex.bitcoinchecker.datamodule.model.market - -import com.aneonex.bitcoinchecker.datamodule.model.CheckerInfo -import com.aneonex.bitcoinchecker.datamodule.model.CurrencyPairInfo -import com.aneonex.bitcoinchecker.datamodule.model.Market -import com.aneonex.bitcoinchecker.datamodule.model.Ticker -import org.json.JSONArray -import org.json.JSONObject - -class Quoine : Market(NAME, TTS_NAME, null) { - override fun getUrl(requestId: Int, checkerInfo: CheckerInfo): String { - return String.format(URL, checkerInfo.currencyPairId) - } - - @Throws(Exception::class) - override fun parseTickerFromJsonObject(requestId: Int, jsonObject: JSONObject, ticker: Ticker, checkerInfo: CheckerInfo) { - ticker.bid = jsonObject.getDouble("market_bid") - ticker.ask = jsonObject.getDouble("market_ask") - ticker.vol = jsonObject.getDouble("volume_24h") - ticker.high = jsonObject.getDouble("high_market_ask") - ticker.low = jsonObject.getDouble("low_market_bid") - ticker.last = jsonObject.getDouble("last_traded_price") - } - - // ==================== - // Get currency pairs - // ==================== - override fun getCurrencyPairsUrl(requestId: Int): String? { - return URL_CURRENCY_PAIRS - } - - @Throws(Exception::class) - override fun parseCurrencyPairs(requestId: Int, responseString: String, pairs: MutableList) { - val pairsJsonArray = JSONArray(responseString) - for (i in 0 until pairsJsonArray.length()) { - val pairJsonObject = pairsJsonArray.getJSONObject(i) - if ("CASH" != pairJsonObject.getString("code")) { - continue - } - val currencyCounter = pairJsonObject.getString("currency") - val pairName = pairJsonObject.getString("currency_pair_code") - if (pairName.endsWith(currencyCounter)) { - val currencyBase = pairName.substring(0, pairName.length - currencyCounter.length) - pairs.add(CurrencyPairInfo( - currencyBase, - currencyCounter, - pairName)) - } - } - } - - companion object { - private const val NAME = "Quoine" - private const val TTS_NAME = NAME - private const val URL = "https://api.quoine.com/products/code/CASH/%1\$s" - private const val URL_CURRENCY_PAIRS = "https://api.quoine.com/products/" - } -} \ No newline at end of file