@ledgerhq/device-transport-kit-web-ble 0.0.0-ledger-button-20250808181454 → 0.0.0-legacy-speculos-datasource-20250819083825
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/api/data/WebBleConfig.js +1 -1
- package/lib/esm/api/data/WebBleConfig.js.map +3 -3
- package/lib/esm/api/transport/WebBleApduSender.js +2 -0
- package/lib/esm/api/transport/WebBleApduSender.js.map +7 -0
- package/lib/esm/api/transport/WebBleApduSender.test.js +2 -0
- package/lib/esm/api/transport/WebBleApduSender.test.js.map +7 -0
- package/lib/esm/api/transport/WebBleTransport.js +1 -1
- package/lib/esm/api/transport/WebBleTransport.js.map +3 -3
- package/lib/esm/api/transport/WebBleTransport.test.js +1 -1
- package/lib/esm/api/transport/WebBleTransport.test.js.map +3 -3
- package/lib/types/api/data/WebBleConfig.d.ts +3 -1
- package/lib/types/api/data/WebBleConfig.d.ts.map +1 -1
- package/lib/types/api/transport/WebBleApduSender.d.ts +34 -0
- package/lib/types/api/transport/WebBleApduSender.d.ts.map +1 -0
- package/lib/types/api/transport/WebBleApduSender.test.d.ts +2 -0
- package/lib/types/api/transport/WebBleApduSender.test.d.ts.map +1 -0
- package/lib/types/api/transport/WebBleTransport.d.ts +21 -76
- package/lib/types/api/transport/WebBleTransport.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/lib/esm/api/transport/BleDeviceConnection.js +0 -2
- package/lib/esm/api/transport/BleDeviceConnection.js.map +0 -7
- package/lib/esm/api/transport/BleDeviceConnection.test.js +0 -2
- package/lib/esm/api/transport/BleDeviceConnection.test.js.map +0 -7
- package/lib/types/api/transport/BleDeviceConnection.d.ts +0 -98
- package/lib/types/api/transport/BleDeviceConnection.d.ts.map +0 -1
- package/lib/types/api/transport/BleDeviceConnection.test.d.ts +0 -2
- package/lib/types/api/transport/BleDeviceConnection.test.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebBleApduSender.test.d.ts","sourceRoot":"","sources":["../../../../src/api/transport/WebBleApduSender.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,91 +1,36 @@
|
|
|
1
|
-
import { type ApduReceiverServiceFactory, type ApduSenderServiceFactory, type ConnectError, type
|
|
1
|
+
import { type ApduReceiverServiceFactory, type ApduSenderServiceFactory, type ConnectError, type DeviceModelDataSource, type LoggerPublisherService, type Transport, TransportConnectedDevice, type TransportDiscoveredDevice, type TransportFactory, type TransportIdentifier, UnknownDeviceError } from "@ledgerhq/device-management-kit";
|
|
2
2
|
import { type Either } from "purify-ts";
|
|
3
3
|
import { type Observable } from "rxjs";
|
|
4
4
|
export declare const webBleIdentifier: TransportIdentifier;
|
|
5
5
|
export declare class WebBleTransport implements Transport {
|
|
6
|
-
private
|
|
7
|
-
private readonly _loggerServiceFactory;
|
|
8
|
-
private readonly _apduSenderFactory;
|
|
9
|
-
private readonly _apduReceiverFactory;
|
|
10
|
-
private readonly _connectedDevices;
|
|
11
|
-
private readonly _internalDevicesById;
|
|
12
|
-
private _deviceConnectionById;
|
|
13
|
-
private _disconnectionHandlersById;
|
|
6
|
+
private loggerFactory;
|
|
14
7
|
private _logger;
|
|
15
|
-
private
|
|
16
|
-
private
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
private
|
|
8
|
+
private _deviceModelDataSource;
|
|
9
|
+
private _apduSenderFactory;
|
|
10
|
+
private _apduReceiverFactory;
|
|
11
|
+
private _deviceRegistry;
|
|
12
|
+
private _connectionMachines;
|
|
13
|
+
private _discoveredDevicesSubject;
|
|
14
|
+
private _reconnectionPromises;
|
|
15
|
+
private _reconnectionTimers;
|
|
16
|
+
constructor(deviceModelDataSource: DeviceModelDataSource, loggerFactory: (tag: string) => LoggerPublisherService, apduSenderFactory: ApduSenderServiceFactory, apduReceiverFactory: ApduReceiverServiceFactory);
|
|
23
17
|
isSupported(): boolean;
|
|
24
18
|
getIdentifier(): TransportIdentifier;
|
|
25
|
-
listenToAvailableDevices(): Observable<TransportDiscoveredDevice[]>;
|
|
26
|
-
/**
|
|
27
|
-
* Get Bluetooth GATT Primary service that is used to get writeCharacteristic and notifyCharacteristic
|
|
28
|
-
* @param bleDevice
|
|
29
|
-
* @private
|
|
30
|
-
*/
|
|
31
|
-
private getBleGattService;
|
|
32
|
-
/**
|
|
33
|
-
* BleDeviceInfos to map primary service uuid to device model & characteristics uuid
|
|
34
|
-
* @param bleGattService
|
|
35
|
-
* @private
|
|
36
|
-
*/
|
|
37
|
-
private getBleDeviceInfos;
|
|
38
|
-
/**
|
|
39
|
-
* Prompt device selection in navigator
|
|
40
|
-
*
|
|
41
|
-
* @private
|
|
42
|
-
*/
|
|
43
|
-
private promptDeviceAccess;
|
|
44
|
-
/**
|
|
45
|
-
* Generate a discovered device from BluetoothDevice, BleGATT primary service and BLE device infos
|
|
46
|
-
* @param bleDeviceInfos
|
|
47
|
-
* @private
|
|
48
|
-
*/
|
|
49
|
-
private getDiscoveredDeviceFrom;
|
|
50
|
-
/**
|
|
51
|
-
* Generate an InternalDevice from a unique id, a BluetoothDevice, BleGATT primary service and BLE device infos
|
|
52
|
-
* @param discoveredDevice
|
|
53
|
-
* @param bleDevice
|
|
54
|
-
* @param bleDeviceInfos
|
|
55
|
-
* @param bleGattService
|
|
56
|
-
* @private
|
|
57
|
-
*/
|
|
58
|
-
private setInternalDeviceFrom;
|
|
59
|
-
/**
|
|
60
|
-
* Main method to get a device from a button click handler
|
|
61
|
-
* The GATT connection is done here in order to populate TransportDiscoveredDevice with deviceModel
|
|
62
|
-
*/
|
|
63
19
|
startDiscovering(): Observable<TransportDiscoveredDevice>;
|
|
20
|
+
listenToAvailableDevices(): Observable<TransportDiscoveredDevice[]>;
|
|
64
21
|
stopDiscovering(): void;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
connect({ deviceId, onDisconnect, }: {
|
|
70
|
-
deviceId: DeviceId;
|
|
71
|
-
onDisconnect: DisconnectHandler;
|
|
22
|
+
connect(params: {
|
|
23
|
+
deviceId: string;
|
|
24
|
+
onDisconnect: (deviceId: string) => void;
|
|
25
|
+
onReconnect?: (deviceId: string) => Promise<void> | void;
|
|
72
26
|
}): Promise<Either<ConnectError, TransportConnectedDevice>>;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
* @returns async () => void
|
|
78
|
-
* @private
|
|
79
|
-
*/
|
|
80
|
-
private _getDeviceDisconnectedHandler;
|
|
81
|
-
/**
|
|
82
|
-
* Disconnect from a BLE device and delete its handlers
|
|
83
|
-
*
|
|
84
|
-
* @param params { connectedDevice: TransportConnectedDevice }
|
|
85
|
-
*/
|
|
27
|
+
private handleDisconnect;
|
|
28
|
+
private _cleanupDevice;
|
|
29
|
+
private _cleanupConnection;
|
|
30
|
+
private _rebindCharacteristics;
|
|
86
31
|
disconnect(params: {
|
|
87
32
|
connectedDevice: TransportConnectedDevice;
|
|
88
|
-
}): Promise<Either<
|
|
33
|
+
}): Promise<Either<UnknownDeviceError, never> | Either<never, undefined>>;
|
|
89
34
|
}
|
|
90
35
|
export declare const webBleTransportFactory: TransportFactory;
|
|
91
36
|
//# sourceMappingURL=WebBleTransport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebBleTransport.d.ts","sourceRoot":"","sources":["../../../../src/api/transport/WebBleTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,
|
|
1
|
+
{"version":3,"file":"WebBleTransport.d.ts","sourceRoot":"","sources":["../../../../src/api/transport/WebBleTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EAGjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAE3B,KAAK,S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