oldTradesLookup method

Future<Either<String, List<Trade>>> oldTradesLookup({
  1. required String symbol,
  2. String? limit,
  3. String? fromId,
})

Get older market trades.

This endpoint need your API key only, not the secret key.

Implementation

Future<Either<String, List<Trade>>> oldTradesLookup({
  required String symbol,
  String? limit,
  String? fromId,
}) {
  Map<String, String> params = {
    'symbol': symbol,
  };
  if (limit != null) params['limit'] = limit;
  if (fromId != null) params['fromId'] = fromId;
  return sendRequest(
    path: 'fapi/v1/historicalTrades',
    type: RequestType.GET,
    params: params,
    keyRequired: true,
  ).then((r) => r.isLeft
      ? Left(r.left)
      : Right(List<Trade>.from(r.right.map((e) => Trade.fromMap(e)))));
}