CakeWallet/lib/view_model/settings
David Adegoke 1d6e594e04
CW-959: Swap Status on Transaction Screen (#2299)
* feat(swap-status-monitor): add real-time swap status monitoring and UI updates

- Introduce SwapManager for automatic tracking of active-wallet swaps.
- Automatically queues new or updated trades from the Hive box.
- Periodically fetch and persist swap statuses via the corresponding trade provider.
- Implement start(wallet, providers), stop(), and dispose() for lifecycle control.
- Apply user's ExchangeApiMode(disabled, tor-only, enabled) when fetching updates.
- Remove swaps from the watchlist on any final state (completed, expired, failed).
- Dispose SwapManager in AppState.dispose() to cancel polling and the Hive subscription.

* refactor(swap-status): replace SwapManager with TradeMonitor for improved trade monitoring.

This change improves the flow by simplifying the trade monitoring logic.

- Removes SwapManager class and replace with TradeMonitor implementation
- Update di and Appstate to register and dispose TradeMonitor
- Modify DashboardViewModel to use TradeMonitor instead of SwapManager

* fix: Modify trade monitoring logic to ensure trade timers are properly disposed when wallet switching occurs

* fix(swap-status): Fix receive amount for exchanges showing as .00 because of null values

* feat(swap-status): Enhance Trade Monitoring

This change:
- Adds a privacy settings option to disable automatic exchange status updates.
- Prevents trade monitoring when privacy settings option is enabled.
- Disables trade monitoring when the app is in background, we only want to run these checks in foreground.
- Refactors the trade monitoring logic to remove unneccessary checks and use of resources.

* feat(swap-status): Enhance Trade Monitoring

This change:
- Adds a privacy settings option to disable automatic exchange status updates.
- Prevents trade monitoring when privacy settings option is enabled.
- Disables trade monitoring when the app is in background, we only want to run these checks in foreground.
- Refactors the trade monitoring logic to remove unneccessary checks and use of resources.

* fix(swap-staus): Prevent unneccessary calls

* feat(swap-status): Prevent api request calls as long as last update time is less than specified interval
2025-06-04 18:24:56 +03:00
..
choices_list_item.dart Cw 155 monero synchronization (#1014) 2023-08-04 20:55:56 +03:00
display_settings_view_model.dart New themes (#2239) 2025-05-25 23:11:45 +03:00
link_list_item.dart Update support links (#1595) 2024-08-13 14:15:47 +03:00
mweb_settings_view_model.dart Mweb fixes (#1972) 2025-01-24 20:09:48 +02:00
other_settings_view_model.dart UI enhancements (#1895) 2025-02-12 14:35:59 +03:00
picker_list_item.dart Flutter upgrade 2022-10-12 13:09:57 -04:00
privacy_settings_view_model.dart CW-959: Swap Status on Transaction Screen (#2299) 2025-06-04 18:24:56 +03:00
regular_list_item.dart Flutter upgrade 2022-10-12 13:09:57 -04:00
security_settings_view_model.dart Generic fixes (#1274) 2024-01-27 00:51:21 +02:00
settings_list_item.dart General changes. CAKE-1. 2020-07-06 23:09:03 +03:00
silent_payments_settings_view_model.dart Cw 453 (#1306) 2024-05-29 17:43:48 +03:00
switcher_list_item.dart Flutter upgrade 2022-10-12 13:09:57 -04:00
sync_mode.dart Implement background sync for xmr using flutter_daemon (#2094) 2025-03-21 19:22:00 +02:00
trocador_providers_view_model.dart Update list of trocador providers to be fetched from the api (#1379) 2025-03-11 21:51:52 +02:00
version_list_item.dart Flutter upgrade 2022-10-12 13:09:57 -04:00