stack_wallet/lib/electrumx_rpc/electrumx_chain_height_service.dart
2024-02-14 11:19:57 -06:00

18 lines
788 B
Dart

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;
static Map<Coin, StreamSubscription<dynamic>?> subscriptions = {};
// Used to hold chain height completers for each coin as in:
// ElectrumxChainHeightService.completers[cryptoCurrency.coin] = completer;
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 = {};
}