mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2025-12-23 17:04:25 +01:00
List payments filtering and paging (#369)
* List payments in reverse chonological order * Add payment filtering and paging * Fix examples * Apply suggestions from code review Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com> * Set timestamp for pseudo payments * Filter by the first non-null timestamp from the join query --------- Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com>
This commit is contained in:
@@ -197,6 +197,42 @@ enum LiquidNetwork {
|
||||
;
|
||||
}
|
||||
|
||||
/// Represents a list payments request.
|
||||
class ListPaymentsRequest {
|
||||
final List<PaymentType>? filters;
|
||||
|
||||
/// Epoch time, in seconds
|
||||
final PlatformInt64? fromTimestamp;
|
||||
|
||||
/// Epoch time, in seconds
|
||||
final PlatformInt64? toTimestamp;
|
||||
final int? offset;
|
||||
final int? limit;
|
||||
|
||||
const ListPaymentsRequest({
|
||||
this.filters,
|
||||
this.fromTimestamp,
|
||||
this.toTimestamp,
|
||||
this.offset,
|
||||
this.limit,
|
||||
});
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
filters.hashCode ^ fromTimestamp.hashCode ^ toTimestamp.hashCode ^ offset.hashCode ^ limit.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is ListPaymentsRequest &&
|
||||
runtimeType == other.runtimeType &&
|
||||
filters == other.filters &&
|
||||
fromTimestamp == other.fromTimestamp &&
|
||||
toTimestamp == other.toTimestamp &&
|
||||
offset == other.offset &&
|
||||
limit == other.limit;
|
||||
}
|
||||
|
||||
@freezed
|
||||
sealed class LnUrlPayResult with _$LnUrlPayResult {
|
||||
const LnUrlPayResult._();
|
||||
|
||||
Reference in New Issue
Block a user