@onekeyfe/hd-core 1.1.12-alpha.0 → 1.1.12-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/api/FirmwareUpdateV3.d.ts.map +1 -1
- package/dist/api/evm/latest/signTransaction.d.ts.map +1 -1
- package/dist/device/DeviceCommands.d.ts +4 -4
- package/dist/device/DeviceCommands.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +26 -8
- package/package.json +4 -4
- package/src/api/FirmwareUpdateV3.ts +13 -3
- package/src/api/evm/latest/signTransaction.ts +0 -15
- package/src/data/messages/messages.json +2 -1
- package/src/device/DeviceCommands.ts +27 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirmwareUpdateV3.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAgD,MAAM,qBAAqB,CAAC;AAgB7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAM/E,eAAO,MAAM,gCAAgC,UAAU,CAAC;AAaxD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,wBAAwB,CAAC,sBAAsB,CAAC;IAC5F,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAE1C,IAAI;IAiCE,GAAG;;;;;IA2CT,OAAO,CAAC,wBAAwB;YAiBlB,qBAAqB;YAmBrB,uBAAuB;YAiBvB,2BAA2B;YA+C3B,aAAa;
|
|
1
|
+
{"version":3,"file":"FirmwareUpdateV3.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAgD,MAAM,qBAAqB,CAAC;AAgB7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAM/E,eAAO,MAAM,gCAAgC,UAAU,CAAC;AAaxD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,wBAAwB,CAAC,sBAAsB,CAAC;IAC5F,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAE1C,IAAI;IAiCE,GAAG;;;;;IA2CT,OAAO,CAAC,wBAAwB;YAiBlB,qBAAqB;YAmBrB,uBAAuB;YAiBvB,2BAA2B;YA+C3B,aAAa;IAyKrB,sBAAsB,CAAC,OAAO,EAAE,MAAM;CAoD7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signTransaction.d.ts","sourceRoot":"","sources":["../../../../src/api/evm/latest/signTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,iBAAiB,EACjB,uBAAuB,EAEvB,SAAS,EACV,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAIxB,eAAO,MAAM,gBAAgB;eAOhB,SAAS;aACX,uBAAuB,GAAG,iBAAiB;UAC9C,MAAM;cACF,MAAM,GAAG,SAAS;;MAE1B,QAAQ,WAAW,CA4DtB,CAAC;AAEF,eAAO,MAAM,SAAS;eAMT,SAAS;cACV,MAAM,EAAE;QACd,cAAc;;0BAgDnB,CAAC;AAEF,eAAO,MAAM,gBAAgB;eAMhB,SAAS;cACV,MAAM,EAAE;QACd,qBAAqB;;0BA4C1B,CAAC;AAEF,eAAO,MAAM,gBAAgB;eAMhB,SAAS;cACV,MAAM,EAAE;QACd,qBAAqB;;
|
|
1
|
+
{"version":3,"file":"signTransaction.d.ts","sourceRoot":"","sources":["../../../../src/api/evm/latest/signTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,iBAAiB,EACjB,uBAAuB,EAEvB,SAAS,EACV,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAIxB,eAAO,MAAM,gBAAgB;eAOhB,SAAS;aACX,uBAAuB,GAAG,iBAAiB;UAC9C,MAAM;cACF,MAAM,GAAG,SAAS;;MAE1B,QAAQ,WAAW,CA4DtB,CAAC;AAEF,eAAO,MAAM,SAAS;eAMT,SAAS;cACV,MAAM,EAAE;QACd,cAAc;;0BAgDnB,CAAC;AAEF,eAAO,MAAM,gBAAgB;eAMhB,SAAS;cACV,MAAM,EAAE;QACd,qBAAqB;;0BA4C1B,CAAC;AAEF,eAAO,MAAM,gBAAgB;eAMhB,SAAS;cACV,MAAM,EAAE;QACd,qBAAqB;;0BAiE1B,CAAC;AAEF,eAAO,MAAM,eAAe;cAOhB,MAAM,EAAE;QACd,cAAc,GAAG,qBAAqB,GAAG,qBAAqB;eACvD,OAAO;;eAEP,SAAS;0BAQrB,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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 900 | 901 | 902;
|
|
101
101
|
payload: {
|
|
102
102
|
message: string;
|
|
103
103
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceCommands.d.ts","sourceRoot":"","sources":["../../src/device/DeviceCommands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAe,MAAM,wBAAwB,CAAC;AAK/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAU,KAAK,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAGlE,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;AACxC,KAAK,UAAU,GAAG,MAAM,WAAW,CAAC;AACpC,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,UAAU,IAAI;IACvD,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;CACzB,CAAC;AACF,KAAK,oBAAoB,GAAG;KACzB,CAAC,IAAI,MAAM,WAAW,GAAG,oBAAoB,CAAC,CAAC,CAAC;CAClD,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,CAAC,MAAM,WAAW,CAAC,CAAC;AAY7E,eAAO,MAAM,oBAAoB,WAAY,MAAM;;;;;;;;;;;;;;;;;;EA0ClD,CAAC;AAEF,eAAO,MAAM,0BAA0B,WAAY,MAAM;;;;;;;;;;;;;;;;;;EAgCxD,CAAC;AAQF,qBAAa,cAAc;IACzB,MAAM,EAAE,MAAM,CAAC;IAEf,SAAS,EAAE,SAAS,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IAEf,QAAQ,EAAE,OAAO,CAAC;IAElB,W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C,CAAC,GACnB,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAE3C,SAAS,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,UAAU,EAClD,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,CAAC,EACV,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAmE7B,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,sBAAsB,CAAC,SAAS,CAAC;IAK3E,kBAAkB,CAChB,GAAG,EAAE,sBAAsB,EAC3B,QAAQ,EAAE,UAAU,GACnB,OAAO,CAAC,sBAAsB,CAAC;IAoJlC,UAAU,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,oBAAoB;IA2C/C,iBAAiB,CAAC,OAAO,EAAE,wBAAwB;CA+CpD;AAED,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2934,7 +2934,7 @@ declare class DeviceCommands {
|
|
|
2934
2934
|
};
|
|
2935
2935
|
} | {
|
|
2936
2936
|
success: boolean;
|
|
2937
|
-
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 | 900 | 901 | 902;
|
|
2937
|
+
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;
|
|
2938
2938
|
payload: {
|
|
2939
2939
|
message: string;
|
|
2940
2940
|
};
|
|
@@ -2953,7 +2953,7 @@ declare class DeviceCommands {
|
|
|
2953
2953
|
};
|
|
2954
2954
|
} | {
|
|
2955
2955
|
success: boolean;
|
|
2956
|
-
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 | 900 | 901 | 902;
|
|
2956
|
+
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;
|
|
2957
2957
|
payload: {
|
|
2958
2958
|
message: string;
|
|
2959
2959
|
};
|
package/dist/index.js
CHANGED
|
@@ -4419,7 +4419,8 @@ var nested$1 = {
|
|
|
4419
4419
|
PinMatrixRequestType_WipeCodeFirst: 4,
|
|
4420
4420
|
PinMatrixRequestType_WipeCodeSecond: 5,
|
|
4421
4421
|
PinMatrixRequestType_BackupFirst: 6,
|
|
4422
|
-
PinMatrixRequestType_BackupSecond: 7
|
|
4422
|
+
PinMatrixRequestType_BackupSecond: 7,
|
|
4423
|
+
PinMatrixRequestType_AttachToPin: 8000
|
|
4423
4424
|
}
|
|
4424
4425
|
}
|
|
4425
4426
|
}
|
|
@@ -26597,6 +26598,20 @@ class DeviceCommands {
|
|
|
26597
26598
|
if (this.disposed) {
|
|
26598
26599
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'typedCall: DeviceCommands already disposed');
|
|
26599
26600
|
}
|
|
26601
|
+
try {
|
|
26602
|
+
const skipTypes = [
|
|
26603
|
+
'ButtonAck',
|
|
26604
|
+
'PinMatrixAck',
|
|
26605
|
+
'PassphraseAck',
|
|
26606
|
+
'Cancel',
|
|
26607
|
+
'BixinPinInputOnDevice',
|
|
26608
|
+
];
|
|
26609
|
+
if (!skipTypes.includes(type) && msg) {
|
|
26610
|
+
Log$b.debug('[DeviceCommands] [typedCall] Sending payload', type, msg);
|
|
26611
|
+
}
|
|
26612
|
+
}
|
|
26613
|
+
catch (e) {
|
|
26614
|
+
}
|
|
26600
26615
|
const response = yield this._commonCall(type, msg);
|
|
26601
26616
|
try {
|
|
26602
26617
|
assertType(response, resType);
|
|
@@ -26668,6 +26683,12 @@ class DeviceCommands {
|
|
|
26668
26683
|
error = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DataOverload);
|
|
26669
26684
|
}
|
|
26670
26685
|
}
|
|
26686
|
+
if (code === 'Failure_ProcessError') {
|
|
26687
|
+
if ((message === null || message === void 0 ? void 0 : message.includes('Bootloader file verify failed')) ||
|
|
26688
|
+
(message === null || message === void 0 ? void 0 : message.includes('verify failed'))) {
|
|
26689
|
+
error = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FirmwareVerificationFailed, message);
|
|
26690
|
+
}
|
|
26691
|
+
}
|
|
26671
26692
|
if (code === 'Failure_UnexpectedMessage') {
|
|
26672
26693
|
if (callType === 'PassphraseAck') {
|
|
26673
26694
|
error = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.UnexpectPassphrase);
|
|
@@ -29915,10 +29936,11 @@ class FirmwareUpdateV3 extends FirmwareUpdateBaseMethod {
|
|
|
29915
29936
|
});
|
|
29916
29937
|
}
|
|
29917
29938
|
catch (error) {
|
|
29918
|
-
|
|
29919
|
-
if (error.errorCode) {
|
|
29939
|
+
Log$4.error('triggerFirmwareUpdateEmmc error: ', error);
|
|
29940
|
+
if (error === null || error === void 0 ? void 0 : error.errorCode) {
|
|
29920
29941
|
const unexpectedError = [
|
|
29921
29942
|
hdShared.HardwareErrorCode.ActionCancelled,
|
|
29943
|
+
hdShared.HardwareErrorCode.FirmwareVerificationFailed,
|
|
29922
29944
|
hdShared.HardwareErrorCode.BleDeviceNotBonded,
|
|
29923
29945
|
hdShared.HardwareErrorCode.BleServiceNotFound,
|
|
29924
29946
|
hdShared.HardwareErrorCode.BlePoweredOff,
|
|
@@ -29935,7 +29957,7 @@ class FirmwareUpdateV3 extends FirmwareUpdateBaseMethod {
|
|
|
29935
29957
|
throw error;
|
|
29936
29958
|
}
|
|
29937
29959
|
}
|
|
29938
|
-
|
|
29960
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FirmwareError, (error === null || error === void 0 ? void 0 : error.message) || 'Firmware update failed');
|
|
29939
29961
|
}
|
|
29940
29962
|
yield hdShared.wait(1500);
|
|
29941
29963
|
this.postProcessingMessage('firmware');
|
|
@@ -32335,10 +32357,6 @@ const evmSignTxEip1559 = ({ typedCall, addressN, tx, supportTrezor, }) => __awai
|
|
|
32335
32357
|
});
|
|
32336
32358
|
const evmSignTxEip7702 = ({ typedCall, addressN, tx, supportTrezor, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32337
32359
|
const { to, value, gasLimit, nonce, data, chainId, maxFeePerGas, maxPriorityFeePerGas, accessList, authorizationList, } = tx;
|
|
32338
|
-
const hasNonSelfSponsoring = authorizationList.some(auth => auth.addressN && auth.addressN.join('/') !== addressN.join('/'));
|
|
32339
|
-
if (hasNonSelfSponsoring) {
|
|
32340
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodError, 'Hardware currently only supports self-sponsoring EIP-7702 transactions. All authorization entries must be signed by the same account as the transaction.');
|
|
32341
|
-
}
|
|
32342
32360
|
const length = data == null ? 0 : data.length / 2;
|
|
32343
32361
|
const [first, rest] = cutString(data, 1024 * 2);
|
|
32344
32362
|
const message = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "1.1.12-alpha.
|
|
3
|
+
"version": "1.1.12-alpha.2",
|
|
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.12-alpha.
|
|
29
|
-
"@onekeyfe/hd-transport": "1.1.12-alpha.
|
|
28
|
+
"@onekeyfe/hd-shared": "1.1.12-alpha.2",
|
|
29
|
+
"@onekeyfe/hd-transport": "1.1.12-alpha.2",
|
|
30
30
|
"axios": "^0.27.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": "6cd77ab9443746cdfa885103b28fc2b546f1828e"
|
|
50
50
|
}
|
|
@@ -283,10 +283,13 @@ export default class FirmwareUpdateV3 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
283
283
|
path: '0:updates',
|
|
284
284
|
});
|
|
285
285
|
} catch (error) {
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
Log.error('triggerFirmwareUpdateEmmc error: ', error);
|
|
287
|
+
// Re-throw errors with specific error codes that should not be ignored
|
|
288
|
+
if (error?.errorCode) {
|
|
288
289
|
const unexpectedError = [
|
|
289
290
|
HardwareErrorCode.ActionCancelled,
|
|
291
|
+
HardwareErrorCode.FirmwareVerificationFailed,
|
|
292
|
+
// BLE connection errors
|
|
290
293
|
HardwareErrorCode.BleDeviceNotBonded,
|
|
291
294
|
HardwareErrorCode.BleServiceNotFound,
|
|
292
295
|
HardwareErrorCode.BlePoweredOff,
|
|
@@ -297,13 +300,20 @@ export default class FirmwareUpdateV3 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
297
300
|
HardwareErrorCode.BleCharacteristicNotifyError,
|
|
298
301
|
HardwareErrorCode.BleTimeoutError,
|
|
299
302
|
HardwareErrorCode.BleWriteCharacteristicError,
|
|
303
|
+
// Web device errors
|
|
300
304
|
HardwareErrorCode.WebDeviceNotFoundOrNeedsPermission,
|
|
301
305
|
];
|
|
306
|
+
|
|
302
307
|
if (unexpectedError.includes(error.errorCode)) {
|
|
303
308
|
throw error;
|
|
304
309
|
}
|
|
305
310
|
}
|
|
306
|
-
|
|
311
|
+
|
|
312
|
+
// Wrap and re-throw all other errors
|
|
313
|
+
throw ERRORS.TypedError(
|
|
314
|
+
HardwareErrorCode.FirmwareError,
|
|
315
|
+
error?.message || 'Firmware update failed'
|
|
316
|
+
);
|
|
307
317
|
}
|
|
308
318
|
|
|
309
319
|
// wait for 1.5s to ensure the device is in update mode
|
|
@@ -228,21 +228,6 @@ export const evmSignTxEip7702 = async ({
|
|
|
228
228
|
authorizationList,
|
|
229
229
|
} = tx;
|
|
230
230
|
|
|
231
|
-
// Hardware currently only supports self-sponsoring transactions
|
|
232
|
-
// Check if all authorization entries are for self-sponsoring
|
|
233
|
-
const hasNonSelfSponsoring = authorizationList.some(
|
|
234
|
-
auth =>
|
|
235
|
-
// If addressN is provided for this authorization, it should match the transaction signer
|
|
236
|
-
auth.addressN && auth.addressN.join('/') !== addressN.join('/')
|
|
237
|
-
);
|
|
238
|
-
|
|
239
|
-
if (hasNonSelfSponsoring) {
|
|
240
|
-
throw ERRORS.TypedError(
|
|
241
|
-
HardwareErrorCode.CallMethodError,
|
|
242
|
-
'Hardware currently only supports self-sponsoring EIP-7702 transactions. All authorization entries must be signed by the same account as the transaction.'
|
|
243
|
-
);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
231
|
const length = data == null ? 0 : data.length / 2;
|
|
247
232
|
|
|
248
233
|
const [first, rest] = cutString(data, 1024 * 2);
|
|
@@ -3063,7 +3063,8 @@
|
|
|
3063
3063
|
"PinMatrixRequestType_WipeCodeFirst": 4,
|
|
3064
3064
|
"PinMatrixRequestType_WipeCodeSecond": 5,
|
|
3065
3065
|
"PinMatrixRequestType_BackupFirst": 6,
|
|
3066
|
-
"PinMatrixRequestType_BackupSecond": 7
|
|
3066
|
+
"PinMatrixRequestType_BackupSecond": 7,
|
|
3067
|
+
"PinMatrixRequestType_AttachToPin": 8000
|
|
3067
3068
|
}
|
|
3068
3069
|
}
|
|
3069
3070
|
}
|
|
@@ -285,6 +285,23 @@ export class DeviceCommands {
|
|
|
285
285
|
);
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
+
// Structured log of actual outgoing payloads (skip acks)
|
|
289
|
+
try {
|
|
290
|
+
const skipTypes: MessageKey[] = [
|
|
291
|
+
'ButtonAck',
|
|
292
|
+
'PinMatrixAck',
|
|
293
|
+
'PassphraseAck',
|
|
294
|
+
'Cancel',
|
|
295
|
+
'BixinPinInputOnDevice',
|
|
296
|
+
] as any;
|
|
297
|
+
if (!skipTypes.includes(type) && msg) {
|
|
298
|
+
// Use debug channel to avoid noise escalation
|
|
299
|
+
Log.debug('[DeviceCommands] [typedCall] Sending payload', type, msg);
|
|
300
|
+
}
|
|
301
|
+
} catch (e) {
|
|
302
|
+
// ignore logging errors
|
|
303
|
+
}
|
|
304
|
+
|
|
288
305
|
const response = await this._commonCall(type, msg);
|
|
289
306
|
try {
|
|
290
307
|
assertType(response, resType);
|
|
@@ -376,6 +393,16 @@ export class DeviceCommands {
|
|
|
376
393
|
}
|
|
377
394
|
}
|
|
378
395
|
|
|
396
|
+
if (code === 'Failure_ProcessError') {
|
|
397
|
+
// Handle firmware verification failures
|
|
398
|
+
if (
|
|
399
|
+
message?.includes('Bootloader file verify failed') ||
|
|
400
|
+
message?.includes('verify failed')
|
|
401
|
+
) {
|
|
402
|
+
error = ERRORS.TypedError(HardwareErrorCode.FirmwareVerificationFailed, message);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
379
406
|
if (code === 'Failure_UnexpectedMessage') {
|
|
380
407
|
if (callType === 'PassphraseAck') {
|
|
381
408
|
error = ERRORS.TypedError(HardwareErrorCode.UnexpectPassphrase);
|