@onekeyfe/hd-web-sdk 0.1.50 → 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,37 @@
1
- # `hd-web-sdk`
1
+ # `@onekeyfe/hd-web-sdk`
2
2
 
3
- > TODO: description
3
+ `@onekeyfe/hd-web-sdk` is a browser implementation of hardware-sdk that creates an iframe and communicates with transport through the iframe to avoid cross-domain issues.
4
4
 
5
- ## Usage
5
+ ## Installation
6
6
 
7
+ Install library as npm module:
8
+
9
+ ```javascript
10
+ npm install @onekeyfe/hd-web-sdk
7
11
  ```
8
- const hdWebSdk = require('hd-web-sdk');
9
12
 
10
- // TODO: DEMONSTRATE API
13
+ or
14
+
15
+ ```javascript
16
+ yarn add @onekeyfe/hd-web-sdk
11
17
  ```
18
+
19
+ ## Initialization
20
+
21
+ ```javascript
22
+ import HardwareSDK from '@onekeyfe/hd-web-sdk';
23
+
24
+ function init() {
25
+ HardwareSDK.init({
26
+ debug: false,
27
+ connectSrc: 'https://jssdk.onekey.so/'
28
+ });
29
+ }
30
+ ```
31
+
32
+ ## Docs
33
+
34
+ Documentation is available [hardware-js-sdk](https://developer.onekey.so/connect-to-hardware/hardware-sdk/start)
35
+
36
+ ## Examples
37
+ // TODO: add example url
package/build/iframe.html CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  const iframeScript = document.createElement('script');
26
26
  iframeScript.setAttribute('type', 'text/javascript');
27
- iframeScript.setAttribute('src', './js/iframe.b8e40a18b27ba2c33153.js');
27
+ iframeScript.setAttribute('src', './js/iframe.fe55716ec5664e14b47b.js');
28
28
  iframeScript.setAttribute('async', 'false');
29
29
  document.body.appendChild(iframeScript);
30
30
  </script>