queryOCO method

Future<Either<String, OcoOrder>> queryOCO({
  1. int? orderListId,
  2. String? origClientOrderId,
  3. int? recvWindow,
})

Retrieves a specific OCO based on provided optional parameters

Implementation

Future<Either<String, OcoOrder>> queryOCO({
  int? orderListId,
  String? origClientOrderId,
  int? recvWindow,
}) {
  Map<String, String> params = {};
  if (orderListId != null) params['orderListId'] = orderListId.toString();
  if (origClientOrderId != null)
    params['origClientOrderId'] = origClientOrderId;
  if (recvWindow != null) params['recvWindow'] = recvWindow.toString();
  return sendRequest(
    path: 'api/v3/orderList',
    type: RequestType.GET,
    params: params,
    keyRequired: true,
    signatureRequired: true,
    timestampRequired: true,
  ).then((r) => r.isLeft ? Left(r.left) : Right(OcoOrder.fromMap(r.right)));
}