use of run.wallet.iota.api.responses.WebGetExchangeRatesHistoryResponse in project run-wallet-android by runplay.
the class WebGetExchangeRatesHistoryRequestHandler method handle.
@Override
public ApiResponse handle(ApiRequest apiRequest) {
WebGetExchangeRatesHistoryRequest req = (WebGetExchangeRatesHistoryRequest) apiRequest;
// Currency curr=Store.getDefaultCurrency(context);
// Log.e("XCHANGE",Constants.WWW_RUN_IOTA+"/xchangehist.jsp?step="+req.step+"&cp="+req.cp);
JSONObject result = JSONUrlReader.readJsonObjectFromUrl(context, Constants.WWW_RUN_IOTA + "/xchangehist.jsp?step=" + req.step + "&cp=" + req.cp);
if (result != null) {
// Log.e("GOT-HIST",result.toString());
Store.updateTickerHist(context, result);
return new WebGetExchangeRatesHistoryResponse(result);
}
NetworkError error = new NetworkError();
error.setErrorType(NetworkErrorType.NETWORK_ERROR);
return error;
}
Aggregations