@onekeyfe/hd-core 0.2.20 → 0.2.22
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/api/cosmos/CosmosGetAddress.d.ts +3 -0
- package/dist/api/cosmos/CosmosGetAddress.d.ts.map +1 -1
- package/dist/api/cosmos/CosmosGetPublicKey.d.ts +3 -0
- package/dist/api/cosmos/CosmosGetPublicKey.d.ts.map +1 -1
- package/dist/api/cosmos/CosmosSignTransaction.d.ts +3 -0
- package/dist/api/cosmos/CosmosSignTransaction.d.ts.map +1 -1
- package/dist/api/firmware/getBinary.d.ts.map +1 -1
- package/dist/index.js +16 -4
- package/package.json +4 -4
- package/src/api/cosmos/CosmosGetAddress.ts +4 -1
- package/src/api/cosmos/CosmosGetPublicKey.ts +4 -1
- package/src/api/cosmos/CosmosSignTransaction.ts +4 -1
- package/src/api/firmware/getBinary.ts +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CosmosGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/cosmos/CosmosGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGtF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,wBAAwB,EAAE,CAAC;IAClF,SAAS,UAAS;IAElB,IAAI;IAgCJ,eAAe
|
|
1
|
+
{"version":3,"file":"CosmosGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/cosmos/CosmosGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGtF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,wBAAwB,EAAE,CAAC;IAClF,SAAS,UAAS;IAElB,IAAI;IAgCJ,eAAe;;;;;;;;IAWT,GAAG;CAoBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CosmosGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/api/cosmos/CosmosGetPublicKey.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,GAAG,CAAC;IAC7D,SAAS,UAAS;IAElB,IAAI;IAwCJ,eAAe
|
|
1
|
+
{"version":3,"file":"CosmosGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/api/cosmos/CosmosGetPublicKey.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,GAAG,CAAC;IAC7D,SAAS,UAAS;IAElB,IAAI;IAwCJ,eAAe;;;;;;;;IAWT,GAAG;;;;;;;CAaV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CosmosSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/cosmos/CosmosSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,UAAU,CAAC,oBAAoB,CAAC;IACjF,SAAS,UAAS;IAElB,IAAI;IAoBJ,eAAe
|
|
1
|
+
{"version":3,"file":"CosmosSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/cosmos/CosmosSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,UAAU,CAAC,oBAAoB,CAAC;IACjF,SAAS,UAAS;IAElB,IAAI;IAoBJ,eAAe;;;;;;;;IAWT,GAAG;;;;CAYV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBinary.d.ts","sourceRoot":"","sources":["../../../src/api/firmware/getBinary.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAMvC,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC;CAChC;AAED,UAAU,cAAe,SAAQ,YAAY;IAC3C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,sCAA6C,cAAc;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"getBinary.d.ts","sourceRoot":"","sources":["../../../src/api/firmware/getBinary.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAMvC,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC;CAChC;AAED,UAAU,cAAe,SAAQ,YAAY;IAC3C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,sCAA6C,cAAc;;;;;;;;;;;;;EA2BhF,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAe,MAAM;;EAWrD,CAAC;AAEF,eAAO,MAAM,OAAO,6BAA8B,YAAY,2DAO7D,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -13148,7 +13148,10 @@ const getBinary = ({ features, updateType, version }) => __awaiter(void 0, void
|
|
|
13148
13148
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'no firmware found for this device');
|
|
13149
13149
|
}
|
|
13150
13150
|
if (version && !semver__default["default"].eq(releaseInfo.version.join('.'), version.join('.'))) {
|
|
13151
|
-
|
|
13151
|
+
const touchWithoutVersion = getDeviceType(features) === 'touch' && !features.onekey_version;
|
|
13152
|
+
if (!touchWithoutVersion) {
|
|
13153
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'firmware version mismatch');
|
|
13154
|
+
}
|
|
13152
13155
|
}
|
|
13153
13156
|
const url = updateType === 'ble' ? releaseInfo.webUpdate : releaseInfo.url;
|
|
13154
13157
|
let fw;
|
|
@@ -16465,7 +16468,10 @@ class CosmosGetAddress extends BaseMethod {
|
|
|
16465
16468
|
getVersionRange() {
|
|
16466
16469
|
return {
|
|
16467
16470
|
model_mini: {
|
|
16468
|
-
min: '2.
|
|
16471
|
+
min: '2.10.0',
|
|
16472
|
+
},
|
|
16473
|
+
model_touch: {
|
|
16474
|
+
min: '4.0.0',
|
|
16469
16475
|
},
|
|
16470
16476
|
};
|
|
16471
16477
|
}
|
|
@@ -16525,7 +16531,10 @@ class CosmosGetPublicKey extends BaseMethod {
|
|
|
16525
16531
|
getVersionRange() {
|
|
16526
16532
|
return {
|
|
16527
16533
|
model_mini: {
|
|
16528
|
-
min: '2.
|
|
16534
|
+
min: '2.10.0',
|
|
16535
|
+
},
|
|
16536
|
+
model_touch: {
|
|
16537
|
+
min: '4.0.0',
|
|
16529
16538
|
},
|
|
16530
16539
|
};
|
|
16531
16540
|
}
|
|
@@ -16566,7 +16575,10 @@ class CosmosSignTransaction extends BaseMethod {
|
|
|
16566
16575
|
getVersionRange() {
|
|
16567
16576
|
return {
|
|
16568
16577
|
model_mini: {
|
|
16569
|
-
min: '2.
|
|
16578
|
+
min: '2.10.0',
|
|
16579
|
+
},
|
|
16580
|
+
model_touch: {
|
|
16581
|
+
min: '4.0.0',
|
|
16570
16582
|
},
|
|
16571
16583
|
};
|
|
16572
16584
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.22",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@onekeyfe/hd-shared": "^0.2.
|
|
28
|
-
"@onekeyfe/hd-transport": "^0.2.
|
|
27
|
+
"@onekeyfe/hd-shared": "^0.2.22",
|
|
28
|
+
"@onekeyfe/hd-transport": "^0.2.22",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"bignumber.js": "^9.0.2",
|
|
31
31
|
"jszip": "^3.10.1",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"@types/semver": "^7.3.9",
|
|
43
43
|
"ripple-keypairs": "^1.1.4"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "720fa3b25f4fd9de7d1f426a4e42af347476ef8f"
|
|
46
46
|
}
|
|
@@ -23,7 +23,10 @@ export const getBinary = async ({ features, updateType, version }: GetBinaryProp
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
if (version && !semver.eq(releaseInfo.version.join('.'), version.join('.'))) {
|
|
26
|
-
|
|
26
|
+
const touchWithoutVersion = getDeviceType(features) === 'touch' && !features.onekey_version;
|
|
27
|
+
if (!touchWithoutVersion) {
|
|
28
|
+
throw ERRORS.TypedError(HardwareErrorCode.RuntimeError, 'firmware version mismatch');
|
|
29
|
+
}
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
// @ts-expect-error
|