getHistory method

  1. @override
Future<ActivityData> getHistory({
  1. required String address,
  2. String? caip2Chain,
  3. String? cursor,
})
override

Implementation

@override
Future<ActivityData> getHistory({
  required String address,
  String? caip2Chain,
  String? cursor,
}) async {
  final queryParams = {
    if (caip2Chain != null) 'chainId': caip2Chain,
    if (cursor != null) 'cursor': cursor,
  };
  final url = _buildUrl('account/$address/history', queryParams);
  final response = await http.get(url, headers: _requiredHeaders);
  _core.logger.i('[$runtimeType] getHistory $url => ${response.body}');

  return _handleResponse(
    response: response,
    parser: (body) => ActivityData.fromRawJson(body),
    errorContext: 'getHistory',
    errorMessage: 'Failed to load wallet activity',
  );
}