2024-02-05 18:09:45 +00:00
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
|
|
|
|
|
|
|
/// Store chain height subscriptions for each coin.
|
|
|
|
abstract class ElectrumxChainHeightService {
|
|
|
|
// Used to hold chain height subscriptions for each coin as in:
|
|
|
|
// ElectrumxChainHeightService.subscriptions[cryptoCurrency.coin] = sub;
|
2024-02-14 17:19:55 +00:00
|
|
|
static Map<Coin, StreamSubscription<dynamic>?> subscriptions = {};
|
2024-02-14 17:07:27 +00:00
|
|
|
|
|
|
|
// Used to hold chain height completers for each coin as in:
|
|
|
|
// ElectrumxChainHeightService.completers[cryptoCurrency.coin] = completer;
|
2024-02-14 17:19:55 +00:00
|
|
|
static Map<Coin, Completer<int>?> completers = {};
|
|
|
|
|
|
|
|
// Used to hold the time each coin started waiting for chain height as in:
|
|
|
|
// ElectrumxChainHeightService.timeStarted[cryptoCurrency.coin] = time;
|
|
|
|
static Map<Coin, DateTime?> timeStarted = {};
|
2024-02-05 18:09:45 +00:00
|
|
|
}
|