longShortRatio method
Get present open interest of a specific symbol.
Implementation
Future<Either<String, List<LongShortRatio>>> longShortRatio({
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/globalLongShortAccountRatio',
type: RequestType.GET,
params: params,
keyRequired: true,
).then((r) => r.isLeft
? Left(r.left)
: Right(List<LongShortRatio>.from(
r.right.map((e) => LongShortRatio.fromMap(e)))));
}