@ledgerhq/device-transport-kit-web-ble 0.0.0-try-to-fix-20250429171448 → 0.0.0-web-ble-29-08---20250829104351
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 +0 -1
- package/lib/esm/api/transport/WebBleTransport.test.js.map +4 -4
- package/lib/esm/package.json +11 -11
- 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/model/BleDevice.stub.d.ts.map +1 -1
- package/lib/types/api/transport/WebBleApduSender.d.ts +41 -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 +26 -75
- package/lib/types/api/transport/WebBleTransport.d.ts.map +1 -1
- package/lib/types/api/transport/WebBleTransport.test.d.ts +0 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +14 -14
- 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
|
@@ -1,91 +1,42 @@
|
|
|
1
|
-
import { type ApduReceiverServiceFactory, type ApduSenderServiceFactory, type ConnectError, type
|
|
1
|
+
import { type ApduReceiverServiceFactory, type ApduSenderServiceFactory, type ConnectError, type DeviceModelDataSource, type DmkError, type LoggerPublisherService, type Transport, TransportConnectedDevice, type TransportDiscoveredDevice, type TransportFactory, type TransportIdentifier } 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 getBluetoothApi;
|
|
8
|
+
private _deviceModelDataSource;
|
|
9
|
+
private _apduSenderFactory;
|
|
10
|
+
private _apduReceiverFactory;
|
|
11
|
+
private _deviceConnectionsById;
|
|
12
|
+
private _registry;
|
|
13
|
+
private _devices$;
|
|
14
|
+
constructor(deviceModelDataSource: DeviceModelDataSource, loggerFactory: (tag: string) => LoggerPublisherService, apduSenderFactory: ApduSenderServiceFactory, apduReceiverFactory: ApduReceiverServiceFactory);
|
|
23
15
|
isSupported(): boolean;
|
|
24
16
|
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
17
|
startDiscovering(): Observable<TransportDiscoveredDevice>;
|
|
64
18
|
stopDiscovering(): void;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
deviceId: DeviceId;
|
|
71
|
-
onDisconnect: DisconnectHandler;
|
|
19
|
+
listenToAvailableDevices(): Observable<TransportDiscoveredDevice[]>;
|
|
20
|
+
connect(params: {
|
|
21
|
+
deviceId: string;
|
|
22
|
+
onDisconnect: (deviceId: string) => void;
|
|
23
|
+
onReconnect?: (deviceId: string) => Promise<void> | void;
|
|
72
24
|
}): Promise<Either<ConnectError, TransportConnectedDevice>>;
|
|
73
|
-
/**
|
|
74
|
-
* Get the device disconnected handler
|
|
75
|
-
* @param internalDevice WebBleInternalDevice
|
|
76
|
-
* @param deviceConnection BleDeviceConnection
|
|
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
|
-
*/
|
|
86
25
|
disconnect(params: {
|
|
87
26
|
connectedDevice: TransportConnectedDevice;
|
|
88
27
|
}): Promise<Either<DmkError, void>>;
|
|
28
|
+
private _handleDeviceDisconnected;
|
|
29
|
+
private _waitForInRange;
|
|
30
|
+
private _rediscoverDevice;
|
|
31
|
+
private tryToReconnect;
|
|
32
|
+
private _safeCancel;
|
|
33
|
+
private _identifyLedgerService;
|
|
34
|
+
private _getLiveLedgerService;
|
|
35
|
+
private _resolveCharacteristics;
|
|
36
|
+
private _pluckWriteCharacteristic;
|
|
37
|
+
private _emitDevices;
|
|
38
|
+
private _withTimeout;
|
|
39
|
+
private _delay;
|
|
89
40
|
}
|
|
90
41
|
export declare const webBleTransportFactory: TransportFactory;
|
|
91
42
|
//# 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,KA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