@onekeyfe/hd-web-sdk 0.1.7 → 0.1.8

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.
@@ -14132,7 +14132,8 @@ const UI_REQUEST$1 = {
14132
14132
  CLOSE_UI_WINDOW: 'ui-close_window',
14133
14133
  BLUETOOTH_PERMISSION: 'ui-bluetooth_permission',
14134
14134
  LOCATION_PERMISSION: 'ui-location_permission',
14135
- FIRMWARE_PROGRESS: 'ui-firmware-progress'
14135
+ FIRMWARE_PROGRESS: 'ui-firmware-progress',
14136
+ NOT_IN_BOOTLOADER: 'ui-device_not_in_bootloader_mode'
14136
14137
  };
14137
14138
 
14138
14139
  const createUiMessage = (type, payload) => ({
@@ -18580,6 +18581,10 @@ const callAPI = message => __awaiter(void 0, void 0, void 0, function* () {
18580
18581
  const unexpectedMode = device.hasUnexpectedMode(method.allowDeviceMode, method.requireDeviceMode);
18581
18582
 
18582
18583
  if (unexpectedMode) {
18584
+ if (unexpectedMode === UI_REQUEST$1.NOT_IN_BOOTLOADER) {
18585
+ return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceUnexpectedBootloaderMode));
18586
+ }
18587
+
18583
18588
  return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceUnexpectedMode, unexpectedMode));
18584
18589
  }
18585
18590
 
@@ -20067,6 +20072,7 @@ const HardwareErrorCode = {
20067
20072
  DeviceNotFound: 105,
20068
20073
  DeviceInitializeFailed: 106,
20069
20074
  DeviceInterruptedFromOutside: 107,
20075
+ DeviceUnexpectedBootloaderMode: 108,
20070
20076
  NotInitialized: 200,
20071
20077
  IFrameNotInitialized: 300,
20072
20078
  IFrameAleradyInitialized: 301,
@@ -20107,6 +20113,7 @@ const HardwareErrorCodeMessage = {
20107
20113
  [HardwareErrorCode.DeviceNotFound]: 'Device not found',
20108
20114
  [HardwareErrorCode.DeviceInitializeFailed]: 'Device initialization failed',
20109
20115
  [HardwareErrorCode.DeviceInterruptedFromOutside]: 'Device interrupted',
20116
+ [HardwareErrorCode.DeviceUnexpectedBootloaderMode]: 'Device should be in bootloader mode',
20110
20117
  [HardwareErrorCode.NotInitialized]: 'Not initialized',
20111
20118
  [HardwareErrorCode.IFrameNotInitialized]: 'IFrame not initialized',
20112
20119
  [HardwareErrorCode.IFrameAleradyInitialized]: 'IFrame alerady initialized',