listTransactions method

Future<IApillonList<ITransaction>> listTransactions(
  1. ITransactionFilters? params
)

Gets list of transactions that occurred on this collection through Apillon. @param params Filters. @returns List of transactions.

Implementation

Future<IApillonList<ITransaction>> listTransactions(
    ITransactionFilters? params) async {
  final url = constructUrlWithQueryParams(
    '$apiPrefix/transactions',
    params?.toJson(),
  );

  final data =
      await ApillonApi.get<IApillonList>(url, mapper: IApillonList.fromJson);

  return IApillonList<ITransaction>(
    total: data.total,
    items: data.items.map((t) => ITransaction.fromJson(t)).toList(),
  );
}