@onekeyfe/hd-core 0.1.16 → 0.1.19
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/BaseMethod.d.ts +4 -0
- package/dist/api/BaseMethod.d.ts.map +1 -1
- package/dist/api/CheckBLEFirmwareRelease.d.ts.map +1 -1
- package/dist/api/CheckFirmwareRelease.d.ts.map +1 -1
- package/dist/api/firmware/releaseHelper.d.ts +18 -0
- package/dist/api/firmware/releaseHelper.d.ts.map +1 -0
- package/dist/constants/errors.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/device/Device.d.ts +5 -2
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DeviceCommands.d.ts +1 -1
- package/dist/device/DeviceCommands.d.ts.map +1 -1
- package/dist/device/DeviceList.d.ts +1 -1
- package/dist/device/DeviceList.d.ts.map +1 -1
- package/dist/events/core.d.ts +2 -1
- package/dist/events/core.d.ts.map +1 -1
- package/dist/events/device.d.ts +8 -2
- package/dist/events/device.d.ts.map +1 -1
- package/dist/events/firmware.d.ts +21 -0
- package/dist/events/firmware.d.ts.map +1 -0
- package/dist/events/index.d.ts +1 -0
- package/dist/events/index.d.ts.map +1 -1
- package/dist/index.d.ts +88 -40
- package/dist/index.js +269 -90
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/btcGetAddress.d.ts +2 -2
- package/dist/types/api/btcGetAddress.d.ts.map +1 -1
- package/dist/types/api/btcGetPublicKey.d.ts +2 -2
- package/dist/types/api/btcGetPublicKey.d.ts.map +1 -1
- package/dist/types/api/btcSignMessage.d.ts +1 -1
- package/dist/types/api/btcSignMessage.d.ts.map +1 -1
- package/dist/types/api/btcSignTransaction.d.ts +1 -1
- package/dist/types/api/btcSignTransaction.d.ts.map +1 -1
- package/dist/types/api/btcVerifyMessage.d.ts +1 -1
- package/dist/types/api/btcVerifyMessage.d.ts.map +1 -1
- package/dist/types/api/cipherKeyValue.d.ts +2 -2
- package/dist/types/api/cipherKeyValue.d.ts.map +1 -1
- package/dist/types/api/evmGetAddress.d.ts +2 -2
- package/dist/types/api/evmGetAddress.d.ts.map +1 -1
- package/dist/types/api/evmGetPublicKey.d.ts +2 -2
- package/dist/types/api/evmGetPublicKey.d.ts.map +1 -1
- package/dist/types/api/evmSignMessage.d.ts +1 -1
- package/dist/types/api/evmSignMessage.d.ts.map +1 -1
- package/dist/types/api/evmSignMessageEIP712.d.ts +1 -1
- package/dist/types/api/evmSignMessageEIP712.d.ts.map +1 -1
- package/dist/types/api/evmSignTransaction.d.ts +1 -1
- package/dist/types/api/evmSignTransaction.d.ts.map +1 -1
- package/dist/types/api/evmSignTypedData.d.ts +1 -1
- package/dist/types/api/evmSignTypedData.d.ts.map +1 -1
- package/dist/types/api/evmVerifyMessage.d.ts +1 -1
- package/dist/types/api/evmVerifyMessage.d.ts.map +1 -1
- package/dist/types/api/nemGetAddress.d.ts +2 -2
- package/dist/types/api/nemGetAddress.d.ts.map +1 -1
- package/dist/types/api/nemSignTransaction.d.ts +1 -1
- package/dist/types/api/nemSignTransaction.d.ts.map +1 -1
- package/dist/types/api/solGetAddress.d.ts +2 -2
- package/dist/types/api/solGetAddress.d.ts.map +1 -1
- package/dist/types/api/solSignTransaction.d.ts +2 -2
- package/dist/types/api/solSignTransaction.d.ts.map +1 -1
- package/dist/types/api/starcoinGetAddress.d.ts +2 -2
- package/dist/types/api/starcoinGetAddress.d.ts.map +1 -1
- package/dist/types/api/starcoinGetPublicKey.d.ts +2 -2
- package/dist/types/api/starcoinGetPublicKey.d.ts.map +1 -1
- package/dist/types/api/starcoinSignMessage.d.ts +1 -1
- package/dist/types/api/starcoinSignMessage.d.ts.map +1 -1
- package/dist/types/api/starcoinSignTransaction.d.ts +1 -1
- package/dist/types/api/starcoinSignTransaction.d.ts.map +1 -1
- package/dist/types/api/starcoinVerifyMessage.d.ts +1 -1
- package/dist/types/api/starcoinVerifyMessage.d.ts.map +1 -1
- package/dist/types/api/stellarGetAddress.d.ts +2 -2
- package/dist/types/api/stellarGetAddress.d.ts.map +1 -1
- package/dist/types/api/stellarSignTransaction.d.ts +1 -1
- package/dist/types/api/stellarSignTransaction.d.ts.map +1 -1
- package/dist/types/params.d.ts +3 -0
- package/dist/types/params.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/BaseMethod.ts +30 -1
- package/src/api/CheckBLEFirmwareRelease.ts +4 -9
- package/src/api/CheckFirmwareRelease.ts +3 -9
- package/src/api/firmware/releaseHelper.ts +24 -0
- package/src/constants/errors.ts +5 -1
- package/src/core/index.ts +146 -26
- package/src/device/Device.ts +24 -6
- package/src/device/DeviceCommands.ts +7 -4
- package/src/device/DeviceList.ts +22 -7
- package/src/events/core.ts +2 -0
- package/src/events/device.ts +11 -2
- package/src/events/firmware.ts +32 -0
- package/src/events/index.ts +1 -0
- package/src/inject.ts +53 -46
- package/src/types/api/btcGetAddress.ts +3 -5
- package/src/types/api/btcGetPublicKey.ts +2 -0
- package/src/types/api/btcSignMessage.ts +1 -0
- package/src/types/api/btcSignTransaction.ts +1 -0
- package/src/types/api/btcVerifyMessage.ts +1 -0
- package/src/types/api/cipherKeyValue.ts +2 -0
- package/src/types/api/evmGetAddress.ts +2 -0
- package/src/types/api/evmGetPublicKey.ts +2 -0
- package/src/types/api/evmSignMessage.ts +1 -0
- package/src/types/api/evmSignMessageEIP712.ts +1 -0
- package/src/types/api/evmSignTransaction.ts +1 -0
- package/src/types/api/evmSignTypedData.ts +1 -0
- package/src/types/api/evmVerifyMessage.ts +1 -0
- package/src/types/api/nemGetAddress.ts +2 -0
- package/src/types/api/nemSignTransaction.ts +1 -0
- package/src/types/api/solGetAddress.ts +2 -0
- package/src/types/api/solSignTransaction.ts +2 -0
- package/src/types/api/starcoinGetAddress.ts +2 -0
- package/src/types/api/starcoinGetPublicKey.ts +2 -0
- package/src/types/api/starcoinSignMessage.ts +1 -0
- package/src/types/api/starcoinSignTransaction.ts +1 -0
- package/src/types/api/starcoinVerifyMessage.ts +1 -0
- package/src/types/api/stellarGetAddress.ts +2 -0
- package/src/types/api/stellarSignTransaction.ts +1 -0
- package/src/types/params.ts +12 -0
- package/src/utils/logger.ts +4 -4
package/dist/api/BaseMethod.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare abstract class BaseMethod<Params = undefined> {
|
|
|
7
7
|
device: Device;
|
|
8
8
|
params: Params;
|
|
9
9
|
connectId?: string;
|
|
10
|
+
deviceId?: string;
|
|
10
11
|
deviceState?: string;
|
|
11
12
|
name: string;
|
|
12
13
|
payload: Record<string, any>;
|
|
@@ -14,6 +15,8 @@ export declare abstract class BaseMethod<Params = undefined> {
|
|
|
14
15
|
useDevice: boolean;
|
|
15
16
|
allowDeviceMode: string[];
|
|
16
17
|
requireDeviceMode: string[];
|
|
18
|
+
shouldEnsureConnected: boolean;
|
|
19
|
+
checkDeviceId: boolean;
|
|
17
20
|
postMessage: (message: CoreMessage) => void;
|
|
18
21
|
constructor(message: {
|
|
19
22
|
id?: number;
|
|
@@ -23,6 +26,7 @@ export declare abstract class BaseMethod<Params = undefined> {
|
|
|
23
26
|
abstract run(): Promise<any>;
|
|
24
27
|
getVersionRange(): DeviceFirmwareRange;
|
|
25
28
|
setDevice(device: Device): void;
|
|
29
|
+
checkFirmwareRelease(): void;
|
|
26
30
|
dispose(): void;
|
|
27
31
|
}
|
|
28
32
|
//# sourceMappingURL=BaseMethod.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseMethod.d.ts","sourceRoot":"","sources":["../../src/api/BaseMethod.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"BaseMethod.d.ts","sourceRoot":"","sources":["../../src/api/BaseMethod.ts"],"names":[],"mapp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,cAAc,CAAC;AAK1C,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU;IAC7D,IAAI;
|
|
1
|
+
{"version":3,"file":"CheckBLEFirmwareRelease.d.ts","sourceRoot":"","sources":["../../src/api/CheckBLEFirmwareRelease.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU;IAC7D,IAAI;IAKJ,GAAG;;;;;;;;CAOJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckFirmwareRelease.d.ts","sourceRoot":"","sources":["../../src/api/CheckFirmwareRelease.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,UAAU;IAC1D,IAAI;IAEJ,GAAG;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CheckFirmwareRelease.d.ts","sourceRoot":"","sources":["../../src/api/CheckFirmwareRelease.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,UAAU;IAC1D,IAAI;IAEJ,GAAG;;;;;;;;CAOJ"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Features } from '../../types';
|
|
2
|
+
export declare const getFirmwareReleaseInfo: (features: Features) => {
|
|
3
|
+
status: import("../../types").IDeviceFirmwareStatus;
|
|
4
|
+
changelog: {
|
|
5
|
+
"zh-CN": string;
|
|
6
|
+
"en-US": string;
|
|
7
|
+
}[];
|
|
8
|
+
release: import("../../types").IFirmwareReleaseInfo;
|
|
9
|
+
};
|
|
10
|
+
export declare const getBleFirmwareReleaseInfo: (features: Features) => {
|
|
11
|
+
status: import("../../types").IDeviceBLEFirmwareStatus;
|
|
12
|
+
changelog: {
|
|
13
|
+
"zh-CN": string;
|
|
14
|
+
"en-US": string;
|
|
15
|
+
}[];
|
|
16
|
+
release: import("../../types").IBLEFirmwareReleaseInfo;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=releaseHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"releaseHelper.d.ts","sourceRoot":"","sources":["../../../src/api/firmware/releaseHelper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,eAAO,MAAM,sBAAsB,aAAc,QAAQ;;;;;;;CASxD,CAAC;AAEF,eAAO,MAAM,yBAAyB,aAAc,QAAQ;;;;;;;CAS3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/constants/errors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,UAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/constants/errors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,UAAW,GAAG,UAUxC,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;AAQlC,OAAO,EACL,WAAW,EAYZ,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAE7D,OAAO,eAAe,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAQlC,OAAO,EACL,WAAW,EAYZ,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAE7D,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAoBxD,eAAO,MAAM,OAAO,YAAmB,WAAW,iBA6KjD,CAAC;AA2JF,eAAO,MAAM,MAAM,0CAkBlB,CAAC;AA2EF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IACtC,aAAa,CAAC,OAAO,EAAE,WAAW;IA+BxC,OAAO;CAGR;AAED,eAAO,MAAM,QAAQ,YAGpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAGzB,CAAC;AAMF,eAAO,MAAM,IAAI,aAAoB,eAAe,aAAa,GAAG,8BAmBnE,CAAC"}
|
package/dist/device/Device.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Deferred } from '@onekeyfe/hd-shared';
|
|
|
5
5
|
import DeviceConnector from './DeviceConnector';
|
|
6
6
|
import { DeviceCommands } from './DeviceCommands';
|
|
7
7
|
import type { Features, Device as DeviceTyped, UnavailableCapabilities } from '../types';
|
|
8
|
-
import { DEVICE, DeviceButtonRequestPayload } from '../events';
|
|
8
|
+
import { DEVICE, DeviceButtonRequestPayload, DeviceFeaturesPayload } from '../events';
|
|
9
9
|
import { PROTO } from '../constants';
|
|
10
10
|
declare type RunOptions = {
|
|
11
11
|
keepSession?: boolean;
|
|
@@ -14,6 +14,7 @@ export interface DeviceEvents {
|
|
|
14
14
|
[DEVICE.PIN]: [Device, PROTO.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
|
|
15
15
|
[DEVICE.PASSPHRASE_ON_DEVICE]: [Device, ((response: any) => void)?];
|
|
16
16
|
[DEVICE.BUTTON]: [Device, DeviceButtonRequestPayload];
|
|
17
|
+
[DEVICE.FEATURES]: [Device, DeviceFeaturesPayload];
|
|
17
18
|
}
|
|
18
19
|
export interface Device {
|
|
19
20
|
on<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
|
|
@@ -49,7 +50,8 @@ export declare class Device extends EventEmitter {
|
|
|
49
50
|
updateFromCache(device: Device): void;
|
|
50
51
|
run(fn?: () => Promise<void>, options?: RunOptions): Promise<void>;
|
|
51
52
|
_runInner<T>(fn: (() => Promise<T>) | undefined, options: RunOptions): Promise<undefined>;
|
|
52
|
-
|
|
53
|
+
interruptionFromOutside(): Promise<void>;
|
|
54
|
+
interruptionFromUser(): Promise<void>;
|
|
53
55
|
getMode(): "normal" | "bootloader" | "initialize" | "seedless";
|
|
54
56
|
getFirmwareVersion(): import("../types").IVersionArray | null;
|
|
55
57
|
getBLEFirmwareVersion(): import("../types").IVersionArray | null;
|
|
@@ -61,6 +63,7 @@ export declare class Device extends EventEmitter {
|
|
|
61
63
|
isSeedless(): boolean | undefined;
|
|
62
64
|
isUnacquired(): boolean;
|
|
63
65
|
hasUnexpectedMode(allow: string[], require: string[]): "ui-device_not_in_bootloader_mode" | "ui-device_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
|
|
66
|
+
checkDeviceId(deviceId: string): boolean;
|
|
64
67
|
}
|
|
65
68
|
export default Device;
|
|
66
69
|
//# sourceMappingURL=Device.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../../src/device/Device.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,gBAAgB,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAkB,QAAQ,EAA6B,MAAM,qBAAqB,CAAC;AAE1F,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAUlD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,WAAW,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACzF,OAAO,EAAE,MAAM,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../../src/device/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,CAAC,EAAE,OAAO,CAAC,EAAE,UAAU;IAYlD,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,UAAU;IA0CpE,uBAAuB;IASvB,oBAAoB;IAS1B,OAAO;IAOP,kBAAkB;IAKlB,qBAAqB;IAKrB,MAAM;IAIN,UAAU;IAQV,eAAe,IAAI,OAAO;IAI1B,YAAY;IAIZ,aAAa;IAIb,UAAU;IAIV,YAAY,IAAI,OAAO;IAIvB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;IAsBpD,aAAa,CAAC,QAAQ,EAAE,MAAM;CAM/B;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -23,7 +23,7 @@ export declare class DeviceCommands {
|
|
|
23
23
|
callPromise?: Promise<DefaultMessageResponse>;
|
|
24
24
|
_cancelableRequest?: (error?: any) => void;
|
|
25
25
|
constructor(device: Device, mainId: string);
|
|
26
|
-
dispose(): void
|
|
26
|
+
dispose(cancelRequest: boolean): Promise<void>;
|
|
27
27
|
call(type: MessageKey, msg?: DefaultMessageResponse['message']): Promise<DefaultMessageResponse>;
|
|
28
28
|
typedCall<T extends MessageKey, R extends MessageKey[]>(type: T, resType: R, msg?: MessageType[T]): Promise<TypedCallResponseMap[R[number]]>;
|
|
29
29
|
typedCall<T extends MessageKey, R extends MessageKey>(type: T, resType: R, msg?: MessageType[T]): Promise<TypedResponseMessage<R>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceCommands.d.ts","sourceRoot":"","sources":["../../src/device/DeviceCommands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIlE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGvC,aAAK,WAAW,GAAG,QAAQ,CAAC,WA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ACnB,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAuC7B,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,sBAAsB,CAAC,SAAS,CAAC;IAK3E,kBAAkB,CAAC,GAAG,EAAE,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAqFhF,UAAU,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,oBAAoB;CAuBhD;AAED,oBAAY,SAAS,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { Device } from './Device';
|
|
|
5
5
|
export declare class DeviceList extends EventEmitter {
|
|
6
6
|
devices: Record<string, Device>;
|
|
7
7
|
connector?: DeviceConnector;
|
|
8
|
-
getDeviceLists(): Promise<Device[]>;
|
|
8
|
+
getDeviceLists(connectId?: string): Promise<Device[]>;
|
|
9
9
|
allDevices(): Device[];
|
|
10
10
|
getDevice(connectId: string): Device;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceList.d.ts","sourceRoot":"","sources":["../../src/device/DeviceList.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"DeviceList.d.ts","sourceRoot":"","sources":["../../src/device/DeviceList.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AASlC,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAErC,SAAS,CAAC,EAAE,eAAe,CAAC;IAMtB,cAAc,CAAC,SAAS,CAAC,EAAE,MAAM;IA8CvC,UAAU,IAAI,MAAM,EAAE;IAItB,SAAS,CAAC,SAAS,EAAE,MAAM;CAG5B"}
|
package/dist/events/core.d.ts
CHANGED
|
@@ -5,11 +5,12 @@ import { IFrameEventMessage } from './iframe';
|
|
|
5
5
|
import { UiEventMessage } from './ui-request';
|
|
6
6
|
import { UiResponseMessage } from './ui-response';
|
|
7
7
|
import { LogEventMessage } from './log';
|
|
8
|
+
import { FirmwareMessage } from './firmware';
|
|
8
9
|
export declare const CORE_EVENT = "CORE_EVENT";
|
|
9
10
|
export declare type CoreMessage = {
|
|
10
11
|
id?: string;
|
|
11
12
|
success?: true | false;
|
|
12
|
-
} & (IFrameEventMessage | IFrameCallMessage | IFrameCancelMessage | UiResponseMessage | UiEventMessage | DeviceEventMessage | LogEventMessage);
|
|
13
|
+
} & (IFrameEventMessage | IFrameCallMessage | IFrameCancelMessage | UiResponseMessage | UiEventMessage | DeviceEventMessage | LogEventMessage | FirmwareMessage);
|
|
13
14
|
export declare type PostMessageEvent = MessageEvent<any>;
|
|
14
15
|
export declare const parseMessage: (messageData: any) => CoreMessage;
|
|
15
16
|
export declare const createErrorMessage: (error: Error & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/events/core.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/events/core.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,UAAU,eAAe,CAAC;AAEvC,oBAAY,WAAW,GAAG;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC;CACxB,GAAG,CACA,kBAAkB,GAClB,iBAAiB,GACjB,mBAAmB,GACnB,iBAAiB,GACjB,cAAc,GACd,kBAAkB,GAClB,eAAe,GACf,eAAe,CAClB,CAAC;AAEF,oBAAY,gBAAgB,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;AAEjD,eAAO,MAAM,YAAY,gBAAiB,GAAG,KAAG,WAiB/C,CAAC;AAEF,eAAO,MAAM,kBAAkB,UAAW,KAAK,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,KAAG,YAS9E,CAAC"}
|
package/dist/events/device.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PROTO } from '../constants';
|
|
2
|
-
import type { KnownDevice as Device } from '../types/device';
|
|
2
|
+
import type { Features, KnownDevice as Device } from '../types/device';
|
|
3
3
|
import { MessageFactoryFn } from './utils';
|
|
4
4
|
export declare const DEVICE_EVENT = "DEVICE_EVENT";
|
|
5
5
|
export declare const DEVICE: {
|
|
@@ -19,6 +19,7 @@ export declare const DEVICE: {
|
|
|
19
19
|
readonly PASSPHRASE: "passphrase";
|
|
20
20
|
readonly PASSPHRASE_ON_DEVICE: "passphrase_on_device";
|
|
21
21
|
readonly WORD: "word";
|
|
22
|
+
readonly FEATURES: "features";
|
|
22
23
|
};
|
|
23
24
|
export interface DeviceButtonRequestPayload extends Omit<PROTO.ButtonRequest, 'code'> {
|
|
24
25
|
code?: PROTO.ButtonRequest['code'] | 'ButtonRequest_FirmwareUpdate';
|
|
@@ -29,7 +30,12 @@ export interface DeviceButtonRequest {
|
|
|
29
30
|
device: Device | null;
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
|
-
export declare type
|
|
33
|
+
export declare type DeviceFeaturesPayload = Features;
|
|
34
|
+
export interface DeviceSendFeatures {
|
|
35
|
+
type: typeof DEVICE.FEATURES;
|
|
36
|
+
payload: DeviceFeaturesPayload;
|
|
37
|
+
}
|
|
38
|
+
export declare type DeviceEvent = DeviceButtonRequest | DeviceSendFeatures;
|
|
33
39
|
export declare type DeviceEventMessage = DeviceEvent & {
|
|
34
40
|
event: typeof DEVICE_EVENT;
|
|
35
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../src/events/device.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../src/events/device.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;CAuBT,CAAC;AAEX,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,MAAM,CAAC;IACnF,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,8BAA8B,CAAC;CACrE;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,MAAM,CAAC,MAAM,CAAC;IAC3B,OAAO,EAAE,0BAA0B,GAAG;QAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CACjE;AAED,oBAAY,qBAAqB,GAAG,QAAQ,CAAC;AAE7C,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,MAAM,CAAC,QAAQ,CAAC;IAC7B,OAAO,EAAE,qBAAqB,CAAC;CAChC;AAED,oBAAY,WAAW,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AAEnE,oBAAY,kBAAkB,GAAG,WAAW,GAAG;IAAE,KAAK,EAAE,OAAO,YAAY,CAAA;CAAE,CAAC;AAE9E,oBAAY,qBAAqB,GAAG,CAClC,IAAI,EAAE,OAAO,YAAY,EACzB,EAAE,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,KACpC,IAAI,CAAC;AAEV,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,CAAC,OAAO,YAAY,EAAE,WAAW,CAQxE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MessageFactoryFn } from './utils';
|
|
2
|
+
import { getBleFirmwareReleaseInfo, getFirmwareReleaseInfo } from '../api/firmware/releaseHelper';
|
|
3
|
+
export declare const FIRMWARE_EVENT = "FIRMWARE_EVENT";
|
|
4
|
+
export declare const FIRMWARE: {
|
|
5
|
+
readonly RELEASE_INFO: "firmware-release-info";
|
|
6
|
+
readonly BLE_RELEASE_INFO: "ble-firmware-release-info";
|
|
7
|
+
};
|
|
8
|
+
export interface ReleaseInfoEvent {
|
|
9
|
+
type: typeof FIRMWARE.RELEASE_INFO;
|
|
10
|
+
payload: ReturnType<typeof getFirmwareReleaseInfo>;
|
|
11
|
+
}
|
|
12
|
+
export interface BleReleaseInfoEvent {
|
|
13
|
+
type: typeof FIRMWARE.BLE_RELEASE_INFO;
|
|
14
|
+
payload: ReturnType<typeof getBleFirmwareReleaseInfo>;
|
|
15
|
+
}
|
|
16
|
+
export declare type FirmwareEvent = ReleaseInfoEvent | BleReleaseInfoEvent;
|
|
17
|
+
export declare type FirmwareMessage = FirmwareEvent & {
|
|
18
|
+
event: typeof FIRMWARE_EVENT;
|
|
19
|
+
};
|
|
20
|
+
export declare const createFirmwareMessage: MessageFactoryFn<typeof FIRMWARE_EVENT, FirmwareEvent>;
|
|
21
|
+
//# sourceMappingURL=firmware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firmware.d.ts","sourceRoot":"","sources":["../../src/events/firmware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAElG,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,QAAQ;;;CAGX,CAAC;AAEX,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,QAAQ,CAAC,YAAY,CAAC;IACnC,OAAO,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,QAAQ,CAAC,gBAAgB,CAAC;IACvC,OAAO,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;CACvD;AAED,oBAAY,aAAa,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAEnE,oBAAY,eAAe,GAAG,aAAa,GAAG;IAAE,KAAK,EAAE,OAAO,cAAc,CAAA;CAAE,CAAC;AAE/E,eAAO,MAAM,qBAAqB,EAAE,gBAAgB,CAAC,OAAO,cAAc,EAAE,aAAa,CAQ9E,CAAC"}
|
package/dist/events/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ import { Deferred } from '@onekeyfe/hd-shared';
|
|
|
6
6
|
|
|
7
7
|
interface CommonParams {
|
|
8
8
|
keepSession?: boolean;
|
|
9
|
+
retryCount?: number;
|
|
10
|
+
pollIntervalTime?: number;
|
|
11
|
+
timeout?: number;
|
|
9
12
|
}
|
|
10
13
|
declare type Params<T> = CommonParams & T & {
|
|
11
14
|
bundle?: undefined;
|
|
@@ -248,8 +251,8 @@ declare type EVMGetAddressParams = {
|
|
|
248
251
|
path: string | number[];
|
|
249
252
|
showOnOneKey?: boolean;
|
|
250
253
|
};
|
|
251
|
-
declare function evmGetAddress(connectId: string, params: CommonParams & EVMGetAddressParams): Response<EVMAddress>;
|
|
252
|
-
declare function evmGetAddress(connectId: string, params: CommonParams & {
|
|
254
|
+
declare function evmGetAddress(connectId: string, deviceId: string, params: CommonParams & EVMGetAddressParams): Response<EVMAddress>;
|
|
255
|
+
declare function evmGetAddress(connectId: string, deviceId: string, params: CommonParams & {
|
|
253
256
|
bundle?: EVMGetAddressParams[];
|
|
254
257
|
}): Response<Array<EVMAddress>>;
|
|
255
258
|
|
|
@@ -260,8 +263,8 @@ declare type EVMGetPublicKeyParams = {
|
|
|
260
263
|
path: string | number[];
|
|
261
264
|
showOnOneKey?: boolean;
|
|
262
265
|
};
|
|
263
|
-
declare function evmGetPublicKey(connectId: string, params: CommonParams & EVMGetPublicKeyParams): Response<EVMPublicKey>;
|
|
264
|
-
declare function evmGetPublicKey(connectId: string, params: CommonParams & {
|
|
266
|
+
declare function evmGetPublicKey(connectId: string, deviceId: string, params: CommonParams & EVMGetPublicKeyParams): Response<EVMPublicKey>;
|
|
267
|
+
declare function evmGetPublicKey(connectId: string, deviceId: string, params: CommonParams & {
|
|
265
268
|
bundle?: EVMGetPublicKeyParams[];
|
|
266
269
|
}): Response<Array<EVMPublicKey>>;
|
|
267
270
|
|
|
@@ -269,14 +272,14 @@ declare type EVMSignMessageParams = {
|
|
|
269
272
|
path: string | number[];
|
|
270
273
|
messageHex: string;
|
|
271
274
|
};
|
|
272
|
-
declare function evmSignMessage(connectId: string, params: CommonParams & EVMSignMessageParams): Response<EthereumMessageSignature>;
|
|
275
|
+
declare function evmSignMessage(connectId: string, deviceId: string, params: CommonParams & EVMSignMessageParams): Response<EthereumMessageSignature>;
|
|
273
276
|
|
|
274
277
|
declare type EVMSignMessageEIP712Params = {
|
|
275
278
|
path: string | number[];
|
|
276
279
|
domainHash: string;
|
|
277
280
|
messageHash: string;
|
|
278
281
|
};
|
|
279
|
-
declare function evmSignMessageEIP712(connectId: string, params: CommonParams & EVMSignMessageEIP712Params): Response<EthereumMessageSignature>;
|
|
282
|
+
declare function evmSignMessageEIP712(connectId: string, deviceId: string, params: CommonParams & EVMSignMessageEIP712Params): Response<EthereumMessageSignature>;
|
|
280
283
|
|
|
281
284
|
declare type EVMSignedTx = {
|
|
282
285
|
v: string;
|
|
@@ -315,7 +318,7 @@ declare type EVMSignTransactionParams = {
|
|
|
315
318
|
path: string | number[];
|
|
316
319
|
transaction: EVMTransaction | EVMTransactionEIP1559;
|
|
317
320
|
};
|
|
318
|
-
declare function evmSignTransaction(connectId: string, params: CommonParams & EVMSignTransactionParams): Response<EVMSignedTx>;
|
|
321
|
+
declare function evmSignTransaction(connectId: string, deviceId: string, params: CommonParams & EVMSignTransactionParams): Response<EVMSignedTx>;
|
|
319
322
|
|
|
320
323
|
declare type EthereumSignTypedDataTypeProperty = {
|
|
321
324
|
name: string;
|
|
@@ -346,14 +349,14 @@ declare type EVMSignTypedDataParams = {
|
|
|
346
349
|
domainHash?: string;
|
|
347
350
|
messageHash?: string;
|
|
348
351
|
};
|
|
349
|
-
declare function evmSignTypedData(connectId: string, params: CommonParams & EVMSignTypedDataParams): Response<EthereumMessageSignature>;
|
|
352
|
+
declare function evmSignTypedData(connectId: string, deviceId: string, params: CommonParams & EVMSignTypedDataParams): Response<EthereumMessageSignature>;
|
|
350
353
|
|
|
351
354
|
declare type EVMVerifyMessageParams = {
|
|
352
355
|
address: string;
|
|
353
356
|
messageHex: string;
|
|
354
357
|
signature: string;
|
|
355
358
|
};
|
|
356
|
-
declare function evmVerifyMessage(connectId: string, params: CommonParams & EVMVerifyMessageParams): Response<Success$1>;
|
|
359
|
+
declare function evmVerifyMessage(connectId: string, deviceId: string, params: CommonParams & EVMVerifyMessageParams): Response<Success$1>;
|
|
357
360
|
|
|
358
361
|
declare type BTCAddress = {
|
|
359
362
|
path: string;
|
|
@@ -365,8 +368,8 @@ declare type BTCGetAddressParams = {
|
|
|
365
368
|
multisig?: MultisigRedeemScriptType;
|
|
366
369
|
scriptType?: InputScriptType;
|
|
367
370
|
};
|
|
368
|
-
declare function btcGetAddress(connectId: string, params: CommonParams & BTCGetAddressParams): Response<BTCAddress>;
|
|
369
|
-
declare function btcGetAddress(connectId: string, params: CommonParams & {
|
|
371
|
+
declare function btcGetAddress(connectId: string, deviceId: string, params: CommonParams & BTCGetAddressParams): Response<BTCAddress>;
|
|
372
|
+
declare function btcGetAddress(connectId: string, deviceId: string, params: CommonParams & {
|
|
370
373
|
bundle?: BTCGetAddressParams[];
|
|
371
374
|
}): Response<Array<BTCAddress>>;
|
|
372
375
|
|
|
@@ -379,8 +382,8 @@ declare type BTCGetPublicKeyParams = {
|
|
|
379
382
|
showOnOneKey?: boolean;
|
|
380
383
|
scriptType?: InputScriptType;
|
|
381
384
|
};
|
|
382
|
-
declare function btcGetPublicKey(connectId: string, params: CommonParams & BTCGetPublicKeyParams): Response<BTCPublicKey>;
|
|
383
|
-
declare function btcGetPublicKey(connectId: string, params: CommonParams & {
|
|
385
|
+
declare function btcGetPublicKey(connectId: string, deviceId: string, params: CommonParams & BTCGetPublicKeyParams): Response<BTCPublicKey>;
|
|
386
|
+
declare function btcGetPublicKey(connectId: string, deviceId: string, params: CommonParams & {
|
|
384
387
|
bundle?: BTCGetPublicKeyParams[];
|
|
385
388
|
}): Response<Array<BTCPublicKey>>;
|
|
386
389
|
|
|
@@ -389,7 +392,7 @@ declare type BTCSignMessageParams = {
|
|
|
389
392
|
messageHex: string;
|
|
390
393
|
coin?: string;
|
|
391
394
|
};
|
|
392
|
-
declare function btcSignMessage(connectId: string, params: CommonParams & BTCSignMessageParams): Response<MessageSignature>;
|
|
395
|
+
declare function btcSignMessage(connectId: string, deviceId: string, params: CommonParams & BTCSignMessageParams): Response<MessageSignature>;
|
|
393
396
|
|
|
394
397
|
declare type SignedTransaction = {
|
|
395
398
|
signatures: string[];
|
|
@@ -461,7 +464,7 @@ declare type BTCSignTransactionParams = {
|
|
|
461
464
|
branchId?: number;
|
|
462
465
|
timestamp?: number;
|
|
463
466
|
};
|
|
464
|
-
declare function btcSignTransaction(connectId: string, params: CommonParams & BTCSignTransactionParams): Response<SignedTransaction>;
|
|
467
|
+
declare function btcSignTransaction(connectId: string, deviceId: string, params: CommonParams & BTCSignTransactionParams): Response<SignedTransaction>;
|
|
465
468
|
|
|
466
469
|
declare type BTCVerifyMessageParams = {
|
|
467
470
|
address: string;
|
|
@@ -469,7 +472,7 @@ declare type BTCVerifyMessageParams = {
|
|
|
469
472
|
signature: string;
|
|
470
473
|
coin: string;
|
|
471
474
|
};
|
|
472
|
-
declare function btcVerifyMessage(connectId: string, params: CommonParams & BTCVerifyMessageParams): Response<Success$1>;
|
|
475
|
+
declare function btcVerifyMessage(connectId: string, deviceId: string, params: CommonParams & BTCVerifyMessageParams): Response<Success$1>;
|
|
473
476
|
|
|
474
477
|
declare function uiResponse(response: UiResponseEvent): void;
|
|
475
478
|
|
|
@@ -548,8 +551,8 @@ declare type StarcoinGetAddressParams = {
|
|
|
548
551
|
path: string | number[];
|
|
549
552
|
showOnOneKey?: boolean;
|
|
550
553
|
};
|
|
551
|
-
declare function starcoinGetAddress(connectId: string, params: CommonParams & StarcoinGetAddressParams): Response<StarcoinAddress>;
|
|
552
|
-
declare function starcoinGetAddress(connectId: string, params: CommonParams & {
|
|
554
|
+
declare function starcoinGetAddress(connectId: string, deviceId: string, params: CommonParams & StarcoinGetAddressParams): Response<StarcoinAddress>;
|
|
555
|
+
declare function starcoinGetAddress(connectId: string, deviceId: string, params: CommonParams & {
|
|
553
556
|
bundle?: StarcoinGetAddressParams[];
|
|
554
557
|
}): Response<Array<StarcoinAddress>>;
|
|
555
558
|
|
|
@@ -560,8 +563,8 @@ declare type StarcoinGetPublicKeyParams = {
|
|
|
560
563
|
path: string | number[];
|
|
561
564
|
showOnOneKey?: boolean;
|
|
562
565
|
};
|
|
563
|
-
declare function starcoinGetPublicKey(connectId: string, params: CommonParams & StarcoinGetPublicKeyParams): Response<StarcoinPublicKey>;
|
|
564
|
-
declare function starcoinGetPublicKey(connectId: string, params: CommonParams & {
|
|
566
|
+
declare function starcoinGetPublicKey(connectId: string, deviceId: string, params: CommonParams & StarcoinGetPublicKeyParams): Response<StarcoinPublicKey>;
|
|
567
|
+
declare function starcoinGetPublicKey(connectId: string, deviceId: string, params: CommonParams & {
|
|
565
568
|
bundle?: StarcoinGetPublicKeyParams[];
|
|
566
569
|
}): Response<Array<StarcoinPublicKey>>;
|
|
567
570
|
|
|
@@ -569,20 +572,20 @@ declare type StarcoinSignMessageParams = {
|
|
|
569
572
|
path: string | number[];
|
|
570
573
|
messageHex: string;
|
|
571
574
|
};
|
|
572
|
-
declare function starcoinSignMessage(connectId: string, params: CommonParams & StarcoinSignMessageParams): Response<StarcoinMessageSignature>;
|
|
575
|
+
declare function starcoinSignMessage(connectId: string, deviceId: string, params: CommonParams & StarcoinSignMessageParams): Response<StarcoinMessageSignature>;
|
|
573
576
|
|
|
574
577
|
declare type StarcoinSignTransactionParams = {
|
|
575
578
|
path: string | number[];
|
|
576
579
|
rawTx: string;
|
|
577
580
|
};
|
|
578
|
-
declare function starcoinSignTransaction(connectId: string, params: CommonParams & StarcoinSignTransactionParams): Response<StarcoinSignedTx>;
|
|
581
|
+
declare function starcoinSignTransaction(connectId: string, deviceId: string, params: CommonParams & StarcoinSignTransactionParams): Response<StarcoinSignedTx>;
|
|
579
582
|
|
|
580
583
|
declare type StarcoinVerifyMessageParams = {
|
|
581
584
|
publicKey: string;
|
|
582
585
|
messageHex: string;
|
|
583
586
|
signature: string;
|
|
584
587
|
};
|
|
585
|
-
declare function starcoinVerifyMessage(connectId: string, params: CommonParams & StarcoinVerifyMessageParams): Response<Success$1>;
|
|
588
|
+
declare function starcoinVerifyMessage(connectId: string, deviceId: string, params: CommonParams & StarcoinVerifyMessageParams): Response<Success$1>;
|
|
586
589
|
|
|
587
590
|
declare type NEMAddress = {
|
|
588
591
|
path: string;
|
|
@@ -592,8 +595,8 @@ declare type NEMGetAddressParams = {
|
|
|
592
595
|
network?: number;
|
|
593
596
|
showOnOneKey?: boolean;
|
|
594
597
|
};
|
|
595
|
-
declare function nemGetAddress(connectId: string, params: CommonParams & NEMGetAddressParams): Response<NEMAddress>;
|
|
596
|
-
declare function nemGetAddress(connectId: string, params: CommonParams & {
|
|
598
|
+
declare function nemGetAddress(connectId: string, deviceId: string, params: CommonParams & NEMGetAddressParams): Response<NEMAddress>;
|
|
599
|
+
declare function nemGetAddress(connectId: string, deviceId: string, params: CommonParams & {
|
|
597
600
|
bundle?: NEMGetAddressParams[];
|
|
598
601
|
}): Response<Array<NEMAddress>>;
|
|
599
602
|
|
|
@@ -685,7 +688,7 @@ declare type NEMSignTransactionParams = {
|
|
|
685
688
|
path: string | number[];
|
|
686
689
|
transaction: NEMTransaction;
|
|
687
690
|
};
|
|
688
|
-
declare function nemSignTransaction(connectId: string, params: CommonParams & NEMSignTransactionParams): Response<NEMSignedTx>;
|
|
691
|
+
declare function nemSignTransaction(connectId: string, deviceId: string, params: CommonParams & NEMSignTransactionParams): Response<NEMSignedTx>;
|
|
689
692
|
|
|
690
693
|
declare type SolanaAddress = {
|
|
691
694
|
path: string;
|
|
@@ -694,8 +697,8 @@ declare type SolanaGetAddressParams = {
|
|
|
694
697
|
path: string | number[];
|
|
695
698
|
showOnOneKey?: boolean;
|
|
696
699
|
};
|
|
697
|
-
declare function solGetAddress(connectId: string, params: CommonParams & SolanaGetAddressParams): Response<SolanaAddress>;
|
|
698
|
-
declare function solGetAddress(connectId: string, params: CommonParams & {
|
|
700
|
+
declare function solGetAddress(connectId: string, deviceId: string, params: CommonParams & SolanaGetAddressParams): Response<SolanaAddress>;
|
|
701
|
+
declare function solGetAddress(connectId: string, deviceId: string, params: CommonParams & {
|
|
699
702
|
bundle?: SolanaGetAddressParams[];
|
|
700
703
|
}): Response<Array<SolanaAddress>>;
|
|
701
704
|
|
|
@@ -706,8 +709,8 @@ declare type SolanaSignTransactionParams = {
|
|
|
706
709
|
path: string | number[];
|
|
707
710
|
rawTx?: string;
|
|
708
711
|
};
|
|
709
|
-
declare function solSignTransaction(connectId: string, params: CommonParams & SolanaSignTransactionParams): Response<SolanaSignedTx>;
|
|
710
|
-
declare function solSignTransaction(connectId: string, params: CommonParams & {
|
|
712
|
+
declare function solSignTransaction(connectId: string, deviceId: string, params: CommonParams & SolanaSignTransactionParams): Response<SolanaSignedTx>;
|
|
713
|
+
declare function solSignTransaction(connectId: string, deviceId: string, params: CommonParams & {
|
|
711
714
|
bundle?: SolanaSignTransactionParams[];
|
|
712
715
|
}): Response<Array<SolanaSignedTx>>;
|
|
713
716
|
|
|
@@ -718,8 +721,8 @@ declare type StellarGetAddressParams = {
|
|
|
718
721
|
path: string | number[];
|
|
719
722
|
showOnOneKey?: boolean;
|
|
720
723
|
};
|
|
721
|
-
declare function stellarGetAddress(connectId: string, params: CommonParams & StellarGetAddressParams): Response<StellarAddress>;
|
|
722
|
-
declare function stellarGetAddress(connectId: string, params: CommonParams & {
|
|
724
|
+
declare function stellarGetAddress(connectId: string, deviceId: string, params: CommonParams & StellarGetAddressParams): Response<StellarAddress>;
|
|
725
|
+
declare function stellarGetAddress(connectId: string, deviceId: string, params: CommonParams & {
|
|
723
726
|
bundle?: StellarGetAddressParams[];
|
|
724
727
|
}): Response<Array<StellarAddress>>;
|
|
725
728
|
|
|
@@ -847,7 +850,7 @@ declare type StellarSignTransactionParams = {
|
|
|
847
850
|
networkPassphrase: string;
|
|
848
851
|
transaction: StellarTransaction;
|
|
849
852
|
};
|
|
850
|
-
declare function stellarSignTransaction(connectId: string, params: CommonParams & StellarSignTransactionParams): Response<StellarSignedTx>;
|
|
853
|
+
declare function stellarSignTransaction(connectId: string, deviceId: string, params: CommonParams & StellarSignTransactionParams): Response<StellarSignedTx>;
|
|
851
854
|
|
|
852
855
|
declare type CipheredKeyValue = {
|
|
853
856
|
path: string;
|
|
@@ -861,8 +864,8 @@ declare type CipheredKeyValueParams = {
|
|
|
861
864
|
askOnDecrypt?: boolean;
|
|
862
865
|
iv?: string;
|
|
863
866
|
};
|
|
864
|
-
declare function cipherKeyValue(connectId: string, params: CommonParams & CipheredKeyValueParams): Response<CipheredKeyValue>;
|
|
865
|
-
declare function cipherKeyValue(connectId: string, params: CommonParams & {
|
|
867
|
+
declare function cipherKeyValue(connectId: string, deviceId: string, params: CommonParams & CipheredKeyValueParams): Response<CipheredKeyValue>;
|
|
868
|
+
declare function cipherKeyValue(connectId: string, deviceId: string, params: CommonParams & {
|
|
866
869
|
bundle?: CipheredKeyValueParams[];
|
|
867
870
|
}): Response<Array<CipheredKeyValue>>;
|
|
868
871
|
|
|
@@ -965,6 +968,7 @@ declare const DEVICE: {
|
|
|
965
968
|
readonly PASSPHRASE: "passphrase";
|
|
966
969
|
readonly PASSPHRASE_ON_DEVICE: "passphrase_on_device";
|
|
967
970
|
readonly WORD: "word";
|
|
971
|
+
readonly FEATURES: "features";
|
|
968
972
|
};
|
|
969
973
|
interface DeviceButtonRequestPayload extends Omit<Messages.ButtonRequest, 'code'> {
|
|
970
974
|
code?: Messages.ButtonRequest['code'] | 'ButtonRequest_FirmwareUpdate';
|
|
@@ -975,7 +979,12 @@ interface DeviceButtonRequest {
|
|
|
975
979
|
device: KnownDevice | null;
|
|
976
980
|
};
|
|
977
981
|
}
|
|
978
|
-
declare type
|
|
982
|
+
declare type DeviceFeaturesPayload = Features;
|
|
983
|
+
interface DeviceSendFeatures {
|
|
984
|
+
type: typeof DEVICE.FEATURES;
|
|
985
|
+
payload: DeviceFeaturesPayload;
|
|
986
|
+
}
|
|
987
|
+
declare type DeviceEvent = DeviceButtonRequest | DeviceSendFeatures;
|
|
979
988
|
declare type DeviceEventMessage = DeviceEvent & {
|
|
980
989
|
event: typeof DEVICE_EVENT;
|
|
981
990
|
};
|
|
@@ -1115,11 +1124,47 @@ declare type LogEventMessage = LogEvent & {
|
|
|
1115
1124
|
};
|
|
1116
1125
|
declare const createLogMessage: MessageFactoryFn<typeof LOG_EVENT, LogEvent>;
|
|
1117
1126
|
|
|
1127
|
+
declare const getFirmwareReleaseInfo: (features: Features) => {
|
|
1128
|
+
status: IDeviceFirmwareStatus;
|
|
1129
|
+
changelog: {
|
|
1130
|
+
"zh-CN": string;
|
|
1131
|
+
"en-US": string;
|
|
1132
|
+
}[];
|
|
1133
|
+
release: IFirmwareReleaseInfo;
|
|
1134
|
+
};
|
|
1135
|
+
declare const getBleFirmwareReleaseInfo: (features: Features) => {
|
|
1136
|
+
status: IDeviceBLEFirmwareStatus;
|
|
1137
|
+
changelog: {
|
|
1138
|
+
"zh-CN": string;
|
|
1139
|
+
"en-US": string;
|
|
1140
|
+
}[];
|
|
1141
|
+
release: IBLEFirmwareReleaseInfo;
|
|
1142
|
+
};
|
|
1143
|
+
|
|
1144
|
+
declare const FIRMWARE_EVENT = "FIRMWARE_EVENT";
|
|
1145
|
+
declare const FIRMWARE: {
|
|
1146
|
+
readonly RELEASE_INFO: "firmware-release-info";
|
|
1147
|
+
readonly BLE_RELEASE_INFO: "ble-firmware-release-info";
|
|
1148
|
+
};
|
|
1149
|
+
interface ReleaseInfoEvent {
|
|
1150
|
+
type: typeof FIRMWARE.RELEASE_INFO;
|
|
1151
|
+
payload: ReturnType<typeof getFirmwareReleaseInfo>;
|
|
1152
|
+
}
|
|
1153
|
+
interface BleReleaseInfoEvent {
|
|
1154
|
+
type: typeof FIRMWARE.BLE_RELEASE_INFO;
|
|
1155
|
+
payload: ReturnType<typeof getBleFirmwareReleaseInfo>;
|
|
1156
|
+
}
|
|
1157
|
+
declare type FirmwareEvent = ReleaseInfoEvent | BleReleaseInfoEvent;
|
|
1158
|
+
declare type FirmwareMessage = FirmwareEvent & {
|
|
1159
|
+
event: typeof FIRMWARE_EVENT;
|
|
1160
|
+
};
|
|
1161
|
+
declare const createFirmwareMessage: MessageFactoryFn<typeof FIRMWARE_EVENT, FirmwareEvent>;
|
|
1162
|
+
|
|
1118
1163
|
declare const CORE_EVENT = "CORE_EVENT";
|
|
1119
1164
|
declare type CoreMessage = {
|
|
1120
1165
|
id?: string;
|
|
1121
1166
|
success?: true | false;
|
|
1122
|
-
} & (IFrameEventMessage | IFrameCallMessage | IFrameCancelMessage | UiResponseMessage | UiEventMessage | DeviceEventMessage | LogEventMessage);
|
|
1167
|
+
} & (IFrameEventMessage | IFrameCallMessage | IFrameCancelMessage | UiResponseMessage | UiEventMessage | DeviceEventMessage | LogEventMessage | FirmwareMessage);
|
|
1123
1168
|
declare type PostMessageEvent = MessageEvent<any>;
|
|
1124
1169
|
declare const parseMessage: (messageData: any) => CoreMessage;
|
|
1125
1170
|
declare const createErrorMessage: (error: Error & {
|
|
@@ -1171,7 +1216,7 @@ declare class DeviceCommands {
|
|
|
1171
1216
|
callPromise?: Promise<DefaultMessageResponse>;
|
|
1172
1217
|
_cancelableRequest?: (error?: any) => void;
|
|
1173
1218
|
constructor(device: Device, mainId: string);
|
|
1174
|
-
dispose(): void
|
|
1219
|
+
dispose(cancelRequest: boolean): Promise<void>;
|
|
1175
1220
|
call(type: MessageKey, msg?: DefaultMessageResponse['message']): Promise<DefaultMessageResponse>;
|
|
1176
1221
|
typedCall<T extends MessageKey, R extends MessageKey[]>(type: T, resType: R, msg?: MessageType[T]): Promise<TypedCallResponseMap[R[number]]>;
|
|
1177
1222
|
typedCall<T extends MessageKey, R extends MessageKey>(type: T, resType: R, msg?: MessageType[T]): Promise<TypedResponseMessage<R>>;
|
|
@@ -1187,6 +1232,7 @@ interface DeviceEvents {
|
|
|
1187
1232
|
[DEVICE.PIN]: [Device, Messages.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
|
|
1188
1233
|
[DEVICE.PASSPHRASE_ON_DEVICE]: [Device, ((response: any) => void)?];
|
|
1189
1234
|
[DEVICE.BUTTON]: [Device, DeviceButtonRequestPayload];
|
|
1235
|
+
[DEVICE.FEATURES]: [Device, DeviceFeaturesPayload];
|
|
1190
1236
|
}
|
|
1191
1237
|
interface Device {
|
|
1192
1238
|
on<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
|
|
@@ -1222,7 +1268,8 @@ declare class Device extends EventEmitter {
|
|
|
1222
1268
|
updateFromCache(device: Device): void;
|
|
1223
1269
|
run(fn?: () => Promise<void>, options?: RunOptions): Promise<void>;
|
|
1224
1270
|
_runInner<T>(fn: (() => Promise<T>) | undefined, options: RunOptions): Promise<undefined>;
|
|
1225
|
-
|
|
1271
|
+
interruptionFromOutside(): Promise<void>;
|
|
1272
|
+
interruptionFromUser(): Promise<void>;
|
|
1226
1273
|
getMode(): "normal" | "bootloader" | "initialize" | "seedless";
|
|
1227
1274
|
getFirmwareVersion(): IVersionArray | null;
|
|
1228
1275
|
getBLEFirmwareVersion(): IVersionArray | null;
|
|
@@ -1234,6 +1281,7 @@ declare class Device extends EventEmitter {
|
|
|
1234
1281
|
isSeedless(): boolean | undefined;
|
|
1235
1282
|
isUnacquired(): boolean;
|
|
1236
1283
|
hasUnexpectedMode(allow: string[], require: string[]): "ui-device_not_in_bootloader_mode" | "ui-device_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
|
|
1284
|
+
checkDeviceId(deviceId: string): boolean;
|
|
1237
1285
|
}
|
|
1238
1286
|
|
|
1239
1287
|
declare type UiPromiseResponse = UiResponseEvent | {
|
|
@@ -1352,4 +1400,4 @@ declare class DataManager {
|
|
|
1352
1400
|
|
|
1353
1401
|
declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, cancel, }: InjectApi) => CoreApi;
|
|
1354
1402
|
|
|
1355
|
-
export { AccountAddress, AccountAddresses, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConnectSettings, Core, CoreApi, CoreMessage, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFirmwareRange, DeviceFlagsParams, DeviceMode, DeviceRecoveryParams, DeviceResetParams, DeviceSettingsParams, DeviceStatus, DeviceTypeMap, DeviceVerifyParams, DeviceVerifySignature, EVMAccessList, EVMAddress, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, Features, FirmwareProgress, FirmwareRange, FirmwareRelease, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareReleaseInfo, IFrameBridge, IFrameCallMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, ILocale, ITransportStatus, IVersionArray, KnownDevice, LOG, LOG_EVENT, LogEvent, LogEventMessage, LogOutput, LoggerNames, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, Params, PostMessageEvent, RESPONSE_EVENT, RefTransaction, ReleaseInfo, RemoteConfigResponse, Response, SearchDevice, SignedTransaction, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, TransactionOptions, TransportReleaseStatus, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePin, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, corsValidator, createDeviceMessage, createErrorMessage, createIFrameMessage, createLogMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceTypeByDeviceId, getDeviceUUID, getEnv, getHDPath, getLog, getLogger, getScriptType, getTimeStamp, httpRequest, init as initCore, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, safeThrowError, setLoggerPostMessage, versionCompare, versionSplit };
|
|
1403
|
+
export { AccountAddress, AccountAddresses, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BleReleaseInfoEvent, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConnectSettings, Core, CoreApi, CoreMessage, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesPayload, DeviceFirmwareRange, DeviceFlagsParams, DeviceMode, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSettingsParams, DeviceStatus, DeviceTypeMap, DeviceVerifyParams, DeviceVerifySignature, EVMAccessList, EVMAddress, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FirmwareEvent, FirmwareMessage, FirmwareProgress, FirmwareRange, FirmwareRelease, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareReleaseInfo, IFrameBridge, IFrameCallMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, ILocale, ITransportStatus, IVersionArray, KnownDevice, LOG, LOG_EVENT, LogEvent, LogEventMessage, LogOutput, LoggerNames, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, Params, PostMessageEvent, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, RemoteConfigResponse, Response, SearchDevice, SignedTransaction, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, TransactionOptions, TransportReleaseStatus, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePin, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceTypeByDeviceId, getDeviceUUID, getEnv, getHDPath, getLog, getLogger, getScriptType, getTimeStamp, httpRequest, init as initCore, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, safeThrowError, setLoggerPostMessage, versionCompare, versionSplit };
|