walletsGetTransactionsWithHttpInfo method

Future<Response> walletsGetTransactionsWithHttpInfo(
  1. String walletId, {
  2. int? page,
  3. int? limit,
  4. DateTime? startDate,
  5. DateTime? endDate,
  6. String? type,
  7. String? source_,
  8. Future<void>? abortTrigger,
})

List wallet transactions

Lists a wallet's transactions, newest first, with optional filters. Returns { transactions, pagination }. In a transaction, type debit adds funds to the wallet and credit takes funds from it; source says why (topUp, payOut, order, exchange or reversal). Filters combine with AND and apply before counting and paging. Use flat page (default 1) and limit (default 10, 1 to 100) query parameters. cursor, skip, offset, nested paging keys and repeated paging parameters return 400 with code 10001 (INVALID_REQUEST). An unknown wallet returns 404 with code 10004.

Note: This method returns the HTTP Response.

Parameters:

  • String walletId (required): Wallet id.

  • int page: One-based page number. Default 1.

  • int limit: Page size, 1 to 100. Default 10.

  • DateTime startDate: Only transactions made at or after this time (UTC).

  • DateTime endDate: Only transactions made at or before this time (UTC).

  • String type: Only this direction: debit adds funds to the wallet, credit takes funds from it.

  • String source_: Only transactions with this cause, such as order or exchange.

Implementation

Future<Response> walletsGetTransactionsWithHttpInfo(String walletId, { int? page, int? limit, DateTime? startDate, DateTime? endDate, String? type, String? source_, Future<void>? abortTrigger, }) async {
  // ignore: prefer_const_declarations
  final path = r'/api/v1/b2b/wallets/{walletId}/transactions'
    .replaceAll('{walletId}', walletId);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (page != null) {
    queryParams.addAll(_queryParams('', 'page', page));
  }
  if (limit != null) {
    queryParams.addAll(_queryParams('', 'limit', limit));
  }
  if (startDate != null) {
    queryParams.addAll(_queryParams('', 'startDate', startDate));
  }
  if (endDate != null) {
    queryParams.addAll(_queryParams('', 'endDate', endDate));
  }
  if (type != null) {
    queryParams.addAll(_queryParams('', 'type', type));
  }
  if (source_ != null) {
    queryParams.addAll(_queryParams('', 'source', source_));
  }

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
    abortTrigger: abortTrigger,
  );
}