@onekeyfe/hd-web-sdk 0.1.50 → 0.1.52
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 +31 -5
- package/build/data/messages/messages.json +41 -0
- package/build/iframe.html +1 -1
- package/build/js/iframe.85b50859cfdb077280b0.js +3 -0
- package/build/js/{iframe.b8e40a18b27ba2c33153.js.LICENSE.txt → iframe.85b50859cfdb077280b0.js.LICENSE.txt} +0 -0
- package/build/js/iframe.85b50859cfdb077280b0.js.map +1 -0
- package/build/onekey-js-sdk.js +105 -7
- package/build/onekey-js-sdk.js.map +1 -1
- package/build/onekey-js-sdk.min.js +1 -1
- package/build/onekey-js-sdk.min.js.map +1 -1
- package/package.json +6 -6
- package/webpack/webpack.config.ts +1 -0
- package/build/js/iframe.b8e40a18b27ba2c33153.js +0 -3
- package/build/js/iframe.b8e40a18b27ba2c33153.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,11 +1,37 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@onekeyfe/hd-web-sdk`
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
|
@@ -3042,6 +3042,45 @@
|
|
|
3042
3042
|
}
|
|
3043
3043
|
}
|
|
3044
3044
|
},
|
|
3045
|
+
"BatchGetPublickeys": {
|
|
3046
|
+
"fields": {
|
|
3047
|
+
"ecdsa_curve_name": {
|
|
3048
|
+
"type": "string",
|
|
3049
|
+
"id": 1,
|
|
3050
|
+
"options": {
|
|
3051
|
+
"default": "ed25519"
|
|
3052
|
+
}
|
|
3053
|
+
},
|
|
3054
|
+
"paths": {
|
|
3055
|
+
"rule": "repeated",
|
|
3056
|
+
"type": "Path",
|
|
3057
|
+
"id": 2
|
|
3058
|
+
}
|
|
3059
|
+
},
|
|
3060
|
+
"nested": {
|
|
3061
|
+
"Path": {
|
|
3062
|
+
"fields": {
|
|
3063
|
+
"address_n": {
|
|
3064
|
+
"rule": "repeated",
|
|
3065
|
+
"type": "uint32",
|
|
3066
|
+
"id": 1,
|
|
3067
|
+
"options": {
|
|
3068
|
+
"packed": false
|
|
3069
|
+
}
|
|
3070
|
+
}
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3073
|
+
}
|
|
3074
|
+
},
|
|
3075
|
+
"EcdsaPublicKeys": {
|
|
3076
|
+
"fields": {
|
|
3077
|
+
"public_keys": {
|
|
3078
|
+
"rule": "repeated",
|
|
3079
|
+
"type": "bytes",
|
|
3080
|
+
"id": 1
|
|
3081
|
+
}
|
|
3082
|
+
}
|
|
3083
|
+
},
|
|
3045
3084
|
"DebugLinkDecision": {
|
|
3046
3085
|
"fields": {
|
|
3047
3086
|
"yes_no": {
|
|
@@ -8203,6 +8242,8 @@
|
|
|
8203
8242
|
"MessageType_CosiCommitment": 72,
|
|
8204
8243
|
"MessageType_CosiSign": 73,
|
|
8205
8244
|
"MessageType_CosiSignature": 74,
|
|
8245
|
+
"MessageType_BatchGetPublickeys": 10016,
|
|
8246
|
+
"MessageType_EcdsaPublicKeys": 10017,
|
|
8206
8247
|
"MessageType_DebugLinkDecision": 100,
|
|
8207
8248
|
"MessageType_DebugLinkGetState": 101,
|
|
8208
8249
|
"MessageType_DebugLinkState": 102,
|
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.
|
|
27
|
+
iframeScript.setAttribute('src', './js/iframe.85b50859cfdb077280b0.js');
|
|
28
28
|
iframeScript.setAttribute('async', 'false');
|
|
29
29
|
document.body.appendChild(iframeScript);
|
|
30
30
|
</script>
|