@onekeyfe/hd-web-sdk 0.1.47 → 0.1.49

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.
@@ -4027,14 +4027,14 @@ var semver = __webpack_require__(7699);
4027
4027
 
4028
4028
  var hdShared = __webpack_require__(8402);
4029
4029
 
4030
- var hdTransport = __webpack_require__(7495);
4031
-
4032
4030
  var axios = __webpack_require__(9644);
4033
4031
 
4034
4032
  var BigNumber = __webpack_require__(6391);
4035
4033
 
4036
4034
  var sha256 = __webpack_require__(1965);
4037
4035
 
4036
+ var hdTransport = __webpack_require__(7495);
4037
+
4038
4038
  function _interopDefaultLegacy(e) {
4039
4039
  return e && typeof e === 'object' && 'default' in e ? e : {
4040
4040
  'default': e
@@ -15318,30 +15318,28 @@ class DeviceCommands {
15318
15318
 
15319
15319
  if (res.type === 'Failure') {
15320
15320
  const {
15321
- code
15322
- } = res.message;
15323
- const {
15321
+ code,
15324
15322
  message
15325
15323
  } = res.message;
15326
15324
  let error = null;
15327
15325
 
15328
- if (code === hdTransport.FailureType.Failure_FirmwareError && !message) {
15326
+ if (code === 'Failure_FirmwareError' && !message) {
15329
15327
  error = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FirmwareError);
15330
15328
  }
15331
15329
 
15332
- if (code === hdTransport.FailureType.Failure_ActionCancelled) {
15330
+ if (code === 'Failure_ActionCancelled') {
15333
15331
  error = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.ActionCancelled);
15334
15332
  }
15335
15333
 
15336
- if (code === hdTransport.FailureType.Failure_PinInvalid) {
15334
+ if (code === 'Failure_PinInvalid') {
15337
15335
  error = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.PinInvalid, message);
15338
15336
  }
15339
15337
 
15340
- if (code === hdTransport.FailureType.Failure_PinCancelled) {
15338
+ if (code === 'Failure_PinCancelled') {
15341
15339
  error = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.PinCancelled);
15342
15340
  }
15343
15341
 
15344
- if (code === hdTransport.FailureType.Failure_DataError && message === 'Please confirm the BlindSign enabled') {
15342
+ if (code === 'Failure_DataError' && message === 'Please confirm the BlindSign enabled') {
15345
15343
  error = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.BlindSignDisabled);
15346
15344
  }
15347
15345
 
@@ -45608,7 +45606,7 @@ try {
45608
45606
  /***/ ((module) => {
45609
45607
 
45610
45608
  "use strict";
45611
- module.exports = JSON.parse('{"name":"@onekeyfe/hd-core","version":"0.1.47","description":"> TODO: description","author":"OneKey","homepage":"https://github.com/OneKeyHQ/hardware-js-sdk#readme","license":"ISC","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/OneKeyHQ/hardware-js-sdk.git"},"publishConfig":{"access":"public"},"scripts":{"dev":"rimraf dist && rollup -c ../../build/rollup.config.js -w","build":"rimraf dist && rollup -c ../../build/rollup.config.js","lint":"eslint .","lint:fix":"eslint . --fix"},"bugs":{"url":"https://github.com/OneKeyHQ/hardware-js-sdk/issues"},"dependencies":{"@onekeyfe/hd-shared":"^0.1.47","@onekeyfe/hd-transport":"^0.1.47","axios":"^0.27.2","bignumber.js":"^9.0.2","js-sha256":"^0.9.0","parse-uri":"^1.0.7","semver":"^7.3.7"},"devDependencies":{"@types/parse-uri":"^1.0.0","@types/semver":"^7.3.9"}}');
45609
+ module.exports = JSON.parse('{"name":"@onekeyfe/hd-core","version":"0.1.49","description":"> TODO: description","author":"OneKey","homepage":"https://github.com/OneKeyHQ/hardware-js-sdk#readme","license":"ISC","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/OneKeyHQ/hardware-js-sdk.git"},"publishConfig":{"access":"public"},"scripts":{"dev":"rimraf dist && rollup -c ../../build/rollup.config.js -w","build":"rimraf dist && rollup -c ../../build/rollup.config.js","lint":"eslint .","lint:fix":"eslint . --fix"},"bugs":{"url":"https://github.com/OneKeyHQ/hardware-js-sdk/issues"},"dependencies":{"@onekeyfe/hd-shared":"^0.1.49","@onekeyfe/hd-transport":"^0.1.49","axios":"^0.27.2","bignumber.js":"^9.0.2","js-sha256":"^0.9.0","parse-uri":"^1.0.7","semver":"^7.3.7"},"devDependencies":{"@types/parse-uri":"^1.0.0","@types/semver":"^7.3.9"}}');
45612
45610
 
45613
45611
  /***/ })
45614
45612
 
@@ -48140,7 +48138,7 @@ const src_init = async settings => {
48140
48138
 
48141
48139
  try {
48142
48140
  await init({ ..._settings,
48143
- version: "0.1.47"
48141
+ version: "0.1.49"
48144
48142
  });
48145
48143
  return true;
48146
48144
  } catch (e) {
@@ -48160,7 +48158,13 @@ const call = async params => {
48160
48158
  src_Log.debug("Try to recreate iframe if it's initialize failed: ", _settings);
48161
48159
 
48162
48160
  try {
48163
- await src_init(_settings);
48161
+ const initResult = await src_init(_settings);
48162
+
48163
+ if (!initResult) {
48164
+ src_Log.debug('Recreate iframe failed');
48165
+ return (0,dist/* createErrorMessage */.xG)(shared_dist.ERRORS.TypedError(shared_dist.HardwareErrorCode.IFrameLoadFail));
48166
+ }
48167
+
48164
48168
  src_Log.debug('Recreate iframe success');
48165
48169
  } catch (error) {
48166
48170
  src_Log.debug('Recreate iframe failed: ', error);