getAccountNotifications method

Future<List<AccountNotification>> getAccountNotifications(
  1. String account, {
  2. int? limit,
})

Implementation

Future<List<AccountNotification>> getAccountNotifications(
  String account, {
  int? limit,
}) async {
  if (limit != null && limit > 100) {
    throw const InvalidParametersException('Limit cannot exceed 100');
  }

  final bodyJson = await _fetchPostData(
    method: 'bridge.account_notifications',
    params: {'account': account, 'limit': limit},
  );

  final list = bodyJson['result'] as List<dynamic>;
  return [
    for (final an in list)
      AccountNotification.fromJson(an as Map<String, dynamic>)
  ];
}