mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
initialize prefs and tor services
This commit is contained in:
parent
5835b1e4a7
commit
685690723a
1 changed files with 13 additions and 2 deletions
|
@ -57,23 +57,34 @@ class SubscribableElectrumXClient {
|
|||
|
||||
late Prefs _prefs;
|
||||
late TorService _torService;
|
||||
|
||||
SubscribableElectrumXClient({
|
||||
bool useSSL = true,
|
||||
required bool useSSL,
|
||||
required Prefs prefs,
|
||||
TorService? torService,
|
||||
this.onConnectionStatusChanged,
|
||||
Duration connectionTimeout = const Duration(seconds: 5),
|
||||
Duration keepAlive = const Duration(seconds: 10),
|
||||
}) {
|
||||
_useSSL = useSSL;
|
||||
_prefs = prefs;
|
||||
_torService = torService ?? TorService.sharedInstance;
|
||||
_connectionTimeout = connectionTimeout;
|
||||
_keepAlive = keepAlive;
|
||||
|
||||
// TODO [prio=high]: Listen for TorConnectionStatusChangedEvent.
|
||||
// TODO [prio=high]: Listen for TorPreferenceChangedEvent.
|
||||
}
|
||||
|
||||
factory SubscribableElectrumXClient.from({
|
||||
required ElectrumXNode node,
|
||||
// TorService? torService,
|
||||
required Prefs prefs,
|
||||
TorService? torService,
|
||||
}) {
|
||||
return SubscribableElectrumXClient(
|
||||
useSSL: node.useSSL,
|
||||
prefs: prefs,
|
||||
torService: torService ?? TorService.sharedInstance,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue