use of com.odysee.app.exceptions.LbryRequestException in project odysee-android by OdyseeTeam.
the class Lbry method resolve.
public static List<Claim> resolve(List<String> urls, String connectionString) throws ApiCallException {
List<Claim> claims = new ArrayList<>();
Map<String, Object> params = new HashMap<>();
params.put("urls", urls);
try {
JSONObject result = (JSONObject) parseResponse(apiCall(METHOD_RESOLVE, params, connectionString));
Iterator<String> keys = result.keys();
if (keys != null) {
while (keys.hasNext()) {
Claim claim = Claim.fromJSONObject(result.getJSONObject(keys.next()));
claims.add(claim);
addClaimToCache(claim);
}
}
} catch (LbryRequestException | LbryResponseException | JSONException ex) {
throw new ApiCallException("Could not execute resolve call", ex);
}
return claims;
}
Aggregations