stack_wallet/lib/electrumx_rpc/electrumx_chain_height_service.dart

19 lines
788 B
Dart
Raw Normal View History

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 = {};
// 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 = {};
}