@onekeyfe/hd-ble-sdk 0.1.1 → 0.1.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.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/package.json +4 -4
- package/src/index.ts +4 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -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;
|
|
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.
|
|
3
|
+
"version": "0.1.2",
|
|
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.
|
|
24
|
-
"@onekeyfe/hd-transport-react-native": "^0.1.
|
|
23
|
+
"@onekeyfe/hd-core": "^0.1.2",
|
|
24
|
+
"@onekeyfe/hd-transport-react-native": "^0.1.2"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "5640e7870a99d8f3bade996fb5f57af055c749d8"
|
|
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;
|