diff --git a/mobile/lib/features/wallet/domain/wallet_history.dart b/mobile/lib/features/wallet/domain/wallet_history.dart index 5822ddffb..de9ce456a 100644 --- a/mobile/lib/features/wallet/domain/wallet_history.dart +++ b/mobile/lib/features/wallet/domain/wallet_history.dart @@ -3,7 +3,7 @@ import 'package:get_10101/features/wallet/wallet_history_item.dart'; import 'payment_flow.dart'; import 'package:get_10101/bridge_generated/bridge_definitions.dart' as rust; -enum WalletHistoryStatus { pending, expired, confirmed } +enum WalletHistoryStatus { pending, expired, confirmed, failed } abstract class WalletHistoryItemData { final PaymentFlow flow; @@ -24,6 +24,7 @@ abstract class WalletHistoryItemData { rust.Status.Pending => WalletHistoryStatus.pending, rust.Status.Expired => WalletHistoryStatus.expired, rust.Status.Confirmed => WalletHistoryStatus.confirmed, + rust.Status.Failed => WalletHistoryStatus.failed, }; DateTime timestamp = DateTime.fromMillisecondsSinceEpoch(item.timestamp * 1000); diff --git a/mobile/lib/features/wallet/wallet_history_item.dart b/mobile/lib/features/wallet/wallet_history_item.dart index 9076e5dec..1659a8765 100644 --- a/mobile/lib/features/wallet/wallet_history_item.dart +++ b/mobile/lib/features/wallet/wallet_history_item.dart @@ -28,7 +28,9 @@ abstract class WalletHistoryItem extends StatelessWidget { WalletHistoryStatus.confirmed => const Icon(Icons.check_circle, color: Colors.green, size: statusIconSize), WalletHistoryStatus.expired => - const Icon(Icons.timer_off, color: Colors.red, size: statusIconSize) + const Icon(Icons.timer_off, color: Colors.red, size: statusIconSize), + WalletHistoryStatus.failed => + const Icon(Icons.error, color: Colors.red, size: statusIconSize), }; const double flowIconSize = 30; diff --git a/mobile/native/src/api.rs b/mobile/native/src/api.rs index 58a99f5a4..65be218b1 100644 --- a/mobile/native/src/api.rs +++ b/mobile/native/src/api.rs @@ -112,6 +112,7 @@ pub enum Status { Pending, Confirmed, Expired, + Failed, } pub fn calculate_margin(price: f32, quantity: f32, leverage: f32) -> SyncReturn { diff --git a/mobile/native/src/ln_dlc/mod.rs b/mobile/native/src/ln_dlc/mod.rs index 6f10727f4..b9c884fff 100644 --- a/mobile/native/src/ln_dlc/mod.rs +++ b/mobile/native/src/ln_dlc/mod.rs @@ -363,8 +363,7 @@ fn keep_wallet_balance_and_history_up_to_date(node: &Node) -> Result<()> { HTLCStatus::Pending if expired => api::Status::Expired, HTLCStatus::Pending => api::Status::Pending, HTLCStatus::Succeeded => api::Status::Confirmed, - // TODO: Handle failed payments - HTLCStatus::Failed => return None, + HTLCStatus::Failed => api::Status::Failed, }; let flow = match details.flow {