use of run.wallet.iota.api.responses.WebGetExchangeRatesResponse in project run-wallet-android by runplay.
the class WebGetExchangeRatesRequestHandler method handle.
@Override
public ApiResponse handle(ApiRequest apiRequest) {
JSONObject result = JSONUrlReader.readJsonObjectFromUrl(context, Constants.WWW_RUN_IOTA + "/xchange.jsp");
if (result != null) {
Store.updateTickers(context, result);
JSONArray msgs = result.optJSONArray("sysmsg");
if (msgs != null && msgs.length() > 0) {
for (int i = 0; i < msgs.length(); i++) {
Store.addSystemMessage(context, msgs.optJSONObject(i));
}
}
return new WebGetExchangeRatesResponse(result);
}
return new WebGetExchangeRatesResponse(new JSONObject());
// NetworkError error = new NetworkError();
// error.setErrorType(NetworkErrorType.NETWORK_ERROR);
// return error;
}
Aggregations