use of run.wallet.iota.api.requests.WebGetExchangeRatesHistoryRequest 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;
}
use of run.wallet.iota.api.requests.WebGetExchangeRatesHistoryRequest in project run-wallet-android by runplay.
the class AppService method updateExchangeRatesHistory.
public static void updateExchangeRatesHistory(Context context, String currencyPair, int step) {
TaskManager rt = new TaskManager(SERVICE);
WebGetExchangeRatesHistoryRequest nir = new WebGetExchangeRatesHistoryRequest(currencyPair, step);
runBasicTask(rt, nir);
}
Aggregations