@Override protected void parseTickerFromJsonObject( int requestId, JSONObject jsonObject, Ticker ticker, CheckerInfo checkerInfo) throws Exception { ticker.bid = ParseUtils.getDoubleFromString(jsonObject, "bid"); ticker.ask = ParseUtils.getDoubleFromString(jsonObject, "ask"); ticker.last = ((ticker.bid + ticker.ask) / 2); // This is how Uphold operate on production (as I observed) }
@Override protected void parseTickerFromJsonObject( int requestId, JSONObject jsonObject, Ticker ticker, CheckerInfo checkerInfo) throws Exception { final JSONObject pairJsonObject = jsonObject.getJSONObject( checkerInfo.getCurrencyBaseLowerCase() + "_" + checkerInfo.getCurrencyCounterLowerCase()); ticker.bid = getDoubleFromString(pairJsonObject, "buy"); ticker.ask = getDoubleFromString(pairJsonObject, "sell"); ticker.vol = getDoubleFromString(pairJsonObject, "volume"); ticker.last = getDoubleFromString(pairJsonObject, "rate"); }
@Override protected void parseTickerFromJsonObject( int requestId, JSONObject jsonObject, Ticker ticker, CheckerInfo checkerInfo) throws Exception { final JSONObject tickerJsonObject = jsonObject.getJSONObject("ticker"); ticker.bid = tickerJsonObject.getDouble("buy"); ticker.ask = tickerJsonObject.getDouble("sell"); ticker.vol = tickerJsonObject.getDouble("vol"); ticker.high = tickerJsonObject.getDouble("high"); ticker.low = tickerJsonObject.getDouble("low"); ticker.last = tickerJsonObject.getDouble("last"); }