@onekeyfe/hd-core 0.2.49-alpha.1 → 0.2.49-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/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAqBlC,OAAO,EACL,WAAW,EAYZ,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAE7D,OAAO,eAAe,MAAM,2BAA2B,CAAC;AA4BxD,eAAO,MAAM,OAAO,YAAmB,WAAW,iBAiRjD,CAAC;AAqMF,eAAO,MAAM,MAAM,0CAkBlB,CAAC;AAoJF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IACtC,aAAa,CAAC,OAAO,EAAE,WAAW;IA8CxC,OAAO;CAGR;AAED,eAAO,MAAM,QAAQ,YAGpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAIzB,CAAC;AAMF,eAAO,MAAM,IAAI,aAAoB,eAAe,aAAa,GAAG,8BAmBnE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAqBlC,OAAO,EACL,WAAW,EAYZ,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAE7D,OAAO,eAAe,MAAM,2BAA2B,CAAC;AA4BxD,eAAO,MAAM,OAAO,YAAmB,WAAW,iBAgRjD,CAAC;AAqMF,eAAO,MAAM,MAAM,0CAkBlB,CAAC;AAoJF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IACtC,aAAa,CAAC,OAAO,EAAE,WAAW;IA8CxC,OAAO;CAGR;AAED,eAAO,MAAM,QAAQ,YAGpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAIzB,CAAC;AAMF,eAAO,MAAM,IAAI,aAAoB,eAAe,aAAa,GAAG,8BAmBnE,CAAC"}
package/dist/index.js CHANGED
@@ -630,7 +630,8 @@ const topLevelInject = () => {
630
630
  return (_a = lowLevelApi === null || lowLevelApi === void 0 ? void 0 : lowLevelApi.init(settings)) !== null && _a !== void 0 ? _a : Promise.resolve(false);
631
631
  }, call }, createCoreApi(call)), { removeAllListeners: type => {
632
632
  eventEmitter.removeAllListeners(type);
633
- }, dispose: () => lowLevelApi === null || lowLevelApi === void 0 ? void 0 : lowLevelApi.dispose, uiResponse: response => lowLevelApi === null || lowLevelApi === void 0 ? void 0 : lowLevelApi.uiResponse(response), cancel: (connectId) => lowLevelApi === null || lowLevelApi === void 0 ? void 0 : lowLevelApi.cancel(connectId) });
633
+ lowLevelApi === null || lowLevelApi === void 0 ? void 0 : lowLevelApi.removeAllListeners(type);
634
+ }, dispose: () => lowLevelApi === null || lowLevelApi === void 0 ? void 0 : lowLevelApi.dispose(), uiResponse: response => lowLevelApi === null || lowLevelApi === void 0 ? void 0 : lowLevelApi.uiResponse(response), cancel: (connectId) => lowLevelApi === null || lowLevelApi === void 0 ? void 0 : lowLevelApi.cancel(connectId) });
634
635
  return api;
635
636
  };
636
637
 
@@ -19013,7 +19014,7 @@ const cleanup = () => {
19013
19014
  };
19014
19015
  const removeDeviceListener = (device) => {
19015
19016
  device.removeAllListeners();
19016
- DevicePool.emitter.removeListener(DEVICE.CONNECT, onDeviceConnectHandler);
19017
+ DevicePool.emitter.removeAllListeners(DEVICE.CONNECT);
19017
19018
  };
19018
19019
  const closePopup = () => {
19019
19020
  postMessage(createUiMessage(UI_REQUEST$1.CLOSE_UI_WINDOW));
@@ -1 +1 @@
1
- {"version":3,"file":"topLevelInject.d.ts","sourceRoot":"","sources":["../src/topLevelInject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAItC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACvB;AAID,eAAO,MAAM,cAAc,eAwC1B,CAAC"}
1
+ {"version":3,"file":"topLevelInject.d.ts","sourceRoot":"","sources":["../src/topLevelInject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAItC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CACvB;AAID,eAAO,MAAM,cAAc,eAyC1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "0.2.49-alpha.1",
3
+ "version": "0.2.49-alpha.2",
4
4
  "description": "> TODO: description",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -24,8 +24,8 @@
24
24
  "url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
25
25
  },
26
26
  "dependencies": {
27
- "@onekeyfe/hd-shared": "^0.2.49-alpha.1",
28
- "@onekeyfe/hd-transport": "^0.2.49-alpha.1",
27
+ "@onekeyfe/hd-shared": "^0.2.49-alpha.2",
28
+ "@onekeyfe/hd-transport": "^0.2.49-alpha.2",
29
29
  "axios": "^0.27.2",
30
30
  "bignumber.js": "^9.0.2",
31
31
  "bytebuffer": "^5.0.1",
@@ -43,5 +43,5 @@
43
43
  "@types/semver": "^7.3.9",
44
44
  "ripple-keypairs": "^1.1.4"
45
45
  },
46
- "gitHead": "594e89bb20c027cc0280ee68beb68d5ee5437a9b"
46
+ "gitHead": "87d4e6fa857ddd469b069390ed6b00b549ab7759"
47
47
  }
package/src/core/index.ts CHANGED
@@ -336,7 +336,6 @@ export const callAPI = async (message: CoreMessage) => {
336
336
  cleanup();
337
337
 
338
338
  removeDeviceListener(device);
339
- // TODO: 方法执行后,检查队列内是否有等待调用的 API,依次调用
340
339
  }
341
340
  };
342
341
 
@@ -580,7 +579,7 @@ const cleanup = () => {
580
579
 
581
580
  const removeDeviceListener = (device: Device) => {
582
581
  device.removeAllListeners();
583
- DevicePool.emitter.removeListener(DEVICE.CONNECT, onDeviceConnectHandler);
582
+ DevicePool.emitter.removeAllListeners(DEVICE.CONNECT);
584
583
  // DevicePool.emitter.removeListener(DEVICE.DISCONNECT, onDeviceDisconnectHandler);
585
584
  };
586
585
 
@@ -40,9 +40,10 @@ export const topLevelInject = () => {
40
40
 
41
41
  removeAllListeners: type => {
42
42
  eventEmitter.removeAllListeners(type);
43
+ lowLevelApi?.removeAllListeners(type);
43
44
  },
44
45
 
45
- dispose: () => lowLevelApi?.dispose,
46
+ dispose: () => lowLevelApi?.dispose(),
46
47
 
47
48
  uiResponse: response => lowLevelApi?.uiResponse(response),
48
49