@onekeyfe/hd-core
Advanced tools
Comparing version 0.1.47 to 0.1.48
@@ -1,2 +0,2 @@ | ||
import { Transport, Messages } from '@onekeyfe/hd-transport'; | ||
import type { Transport, Messages } from '@onekeyfe/hd-transport'; | ||
import type { Device } from './Device'; | ||
@@ -3,0 +3,0 @@ declare type MessageType = Messages.MessageType; |
{ | ||
"name": "@onekeyfe/hd-core", | ||
"version": "0.1.47", | ||
"version": "0.1.48", | ||
"description": "> TODO: description", | ||
@@ -27,4 +27,4 @@ "author": "OneKey", | ||
"dependencies": { | ||
"@onekeyfe/hd-shared": "^0.1.47", | ||
"@onekeyfe/hd-transport": "^0.1.47", | ||
"@onekeyfe/hd-shared": "^0.1.48", | ||
"@onekeyfe/hd-transport": "^0.1.48", | ||
"axios": "^0.27.2", | ||
@@ -40,3 +40,3 @@ "bignumber.js": "^9.0.2", | ||
}, | ||
"gitHead": "66d6a45a4b761292ca21ddf8e0d1c192d3756529" | ||
"gitHead": "591633098720e2845ecfbe95460b5f7bc2d15e5b" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { Transport, Messages, FailureType } from '@onekeyfe/hd-transport'; | ||
import type { Transport, Messages } from '@onekeyfe/hd-transport'; | ||
import { ERRORS, HardwareError, HardwareErrorCode } from '@onekeyfe/hd-shared'; | ||
@@ -146,23 +146,22 @@ import TransportManager from '../data-manager/TransportManager'; | ||
if (res.type === 'Failure') { | ||
const { code } = res.message; | ||
const { message } = res.message; | ||
const { code, message } = res.message; | ||
let error: HardwareError | null = null; | ||
// Model One does not send any message in firmware update | ||
if (code === FailureType.Failure_FirmwareError && !message) { | ||
if (code === 'Failure_FirmwareError' && !message) { | ||
error = ERRORS.TypedError(HardwareErrorCode.FirmwareError); | ||
} | ||
// Failure_ActionCancelled message could be also missing | ||
if (code === FailureType.Failure_ActionCancelled) { | ||
if (code === 'Failure_ActionCancelled') { | ||
error = ERRORS.TypedError(HardwareErrorCode.ActionCancelled); | ||
} | ||
if (code === FailureType.Failure_PinInvalid) { | ||
if (code === 'Failure_PinInvalid') { | ||
error = ERRORS.TypedError(HardwareErrorCode.PinInvalid, message); | ||
} | ||
if (code === FailureType.Failure_PinCancelled) { | ||
if (code === 'Failure_PinCancelled') { | ||
error = ERRORS.TypedError(HardwareErrorCode.PinCancelled); | ||
} | ||
if (code === FailureType.Failure_DataError && message === 'Please confirm the BlindSign enabled') { | ||
if (code === 'Failure_DataError' && message === 'Please confirm the BlindSign enabled') { | ||
error = ERRORS.TypedError(HardwareErrorCode.BlindSignDisabled); | ||
@@ -169,0 +168,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1244978
38077