compressedAggregateTradesList method
Get compressed, aggregate trades.
Trades that fill at the time, from the same order, with the same price will have the quantity aggregated.
Implementation
Future<Either<String, List<AggregatedTrade>>> compressedAggregateTradesList({
required String symbol,
String? fromId,
String? startTime,
String? endTime,
String? limit,
}) {
Map<String, String> params = {
'symbol': symbol,
};
if (fromId != null) params['fromId'] = fromId;
if (startTime != null) params['startTime'] = startTime;
if (endTime != null) params['endTime'] = endTime;
if (limit != null) params['limit'] = limit;
return sendRequest(
path: 'fapi/v1/aggTrades',
type: RequestType.GET,
params: params,
).then((r) => r.isLeft
? Left(r.left)
: Right(List<AggregatedTrade>.from(
r.right.map((e) => AggregatedTrade.fromMap(e)))));
}