@onekeyfe/hd-transport-react-native 1.0.8-alpha.0 → 1.0.8-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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,UAAU,IAAI,aAAa,EAC3B,MAAM,EAEN,cAAc,EAEf,MAAM,gCAAgC,CAAC;AAExC,OAAO,SAAkD,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAkB,QAAQ,EAA6B,MAAM,qBAAqB,CAAC;AAC1F,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;AAavC,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAoBjE,MAAM,CAAC,OAAO,OAAO,uBAAuB;IAC1C,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IAEzC,SAAS,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IAEnE,UAAU,UAAS;IAEnB,OAAO,UAAS;IAEhB,WAAW,SAAQ;IAEnB,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAExC,GAAG,CAAC,EAAE,GAAG,CAAC;IAEV,OAAO,CAAC,EAAE,YAAY,CAAC;gBAEX,OAAO,EAAE,gBAAgB;IAIrC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,YAAY;IAKvC,SAAS,CAAC,UAAU,EAAE,GAAG;IAMzB,MAAM;IAIN,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC;IAYjC,SAAS;IA6FT,OAAO,CAAC,KAAK,EAAE,eAAe;;;IAwMpC,sBAAsB,CAAC,cAAc,EAAE,cAAc;IAiF/C,OAAO,CAAC,IAAI,EAAE,MAAM;IAepB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAA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OAAO,CAAC;IA+FpE,IAAI;IAIJ,MAAM;CAOP"}
package/dist/index.js CHANGED
@@ -462,7 +462,7 @@ class ReactNativeBleTransport {
462
462
  let bufferLength = 0;
463
463
  let buffer$1 = [];
464
464
  const subscription = characteristic.monitor((error, c) => {
465
- var _a, _b, _c, _d, _e, _f, _g, _h;
465
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
466
466
  if (error) {
467
467
  this.Log.debug(`error monitor ${characteristic.uuid}, deviceId: ${characteristic.deviceID}: ${error}`);
468
468
  if (this.runPromise) {
@@ -474,12 +474,13 @@ class ReactNativeBleTransport {
474
474
  ERROR = hdShared.HardwareErrorCode.BleDeviceBondError;
475
475
  }
476
476
  if (((_c = error.reason) === null || _c === void 0 ? void 0 : _c.includes('Cannot write client characteristic config descriptor')) ||
477
- ((_d = error.reason) === null || _d === void 0 ? void 0 : _d.includes('Cannot find client characteristic config descriptor'))) {
478
- this.runPromise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.BleCharacteristicNotifyChangeFailure, (_e = error.message) !== null && _e !== void 0 ? _e : error.reason));
477
+ ((_d = error.reason) === null || _d === void 0 ? void 0 : _d.includes('Cannot find client characteristic config descriptor')) ||
478
+ ((_e = error.reason) === null || _e === void 0 ? void 0 : _e.includes('The handle is invalid'))) {
479
+ this.runPromise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.BleCharacteristicNotifyChangeFailure, (_f = error.message) !== null && _f !== void 0 ? _f : error.reason));
479
480
  this.Log.debug(`${hdShared.HardwareErrorCode.BleCharacteristicNotifyChangeFailure} ${error.message} ${error.reason}`);
480
481
  return;
481
482
  }
482
- this.runPromise.reject(hdShared.ERRORS.TypedError(ERROR, (_f = error.reason) !== null && _f !== void 0 ? _f : error.message));
483
+ this.runPromise.reject(hdShared.ERRORS.TypedError(ERROR, (_g = error.reason) !== null && _g !== void 0 ? _g : error.message));
483
484
  this.Log.debug(': monitor notify error, and has unreleased Promise');
484
485
  }
485
486
  return;
@@ -500,12 +501,12 @@ class ReactNativeBleTransport {
500
501
  const value = buffer.Buffer.from(buffer$1);
501
502
  bufferLength = 0;
502
503
  buffer$1 = [];
503
- (_g = this.runPromise) === null || _g === void 0 ? void 0 : _g.resolve(value.toString('hex'));
504
+ (_h = this.runPromise) === null || _h === void 0 ? void 0 : _h.resolve(value.toString('hex'));
504
505
  }
505
506
  }
506
507
  catch (error) {
507
508
  this.Log.debug('monitor data error: ', error);
508
- (_h = this.runPromise) === null || _h === void 0 ? void 0 : _h.reject(error);
509
+ (_j = this.runPromise) === null || _j === void 0 ? void 0 : _j.reject(error);
509
510
  }
510
511
  });
511
512
  return () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-transport-react-native",
3
- "version": "1.0.8-alpha.0",
3
+ "version": "1.0.8-alpha.2",
4
4
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -19,10 +19,10 @@
19
19
  "lint:fix": "eslint . --fix"
20
20
  },
21
21
  "dependencies": {
22
- "@onekeyfe/hd-shared": "^1.0.8-alpha.0",
23
- "@onekeyfe/hd-transport": "^1.0.8-alpha.0",
22
+ "@onekeyfe/hd-shared": "^1.0.8-alpha.2",
23
+ "@onekeyfe/hd-transport": "^1.0.8-alpha.2",
24
24
  "@onekeyfe/react-native-ble-plx": "3.0.1",
25
25
  "react-native-ble-manager": "^8.1.0"
26
26
  },
27
- "gitHead": "5e68522825bfe3e42fac05c795fbee6caa7cc260"
27
+ "gitHead": "39db80138450ed72f7539506b6fd990f6e3dbe27"
28
28
  }
package/src/index.ts CHANGED
@@ -408,7 +408,8 @@ export default class ReactNativeBleTransport {
408
408
  }
409
409
  if (
410
410
  error.reason?.includes('Cannot write client characteristic config descriptor') ||
411
- error.reason?.includes('Cannot find client characteristic config descriptor')
411
+ error.reason?.includes('Cannot find client characteristic config descriptor') ||
412
+ error.reason?.includes('The handle is invalid')
412
413
  ) {
413
414
  this.runPromise.reject(
414
415
  ERRORS.TypedError(