@onekeyfe/hd-core 1.2.0-alpha.126 → 1.2.0-alpha.127
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.
|
@@ -19,6 +19,22 @@ const createCommands = () => {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
describe('DeviceCommands failure mapping', () => {
|
|
22
|
+
it.each(['File already exists', 'NFT already exists'])(
|
|
23
|
+
'maps duplicate file response "%s" to FileAlreadyExists',
|
|
24
|
+
async message => {
|
|
25
|
+
const commands = createCommands();
|
|
26
|
+
await expect(
|
|
27
|
+
commands._filterCommonTypes(
|
|
28
|
+
{
|
|
29
|
+
type: 'Failure',
|
|
30
|
+
message: { code: 'Failure_DataError', message },
|
|
31
|
+
} as any,
|
|
32
|
+
'NFTUpdate'
|
|
33
|
+
)
|
|
34
|
+
).rejects.toMatchObject({ errorCode: HardwareErrorCode.FileAlreadyExists });
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
|
|
22
38
|
it('logs passphrase request and canonical response without exposing the passphrase', async () => {
|
|
23
39
|
const commands = createCommands();
|
|
24
40
|
const log = getLogger(LoggerNames.DeviceCommands);
|
package/dist/index.js
CHANGED
|
@@ -43830,7 +43830,7 @@ class DeviceCommands {
|
|
|
43830
43830
|
if (message === 'Please confirm the BlindSign enabled') {
|
|
43831
43831
|
error = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.BlindSignDisabled);
|
|
43832
43832
|
}
|
|
43833
|
-
if (message === 'File already exists') {
|
|
43833
|
+
if (message === 'File already exists' || message === 'NFT already exists') {
|
|
43834
43834
|
error = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FileAlreadyExists);
|
|
43835
43835
|
}
|
|
43836
43836
|
if (message === null || message === void 0 ? void 0 : message.includes('bytes overflow')) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.127",
|
|
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.2.0-alpha.
|
|
29
|
-
"@onekeyfe/hd-transport": "1.2.0-alpha.
|
|
28
|
+
"@onekeyfe/hd-shared": "1.2.0-alpha.127",
|
|
29
|
+
"@onekeyfe/hd-transport": "1.2.0-alpha.127",
|
|
30
30
|
"axios": "1.15.2",
|
|
31
31
|
"bignumber.js": "^9.0.2",
|
|
32
32
|
"buffer": "^6.0.3",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"@types/w3c-web-usb": "^1.0.10",
|
|
47
47
|
"@types/web-bluetooth": "^0.0.21"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "55a124eb1fb7bcdfa7890fa19947f2330d687d14"
|
|
50
50
|
}
|
|
@@ -482,7 +482,7 @@ export class DeviceCommands {
|
|
|
482
482
|
if (message === 'Please confirm the BlindSign enabled') {
|
|
483
483
|
error = ERRORS.TypedError(HardwareErrorCode.BlindSignDisabled);
|
|
484
484
|
}
|
|
485
|
-
if (message === 'File already exists') {
|
|
485
|
+
if (message === 'File already exists' || message === 'NFT already exists') {
|
|
486
486
|
error = ERRORS.TypedError(HardwareErrorCode.FileAlreadyExists);
|
|
487
487
|
}
|
|
488
488
|
if (message?.includes('bytes overflow')) {
|