@onekeyfe/hd-core 0.1.11 → 0.1.12
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":"DeviceVerify.d.ts","sourceRoot":"","sources":["../../../src/api/device/DeviceVerify.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeviceVerify.d.ts","sourceRoot":"","sources":["../../../src/api/device/DeviceVerify.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGlE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,UAAU,CAAC,wBAAwB,CAAC;IAC5E,IAAI;IAUE,GAAG;CAoCV"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ var semver = require('semver');
|
|
|
6
6
|
var hdShared = require('@onekeyfe/hd-shared');
|
|
7
7
|
var axios = require('axios');
|
|
8
8
|
var BigNumber = require('bignumber.js');
|
|
9
|
+
var sha256 = require('js-sha256');
|
|
9
10
|
var hdTransport = require('@onekeyfe/hd-transport');
|
|
10
11
|
|
|
11
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -13,6 +14,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
13
14
|
var semver__default = /*#__PURE__*/_interopDefaultLegacy(semver);
|
|
14
15
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
15
16
|
var BigNumber__default = /*#__PURE__*/_interopDefaultLegacy(BigNumber);
|
|
17
|
+
var sha256__default = /*#__PURE__*/_interopDefaultLegacy(sha256);
|
|
16
18
|
|
|
17
19
|
const inject = ({ call, cancel, dispose, eventEmitter, init, uiResponse, }) => {
|
|
18
20
|
const api = {
|
|
@@ -11842,7 +11844,7 @@ class DeviceVerify extends BaseMethod {
|
|
|
11842
11844
|
const deviceType = getDeviceType(this.device.features);
|
|
11843
11845
|
let response;
|
|
11844
11846
|
if (deviceType === 'classic') {
|
|
11845
|
-
const res = yield this.device.commands.typedCall('BixinVerifyDeviceRequest', 'BixinVerifyDeviceAck', Object.assign({}, this.params));
|
|
11847
|
+
const res = yield this.device.commands.typedCall('BixinVerifyDeviceRequest', 'BixinVerifyDeviceAck', Object.assign(Object.assign({}, this.params), { data: sha256__default["default"].sha256(this.params.data) }));
|
|
11846
11848
|
response = res.message;
|
|
11847
11849
|
}
|
|
11848
11850
|
else if (deviceType === 'mini') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@onekeyfe/hd-shared": "^0.1.
|
|
29
|
-
"@onekeyfe/hd-transport": "^0.1.
|
|
28
|
+
"@onekeyfe/hd-shared": "^0.1.12",
|
|
29
|
+
"@onekeyfe/hd-transport": "^0.1.12",
|
|
30
30
|
"axios": "^0.27.2",
|
|
31
31
|
"bignumber.js": "^9.0.2",
|
|
32
|
+
"js-sha256": "^0.9.0",
|
|
32
33
|
"parse-uri": "^1.0.7",
|
|
33
34
|
"semver": "^7.3.7"
|
|
34
35
|
},
|
|
@@ -36,5 +37,5 @@
|
|
|
36
37
|
"@types/parse-uri": "^1.0.0",
|
|
37
38
|
"@types/semver": "^7.3.9"
|
|
38
39
|
},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "38d4f8d711d212de8617f217a0148dcf3cdcc477"
|
|
40
41
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import sha256 from 'js-sha256';
|
|
1
2
|
import { BixinVerifyDeviceRequest } from '@onekeyfe/hd-transport';
|
|
2
3
|
import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
3
4
|
import { formatAnyHex } from '../helpers/hexUtils';
|
|
@@ -28,6 +29,7 @@ export default class DeviceVerify extends BaseMethod<BixinVerifyDeviceRequest> {
|
|
|
28
29
|
'BixinVerifyDeviceAck',
|
|
29
30
|
{
|
|
30
31
|
...this.params,
|
|
32
|
+
data: sha256.sha256(this.params.data),
|
|
31
33
|
}
|
|
32
34
|
);
|
|
33
35
|
response = res.message;
|