Files
hash-wallet/lib/view_model/hardware_wallet/hardware_wallet_view_model.dart
T
Konstantin UllrichandGitHub 3d03a62e21 Add thread-safety and BLE support for Ledger and Trezor devices (#3638)
* feat: support BLE device detection for Ledger and Trezor wallets, update trezor-flutter dependency

* feat: add BLE connection state listener for Trezor devices, handle disconnect events, and clean up resources on close

* feat: add mutex locking to MoneroTrezorService for thread-safe operations
2026-09-18 21:10:59 +02:00

35 lines
1009 B
Dart

import "package:cake_wallet/entities/hardware_wallet/hardware_wallet_device.dart";
import "package:cw_core/hardware/hardware_wallet_service.dart";
import "package:cw_core/wallet_base.dart";
import "package:cw_core/wallet_info.dart";
import "package:cw_core/wallet_type.dart";
abstract class HardwareWalletViewModel {
HardwareWalletType get hardwareWalletType;
bool get isBleEnabled;
bool get hasBluetooth;
bool get isConnecting;
bool isConnected(WalletType type);
Future<void> updateBleState();
Stream<HardwareWalletDevice> scanForBleDevices();
Future<List<HardwareWalletDevice>> getAllUsbDevices();
Future<List<HardwareWalletDevice>> getConnectedBleDevices() async => [];
Future<void> stopScanning();
Future<bool> connectDevice(HardwareWalletDevice device, WalletType type);
HardwareWalletService getHardwareWalletService(WalletType type);
Future<void> initWallet(WalletBase wallet);
String? interpretErrorCode(String error) => null;
Future<void> close() async {}
}