@onekeyfe/hd-ble-sdk 0.1.0 → 0.1.3

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":"AACA,OAAoB,EAYlB,QAAQ,EAMT,MAAM,mBAAmB,CAAC;AAa3B,eAAO,MAAM,eAAe,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;CAAO,CAAC;AAwGpE,QAAA,MAAM,cAAc,qCAOlB,CAAC;AAEH,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAoB,EAYlB,QAAQ,EAMT,MAAM,mBAAmB,CAAC;AAa3B,eAAO,MAAM,eAAe,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;CAAO,CAAC;AA2GpE,QAAA,MAAM,cAAc,qCAOlB,CAAC;AAEH,eAAe,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -528,7 +528,11 @@ const uiResponse = (response) => {
528
528
  const { type, payload } = response;
529
529
  _core.handleMessage({ event: HardwareSdk.UI_EVENT, type, payload });
530
530
  };
531
- const cancel = () => { };
531
+ const cancel = (connectId) => {
532
+ if (_core === undefined)
533
+ return;
534
+ _core.handleMessage({ event: HardwareSdk.IFRAME.CANCEL, type: HardwareSdk.IFRAME.CANCEL, payload: { connectId } });
535
+ };
532
536
  function handleMessage(message) {
533
537
  const { event } = message;
534
538
  if (!_core) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-ble-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "author": "OneKey",
5
5
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
6
6
  "license": "ISC",
@@ -20,8 +20,8 @@
20
20
  "lint:fix": "eslint . --fix"
21
21
  },
22
22
  "dependencies": {
23
- "@onekeyfe/hd-core": "^0.1.0",
24
- "@onekeyfe/hd-transport-react-native": "^0.1.0"
23
+ "@onekeyfe/hd-core": "^0.1.3",
24
+ "@onekeyfe/hd-transport-react-native": "^0.1.3"
25
25
  },
26
- "gitHead": "d50dc424865150391b7249d1010ee75dc2074a7e"
26
+ "gitHead": "64411d3cac440d142574f8aa30c9d60204d47c2c"
27
27
  }
package/src/index.ts CHANGED
@@ -45,7 +45,10 @@ const uiResponse = (response: UiResponseEvent) => {
45
45
  _core.handleMessage({ event: UI_EVENT, type, payload });
46
46
  };
47
47
 
48
- const cancel = () => {};
48
+ const cancel = (connectId?: string) => {
49
+ if (_core === undefined) return;
50
+ _core.handleMessage({ event: IFRAME.CANCEL, type: IFRAME.CANCEL, payload: { connectId } });
51
+ };
49
52
 
50
53
  function handleMessage(message: CoreMessage) {
51
54
  const { event } = message;