From 51dd86f50c9f1628e786f62c87a5aa27a1b32ba3 Mon Sep 17 00:00:00 2001 From: ByteZhang Date: Wed, 31 Jul 2024 11:31:35 +0800 Subject: [PATCH] fix: battery_level decode --- package.json | 6 +-- src/components/Firmware/Firmware.tsx | 5 ++ src/hardware/index.ts | 1 + src/hardware/instance.ts | 2 +- yarn.lock | 68 ++++++++++++++-------------- 5 files changed, 44 insertions(+), 38 deletions(-) diff --git a/package.json b/package.json index 7de6970..54fb39f 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,9 @@ "@headlessui/react": "^1.7.2", "@heroicons/react": "^2.0.11", "@noble/hashes": "^1.1.3", - "@onekeyfe/hd-core": "0.3.41", - "@onekeyfe/hd-shared": "0.3.41", - "@onekeyfe/hd-web-sdk": "0.3.41", + "@onekeyfe/hd-core": "1.0.7", + "@onekeyfe/hd-shared": "1.0.7", + "@onekeyfe/hd-web-sdk": "1.0.7", "@onekeyfe/ui-components": "^1.0.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.3", "@reduxjs/toolkit": "^1.8.5", diff --git a/src/components/Firmware/Firmware.tsx b/src/components/Firmware/Firmware.tsx index 7e995f4..53d0354 100644 --- a/src/components/Firmware/Firmware.tsx +++ b/src/components/Firmware/Firmware.tsx @@ -280,7 +280,12 @@ export default function Firmware() { case 'pro': typeFlag = 'OneKey Pro'; break; + case 'unknown': + typeFlag = 'Unknown'; + break; default: + // eslint-disable-next-line no-case-declarations, no-unused-vars, @typescript-eslint/no-unused-vars + const checkType: never = originType; break; } setDeviceType(typeFlag); diff --git a/src/hardware/index.ts b/src/hardware/index.ts index 58f09a6..59da876 100644 --- a/src/hardware/index.ts +++ b/src/hardware/index.ts @@ -218,6 +218,7 @@ class ServiceHardware { mini: data.mini, touch: data.touch, pro: data.pro, + unknown: data.unknown, }; store.dispatch(setReleaseMap(deviceMap)); diff --git a/src/hardware/instance.ts b/src/hardware/instance.ts index ab99c12..122354e 100644 --- a/src/hardware/instance.ts +++ b/src/hardware/instance.ts @@ -17,7 +17,7 @@ export const getHardwareSDKInstance = memoizee( } const settings: Partial = { debug: true, - connectSrc: 'https://jssdk.onekey.so/0.3.41/', + connectSrc: 'https://jssdk.onekey.so/1.0.7/', preRelease: false, fetchConfig: true, }; diff --git a/yarn.lock b/yarn.lock index 09a1047..4b0c2fc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2156,13 +2156,13 @@ resolved "https://registry.yarnpkg.com/@onekeyfe/cross-inpage-provider-types/-/cross-inpage-provider-types-0.0.17.tgz#0c88c1a2febac44ec1600e0e59da732579cbd045" integrity sha512-QqjIPXQHb3UG9w79ujjL5L5Qd6oCrymQ/x2J2rYICtr56G6shHTmUvRZxAvne0ZsLv8UBGqZWbepVdnPipehYQ== -"@onekeyfe/hd-core@0.3.41", "@onekeyfe/hd-core@^0.3.41": - version "0.3.41" - resolved "https://registry.yarnpkg.com/@onekeyfe/hd-core/-/hd-core-0.3.41.tgz#71dbd4db8ae3616e09ec78cf0b023ca49cb3d21d" - integrity sha512-g6txoAazxP84zBUHr8ig7LTrJ4gU2ZTLvn+Cms4ZVH97iH4lY06kfY8eJWZ09hrH+7ke4uXS5vLmi4UeLrtn/A== +"@onekeyfe/hd-core@1.0.7", "@onekeyfe/hd-core@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@onekeyfe/hd-core/-/hd-core-1.0.7.tgz#a3b290d6caea3e8b8b1aa6039ff383fb74263115" + integrity sha512-NZHUk98sbKmsZjFRPRnbKf3B0nZe4OQxDh0jaO8yQGQqqC53Y0+P2ZoJtqKQ4nRDuGKOeo2p2sDP0DwaTK1gdQ== dependencies: - "@onekeyfe/hd-shared" "^0.3.41" - "@onekeyfe/hd-transport" "^0.3.41" + "@onekeyfe/hd-shared" "^1.0.7" + "@onekeyfe/hd-transport" "^1.0.7" axios "^0.27.2" bignumber.js "^9.0.2" bytebuffer "^5.0.1" @@ -2170,47 +2170,47 @@ parse-uri "^1.0.7" semver "^7.3.7" -"@onekeyfe/hd-shared@0.3.41", "@onekeyfe/hd-shared@^0.3.41": - version "0.3.41" - resolved "https://registry.yarnpkg.com/@onekeyfe/hd-shared/-/hd-shared-0.3.41.tgz#17524e7657c9aebad93c103b963aa3fd1619da66" - integrity sha512-PwlVCqCYArbzijhKUpik9lxfeSgQBZZoB4HD5JuihOQ3KSkSFvNMbswqD+Xv629lUSBHIfHiAyHmX7vLwQa2Aw== +"@onekeyfe/hd-shared@1.0.7", "@onekeyfe/hd-shared@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@onekeyfe/hd-shared/-/hd-shared-1.0.7.tgz#2c8b2dcbdffe6d69180bc38ed61726d5c47c082b" + integrity sha512-yIpvGoMH4NNxjSOMeOx+ktA1OxMJVfkYku07Etd0D2wekZPcoCCGEvloc59kmMbV0u0/fzrauZUNZgp+6KTgPA== -"@onekeyfe/hd-transport-http@^0.3.41": - version "0.3.41" - resolved "https://registry.yarnpkg.com/@onekeyfe/hd-transport-http/-/hd-transport-http-0.3.41.tgz#12ba68a4ee8725d91dc57f3ad99cc62e6cd2de59" - integrity sha512-+0Q0OGZ+nrN4z0wq11OJhr9JMZ5UsgNUM0p4+BL0lSr0jpcO6ukiRA9b/4Se9K711TZyLjXc6AwUsg7u4RE6RQ== +"@onekeyfe/hd-transport-http@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@onekeyfe/hd-transport-http/-/hd-transport-http-1.0.7.tgz#132f14a806009f918604daf0d5ba676243682d72" + integrity sha512-AJYfMyub4Ejwc2S+AfPAr4NuLdAcPBa2H+15McpIwKk19R8EMaF1HjHaPLxtvpGPAMm4y7oLKqW9Obyl+zqTog== dependencies: - "@onekeyfe/hd-shared" "^0.3.41" - "@onekeyfe/hd-transport" "^0.3.41" + "@onekeyfe/hd-shared" "^1.0.7" + "@onekeyfe/hd-transport" "^1.0.7" axios "^0.27.2" -"@onekeyfe/hd-transport-webusb@^0.3.41": - version "0.3.41" - resolved "https://registry.yarnpkg.com/@onekeyfe/hd-transport-webusb/-/hd-transport-webusb-0.3.41.tgz#98a6a36a4f804200f2e7b5c59d3ff8b895d3ce21" - integrity sha512-OJRR9eYzowABC1zNa/edEIYp8B299mRxNLKutyYecQhbDarBTX3LqQERppdnRy4Ptmrgm/Lz/mqKXdegoeUkXg== +"@onekeyfe/hd-transport-webusb@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@onekeyfe/hd-transport-webusb/-/hd-transport-webusb-1.0.7.tgz#15b6554f6bd6bba2223c54965f7059ce1a3c2977" + integrity sha512-j/fh7nD7kGOuyvR/GdI8qSFwbivQkXFy7i/3+Onkhzo6xYwyIeq7pfTVXNgKaFPH+BdhEkMf44Qg07jZHFLt/Q== dependencies: - "@onekeyfe/hd-shared" "^0.3.41" - "@onekeyfe/hd-transport" "^0.3.41" + "@onekeyfe/hd-shared" "^1.0.7" + "@onekeyfe/hd-transport" "^1.0.7" -"@onekeyfe/hd-transport@^0.3.41": - version "0.3.41" - resolved "https://registry.yarnpkg.com/@onekeyfe/hd-transport/-/hd-transport-0.3.41.tgz#fb869085dfc1d7926533181762d04ccac40bfd87" - integrity sha512-vXctzTv4mLEuALjgo98ROpQL/Y1hjAheixe9IDVAPOGsxtfA5ioCGjt2jjdOLRw30a92bcHRWmuYDV0tG5irkg== +"@onekeyfe/hd-transport@^1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@onekeyfe/hd-transport/-/hd-transport-1.0.7.tgz#216ab6e86567695b1f3e5b9b935886ddb6257420" + integrity sha512-FlfZNCH2C4mOy61Whn9l3AueDSDSa+5bTTFLH267/XanOt11CAbPS1zB8awO/mwDENA2/Ci+ObfybTRXzoBc7w== dependencies: bytebuffer "^5.0.1" long "^4.0.0" protobufjs "^6.11.2" -"@onekeyfe/hd-web-sdk@0.3.41": - version "0.3.41" - resolved "https://registry.yarnpkg.com/@onekeyfe/hd-web-sdk/-/hd-web-sdk-0.3.41.tgz#f9ad7404fa9d5b2f5a957f0a83408b41cd6c139a" - integrity sha512-6AMu1c3seSX+LF5HecKbXSlDZp8ATrQQtEToiqS+ViMIwftyZDKYVR9wdWYlC5Ubm/TF3MCcn+7BIHHywXfQkw== +"@onekeyfe/hd-web-sdk@1.0.7": + version "1.0.7" + resolved "https://registry.yarnpkg.com/@onekeyfe/hd-web-sdk/-/hd-web-sdk-1.0.7.tgz#e6a6f254375250181144b466e1957bb03087670f" + integrity sha512-odEH3dAAwH+iJF3b9B7AF484yyzQ1vhmjnzu5vEsF4T/cDEXPFZz+6KcDsOC1aVBkXwLToKhEf8WBa34H8ORmw== dependencies: "@onekeyfe/cross-inpage-provider-core" "^0.0.17" - "@onekeyfe/hd-core" "^0.3.41" - "@onekeyfe/hd-shared" "^0.3.41" - "@onekeyfe/hd-transport-http" "^0.3.41" - "@onekeyfe/hd-transport-webusb" "^0.3.41" + "@onekeyfe/hd-core" "^1.0.7" + "@onekeyfe/hd-shared" "^1.0.7" + "@onekeyfe/hd-transport-http" "^1.0.7" + "@onekeyfe/hd-transport-webusb" "^1.0.7" "@onekeyfe/ui-components@^1.0.0": version "1.0.0"