mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 13:54:20 +01:00
Fix Dart timestamp unit (epoch seconds instead of ms)
This commit is contained in:
@@ -11,17 +11,20 @@ Future<List<Payment>> listPayments() async {
|
||||
}
|
||||
|
||||
Future<List<Payment>> listPaymentsFiltered({
|
||||
DateTime? startDate,
|
||||
DateTime? endDate,
|
||||
int? fromTimestamp,
|
||||
int? toTimestamp,
|
||||
bool? includeFailures,
|
||||
int? offset,
|
||||
int? limit,
|
||||
}) async {
|
||||
// ANCHOR: list-payments-filtered
|
||||
/// Get the desired epoch timestamp in seconds
|
||||
int fromTimestamp = DateTime.now().subtract(const Duration(minutes: 30)).millisecondsSinceEpoch ~/ 1000;
|
||||
|
||||
ListPaymentsRequest req = ListPaymentsRequest(
|
||||
filter: PaymentTypeFilter.Sent,
|
||||
fromTimestamp: startDate?.millisecondsSinceEpoch,
|
||||
toTimestamp: endDate?.millisecondsSinceEpoch,
|
||||
fromTimestamp: fromTimestamp,
|
||||
toTimestamp: toTimestamp,
|
||||
includeFailures: includeFailures,
|
||||
offset: offset,
|
||||
limit: limit,
|
||||
|
||||
Reference in New Issue
Block a user