@onekeyfe/hd-core 1.1.13 → 1.1.14-alpha.0
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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAY,6BAA6B,EAAoB,MAAM,wBAAwB,CAAC;AA4BnG,OAAO,EAAE,MAAM,EAAyC,MAAM,kBAAkB,CAAC;AAOjF,OAAO,EAEL,WAAW,EAWZ,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAE7D,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAMxD,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAsC7D,eAAO,MAAM,OAAO,YAAmB,WAAW,WAAW,WAAW,iBA2DvE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAY,6BAA6B,EAAoB,MAAM,wBAAwB,CAAC;AA4BnG,OAAO,EAAE,MAAM,EAAyC,MAAM,kBAAkB,CAAC;AAOjF,OAAO,EAEL,WAAW,EAWZ,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAE7D,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAMxD,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAsC7D,eAAO,MAAM,OAAO,YAAmB,WAAW,WAAW,WAAW,iBA2DvE,CAAC;AAumBF,eAAO,MAAM,MAAM,YAAa,WAAW,cAAc,MAAM,SA+E9D,CAAC;AAsEF,eAAO,MAAM,qBAAqB,gFAejC,CAAC;AAsFF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IAC5C,OAAO,CAAC,YAAY,CAAsB;IAG1C,OAAO,CAAC,qBAAqB,CAA4B;IAEzD,OAAO,CAAC,iBAAiB,CAAoB;IAE7C,OAAO,CAAC,cAAc;IAkBhB,aAAa,CAAC,OAAO,EAAE,WAAW;IA0DxC,OAAO;CAGR;AAED,eAAO,MAAM,QAAQ,YAGpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAIzB,CAAC;AAMF,eAAO,MAAM,IAAI,aACL,eAAe,aACd,GAAG,WACL,6BAA6B,8BAoBvC,CAAC;AAEF,eAAO,MAAM,eAAe;SAKrB,eAAe,CAAC,KAAK,CAAC;eAChB,GAAG;;UASf,CAAC"}
|
|
@@ -31,7 +31,7 @@ export declare const cancelDeviceInPrompt: (device: Device, expectResponse?: boo
|
|
|
31
31
|
};
|
|
32
32
|
} | {
|
|
33
33
|
success: boolean;
|
|
34
|
-
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 900 | 901 | 902;
|
|
34
|
+
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 900 | 901 | 902;
|
|
35
35
|
payload: {
|
|
36
36
|
message: string;
|
|
37
37
|
};
|
|
@@ -50,7 +50,7 @@ export declare const cancelDeviceWithInitialize: (device: Device) => Promise<{
|
|
|
50
50
|
};
|
|
51
51
|
} | {
|
|
52
52
|
success: boolean;
|
|
53
|
-
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 900 | 901 | 902;
|
|
53
|
+
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 900 | 901 | 902;
|
|
54
54
|
payload: {
|
|
55
55
|
message: string;
|
|
56
56
|
};
|
|
@@ -78,7 +78,7 @@ export declare class DeviceCommands {
|
|
|
78
78
|
};
|
|
79
79
|
} | {
|
|
80
80
|
success: boolean;
|
|
81
|
-
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 900 | 901 | 902;
|
|
81
|
+
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 900 | 901 | 902;
|
|
82
82
|
payload: {
|
|
83
83
|
message: string;
|
|
84
84
|
};
|
|
@@ -97,7 +97,7 @@ export declare class DeviceCommands {
|
|
|
97
97
|
};
|
|
98
98
|
} | {
|
|
99
99
|
success: boolean;
|
|
100
|
-
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 900 | 901 | 902;
|
|
100
|
+
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 900 | 901 | 902;
|
|
101
101
|
payload: {
|
|
102
102
|
message: string;
|
|
103
103
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -2933,7 +2933,7 @@ declare class DeviceCommands {
|
|
|
2933
2933
|
};
|
|
2934
2934
|
} | {
|
|
2935
2935
|
success: boolean;
|
|
2936
|
-
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 900 | 901 | 902;
|
|
2936
|
+
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 900 | 901 | 902;
|
|
2937
2937
|
payload: {
|
|
2938
2938
|
message: string;
|
|
2939
2939
|
};
|
|
@@ -2952,7 +2952,7 @@ declare class DeviceCommands {
|
|
|
2952
2952
|
};
|
|
2953
2953
|
} | {
|
|
2954
2954
|
success: boolean;
|
|
2955
|
-
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 900 | 901 | 902;
|
|
2955
|
+
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 900 | 901 | 902;
|
|
2956
2956
|
payload: {
|
|
2957
2957
|
message: string;
|
|
2958
2958
|
};
|
package/dist/index.js
CHANGED
|
@@ -26859,14 +26859,14 @@ class Device extends events.exports {
|
|
|
26859
26859
|
}
|
|
26860
26860
|
connect() {
|
|
26861
26861
|
const env = DataManager.getSettings('env');
|
|
26862
|
-
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
26862
|
+
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
26863
26863
|
if (DataManager.isBleConnect(env)) {
|
|
26864
26864
|
try {
|
|
26865
26865
|
yield this.acquire();
|
|
26866
26866
|
resolve(true);
|
|
26867
26867
|
}
|
|
26868
26868
|
catch (error) {
|
|
26869
|
-
|
|
26869
|
+
reject(error);
|
|
26870
26870
|
}
|
|
26871
26871
|
return;
|
|
26872
26872
|
}
|
|
@@ -26876,7 +26876,7 @@ class Device extends events.exports {
|
|
|
26876
26876
|
resolve(true);
|
|
26877
26877
|
}
|
|
26878
26878
|
catch (error) {
|
|
26879
|
-
|
|
26879
|
+
reject(error);
|
|
26880
26880
|
}
|
|
26881
26881
|
return;
|
|
26882
26882
|
}
|
|
@@ -38865,7 +38865,7 @@ class DeviceConnector {
|
|
|
38865
38865
|
return res;
|
|
38866
38866
|
}
|
|
38867
38867
|
catch (error) {
|
|
38868
|
-
Log$2.
|
|
38868
|
+
Log$2.error('acquire error: ', error.message);
|
|
38869
38869
|
safeThrowError(error);
|
|
38870
38870
|
}
|
|
38871
38871
|
});
|
|
@@ -39425,7 +39425,11 @@ const ensureConnected = (_context, method, pollingId, abortSignal) => __awaiter(
|
|
|
39425
39425
|
}
|
|
39426
39426
|
catch (error) {
|
|
39427
39427
|
Log.debug('device list error: ', error);
|
|
39428
|
-
if ([
|
|
39428
|
+
if ([
|
|
39429
|
+
hdShared.HardwareErrorCode.BridgeNotInstalled,
|
|
39430
|
+
hdShared.HardwareErrorCode.BridgeTimeoutError,
|
|
39431
|
+
hdShared.HardwareErrorCode.BridgeNeedsPermission,
|
|
39432
|
+
].includes(error.errorCode)) {
|
|
39429
39433
|
_deviceList = undefined;
|
|
39430
39434
|
reject(error);
|
|
39431
39435
|
return;
|
|
@@ -39484,6 +39488,7 @@ const ensureConnected = (_context, method, pollingId, abortSignal) => __awaiter(
|
|
|
39484
39488
|
hdShared.HardwareErrorCode.DeviceDetectInBootloaderMode,
|
|
39485
39489
|
hdShared.HardwareErrorCode.BleCharacteristicNotifyChangeFailure,
|
|
39486
39490
|
hdShared.HardwareErrorCode.WebDeviceNotFoundOrNeedsPermission,
|
|
39491
|
+
hdShared.HardwareErrorCode.BridgeNeedsPermission,
|
|
39487
39492
|
].includes(error.errorCode)) {
|
|
39488
39493
|
reject(error);
|
|
39489
39494
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14-alpha.0",
|
|
4
4
|
"description": "Core processes and APIs for communicating with OneKey hardware devices.",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@onekeyfe/hd-shared": "1.1.
|
|
29
|
-
"@onekeyfe/hd-transport": "1.1.
|
|
28
|
+
"@onekeyfe/hd-shared": "1.1.14-alpha.0",
|
|
29
|
+
"@onekeyfe/hd-transport": "1.1.14-alpha.0",
|
|
30
30
|
"axios": "1.12.2",
|
|
31
31
|
"bignumber.js": "^9.0.2",
|
|
32
32
|
"bytebuffer": "^5.0.1",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"@types/web-bluetooth": "^0.0.21",
|
|
47
47
|
"ripple-keypairs": "^1.3.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "cde48372296ce37cba3ed627f3fcfd65071d22f2"
|
|
50
50
|
}
|
package/src/core/index.ts
CHANGED
|
@@ -671,9 +671,11 @@ const ensureConnected = async (
|
|
|
671
671
|
} catch (error) {
|
|
672
672
|
Log.debug('device list error: ', error);
|
|
673
673
|
if (
|
|
674
|
-
[
|
|
675
|
-
|
|
676
|
-
|
|
674
|
+
[
|
|
675
|
+
HardwareErrorCode.BridgeNotInstalled,
|
|
676
|
+
HardwareErrorCode.BridgeTimeoutError,
|
|
677
|
+
HardwareErrorCode.BridgeNeedsPermission,
|
|
678
|
+
].includes(error.errorCode)
|
|
677
679
|
) {
|
|
678
680
|
_deviceList = undefined;
|
|
679
681
|
reject(error);
|
|
@@ -740,6 +742,7 @@ const ensureConnected = async (
|
|
|
740
742
|
HardwareErrorCode.DeviceDetectInBootloaderMode,
|
|
741
743
|
HardwareErrorCode.BleCharacteristicNotifyChangeFailure,
|
|
742
744
|
HardwareErrorCode.WebDeviceNotFoundOrNeedsPermission,
|
|
745
|
+
HardwareErrorCode.BridgeNeedsPermission,
|
|
743
746
|
].includes(error.errorCode)
|
|
744
747
|
) {
|
|
745
748
|
reject(error);
|
package/src/device/Device.ts
CHANGED
|
@@ -205,13 +205,13 @@ export class Device extends EventEmitter {
|
|
|
205
205
|
connect() {
|
|
206
206
|
const env = DataManager.getSettings('env');
|
|
207
207
|
// eslint-disable-next-line no-async-promise-executor
|
|
208
|
-
return new Promise<boolean>(async resolve => {
|
|
208
|
+
return new Promise<boolean>(async (resolve, reject) => {
|
|
209
209
|
if (DataManager.isBleConnect(env)) {
|
|
210
210
|
try {
|
|
211
211
|
await this.acquire();
|
|
212
212
|
resolve(true);
|
|
213
213
|
} catch (error) {
|
|
214
|
-
|
|
214
|
+
reject(error);
|
|
215
215
|
}
|
|
216
216
|
return;
|
|
217
217
|
}
|
|
@@ -221,7 +221,7 @@ export class Device extends EventEmitter {
|
|
|
221
221
|
await this.acquire();
|
|
222
222
|
resolve(true);
|
|
223
223
|
} catch (error) {
|
|
224
|
-
|
|
224
|
+
reject(error);
|
|
225
225
|
}
|
|
226
226
|
return;
|
|
227
227
|
}
|