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