mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 22:04:21 +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({
|
Future<List<Payment>> listPaymentsFiltered({
|
||||||
DateTime? startDate,
|
int? fromTimestamp,
|
||||||
DateTime? endDate,
|
int? toTimestamp,
|
||||||
bool? includeFailures,
|
bool? includeFailures,
|
||||||
int? offset,
|
int? offset,
|
||||||
int? limit,
|
int? limit,
|
||||||
}) async {
|
}) async {
|
||||||
// ANCHOR: list-payments-filtered
|
// 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(
|
ListPaymentsRequest req = ListPaymentsRequest(
|
||||||
filter: PaymentTypeFilter.Sent,
|
filter: PaymentTypeFilter.Sent,
|
||||||
fromTimestamp: startDate?.millisecondsSinceEpoch,
|
fromTimestamp: fromTimestamp,
|
||||||
toTimestamp: endDate?.millisecondsSinceEpoch,
|
toTimestamp: toTimestamp,
|
||||||
includeFailures: includeFailures,
|
includeFailures: includeFailures,
|
||||||
offset: offset,
|
offset: offset,
|
||||||
limit: limit,
|
limit: limit,
|
||||||
|
|||||||
Reference in New Issue
Block a user