@onekeyfe/hd-common-connect-sdk 0.1.49 → 0.1.51

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/README.md CHANGED
@@ -1,11 +1,36 @@
1
- # `hd-common-connect-sdk`
1
+ # `@onekeyfe/hd-common-connect-sdk`
2
2
 
3
- > TODO: description
3
+ `@onekeyfe/hd-common-connect-sdk` is a libarary that runs in the node enviroment. And communicates with transport in the normal way.
4
4
 
5
- ## Usage
5
+ ## Installation
6
6
 
7
+ Install library as npm module:
8
+
9
+ ```javascript
10
+ npm install @onekeyfe/hd-common-connect-sdk
7
11
  ```
8
- const hdCommonConnectSdk = require('hd-common-connect-sdk');
9
12
 
10
- // TODO: DEMONSTRATE API
13
+ or
14
+
15
+ ```javascript
16
+ yarn add @onekeyfe/hd-common-connect-sdk
11
17
  ```
18
+
19
+ ## Initialization
20
+
21
+ ```javascript
22
+ import HardwareSDK from '@onekeyfe/hd-common-connect-sdk';
23
+
24
+ function init() {
25
+ HardwareSDK.init({
26
+ debug: false,
27
+ });
28
+ }
29
+ ```
30
+
31
+ ## Docs
32
+
33
+ Documentation is available [hardware-js-sdk](https://developer.onekey.so/connect-to-hardware/hardware-sdk/start)
34
+
35
+ ## Examples
36
+ // TODO: add example url
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-common-connect-sdk",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
4
4
  "author": "OneKey",
5
5
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
6
6
  "license": "ISC",
@@ -20,10 +20,10 @@
20
20
  "lint:fix": "eslint . --fix"
21
21
  },
22
22
  "dependencies": {
23
- "@onekeyfe/hd-core": "^0.1.49",
24
- "@onekeyfe/hd-shared": "^0.1.49",
25
- "@onekeyfe/hd-transport-http": "^0.1.49",
26
- "@onekeyfe/hd-transport-webusb": "^0.1.49"
23
+ "@onekeyfe/hd-core": "^0.1.51",
24
+ "@onekeyfe/hd-shared": "^0.1.51",
25
+ "@onekeyfe/hd-transport-http": "^0.1.51",
26
+ "@onekeyfe/hd-transport-webusb": "^0.1.51"
27
27
  },
28
- "gitHead": "692944ef9897d6a9b0069fb60eec18d2dfbd6a2b"
28
+ "gitHead": "0bc84671cf1fabb0f50339407dd43ad82ff096b8"
29
29
  }
package/src/index.ts CHANGED
@@ -42,7 +42,7 @@ const uiResponse = (response: UiResponseEvent) => {
42
42
  throw ERRORS.TypedError(HardwareErrorCode.NotInitialized);
43
43
  }
44
44
  const { type, payload } = response;
45
- _core.handleMessage({ event: UI_EVENT, type, payload });
45
+ _core.handleMessage({ event: UI_EVENT, type, payload } as CoreMessage);
46
46
  };
47
47
 
48
48
  const cancel = (connectId?: string) => {