mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-27 06:18:50 +01:00
* 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
35 lines
1009 B
Dart
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 {}
|
|
}
|