walletsGetTransactions method
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.
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:
debitadds funds to the wallet,credittakes funds from it. -
String source_: Only transactions with this cause, such as
orderorexchange.
Implementation
Future<WalletTransactionList?> walletsGetTransactions(String walletId, { int? page, int? limit, DateTime? startDate, DateTime? endDate, String? type, String? source_, Future<void>? abortTrigger, }) async {
final response = await walletsGetTransactionsWithHttpInfo(walletId, page: page, limit: limit, startDate: startDate, endDate: endDate, type: type, source_: source_, abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'WalletTransactionList',) as WalletTransactionList;
}
return null;
}