@onekeyfe/hd-core 1.2.0-alpha.0 → 1.2.0-alpha.10
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/__tests__/connectSettings.test.ts +19 -0
- package/__tests__/device-wallet-session-store.test.ts +131 -0
- package/__tests__/preInitialize.test.ts +33 -0
- package/__tests__/protocol-v2-firmware-targets.test.ts +19 -0
- package/__tests__/protocol-v2.test.ts +1930 -765
- package/dist/api/ClearSessionCache.d.ts +9 -0
- package/dist/api/ClearSessionCache.d.ts.map +1 -0
- package/dist/api/FileRead.d.ts.map +1 -1
- package/dist/api/FileWrite.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV4.d.ts +26 -5
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/GetDeviceInfo.d.ts.map +1 -1
- package/dist/api/GetFeatures.d.ts +1 -1
- package/dist/api/GetOnekeyFeatures.d.ts.map +1 -1
- package/dist/api/GetPassphraseState.d.ts +4 -4
- package/dist/api/GetPassphraseState.d.ts.map +1 -1
- package/dist/api/device/DeviceUnlock.d.ts +1 -1
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +1 -0
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
- package/dist/api/firmware/bootloaderHelper.d.ts.map +1 -1
- package/dist/api/firmware/getBinary.d.ts +4 -0
- package/dist/api/firmware/getBinary.d.ts.map +1 -1
- package/dist/api/firmware/progressThrottle.d.ts +3 -0
- package/dist/api/firmware/progressThrottle.d.ts.map +1 -0
- package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
- package/dist/api/index.d.ts +8 -10
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts +6 -0
- package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts +7 -0
- package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts +1 -1
- package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts +3 -2
- package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts.map +1 -1
- package/dist/api/protocol-v2/{DeviceGetDeviceInfo.d.ts → DeviceInfoGet.d.ts} +10 -10
- package/dist/api/protocol-v2/DeviceInfoGet.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceSessionGet.d.ts +9 -0
- package/dist/api/protocol-v2/DeviceSessionGet.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceStatusGet.d.ts +6 -0
- package/dist/api/protocol-v2/DeviceStatusGet.d.ts.map +1 -0
- package/dist/api/protocol-v2/FilesystemFormat.d.ts.map +1 -1
- package/dist/api/protocol-v2/{FilesystemFixPermission.d.ts → FilesystemPermissionFix.d.ts} +2 -2
- package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts.map +1 -0
- package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts +6 -0
- package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts.map +1 -0
- package/dist/api/protocol-v2/helpers.d.ts +27 -19
- package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
- package/dist/api/ton/TonSignData.d.ts +1 -5
- package/dist/api/ton/TonSignData.d.ts.map +1 -1
- package/dist/api/tron/TronSignMessage.d.ts +0 -1
- package/dist/api/tron/TronSignMessage.d.ts.map +1 -1
- package/dist/api/tron/TronSignTransaction.d.ts +0 -1
- package/dist/api/tron/TronSignTransaction.d.ts.map +1 -1
- package/dist/constants/index.d.ts +2 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/data-manager/DataManager.d.ts +1 -1
- package/dist/data-manager/DataManager.d.ts.map +1 -1
- package/dist/data-manager/connectSettings.d.ts.map +1 -1
- package/dist/device/Device.d.ts +17 -18
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DeviceWalletSessionStore.d.ts +15 -0
- package/dist/device/DeviceWalletSessionStore.d.ts.map +1 -0
- package/dist/deviceProfile/buildDeviceFeatures.d.ts +6 -0
- package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -0
- package/dist/deviceProfile/buildDeviceProfile.d.ts +3 -4
- package/dist/deviceProfile/buildDeviceProfile.d.ts.map +1 -1
- package/dist/deviceProfile/index.d.ts +1 -1
- package/dist/deviceProfile/index.d.ts.map +1 -1
- package/dist/index.d.ts +657 -539
- package/dist/index.js +2579 -2161
- package/dist/inject.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/features.d.ts +12 -14
- package/dist/protocols/protocol-v2/features.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/firmware.d.ts +11 -9
- package/dist/protocols/protocol-v2/firmware.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/index.d.ts +1 -0
- package/dist/protocols/protocol-v2/index.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/walletSession.d.ts +13 -0
- package/dist/protocols/protocol-v2/walletSession.d.ts.map +1 -0
- package/dist/types/api/firmwareUpdate.d.ts +4 -6
- package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
- package/dist/types/api/getDeviceInfo.d.ts +4 -2
- package/dist/types/api/getDeviceInfo.d.ts.map +1 -1
- package/dist/types/api/getPassphraseState.d.ts +4 -4
- package/dist/types/api/getPassphraseState.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +11 -11
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/protocolV2.d.ts +16 -17
- package/dist/types/api/protocolV2.d.ts.map +1 -1
- package/dist/types/api/sessionCache.d.ts +10 -0
- package/dist/types/api/sessionCache.d.ts.map +1 -0
- package/dist/types/device.d.ts +88 -8
- package/dist/types/device.d.ts.map +1 -1
- package/dist/types/params.d.ts +1 -0
- package/dist/types/params.d.ts.map +1 -1
- package/dist/types/settings.d.ts +21 -1
- package/dist/types/settings.d.ts.map +1 -1
- package/dist/utils/capabilitieUtils.d.ts.map +1 -1
- package/dist/utils/deviceFeaturesUtils.d.ts +2 -0
- package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
- package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
- package/dist/utils/deviceVersionUtils.d.ts.map +1 -1
- package/dist/utils/findDefectiveBatchDevice.d.ts +1 -1
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/patch.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/ClearSessionCache.ts +28 -0
- package/src/api/FileRead.ts +16 -3
- package/src/api/FileWrite.ts +14 -1
- package/src/api/FirmwareUpdateV2.ts +9 -2
- package/src/api/FirmwareUpdateV3.ts +2 -1
- package/src/api/FirmwareUpdateV4.ts +1089 -285
- package/src/api/GetDeviceInfo.ts +6 -13
- package/src/api/GetOnekeyFeatures.ts +3 -14
- package/src/api/GetPassphraseState.ts +7 -4
- package/src/api/device/DeviceRebootToBoardloader.ts +4 -4
- package/src/api/device/DeviceRebootToBootloader.ts +4 -4
- package/src/api/firmware/FirmwareUpdateBaseMethod.ts +18 -4
- package/src/api/firmware/bootloaderHelper.ts +3 -2
- package/src/api/firmware/getBinary.ts +1 -1
- package/src/api/firmware/progressThrottle.ts +44 -0
- package/src/api/firmware/releaseHelper.ts +3 -3
- package/src/api/firmware/uploadFirmware.ts +5 -2
- package/src/api/index.ts +8 -10
- package/src/api/protocol-v2/{FactoryGetDeviceInfo.ts → DeviceFactoryInfoGet.ts} +3 -3
- package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +32 -0
- package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +3 -5
- package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +39 -5
- package/src/api/protocol-v2/{DeviceGetDeviceInfo.ts → DeviceInfoGet.ts} +52 -22
- package/src/api/protocol-v2/DeviceReboot.ts +2 -2
- package/src/api/protocol-v2/DeviceSessionGet.ts +26 -0
- package/src/api/protocol-v2/DeviceStatusGet.ts +14 -0
- package/src/api/protocol-v2/FilesystemFormat.ts +4 -1
- package/src/api/protocol-v2/{FilesystemFixPermission.ts → FilesystemPermissionFix.ts} +2 -2
- package/src/api/protocol-v2/{GetProtoVersion.ts → ProtocolInfoRequest.ts} +2 -2
- package/src/api/protocol-v2/helpers.ts +58 -59
- package/src/api/ton/TonSignData.ts +1 -5
- package/src/api/tron/TronSignMessage.ts +0 -1
- package/src/api/tron/TronSignTransaction.ts +0 -1
- package/src/constants/index.ts +10 -1
- package/src/core/index.ts +22 -10
- package/src/data/messages/messages-protocol-v2.json +992 -1420
- package/src/data/messages/messages.json +8 -0
- package/src/data-manager/DataManager.ts +11 -4
- package/src/data-manager/connectSettings.ts +4 -0
- package/src/device/Device.ts +158 -294
- package/src/device/DevicePool.ts +9 -9
- package/src/device/DeviceWalletSessionStore.ts +78 -0
- package/src/deviceProfile/buildDeviceFeatures.ts +365 -0
- package/src/deviceProfile/buildDeviceProfile.ts +165 -200
- package/src/deviceProfile/index.ts +4 -1
- package/src/inject.ts +13 -16
- package/src/protocols/protocol-v2/features.ts +28 -67
- package/src/protocols/protocol-v2/firmware.ts +12 -36
- package/src/protocols/protocol-v2/index.ts +1 -0
- package/src/protocols/protocol-v2/walletSession.ts +83 -0
- package/src/types/api/firmwareUpdate.ts +16 -20
- package/src/types/api/getDeviceInfo.ts +4 -2
- package/src/types/api/getPassphraseState.ts +4 -4
- package/src/types/api/index.ts +17 -20
- package/src/types/api/protocolV2.ts +35 -40
- package/src/types/api/sessionCache.ts +14 -0
- package/src/types/device.ts +98 -34
- package/src/types/params.ts +4 -0
- package/src/types/settings.ts +42 -30
- package/src/utils/capabilitieUtils.ts +1 -2
- package/src/utils/deviceFeaturesUtils.ts +54 -29
- package/src/utils/deviceInfoUtils.ts +11 -29
- package/src/utils/deviceVersionUtils.ts +7 -25
- package/src/utils/findDefectiveBatchDevice.ts +6 -6
- package/dist/api/protocol-v2/DevReboot.d.ts +0 -7
- package/dist/api/protocol-v2/DevReboot.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceGetDeviceInfo.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts +0 -6
- package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts.map +0 -1
- package/dist/api/protocol-v2/FactoryDeviceInfoSettings.d.ts +0 -7
- package/dist/api/protocol-v2/FactoryDeviceInfoSettings.d.ts.map +0 -1
- package/dist/api/protocol-v2/FactoryGetDeviceInfo.d.ts +0 -6
- package/dist/api/protocol-v2/FactoryGetDeviceInfo.d.ts.map +0 -1
- package/dist/api/protocol-v2/FilesystemFixPermission.d.ts.map +0 -1
- package/dist/api/protocol-v2/GetProtoVersion.d.ts +0 -6
- package/dist/api/protocol-v2/GetProtoVersion.d.ts.map +0 -1
- package/dist/deviceProfile/legacyFeaturesView.d.ts +0 -5
- package/dist/deviceProfile/legacyFeaturesView.d.ts.map +0 -1
- package/src/api/protocol-v2/DevReboot.ts +0 -24
- package/src/api/protocol-v2/DeviceGetOnboardingStatus.ts +0 -16
- package/src/api/protocol-v2/FactoryDeviceInfoSettings.ts +0 -29
- package/src/deviceProfile/legacyFeaturesView.ts +0 -123
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EACL,QAAQ,IAAI,KAAK,EACjB,YAAY,EACZ,eAAe,EACf,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,UAAU,EACV,OAAO,IAAI,aAAa,GACzB,MAAM,wBAAwB,CAAC"}
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAoClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAkB1C,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAIxD,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAoClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAkB1C,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAIxD,OAAO,KAAK,EAAE,eAAe,EAAyB,MAAM,UAAU,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAmD,MAAM,WAAW,CAAC;AAI9F,OAAO,KAAK,EAAE,6BAA6B,EAAoB,MAAM,wBAAwB,CAAC;AAW9F,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;AA+D7D,eAAO,MAAM,OAAO,YAAmB,WAAW,WAAW,WAAW,iBA6EvE,CAAC;AAyzBF,eAAO,MAAM,MAAM,YAAa,WAAW,cAAc,MAAM,SAkF9D,CAAC;AAiFF,eAAO,MAAM,qBAAqB,gFAejC,CAAC;AA0GF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IAC5C,OAAO,CAAC,cAAc,CAAoB;IAE1C,SAAgB,aAAa,EAAE,MAAM,CAAC;IAEtC,OAAO,CAAC,YAAY,CAAsB;IAG1C,OAAO,CAAC,qBAAqB,CAA4B;IAEzD,OAAO,CAAC,iBAAiB,CAAoB;;IAS7C,OAAO,CAAC,cAAc;IAoBhB,aAAa,CAAC,OAAO,EAAE,WAAW;IA2DxC,OAAO;CASR;AAED,eAAO,MAAM,QAAQ,YAGpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAIzB,CAAC;AAMF,eAAO,MAAM,IAAI,aACL,eAAe,aACd,GAAG,WACL,6BAA6B,8BAoBvC,CAAC;AAEF,eAAO,MAAM,eAAe;SAKrB,eAAe,CAAC,KAAK,CAAC;eAChB,GAAG;;UASf,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EFirmwareType } from '@onekeyfe/hd-shared';
|
|
2
2
|
import type { AssetsMap, ConnectSettings, DeviceTypeMap, Features, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, ITransportStatus, IVersionArray } from '../types';
|
|
3
|
-
export declare const FIRMWARE_FIELDS: readonly ["firmware", "firmware-v2", "firmware-v8", "firmware-btc-v8"];
|
|
3
|
+
export declare const FIRMWARE_FIELDS: readonly ["firmware", "firmware-v1", "firmware-v2", "firmware-v8", "firmware-btc-v8"];
|
|
4
4
|
export type IFirmwareField = (typeof FIRMWARE_FIELDS)[number];
|
|
5
5
|
export type ProtocolV1MessageSchema = 'v1CurrentSchema' | 'v1LegacySchema';
|
|
6
6
|
export type ProtobufMessageSchema = ProtocolV1MessageSchema | 'v2Schema';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataManager.d.ts","sourceRoot":"","sources":["../../src/data-manager/DataManager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAkBjE,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,aAAa,EACb,QAAQ,EACR,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EAEd,MAAM,UAAU,CAAC;AAIlB,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"DataManager.d.ts","sourceRoot":"","sources":["../../src/data-manager/DataManager.ts"],"names":[],"mappings":"A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MAAM,UAAU,CAAC;AAEhD,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAGlC,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,kBAAkB,EAAE,MAAM,CAAC;CAChC;AAmBD,eAAO,MAAM,MAAM,4DAqBlB,CAAC;AAEF,eAAO,MAAM,aAAa,SAAU,MAAM,uBAKzC,CAAC;AAEF,eAAO,MAAM,oBAAoB,WAAW,QAAQ,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"connectSettings.d.ts","sourceRoot":"","sources":["../../src/data-manager/connectSettings.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAGlC,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,kBAAkB,EAAE,MAAM,CAAC;CAChC;AAmBD,eAAO,MAAM,MAAM,4DAqBlB,CAAC;AAEF,eAAO,MAAM,aAAa,SAAU,MAAM,uBAKzC,CAAC;AAEF,eAAO,MAAM,oBAAoB,WAAW,QAAQ,eAAe,CAAC,oBA6DnE,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/device/Device.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import EventEmitter from 'events';
|
|
3
3
|
import { DeviceCommands } from './DeviceCommands';
|
|
4
|
-
import { type DeviceFirmwareRange, type Device as DeviceTyped, EOneKeyDeviceMode, type Features, type IDeviceModel, type IDeviceType, type
|
|
4
|
+
import { type DeviceFirmwareRange, type Device as DeviceTyped, EOneKeyDeviceMode, type Features, type IDeviceModel, type IDeviceType, type IVersionRange, type SupportFeatureType, type UnavailableCapabilities } from '../types';
|
|
5
5
|
import { DEVICE } from '../events';
|
|
6
6
|
import type { PROTO } from '../constants';
|
|
7
7
|
import type { DeviceButtonRequestPayload, DeviceFeaturesPayload, PassphraseRequestPayload } from '../events';
|
|
8
8
|
import type { PassphrasePromptResponse } from './DeviceCommands';
|
|
9
9
|
import type { Deferred, HardwareConnectProtocol } from '@onekeyfe/hd-shared';
|
|
10
|
-
import type { OneKeyDeviceInfo as DeviceDescriptor, ProtocolV2DeviceInfo, Success } from '@onekeyfe/hd-transport';
|
|
10
|
+
import type { OneKeyDeviceInfo as DeviceDescriptor, DeviceStatus, ProtocolV2DeviceInfo, Success } from '@onekeyfe/hd-transport';
|
|
11
11
|
import type DeviceConnector from './DeviceConnector';
|
|
12
|
-
import type { DeviceProfile } from '../types/api/getDeviceInfo';
|
|
13
12
|
export type InitOptions = {
|
|
14
13
|
initSession?: boolean;
|
|
15
14
|
deviceId?: string;
|
|
16
15
|
passphraseState?: string;
|
|
17
16
|
deriveCardano?: boolean;
|
|
18
17
|
connectProtocol?: HardwareConnectProtocol;
|
|
18
|
+
protocolV2DeviceInfoTimeoutMs?: number;
|
|
19
19
|
};
|
|
20
20
|
export type RunOptions = {
|
|
21
21
|
keepSession?: boolean;
|
|
@@ -57,9 +57,6 @@ export declare class Device extends EventEmitter {
|
|
|
57
57
|
private cancelableAction?;
|
|
58
58
|
private deviceAcquired;
|
|
59
59
|
features: Features | undefined;
|
|
60
|
-
private getFeaturesProfile;
|
|
61
|
-
get profile(): DeviceProfile | undefined;
|
|
62
|
-
set profile(profile: DeviceProfile | undefined);
|
|
63
60
|
featuresNeedsReload: boolean;
|
|
64
61
|
runPromise?: Deferred<void> | null;
|
|
65
62
|
externalState: string[];
|
|
@@ -77,7 +74,9 @@ export declare class Device extends EventEmitter {
|
|
|
77
74
|
static fromDescriptor(originalDescriptor: DeviceDescriptor, sdkInstanceId?: string): Device;
|
|
78
75
|
toMessageObject(): DeviceTyped | null;
|
|
79
76
|
connect(connectProtocol?: HardwareConnectProtocol): Promise<boolean>;
|
|
80
|
-
acquire(connectProtocol?: HardwareConnectProtocol
|
|
77
|
+
acquire(connectProtocol?: HardwareConnectProtocol, options?: {
|
|
78
|
+
throwOnRunPromiseError?: boolean;
|
|
79
|
+
}): Promise<void>;
|
|
81
80
|
release(): Promise<void>;
|
|
82
81
|
preInitialize(initOptions?: InitOptions): Promise<void>;
|
|
83
82
|
markPreInitialized(meta?: {
|
|
@@ -96,30 +95,30 @@ export declare class Device extends EventEmitter {
|
|
|
96
95
|
getCurrentDeviceType(): IDeviceType;
|
|
97
96
|
getCurrentDeviceId(): string | undefined;
|
|
98
97
|
getCurrentSerialNo(): string;
|
|
98
|
+
getConnectId(): string;
|
|
99
99
|
getCurrentBleName(): string | null;
|
|
100
100
|
getCurrentLabel(): string | null;
|
|
101
101
|
getCurrentPassphraseProtection(): boolean | null | undefined;
|
|
102
102
|
getCurrentFirmwareType(): import("@onekeyfe/hd-shared").EFirmwareType;
|
|
103
103
|
getCurrentFirmwareVersionString(): string;
|
|
104
104
|
getCurrentBLEFirmwareVersionString(): string | undefined;
|
|
105
|
-
getCurrentSafetyChecks():
|
|
105
|
+
getCurrentSafetyChecks(): string | null | undefined;
|
|
106
106
|
getCurrentMethodVersionRange(getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined): IVersionRange | undefined;
|
|
107
107
|
supportNewPassphrase(): SupportFeatureType;
|
|
108
108
|
supportInputPinOnSoftware(): SupportFeatureType;
|
|
109
109
|
supportModifyHomescreen(): SupportFeatureType;
|
|
110
|
-
private
|
|
110
|
+
private getSessionCacheDeviceKey;
|
|
111
111
|
getInternalState(_deviceId?: string): string | undefined;
|
|
112
|
-
updateInternalState(enablePassphrase: boolean, passphraseState: string | undefined, deviceId: string, sessionId?: string | null, featuresSessionId?: string | null): void;
|
|
112
|
+
updateInternalState(enablePassphrase: boolean, passphraseState: string | undefined, deviceId: string | undefined, sessionId?: string | null, featuresSessionId?: string | null): void;
|
|
113
113
|
private setInternalState;
|
|
114
114
|
clearInternalState(_deviceId?: string): void;
|
|
115
115
|
initialize(options?: InitOptions): Promise<void>;
|
|
116
116
|
private _initializeProtocolV2;
|
|
117
117
|
private _refreshProtocolV2Status;
|
|
118
|
-
getFeatures(): Promise<
|
|
119
|
-
_updateFeatures(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
private updateProtocolV2Features;
|
|
118
|
+
getFeatures(): Promise<Features | undefined>;
|
|
119
|
+
_updateFeatures(protoFeatures: PROTO.Features | Features, initSession?: boolean): void;
|
|
120
|
+
updateProtocolV2Features(deviceInfo?: ProtocolV2DeviceInfo): Features;
|
|
121
|
+
updateProtocolV2Status(status: DeviceStatus): Features;
|
|
123
122
|
updateDescriptor(descriptor: DeviceDescriptor, forceUpdate?: boolean): void;
|
|
124
123
|
updateFromCache(device: Device): void;
|
|
125
124
|
run(fn?: () => Promise<void>, options?: RunOptions): Promise<void>;
|
|
@@ -129,8 +128,8 @@ export declare class Device extends EventEmitter {
|
|
|
129
128
|
setCancelableAction(callback: (err?: Error) => Promise<unknown>): void;
|
|
130
129
|
clearCancelableAction(): void;
|
|
131
130
|
getMode(): EOneKeyDeviceMode;
|
|
132
|
-
getFirmwareVersion(): IVersionArray | null;
|
|
133
|
-
getBLEFirmwareVersion(): IVersionArray | null;
|
|
131
|
+
getFirmwareVersion(): import("../types").IVersionArray | null;
|
|
132
|
+
getBLEFirmwareVersion(): import("../types").IVersionArray | null;
|
|
134
133
|
isUsed(): boolean;
|
|
135
134
|
hasDeviceAcquire(): boolean;
|
|
136
135
|
isUsedHere(): boolean;
|
|
@@ -144,7 +143,7 @@ export declare class Device extends EventEmitter {
|
|
|
144
143
|
checkDeviceId(deviceId: string): boolean;
|
|
145
144
|
lockDevice(): Promise<Success>;
|
|
146
145
|
supportUnlockVersionRange(): DeviceFirmwareRange;
|
|
147
|
-
unlockDevice(): Promise<
|
|
146
|
+
unlockDevice(): Promise<Features | undefined>;
|
|
148
147
|
checkPassphraseStateSafety(passphraseState?: string, useEmptyPassphrase?: boolean, skipPassphraseCheck?: boolean): Promise<boolean>;
|
|
149
148
|
}
|
|
150
149
|
export default Device;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../../src/device/Device.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../../src/device/Device.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAiClC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EACL,KAAK,mBAAmB,EAGxB,KAAK,MAAM,IAAI,WAAW,EAC1B,iBAAiB,EACjB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAc,MAAM,WAAW,CAAC;AAY/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EACV,0BAA0B,EAC1B,qBAAqB,EACrB,wBAAwB,EACzB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,KAAK,EACV,gBAAgB,IAAI,gBAAgB,EACpC,YAAY,EACZ,oBAAoB,EACpB,OAAO,EACR,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,6BAA6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iB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;IAsBpD,gBAAgB;IAahB,aAAa,CAAC,QAAQ,EAAE,MAAM;IAIxB,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAKpC,yBAAyB,IAAI,mBAAmB;IAS1C,YAAY;IAgEZ,0BAA0B,CAC9B,eAAe,CAAC,EAAE,MAAM,EACxB,kBAAkB,CAAC,EAAE,OAAO,EAC5B,mBAAmB,CAAC,EAAE,OAAO;CAiDhC;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class DeviceWalletSessionStore {
|
|
2
|
+
private readonly walletSessions;
|
|
3
|
+
private readonly pendingSessions;
|
|
4
|
+
get(deviceKey: string, passphraseState?: string): string | undefined;
|
|
5
|
+
set(deviceKey: string, passphraseState?: string, sessionId?: string): void;
|
|
6
|
+
setPending(deviceKey: string, sessionId?: string): void;
|
|
7
|
+
getPending(deviceKey: string): string | undefined;
|
|
8
|
+
delete(deviceKey: string, passphraseState?: string): void;
|
|
9
|
+
deletePending(deviceKey: string): void;
|
|
10
|
+
deleteDevice(deviceKey: string): void;
|
|
11
|
+
migrateDeviceKey(from: string, to: string): void;
|
|
12
|
+
clear(): void;
|
|
13
|
+
}
|
|
14
|
+
export declare const deviceWalletSessionStore: DeviceWalletSessionStore;
|
|
15
|
+
//# sourceMappingURL=DeviceWalletSessionStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeviceWalletSessionStore.d.ts","sourceRoot":"","sources":["../../src/device/DeviceWalletSessionStore.ts"],"names":[],"mappings":"AAAA,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA0C;IAEzE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA6B;IAE7D,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM;IAK/C,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAUnE,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAKhD,UAAU,CAAC,SAAS,EAAE,MAAM;IAK5B,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM;IAUlD,aAAa,CAAC,SAAS,EAAE,MAAM;IAK/B,YAAY,CAAC,SAAS,EAAE,MAAM;IAM9B,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM;IAoBzC,KAAK;CAIN;AAED,eAAO,MAAM,wBAAwB,0BAAiC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Features } from '../types';
|
|
2
|
+
import type { PROTO } from '../constants';
|
|
3
|
+
import type { ProtocolV2DeviceInfo } from '@onekeyfe/hd-transport';
|
|
4
|
+
export declare const buildProtocolV1FeaturesPayload: (protocolV1Features: PROTO.Features, previous?: Features) => Features;
|
|
5
|
+
export declare const buildProtocolV2FeaturesPayload: (deviceInfo?: ProtocolV2DeviceInfo, previous?: Features) => Features;
|
|
6
|
+
//# sourceMappingURL=buildDeviceFeatures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildDeviceFeatures.d.ts","sourceRoot":"","sources":["../../src/deviceProfile/buildDeviceFeatures.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAA2B,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAqG5F,eAAO,MAAM,8BAA8B,uBACrB,cAAc,aACvB,QAAQ,KAClB,QAqGF,CAAC;AASF,eAAO,MAAM,8BAA8B,gBAC5B,oBAAoB,aACtB,QAAQ,KAClB,QA+IF,CAAC"}
|
|
@@ -4,7 +4,7 @@ import type { ProtocolV2DeviceInfo } from '@onekeyfe/hd-transport';
|
|
|
4
4
|
type BuildProtocolV1ProfileParams = {
|
|
5
5
|
protocol?: DeviceInfoProtocol;
|
|
6
6
|
features?: Features;
|
|
7
|
-
|
|
7
|
+
protocolV1OneKeyFeatures?: OnekeyFeatures;
|
|
8
8
|
sources?: DeviceInfoSource[];
|
|
9
9
|
scope?: GetDeviceInfoParams['scope'];
|
|
10
10
|
includeRaw?: boolean;
|
|
@@ -14,9 +14,8 @@ type BuildProtocolV2ProfileParams = {
|
|
|
14
14
|
sources?: DeviceInfoSource[];
|
|
15
15
|
scope?: GetDeviceInfoParams['scope'];
|
|
16
16
|
includeRaw?: boolean;
|
|
17
|
-
fallbackSerialNo?: string;
|
|
18
17
|
};
|
|
19
|
-
export declare function buildProfileFromProtocolV1({ protocol, features,
|
|
20
|
-
export declare function buildProfileFromProtocolV2({ deviceInfo, sources, scope, includeRaw,
|
|
18
|
+
export declare function buildProfileFromProtocolV1({ protocol, features, protocolV1OneKeyFeatures, sources, scope, includeRaw, }: BuildProtocolV1ProfileParams): DeviceProfile;
|
|
19
|
+
export declare function buildProfileFromProtocolV2({ deviceInfo, sources, scope, includeRaw, }: BuildProtocolV2ProfileParams): DeviceProfile;
|
|
21
20
|
export {};
|
|
22
21
|
//# sourceMappingURL=buildDeviceProfile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildDeviceProfile.d.ts","sourceRoot":"","sources":["../../src/deviceProfile/buildDeviceProfile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildDeviceProfile.d.ts","sourceRoot":"","sources":["../../src/deviceProfile/buildDeviceProfile.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAEhB,aAAa,EAIb,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAA2B,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG5F,KAAK,4BAA4B,GAAG;IAClC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,wBAAwB,CAAC,EAAE,cAAc,CAAC;IAC1C,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,KAAK,4BAA4B,GAAG;IAClC,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAgPF,wBAAgB,0BAA0B,CAAC,EACzC,QAAe,EACf,QAAQ,EACR,wBAAwB,EACxB,OAAsB,EACtB,KAAe,EACf,UAAkB,GACnB,EAAE,4BAA4B,GAAG,aAAa,CAyB9C;AAED,wBAAgB,0BAA0B,CAAC,EACzC,UAAU,EACV,OAAwB,EACxB,KAAe,EACf,UAAkB,GACnB,EAAE,4BAA4B,GAAG,aAAa,CA4B9C"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { buildProfileFromProtocolV1, buildProfileFromProtocolV2 } from './buildDeviceProfile';
|
|
2
|
-
export {
|
|
2
|
+
export { buildProtocolV1FeaturesPayload, buildProtocolV2FeaturesPayload, } from './buildDeviceFeatures';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deviceProfile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deviceProfile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,uBAAuB,CAAC"}
|