@onekeyfe/hd-transport-electron 1.1.20-alpha.0 → 1.1.20-alpha.2
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/dist/{index-28d46641.js → index-1fa563cd.js} +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/{noble-ble-handler-24e390db.js → noble-ble-handler-1a6d7f4a.js} +5 -1
- package/dist/noble-ble-handler.d.ts.map +1 -1
- package/dist/types/noble-extended.d.ts +2 -1
- package/dist/types/noble-extended.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/noble-ble-handler.ts +4 -0
- package/src/types/noble-extended.ts +2 -1
|
@@ -32,7 +32,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
32
32
|
|
|
33
33
|
function initNobleBleSupport(webContents) {
|
|
34
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
const { setupNobleBleHandlers } = yield Promise.resolve().then(function () { return require('./noble-ble-handler-
|
|
35
|
+
const { setupNobleBleHandlers } = yield Promise.resolve().then(function () { return require('./noble-ble-handler-1a6d7f4a.js'); });
|
|
36
36
|
setupNobleBleHandlers(webContents);
|
|
37
37
|
});
|
|
38
38
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { WebContents } from 'electron';
|
|
2
2
|
import { Characteristic, Peripheral } from '@stoprocent/noble';
|
|
3
|
+
import { OneKeyDeviceInfoBase } from '@onekeyfe/hd-transport';
|
|
3
4
|
|
|
4
|
-
interface DeviceInfo {
|
|
5
|
+
interface DeviceInfo extends OneKeyDeviceInfoBase {
|
|
5
6
|
id: string;
|
|
6
7
|
name: string;
|
|
7
8
|
state: string;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-1fa563cd.js');
|
|
4
4
|
var hdShared = require('@onekeyfe/hd-shared');
|
|
5
5
|
var hdTransport = require('@onekeyfe/hd-transport');
|
|
6
6
|
var pRetry = require('p-retry');
|
|
@@ -614,6 +614,7 @@ function enumerateDevices() {
|
|
|
614
614
|
if (!existingDevice) {
|
|
615
615
|
const deviceName = ((_a = peripheral.advertisement) === null || _a === void 0 ? void 0 : _a.localName) || 'Unknown Device';
|
|
616
616
|
devices.push({
|
|
617
|
+
commType: 'electron-ble',
|
|
617
618
|
id,
|
|
618
619
|
name: deviceName,
|
|
619
620
|
state: peripheral.state || 'disconnected',
|
|
@@ -663,6 +664,7 @@ function getDevice(deviceId) {
|
|
|
663
664
|
if (peripheral) {
|
|
664
665
|
const deviceName = ((_a = peripheral.advertisement) === null || _a === void 0 ? void 0 : _a.localName) || 'Unknown Device';
|
|
665
666
|
return {
|
|
667
|
+
commType: 'electron-ble',
|
|
666
668
|
id: peripheral.id,
|
|
667
669
|
name: deviceName,
|
|
668
670
|
state: peripheral.state || 'disconnected',
|
|
@@ -672,12 +674,14 @@ function getDevice(deviceId) {
|
|
|
672
674
|
if (connectedPeripheral) {
|
|
673
675
|
const deviceName = ((_b = connectedPeripheral.advertisement) === null || _b === void 0 ? void 0 : _b.localName) || 'Unknown Device';
|
|
674
676
|
return {
|
|
677
|
+
commType: 'electron-ble',
|
|
675
678
|
id: connectedPeripheral.id,
|
|
676
679
|
name: deviceName,
|
|
677
680
|
state: connectedPeripheral.state || 'connected',
|
|
678
681
|
};
|
|
679
682
|
}
|
|
680
683
|
return {
|
|
684
|
+
commType: 'electron-ble',
|
|
681
685
|
id: deviceId,
|
|
682
686
|
name: 'OneKey Device',
|
|
683
687
|
state: 'disconnected',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noble-ble-handler.d.ts","sourceRoot":"","sources":["../src/noble-ble-handler.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"noble-ble-handler.d.ts","sourceRoot":"","sources":["../src/noble-ble-handler.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,UAAU,CAAC;AA6+ChE,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAsKpE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Peripheral, Characteristic } from '@stoprocent/noble';
|
|
2
|
-
|
|
2
|
+
import type { OneKeyDeviceInfoBase } from '@onekeyfe/hd-transport';
|
|
3
|
+
export interface DeviceInfo extends OneKeyDeviceInfoBase {
|
|
3
4
|
id: string;
|
|
4
5
|
name: string;
|
|
5
6
|
state: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noble-extended.d.ts","sourceRoot":"","sources":["../../src/types/noble-extended.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"noble-extended.d.ts","sourceRoot":"","sources":["../../src/types/noble-extended.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,MAAM,WAAW,UAAW,SAAQ,oBAAoB;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;CACxB;AAGD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CACX,YAAY,EAAE,MAAM,EAAE,EACtB,eAAe,EAAE,OAAO,EACxB,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,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github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"electron-log": ">=4.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@onekeyfe/hd-core": "1.1.20-alpha.
|
|
29
|
-
"@onekeyfe/hd-shared": "1.1.20-alpha.
|
|
30
|
-
"@onekeyfe/hd-transport": "1.1.20-alpha.
|
|
28
|
+
"@onekeyfe/hd-core": "1.1.20-alpha.2",
|
|
29
|
+
"@onekeyfe/hd-shared": "1.1.20-alpha.2",
|
|
30
|
+
"@onekeyfe/hd-transport": "1.1.20-alpha.2",
|
|
31
31
|
"@stoprocent/noble": "2.3.4",
|
|
32
32
|
"p-retry": "^4.6.2"
|
|
33
33
|
},
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"electron": "^25.0.0",
|
|
37
37
|
"typescript": "^5.3.3"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "dbf71f2cde0679e6f0bc84441ff0d0f905b054c0"
|
|
40
40
|
}
|
package/src/noble-ble-handler.ts
CHANGED
|
@@ -824,6 +824,7 @@ async function enumerateDevices(): Promise<DeviceInfo[]> {
|
|
|
824
824
|
if (!existingDevice) {
|
|
825
825
|
const deviceName = peripheral.advertisement?.localName || 'Unknown Device';
|
|
826
826
|
devices.push({
|
|
827
|
+
commType: 'electron-ble',
|
|
827
828
|
id,
|
|
828
829
|
name: deviceName,
|
|
829
830
|
state: peripheral.state || 'disconnected',
|
|
@@ -882,6 +883,7 @@ function getDevice(deviceId: string): DeviceInfo | null {
|
|
|
882
883
|
if (peripheral) {
|
|
883
884
|
const deviceName = peripheral.advertisement?.localName || 'Unknown Device';
|
|
884
885
|
return {
|
|
886
|
+
commType: 'electron-ble',
|
|
885
887
|
id: peripheral.id,
|
|
886
888
|
name: deviceName,
|
|
887
889
|
state: peripheral.state || 'disconnected',
|
|
@@ -893,6 +895,7 @@ function getDevice(deviceId: string): DeviceInfo | null {
|
|
|
893
895
|
if (connectedPeripheral) {
|
|
894
896
|
const deviceName = connectedPeripheral.advertisement?.localName || 'Unknown Device';
|
|
895
897
|
return {
|
|
898
|
+
commType: 'electron-ble',
|
|
896
899
|
id: connectedPeripheral.id,
|
|
897
900
|
name: deviceName,
|
|
898
901
|
state: connectedPeripheral.state || 'connected',
|
|
@@ -902,6 +905,7 @@ function getDevice(deviceId: string): DeviceInfo | null {
|
|
|
902
905
|
// For direct connection mode, return a placeholder device info
|
|
903
906
|
// This allows the connection process to proceed without prior discovery
|
|
904
907
|
return {
|
|
908
|
+
commType: 'electron-ble',
|
|
905
909
|
id: deviceId,
|
|
906
910
|
name: 'OneKey Device',
|
|
907
911
|
state: 'disconnected',
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { Peripheral, Characteristic } from '@stoprocent/noble';
|
|
7
|
+
import type { OneKeyDeviceInfoBase } from '@onekeyfe/hd-transport';
|
|
7
8
|
|
|
8
9
|
// Device info interface for our API
|
|
9
|
-
export interface DeviceInfo {
|
|
10
|
+
export interface DeviceInfo extends OneKeyDeviceInfoBase {
|
|
10
11
|
id: string;
|
|
11
12
|
name: string;
|
|
12
13
|
state: string;
|