@ledgerhq/device-transport-kit-web-ble 0.0.0-signer-eth-plugin-fix-20250331141239 → 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.
Files changed (32) hide show
  1. package/README.md +2 -2
  2. package/lib/esm/api/data/WebBleConfig.js +1 -1
  3. package/lib/esm/api/data/WebBleConfig.js.map +3 -3
  4. package/lib/esm/api/transport/WebBleApduSender.js +2 -0
  5. package/lib/esm/api/transport/WebBleApduSender.js.map +7 -0
  6. package/lib/esm/api/transport/WebBleApduSender.test.js +2 -0
  7. package/lib/esm/api/transport/WebBleApduSender.test.js.map +7 -0
  8. package/lib/esm/api/transport/WebBleTransport.js +1 -1
  9. package/lib/esm/api/transport/WebBleTransport.js.map +3 -3
  10. package/lib/esm/api/transport/WebBleTransport.test.js +0 -1
  11. package/lib/esm/api/transport/WebBleTransport.test.js.map +4 -4
  12. package/lib/esm/package.json +11 -11
  13. package/lib/types/api/data/WebBleConfig.d.ts +3 -1
  14. package/lib/types/api/data/WebBleConfig.d.ts.map +1 -1
  15. package/lib/types/api/model/BleDevice.stub.d.ts.map +1 -1
  16. package/lib/types/api/transport/WebBleApduSender.d.ts +41 -0
  17. package/lib/types/api/transport/WebBleApduSender.d.ts.map +1 -0
  18. package/lib/types/api/transport/WebBleApduSender.test.d.ts +2 -0
  19. package/lib/types/api/transport/WebBleApduSender.test.d.ts.map +1 -0
  20. package/lib/types/api/transport/WebBleTransport.d.ts +26 -75
  21. package/lib/types/api/transport/WebBleTransport.d.ts.map +1 -1
  22. package/lib/types/api/transport/WebBleTransport.test.d.ts +0 -1
  23. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  24. package/package.json +13 -13
  25. package/lib/esm/api/transport/BleDeviceConnection.js +0 -2
  26. package/lib/esm/api/transport/BleDeviceConnection.js.map +0 -7
  27. package/lib/esm/api/transport/BleDeviceConnection.test.js +0 -2
  28. package/lib/esm/api/transport/BleDeviceConnection.test.js.map +0 -7
  29. package/lib/types/api/transport/BleDeviceConnection.d.ts +0 -98
  30. package/lib/types/api/transport/BleDeviceConnection.d.ts.map +0 -1
  31. package/lib/types/api/transport/BleDeviceConnection.test.d.ts +0 -2
  32. package/lib/types/api/transport/BleDeviceConnection.test.d.ts.map +0 -1
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=WebBleApduSender.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebBleApduSender.test.d.ts","sourceRoot":"","sources":["../../../../src/api/transport/WebBleApduSender.test.ts"],"names":[],"mappings":""}
@@ -1,91 +1,42 @@
1
- import { type ApduReceiverServiceFactory, type ApduSenderServiceFactory, type ConnectError, type DeviceId, type DeviceModelDataSource, type DisconnectHandler, type DmkError, type LoggerPublisherService, type Transport, TransportConnectedDevice, type TransportDiscoveredDevice, type TransportFactory, type TransportIdentifier } from "@ledgerhq/device-management-kit";
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 readonly _deviceModelDataSource;
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 readonly connectionType;
16
- private readonly identifier;
17
- constructor(_deviceModelDataSource: DeviceModelDataSource, _loggerServiceFactory: (tag: string) => LoggerPublisherService, _apduSenderFactory: ApduSenderServiceFactory, _apduReceiverFactory: ApduReceiverServiceFactory);
18
- /**
19
- * Get the Bluetooth API if supported or error
20
- * @returns `Either<BleTransportNotSupportedError, Bluetooth>`
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
- * Connect to a BLE device and update the internal state of the associated device
67
- * Handle ondisconnect event on the device in order to try a reconnection
68
- */
69
- connect({ deviceId, onDisconnect, }: {
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,EAE7B,KAAK,YAAY,EAGjB,KAAK,QAAQ,EACb,KAAK,qBAAqB,EAE1B,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,sBAAsB,EAG3B,KAAK,SAAS,EACd,wBAAwB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EAEzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,MAAM,EAAmC,MAAM,WAAW,CAAC;AACzE,OAAO,EAAQ,KAAK,UAAU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