use of com.github.jnidzwetzki.bitfinex.v2.entity.symbol.BitfinexExecutedTradeSymbol in project bitfinex-v2-wss-api-java by jnidzwetzki.
the class ExecutedTradeHandler method handleChannelData.
@Override
public void handleChannelData(final BitfinexApiBroker bitfinexApiBroker, final BitfinexStreamSymbol channelSymbol, final JSONArray jsonArray) throws APIException {
final BitfinexExecutedTradeSymbol configuration = (BitfinexExecutedTradeSymbol) channelSymbol;
try {
// Snapshots contain multiple executes entries, updates only one
if (jsonArray.get(0) instanceof JSONArray) {
for (int pos = 0; pos < jsonArray.length(); pos++) {
final JSONArray parts = jsonArray.getJSONArray(pos);
handleEntry(bitfinexApiBroker, configuration, parts);
}
} else {
handleEntry(bitfinexApiBroker, configuration, jsonArray);
}
} catch (JSONException e) {
throw new APIException(e);
}
}
Aggregations