takerBuySellVolume method

Future<Either<String, List<TakerLongShortRatio>>> takerBuySellVolume({
  1. required String symbol,
  2. required String period,
  3. String? limit,
  4. String? startTime,
  5. String? endTime,
})

Taker long/short ratio

Implementation

Future<Either<String, List<TakerLongShortRatio>>> takerBuySellVolume({
  required String symbol,
  required String period,
  String? limit,
  String? startTime,
  String? endTime,
}) {
  Map<String, String> params = {
    'symbol': symbol,
    'period': period,
  };
  if (limit != null) params['limit'] = limit;
  if (startTime != null) params['startTime'] = startTime;
  if (endTime != null) params['endTime'] = endTime;
  return sendRequest(
    path: 'futures/data/takerlongshortRatio',
    type: RequestType.GET,
    params: params,
    keyRequired: true,
  ).then((r) => r.isLeft
      ? Left(r.left)
      : Right(List<TakerLongShortRatio>.from(
          r.right.map((e) => TakerLongShortRatio.fromMap(e)))));
}