@onekeyfe/hd-core 0.1.45 → 0.1.46
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/core/index.d.ts.map +1 -1
- package/dist/events/ui-request.d.ts +2 -1
- package/dist/events/ui-request.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -1
- package/package.json +4 -4
- package/src/api/aptos/AptosSignTransaction.ts +1 -1
- package/src/core/index.ts +3 -1
- package/src/events/ui-request.ts +3 -1
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAqBlC,OAAO,EACL,WAAW,EAYZ,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAE7D,OAAO,eAAe,MAAM,2BAA2B,CAAC;AA2BxD,eAAO,MAAM,OAAO,YAAmB,WAAW,iBAyPjD,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAqBlC,OAAO,EACL,WAAW,EAYZ,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAE7D,OAAO,eAAe,MAAM,2BAA2B,CAAC;AA2BxD,eAAO,MAAM,OAAO,YAAmB,WAAW,iBAyPjD,CAAC;AA2KF,eAAO,MAAM,MAAM,0CAkBlB,CAAC;AAuHF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IACtC,aAAa,CAAC,OAAO,EAAE,WAAW;IA6CxC,OAAO;CAGR;AAED,eAAO,MAAM,QAAQ,YAGpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAIzB,CAAC;AAMF,eAAO,MAAM,IAAI,aAAoB,eAAe,aAAa,GAAG,8BAmBnE,CAAC"}
|
|
@@ -11,11 +11,12 @@ export declare const UI_REQUEST: {
|
|
|
11
11
|
readonly CLOSE_UI_WINDOW: "ui-close_window";
|
|
12
12
|
readonly BLUETOOTH_PERMISSION: "ui-bluetooth_permission";
|
|
13
13
|
readonly LOCATION_PERMISSION: "ui-location_permission";
|
|
14
|
+
readonly LOCATION_SERVICE_PERMISSION: "ui-location_service_permission";
|
|
14
15
|
readonly FIRMWARE_PROGRESS: "ui-firmware-progress";
|
|
15
16
|
readonly NOT_IN_BOOTLOADER: "ui-device_not_in_bootloader_mode";
|
|
16
17
|
};
|
|
17
18
|
export interface UiRequestWithoutPayload {
|
|
18
|
-
type: typeof UI_REQUEST.CLOSE_UI_WINDOW | typeof UI_REQUEST.BLUETOOTH_PERMISSION | typeof UI_REQUEST.LOCATION_PERMISSION;
|
|
19
|
+
type: typeof UI_REQUEST.CLOSE_UI_WINDOW | typeof UI_REQUEST.BLUETOOTH_PERMISSION | typeof UI_REQUEST.LOCATION_PERMISSION | typeof UI_REQUEST.LOCATION_SERVICE_PERMISSION;
|
|
19
20
|
payload?: typeof undefined;
|
|
20
21
|
}
|
|
21
22
|
export declare type UiRequestDeviceAction = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-request.d.ts","sourceRoot":"","sources":["../../src/events/ui-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,QAAQ,aAAa,CAAC;AAEnC,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"ui-request.d.ts","sourceRoot":"","sources":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;KAClB,CAAC;CACH;AAED,oBAAY,OAAO,GACf,uBAAuB,GACvB,qBAAqB,GACrB,eAAe,GACf,mBAAmB,GACnB,gBAAgB,CAAC;AAErB,oBAAY,cAAc,GAAG,OAAO,GAAG;IAAE,KAAK,EAAE,OAAO,QAAQ,CAAA;CAAE,CAAC;AAElE,eAAO,MAAM,eAAe,EAAE,gBAAgB,CAAC,OAAO,QAAQ,EAAE,OAAO,CAK5D,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1191,11 +1191,12 @@ declare const UI_REQUEST: {
|
|
|
1191
1191
|
readonly CLOSE_UI_WINDOW: "ui-close_window";
|
|
1192
1192
|
readonly BLUETOOTH_PERMISSION: "ui-bluetooth_permission";
|
|
1193
1193
|
readonly LOCATION_PERMISSION: "ui-location_permission";
|
|
1194
|
+
readonly LOCATION_SERVICE_PERMISSION: "ui-location_service_permission";
|
|
1194
1195
|
readonly FIRMWARE_PROGRESS: "ui-firmware-progress";
|
|
1195
1196
|
readonly NOT_IN_BOOTLOADER: "ui-device_not_in_bootloader_mode";
|
|
1196
1197
|
};
|
|
1197
1198
|
interface UiRequestWithoutPayload {
|
|
1198
|
-
type: typeof UI_REQUEST.CLOSE_UI_WINDOW | typeof UI_REQUEST.BLUETOOTH_PERMISSION | typeof UI_REQUEST.LOCATION_PERMISSION;
|
|
1199
|
+
type: typeof UI_REQUEST.CLOSE_UI_WINDOW | typeof UI_REQUEST.BLUETOOTH_PERMISSION | typeof UI_REQUEST.LOCATION_PERMISSION | typeof UI_REQUEST.LOCATION_SERVICE_PERMISSION;
|
|
1199
1200
|
payload?: typeof undefined;
|
|
1200
1201
|
}
|
|
1201
1202
|
declare type UiRequestDeviceAction = {
|
package/dist/index.js
CHANGED
|
@@ -10464,6 +10464,7 @@ const UI_REQUEST$1 = {
|
|
|
10464
10464
|
CLOSE_UI_WINDOW: 'ui-close_window',
|
|
10465
10465
|
BLUETOOTH_PERMISSION: 'ui-bluetooth_permission',
|
|
10466
10466
|
LOCATION_PERMISSION: 'ui-location_permission',
|
|
10467
|
+
LOCATION_SERVICE_PERMISSION: 'ui-location_service_permission',
|
|
10467
10468
|
FIRMWARE_PROGRESS: 'ui-firmware-progress',
|
|
10468
10469
|
NOT_IN_BOOTLOADER: 'ui-device_not_in_bootloader_mode',
|
|
10469
10470
|
};
|
|
@@ -15320,6 +15321,7 @@ const ensureConnected = (method, pollingId) => __awaiter(void 0, void 0, void 0,
|
|
|
15320
15321
|
if ([
|
|
15321
15322
|
hdShared.HardwareErrorCode.BlePermissionError,
|
|
15322
15323
|
hdShared.HardwareErrorCode.BleLocationError,
|
|
15324
|
+
hdShared.HardwareErrorCode.BleLocationServicesDisabled,
|
|
15323
15325
|
hdShared.HardwareErrorCode.BleDeviceNotBonded,
|
|
15324
15326
|
hdShared.HardwareErrorCode.BleCharacteristicNotifyError,
|
|
15325
15327
|
hdShared.HardwareErrorCode.BleWriteCharacteristicError,
|
|
@@ -15456,7 +15458,8 @@ class Core extends events.exports {
|
|
|
15456
15458
|
break;
|
|
15457
15459
|
}
|
|
15458
15460
|
case UI_REQUEST$1.BLUETOOTH_PERMISSION:
|
|
15459
|
-
case UI_REQUEST$1.LOCATION_PERMISSION:
|
|
15461
|
+
case UI_REQUEST$1.LOCATION_PERMISSION:
|
|
15462
|
+
case UI_REQUEST$1.LOCATION_SERVICE_PERMISSION: {
|
|
15460
15463
|
postMessage(message);
|
|
15461
15464
|
break;
|
|
15462
15465
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.46",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@onekeyfe/hd-shared": "^0.1.
|
|
28
|
-
"@onekeyfe/hd-transport": "^0.1.
|
|
27
|
+
"@onekeyfe/hd-shared": "^0.1.46",
|
|
28
|
+
"@onekeyfe/hd-transport": "^0.1.46",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"bignumber.js": "^9.0.2",
|
|
31
31
|
"js-sha256": "^0.9.0",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"@types/parse-uri": "^1.0.0",
|
|
37
37
|
"@types/semver": "^7.3.9"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "cb71b9b5f2013756b0ba8d4111e233124bf6282e"
|
|
40
40
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AptosSignTx as HardwareAptosSignTx } from '@onekeyfe/hd-transport';
|
|
2
2
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
|
-
import {
|
|
3
|
+
import { validatePath } from '../helpers/pathUtils';
|
|
4
4
|
import { BaseMethod } from '../BaseMethod';
|
|
5
5
|
import { validateParams } from '../helpers/paramsValidator';
|
|
6
6
|
import { formatAnyHex } from '../helpers/hexUtils';
|
package/src/core/index.ts
CHANGED
|
@@ -457,6 +457,7 @@ const ensureConnected = async (method: BaseMethod, pollingId: number) => {
|
|
|
457
457
|
[
|
|
458
458
|
HardwareErrorCode.BlePermissionError,
|
|
459
459
|
HardwareErrorCode.BleLocationError,
|
|
460
|
+
HardwareErrorCode.BleLocationServicesDisabled,
|
|
460
461
|
HardwareErrorCode.BleDeviceNotBonded,
|
|
461
462
|
HardwareErrorCode.BleCharacteristicNotifyError,
|
|
462
463
|
HardwareErrorCode.BleWriteCharacteristicError,
|
|
@@ -633,7 +634,8 @@ export default class Core extends EventEmitter {
|
|
|
633
634
|
}
|
|
634
635
|
|
|
635
636
|
case UI_REQUEST.BLUETOOTH_PERMISSION:
|
|
636
|
-
case UI_REQUEST.LOCATION_PERMISSION:
|
|
637
|
+
case UI_REQUEST.LOCATION_PERMISSION:
|
|
638
|
+
case UI_REQUEST.LOCATION_SERVICE_PERMISSION: {
|
|
637
639
|
postMessage(message);
|
|
638
640
|
break;
|
|
639
641
|
}
|
package/src/events/ui-request.ts
CHANGED
|
@@ -15,6 +15,7 @@ export const UI_REQUEST = {
|
|
|
15
15
|
|
|
16
16
|
BLUETOOTH_PERMISSION: 'ui-bluetooth_permission',
|
|
17
17
|
LOCATION_PERMISSION: 'ui-location_permission',
|
|
18
|
+
LOCATION_SERVICE_PERMISSION: 'ui-location_service_permission',
|
|
18
19
|
|
|
19
20
|
FIRMWARE_PROGRESS: 'ui-firmware-progress',
|
|
20
21
|
|
|
@@ -25,7 +26,8 @@ export interface UiRequestWithoutPayload {
|
|
|
25
26
|
type:
|
|
26
27
|
| typeof UI_REQUEST.CLOSE_UI_WINDOW
|
|
27
28
|
| typeof UI_REQUEST.BLUETOOTH_PERMISSION
|
|
28
|
-
| typeof UI_REQUEST.LOCATION_PERMISSION
|
|
29
|
+
| typeof UI_REQUEST.LOCATION_PERMISSION
|
|
30
|
+
| typeof UI_REQUEST.LOCATION_SERVICE_PERMISSION;
|
|
29
31
|
payload?: typeof undefined;
|
|
30
32
|
}
|
|
31
33
|
|