getHolds method

Future<Response> getHolds({
  1. required String accountId,
  2. DateTime? before,
  3. DateTime? after,
  4. int? limit,
})

Get a single account's holds

List the holds of an account that belong to the same profile as the API key. Holds are placed on an account for any active orders or pending withdraw requests. As an order is filled, the hold amount is updated. If an order is canceled, any remaining hold is removed. For withdrawals, the hold is removed after it is completed.

https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_getaccountholds

Implementation

Future<http.Response> getHolds({
  required String accountId,
  DateTime? before,
  DateTime? after,
  int? limit,
}) async {
  Map<String, String> queryParameters = {};
  if (before != null) queryParameters['before'] = before.toIso8601String();
  if (after != null) queryParameters['after'] = after.toIso8601String();
  if (limit != null) queryParameters['limit'] = limit.toString();

  return get(
    path: '/accounts/$accountId/holds',
    queryParameters: queryParameters,
  );
}