@onekeyfe/hd-core 1.2.0-alpha.20 → 1.2.0-alpha.21
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__/device-lifecycle-events.test.ts +1 -1
- package/__tests__/device-settings.test.ts +110 -5
- package/__tests__/device-state-events.test.ts +3 -3
- package/__tests__/device-state-mapper.test.ts +15 -3
- package/__tests__/device-state-store.test.ts +1 -1
- package/__tests__/deviceSettings.test.ts +55 -15
- package/__tests__/evmLedgerLegacySafety.test.ts +6 -5
- package/__tests__/get-device-state.test.ts +7 -0
- package/__tests__/protocol-v2.test.ts +40 -153
- package/__tests__/public-device-state-api.test.ts +19 -15
- package/__tests__/public-pro2-api-boundary.test.ts +20 -1
- package/dist/api/BaseMethod.d.ts +0 -3
- package/dist/api/BaseMethod.d.ts.map +1 -1
- package/dist/api/UploadPortfolio.d.ts +0 -1
- package/dist/api/UploadPortfolio.d.ts.map +1 -1
- package/dist/api/device/DeviceSettings.d.ts.map +1 -1
- package/dist/api/device/DeviceUnlock.d.ts +1 -1
- package/dist/api/device/DeviceUnlock.d.ts.map +1 -1
- package/dist/api/index.d.ts +0 -3
- package/dist/api/index.d.ts.map +1 -1
- package/dist/core/RequestQueue.d.ts +1 -19
- package/dist/core/RequestQueue.d.ts.map +1 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/device/Device.d.ts +1 -1
- package/dist/device/DeviceFeaturesState.d.ts +0 -1
- package/dist/device/DeviceFeaturesState.d.ts.map +1 -1
- package/dist/device/DeviceStateMapper.d.ts.map +1 -1
- package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -1
- package/dist/events/call.d.ts +0 -7
- package/dist/events/call.d.ts.map +1 -1
- package/dist/events/core.d.ts +2 -2
- package/dist/events/core.d.ts.map +1 -1
- package/dist/events/iframe.d.ts +0 -1
- package/dist/events/iframe.d.ts.map +1 -1
- package/dist/index.d.ts +59 -55
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +169 -310
- package/dist/inject.d.ts +2 -3
- package/dist/inject.d.ts.map +1 -1
- package/dist/lowLevelInject.d.ts +1 -2
- package/dist/lowLevelInject.d.ts.map +1 -1
- package/dist/topLevelInject.d.ts.map +1 -1
- package/dist/types/api/deviceSettings.d.ts +2 -2
- package/dist/types/api/deviceSettings.d.ts.map +1 -1
- package/dist/types/api/deviceUnlock.d.ts +2 -2
- package/dist/types/api/deviceUnlock.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +1 -5
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/protocolV2.d.ts +1 -9
- package/dist/types/api/protocolV2.d.ts.map +1 -1
- package/dist/types/device.d.ts +4 -4
- package/dist/types/device.d.ts.map +1 -1
- package/dist/utils/deviceSettings.d.ts +36 -7
- package/dist/utils/deviceSettings.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/BaseMethod.ts +3 -9
- package/src/api/UploadPortfolio.ts +2 -12
- package/src/api/device/DeviceSettings.ts +66 -5
- package/src/api/device/DeviceUnlock.ts +2 -1
- package/src/api/index.ts +0 -3
- package/src/core/RequestQueue.ts +4 -123
- package/src/core/index.ts +25 -31
- package/src/device/Device.ts +1 -1
- package/src/device/DeviceFeaturesState.ts +0 -9
- package/src/device/DeviceStateMapper.ts +8 -7
- package/src/deviceProfile/buildDeviceFeatures.ts +2 -1
- package/src/events/call.ts +0 -6
- package/src/events/core.ts +0 -2
- package/src/events/iframe.ts +0 -1
- package/src/index.ts +0 -4
- package/src/inject.ts +0 -10
- package/src/lowLevelInject.ts +0 -3
- package/src/topLevelInject.ts +0 -2
- package/src/types/api/deviceSettings.ts +17 -2
- package/src/types/api/deviceUnlock.ts +5 -2
- package/src/types/api/index.ts +0 -7
- package/src/types/api/protocolV2.ts +0 -31
- package/src/types/device.ts +5 -3
- package/src/utils/deviceSettings.ts +130 -56
- package/src/utils/index.ts +18 -1
- package/__tests__/RequestQueue.test.ts +0 -140
- package/__tests__/UploadPortfolio.test.ts +0 -46
- package/dist/api/protocol-v2/DeviceSettingsGet.d.ts +0 -6
- package/dist/api/protocol-v2/DeviceSettingsGet.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceSettingsPageShow.d.ts +0 -16
- package/dist/api/protocol-v2/DeviceSettingsPageShow.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceSettingsSet.d.ts +0 -12
- package/dist/api/protocol-v2/DeviceSettingsSet.d.ts.map +0 -1
- package/src/api/protocol-v2/DeviceSettingsGet.ts +0 -18
- package/src/api/protocol-v2/DeviceSettingsPageShow.ts +0 -70
- package/src/api/protocol-v2/DeviceSettingsSet.ts +0 -44
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildDeviceFeatures.d.ts","sourceRoot":"","sources":["../../src/deviceProfile/buildDeviceFeatures.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildDeviceFeatures.d.ts","sourceRoot":"","sources":["../../src/deviceProfile/buildDeviceFeatures.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAEV,YAAY,EACZ,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAsB,QAAQ,EAAE,MAAM,UAAU,CAAC;AA6C7D,eAAO,MAAM,8BAA8B,uBACrB,cAAc,aACvB,QAAQ,KAClB,QA+HF,CAAC;AASF,eAAO,MAAM,8BAA8B;;;;;MAUvC,QAgLH,CAAC"}
|
package/dist/events/call.d.ts
CHANGED
|
@@ -34,13 +34,6 @@ export interface IFrameCancelMessage {
|
|
|
34
34
|
connectId?: string;
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
export interface IFrameCancelOperationMessage {
|
|
38
|
-
event: typeof IFRAME.CANCEL_OPERATION;
|
|
39
|
-
type: typeof IFRAME.CANCEL_OPERATION;
|
|
40
|
-
payload: {
|
|
41
|
-
operationId: string;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
37
|
export interface IFrameSwitchTransportMessage {
|
|
45
38
|
event: typeof IFRAME.SWITCH_TRANSPORT;
|
|
46
39
|
type: typeof IFRAME.SWITCH_TRANSPORT;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../src/events/call.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEvE,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAClD,CAAC,SAAS;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,CAAA;CAAE,GAC3C,CAAC,GACD,KAAK,GACP,IAAI,CAAC;AAET,KAAK,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS;IACrE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC7B,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;CAC9B,GACG,CAAC,CAAC,MAAM,EAAE,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,GACnD,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GACvC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GACvB,KAAK,CA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5 @@
|
|
|
1
1
|
import type { Unsuccessful } from '../types/params';
|
|
2
|
-
import type { IFrameCallMessage, IFrameCallbackMessage, IFrameCancelMessage,
|
|
2
|
+
import type { IFrameCallMessage, IFrameCallbackMessage, IFrameCancelMessage, IFrameSwitchTransportMessage } from './call';
|
|
3
3
|
import type { DeviceEventMessage } from './device';
|
|
4
4
|
import type { IFrameEventMessage } from './iframe';
|
|
5
5
|
import type { UiEventMessage } from './ui-request';
|
|
@@ -10,7 +10,7 @@ export declare const CORE_EVENT = "CORE_EVENT";
|
|
|
10
10
|
export type CoreMessage = {
|
|
11
11
|
id?: string;
|
|
12
12
|
success?: true | false;
|
|
13
|
-
} & (IFrameEventMessage | IFrameCallMessage | IFrameCancelMessage |
|
|
13
|
+
} & (IFrameEventMessage | IFrameCallMessage | IFrameCancelMessage | IFrameSwitchTransportMessage | IFrameCallbackMessage | UiResponseMessage | UiEventMessage | DeviceEventMessage | LogEventMessage | FirmwareMessage);
|
|
14
14
|
export type PostMessageEvent = MessageEvent<any>;
|
|
15
15
|
export declare const parseMessage: (messageData: any) => CoreMessage;
|
|
16
16
|
export declare const createErrorMessage: (error: Error & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/events/core.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,4BAA4B,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/events/core.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,4BAA4B,EAC7B,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,eAAO,MAAM,UAAU,eAAe,CAAC;AAEvC,MAAM,MAAM,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,4BAA4B,GAC5B,qBAAqB,GACrB,iBAAiB,GACjB,cAAc,GACd,kBAAkB,GAClB,eAAe,GACf,eAAe,CAClB,CAAC;AAEF,MAAM,MAAM,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/iframe.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export declare const IFRAME: {
|
|
|
6
6
|
readonly INIT_BRIDGE: "iframe-init-bridge";
|
|
7
7
|
readonly CALL: "iframe-call";
|
|
8
8
|
readonly CANCEL: "iframe-cancel";
|
|
9
|
-
readonly CANCEL_OPERATION: "iframe-cancel-operation";
|
|
10
9
|
readonly SWITCH_TRANSPORT: "iframe-switch-transport";
|
|
11
10
|
readonly CALLBACK: "iframe-callback";
|
|
12
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iframe.d.ts","sourceRoot":"","sources":["../../src/events/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MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG;IAAE,KAAK,EAAE,OAAO,QAAQ,CAAA;CAAE,CAAC;AAE1E,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,CAAC,OAAO,QAAQ,EAAE,WAAW,CAQpE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
|
|
2
|
-
import
|
|
2
|
+
import * as _onekeyfe_hd_transport from '@onekeyfe/hd-transport';
|
|
3
|
+
import { DeviceFirmwareTargetType, DeviceFirmwareUpdateRecordFields, DeviceRebootType, DeviceFirmwareTarget, Messages, Transport, TransportCallOptions, OneKeyDeviceCommType, ProtocolV2DeviceInfo, DeviceStatus as DeviceStatus$1, Enum_SafetyCheckLevel, OneKeyDeviceInfo, Success as Success$1, LowlevelTransportSharedPlugin, ProtocolInfo, DevOnboardingStatus, DeviceFirmwareUpdateStatus, DeviceFactoryInfo, RecoveryDeviceType, ResourceType, NextU2FCounter, SetU2FCounter, CipheredKeyValue as CipheredKeyValue$1, UintType, EthereumPublicKey, EthereumMessageSignature, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, SignedPsbt, PrevInput, TxOutputBinType, TxInput, TxOutputType, TxInputType, StarcoinAddress as StarcoinAddress$1, StarcoinPublicKey as StarcoinPublicKey$1, StarcoinMessageSignature, StarcoinSignedTx, NEMAddress as NEMAddress$1, NEMSignedTx, SolanaAddress as SolanaAddress$1, SolanaSignedTx as SolanaSignedTx$1, SolanaTxExtraInfo, SolanaOffChainMessageVersion, SolanaOffChainMessageFormat, StellarAddress as StellarAddress$1, StellarSignedTx, TronAddress as TronAddress$1, TronResourceCode, TronSignedTx, TronMessageSignature, ConfluxAddress as ConfluxAddress$1, ConfluxMessageSignature, NearAddress as NearAddress$1, NearSignedTx, AptosAddress as AptosAddress$1, AptosMessageSignature as AptosMessageSignature$1, AptosSignedTx as AptosSignedTx$1, AlgorandAddress, AlgorandSignedTx, CosmosAddress as CosmosAddress$1, CosmosSignedTx as CosmosSignedTx$1, SuiAddress as SuiAddress$1, SuiMessageSignature, CardanoAddressParametersType, CardanoMessageSignature, FilecoinAddress as FilecoinAddress$1, FilecoinSignedTx as FilecoinSignedTx$1, PolkadotAddress as PolkadotAddress$1, PolkadotSignedTx as PolkadotSignedTx$1, KaspaAddress as KaspaAddress$1, NervosAddress as NervosAddress$1, NervosSignedTx as NervosSignedTx$1, DnxAddress as DnxAddress$1, TonWalletVersion, TonWorkChain, TonSignedMessage, TonSignedProof, TonSignDataType, TonSignedData, ScdoAddress as ScdoAddress$1, ScdoSignedMessage, ScdoSignedTx as ScdoSignedTx$1, AlephiumMessageSignature, AlephiumSignedTx as AlephiumSignedTx$1, BenfenAddress as BenfenAddress$1, BenfenMessageSignature, SafetyCheckLevel, ChangeOutputScriptType } from '@onekeyfe/hd-transport';
|
|
3
4
|
export { Success as DeviceSuccess, HDNodeType, Messages as PROTO, ResourceType, TonSignDataType, TonWalletVersion } from '@onekeyfe/hd-transport';
|
|
4
5
|
import * as _onekeyfe_hd_shared from '@onekeyfe/hd-shared';
|
|
5
6
|
import { HardwareConnectProtocol, EFirmwareType, EDeviceType, Deferred } from '@onekeyfe/hd-shared';
|
|
@@ -417,7 +418,7 @@ type DeviceFeaturesRawPatch = {
|
|
|
417
418
|
type DeviceStateProtocol = DeviceFeaturesProtocol;
|
|
418
419
|
type DeviceStateMode = DeviceFeaturesMode;
|
|
419
420
|
type DeviceStateSection = 'identity' | 'status' | 'settings' | 'versions' | 'verification';
|
|
420
|
-
type DeviceStateUpdateSource = 'initialize' | 'device-info' | 'device-status' | '
|
|
421
|
+
type DeviceStateUpdateSource = 'initialize' | 'device-info' | 'device-status' | 'settings-read' | 'settings-write' | 'change-pin' | 'lock' | 'unlock' | 'passphrase' | 'session-clear' | 'firmware-update' | 'transport-reconnect' | 'compatibility';
|
|
421
422
|
type DeviceStateIdentity = {
|
|
422
423
|
deviceType: IDeviceType;
|
|
423
424
|
firmwareType: EFirmwareType;
|
|
@@ -449,7 +450,7 @@ type DeviceStateSettings = {
|
|
|
449
450
|
sdProtection: boolean | null;
|
|
450
451
|
wipeCodeProtection: boolean | null;
|
|
451
452
|
passphraseAlwaysOnDevice: boolean | null;
|
|
452
|
-
safetyChecks:
|
|
453
|
+
safetyChecks: Enum_SafetyCheckLevel | null;
|
|
453
454
|
autoLockDelayMs: number | null;
|
|
454
455
|
autoShutdownDelayMs: number | null;
|
|
455
456
|
displayRotation: number | null;
|
|
@@ -543,7 +544,7 @@ type NormalizedFeatures = {
|
|
|
543
544
|
wipeCodeProtection: boolean | null;
|
|
544
545
|
passphraseAlwaysOnDevice: boolean | null;
|
|
545
546
|
attachToPinEnabled?: boolean | null;
|
|
546
|
-
safetyChecks:
|
|
547
|
+
safetyChecks: Enum_SafetyCheckLevel | null;
|
|
547
548
|
autoLockDelayMs: number | null;
|
|
548
549
|
autoShutdownDelayMs: number | null;
|
|
549
550
|
displayRotation: number | null;
|
|
@@ -850,7 +851,7 @@ declare class Device extends EventEmitter {
|
|
|
850
851
|
getCurrentFirmwareVersionString(): string;
|
|
851
852
|
getCurrentBLEFirmwareVersionString(): string | undefined;
|
|
852
853
|
getCurrentBootloaderVersionString(): string | undefined;
|
|
853
|
-
getCurrentSafetyChecks():
|
|
854
|
+
getCurrentSafetyChecks(): _onekeyfe_hd_transport.Enum_SafetyCheckLevel | null | undefined;
|
|
854
855
|
getCurrentMethodVersionRange(getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined): IVersionRange | undefined;
|
|
855
856
|
supportNewPassphrase(): SupportFeatureType;
|
|
856
857
|
supportInputPinOnSoftware(): SupportFeatureType;
|
|
@@ -1016,7 +1017,6 @@ declare class Core extends EventEmitter {
|
|
|
1016
1017
|
private prePendingCallPromise;
|
|
1017
1018
|
private methodSynchronize;
|
|
1018
1019
|
constructor();
|
|
1019
|
-
cancelOperation(operationId: string): void;
|
|
1020
1020
|
private getCoreContext;
|
|
1021
1021
|
handleMessage(message: CoreMessage): Promise<any>;
|
|
1022
1022
|
dispose(): Promise<void>;
|
|
@@ -1049,17 +1049,6 @@ type DeviceInfoGetParams = {
|
|
|
1049
1049
|
types?: DeviceInfoGetTypes;
|
|
1050
1050
|
};
|
|
1051
1051
|
|
|
1052
|
-
type DeviceSettingsSetParams = {
|
|
1053
|
-
settings?: Omit<DeviceSettings, 'passphrase_enable' | 'airgap_mode'>;
|
|
1054
|
-
};
|
|
1055
|
-
|
|
1056
|
-
type SupportedDeviceSettingsPage = DeviceSettingsPage;
|
|
1057
|
-
type DeviceSettingsPageShowParams = {
|
|
1058
|
-
page?: SupportedDeviceSettingsPage | 'DeviceReset' | 'DevicePinChange' | 'DevicePassphrase' | 'DeviceAirgap';
|
|
1059
|
-
fieldName?: string;
|
|
1060
|
-
field_name?: string;
|
|
1061
|
-
};
|
|
1062
|
-
|
|
1063
1052
|
declare const PRO2_WALLPAPER_WIDTH = 604;
|
|
1064
1053
|
declare const PRO2_WALLPAPER_HEIGHT = 1024;
|
|
1065
1054
|
type Pro2WallpaperColorFormat = 'RGB565' | 'RGB565A8';
|
|
@@ -1122,8 +1111,6 @@ type PathInfoResult = {
|
|
|
1122
1111
|
declare function deviceInfoGet(connectId: string, params?: CommonParams & DeviceInfoGetParams): Response<ProtocolV2DeviceInfo>;
|
|
1123
1112
|
/** @deprecated Development-only raw Protocol V2 command. Use `getDeviceState`. */
|
|
1124
1113
|
declare function deviceStatusGet(connectId: string, params?: CommonParams): Response<DeviceStatus$1>;
|
|
1125
|
-
/** @deprecated Development-only raw Protocol V2 command. Use `getDeviceState`. */
|
|
1126
|
-
declare function deviceSettingsGet(connectId: string, params?: CommonParams): Response<DeviceSettings>;
|
|
1127
1114
|
/** @deprecated Development-only raw Protocol V2 command. */
|
|
1128
1115
|
declare function protocolInfoRequest(connectId: string, params?: CommonParams): Response<ProtocolInfo>;
|
|
1129
1116
|
declare function ping(connectId: string, params?: CommonParams & {
|
|
@@ -1135,14 +1122,6 @@ declare function deviceFirmwareUpdate(connectId: string, params: CommonParams &
|
|
|
1135
1122
|
declare function deviceGetFirmwareUpdateStatus(connectId: string, params?: CommonParams & DeviceFirmwareUpdateStatusGetParams): Response<DeviceFirmwareUpdateStatus>;
|
|
1136
1123
|
declare function deviceFactoryInfoSet(connectId: string, params: CommonParams & DeviceFactoryInfoSetParams): Response<Success$1>;
|
|
1137
1124
|
declare function deviceFactoryInfoGet(connectId: string, params?: CommonParams): Response<DeviceFactoryInfo>;
|
|
1138
|
-
/**
|
|
1139
|
-
* @deprecated Use the protocol-independent `deviceSettings`.
|
|
1140
|
-
*/
|
|
1141
|
-
declare function deviceSettingsSet(connectId: string, params: CommonParams & DeviceSettingsSetParams): Response<Success$1>;
|
|
1142
|
-
/**
|
|
1143
|
-
* @deprecated Use `deviceSettings`, `deviceChangePin`, or `deviceWipe`.
|
|
1144
|
-
*/
|
|
1145
|
-
declare function deviceSettingsPageShow(connectId: string, params: CommonParams & DeviceSettingsPageShowParams): Response<Success$1>;
|
|
1146
1125
|
declare function deviceUploadWallpaper(connectId: string, params: CommonParams & DeviceUploadWallpaperParams): Response<DeviceUploadWallpaperResponse>;
|
|
1147
1126
|
declare function filesystemPermissionFix(connectId: string, params?: CommonParams): Response<Success$1>;
|
|
1148
1127
|
declare function fileRead(connectId: string, params: {
|
|
@@ -1182,7 +1161,6 @@ declare function pathInfo(connectId: string, params: {
|
|
|
1182
1161
|
timeoutMs?: number | string;
|
|
1183
1162
|
}): Response<PathInfoResult>;
|
|
1184
1163
|
declare function uploadPortfolio(connectId: string, params: {
|
|
1185
|
-
operationId?: string;
|
|
1186
1164
|
packageBytes: ArrayBuffer | Uint8Array | Blob;
|
|
1187
1165
|
timeoutMs?: number | string;
|
|
1188
1166
|
}): Response<FileInfo & {
|
|
@@ -1204,7 +1182,6 @@ interface LowLevelInjectApi {
|
|
|
1204
1182
|
dispose: CoreApi['dispose'];
|
|
1205
1183
|
uiResponse: CoreApi['uiResponse'];
|
|
1206
1184
|
cancel: CoreApi['cancel'];
|
|
1207
|
-
cancelOperation: CoreApi['cancelOperation'];
|
|
1208
1185
|
updateSettings: CoreApi['updateSettings'];
|
|
1209
1186
|
switchTransport: CoreApi['switchTransport'];
|
|
1210
1187
|
addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
|
|
@@ -1520,24 +1497,39 @@ type DeviceSettingsParams = {
|
|
|
1520
1497
|
language?: string;
|
|
1521
1498
|
label?: string;
|
|
1522
1499
|
usePassphrase?: boolean;
|
|
1500
|
+
/** Protocol V1 only. */
|
|
1523
1501
|
homescreen?: string;
|
|
1502
|
+
/** Protocol V1 only. */
|
|
1524
1503
|
passphraseSource?: number;
|
|
1525
1504
|
autoLockDelayMs?: number;
|
|
1505
|
+
/** Protocol V1 only. */
|
|
1526
1506
|
displayRotation?: number;
|
|
1507
|
+
/** Protocol V1 only. */
|
|
1527
1508
|
passphraseAlwaysOnDevice?: boolean;
|
|
1528
|
-
|
|
1509
|
+
/** Protocol V1 only. Uses Enum_SafetyCheckLevel numeric values. */
|
|
1510
|
+
safetyChecks?: Enum_SafetyCheckLevel;
|
|
1511
|
+
/** Protocol V1 only; the current Protocol V2 schema has no matching field. */
|
|
1529
1512
|
experimentalFeatures?: boolean;
|
|
1530
1513
|
autoShutdownDelayMs?: number;
|
|
1514
|
+
/** Protocol V1 only; opens the legacy device-side brightness flow. */
|
|
1531
1515
|
changeBrightness?: boolean;
|
|
1516
|
+
/** Protocol V2 only. */
|
|
1532
1517
|
brightness?: number;
|
|
1533
1518
|
hapticFeedback?: boolean;
|
|
1534
1519
|
bluetoothEnabled?: boolean;
|
|
1520
|
+
/** Protocol V2 only; changed through an on-device confirmation page. */
|
|
1535
1521
|
airgapMode?: boolean;
|
|
1522
|
+
/** Protocol V2 only. */
|
|
1536
1523
|
animationEnabled?: boolean;
|
|
1524
|
+
/** Protocol V2 only. */
|
|
1537
1525
|
tapToWake?: boolean;
|
|
1526
|
+
/** Protocol V2 only. */
|
|
1538
1527
|
deviceNameDisplayEnabled?: boolean;
|
|
1528
|
+
/** Protocol V2 only. */
|
|
1539
1529
|
fidoEnabled?: boolean;
|
|
1530
|
+
/** Protocol V2 only. */
|
|
1540
1531
|
usbLockEnabled?: boolean;
|
|
1532
|
+
/** Protocol V2 only. */
|
|
1541
1533
|
randomKeypad?: boolean;
|
|
1542
1534
|
};
|
|
1543
1535
|
declare function deviceSettings(connectId: string, params: CommonParams & DeviceSettingsParams): Response<Success$1>;
|
|
@@ -1580,7 +1572,7 @@ declare function deviceUpdateBootloader(connectId: string, params?: DeviceUpdate
|
|
|
1580
1572
|
|
|
1581
1573
|
declare function deviceLock(connectId: string, params: CommonParams): Response<Success$1>;
|
|
1582
1574
|
|
|
1583
|
-
declare function deviceUnlock(connectId: string, params?: CommonParams): Response<
|
|
1575
|
+
declare function deviceUnlock(connectId: string, params?: CommonParams): Response<DeviceState>;
|
|
1584
1576
|
|
|
1585
1577
|
declare function deviceCancel(connectId: string, params: CommonParams): Response<Success$1>;
|
|
1586
1578
|
|
|
@@ -3512,7 +3504,6 @@ type CoreApi = {
|
|
|
3512
3504
|
call: (params: any) => Promise<any>;
|
|
3513
3505
|
uiResponse: typeof uiResponse;
|
|
3514
3506
|
cancel: (connectId?: string) => void;
|
|
3515
|
-
cancelOperation: (operationId: string) => void;
|
|
3516
3507
|
updateSettings: typeof updateSettings;
|
|
3517
3508
|
switchTransport: (env: ConnectSettings['env']) => Promise<{
|
|
3518
3509
|
success: boolean;
|
|
@@ -3577,15 +3568,12 @@ type CoreApi = {
|
|
|
3577
3568
|
deviceUploadWallpaper: typeof deviceUploadWallpaper;
|
|
3578
3569
|
deviceInfoGet: typeof deviceInfoGet;
|
|
3579
3570
|
deviceStatusGet: typeof deviceStatusGet;
|
|
3580
|
-
deviceSettingsGet: typeof deviceSettingsGet;
|
|
3581
3571
|
protocolInfoRequest: typeof protocolInfoRequest;
|
|
3582
3572
|
ping: typeof ping;
|
|
3583
3573
|
deviceFirmwareUpdate: typeof deviceFirmwareUpdate;
|
|
3584
3574
|
deviceGetFirmwareUpdateStatus: typeof deviceGetFirmwareUpdateStatus;
|
|
3585
3575
|
deviceFactoryInfoSet: typeof deviceFactoryInfoSet;
|
|
3586
3576
|
deviceFactoryInfoGet: typeof deviceFactoryInfoGet;
|
|
3587
|
-
deviceSettingsSet: typeof deviceSettingsSet;
|
|
3588
|
-
deviceSettingsPageShow: typeof deviceSettingsPageShow;
|
|
3589
3577
|
filesystemPermissionFix: typeof filesystemPermissionFix;
|
|
3590
3578
|
filesystemFormat: typeof filesystemFormat;
|
|
3591
3579
|
uploadPortfolio: typeof uploadPortfolio;
|
|
@@ -4089,7 +4077,6 @@ declare const IFRAME: {
|
|
|
4089
4077
|
readonly INIT_BRIDGE: "iframe-init-bridge";
|
|
4090
4078
|
readonly CALL: "iframe-call";
|
|
4091
4079
|
readonly CANCEL: "iframe-cancel";
|
|
4092
|
-
readonly CANCEL_OPERATION: "iframe-cancel-operation";
|
|
4093
4080
|
readonly SWITCH_TRANSPORT: "iframe-switch-transport";
|
|
4094
4081
|
readonly CALLBACK: "iframe-callback";
|
|
4095
4082
|
};
|
|
@@ -4158,13 +4145,6 @@ interface IFrameCancelMessage {
|
|
|
4158
4145
|
connectId?: string;
|
|
4159
4146
|
};
|
|
4160
4147
|
}
|
|
4161
|
-
interface IFrameCancelOperationMessage {
|
|
4162
|
-
event: typeof IFRAME.CANCEL_OPERATION;
|
|
4163
|
-
type: typeof IFRAME.CANCEL_OPERATION;
|
|
4164
|
-
payload: {
|
|
4165
|
-
operationId: string;
|
|
4166
|
-
};
|
|
4167
|
-
}
|
|
4168
4148
|
interface IFrameSwitchTransportMessage {
|
|
4169
4149
|
event: typeof IFRAME.SWITCH_TRANSPORT;
|
|
4170
4150
|
type: typeof IFRAME.SWITCH_TRANSPORT;
|
|
@@ -4291,7 +4271,7 @@ declare const CORE_EVENT = "CORE_EVENT";
|
|
|
4291
4271
|
type CoreMessage = {
|
|
4292
4272
|
id?: string;
|
|
4293
4273
|
success?: true | false;
|
|
4294
|
-
} & (IFrameEventMessage | IFrameCallMessage | IFrameCancelMessage |
|
|
4274
|
+
} & (IFrameEventMessage | IFrameCallMessage | IFrameCancelMessage | IFrameSwitchTransportMessage | IFrameCallbackMessage | UiResponseMessage | UiEventMessage | DeviceEventMessage | LogEventMessage | FirmwareMessage);
|
|
4295
4275
|
type PostMessageEvent = MessageEvent<any>;
|
|
4296
4276
|
declare const parseMessage: (messageData: any) => CoreMessage;
|
|
4297
4277
|
declare const createErrorMessage: (error: Error & {
|
|
@@ -4320,7 +4300,6 @@ interface InjectApi {
|
|
|
4320
4300
|
dispose: CoreApi['dispose'];
|
|
4321
4301
|
uiResponse: CoreApi['uiResponse'];
|
|
4322
4302
|
cancel: CoreApi['cancel'];
|
|
4323
|
-
cancelOperation: CoreApi['cancelOperation'];
|
|
4324
4303
|
switchTransport: CoreApi['switchTransport'];
|
|
4325
4304
|
}
|
|
4326
4305
|
|
|
@@ -4561,15 +4540,40 @@ declare function checkNeedUpdateBootForClassicAndMini({ features, willUpdateFirm
|
|
|
4561
4540
|
firmwareType: EFirmwareType;
|
|
4562
4541
|
}): boolean;
|
|
4563
4542
|
|
|
4543
|
+
type DeviceSettingsProtocol = 'V1' | 'V2';
|
|
4544
|
+
type DeviceSettingsField = keyof DeviceSettingsParams;
|
|
4545
|
+
declare const DEVICE_SETTINGS_SHARED_FIELDS: readonly ["language", "label", "usePassphrase", "autoLockDelayMs", "autoShutdownDelayMs", "hapticFeedback", "bluetoothEnabled"];
|
|
4546
|
+
declare const DEVICE_SETTINGS_V1_ONLY_FIELDS: readonly ["homescreen", "passphraseSource", "displayRotation", "passphraseAlwaysOnDevice", "safetyChecks", "experimentalFeatures", "changeBrightness"];
|
|
4547
|
+
declare const DEVICE_SETTINGS_V2_ONLY_FIELDS: readonly ["brightness", "airgapMode", "animationEnabled", "tapToWake", "deviceNameDisplayEnabled", "fidoEnabled", "usbLockEnabled", "randomKeypad"];
|
|
4548
|
+
declare const PROTOCOL_V2_NEVER_TIMEOUT_MS = 268435456;
|
|
4549
|
+
declare const normalizeSafetyCheckLevel: (value: SafetyCheckLevel | null | undefined) => Enum_SafetyCheckLevel | null | undefined;
|
|
4564
4550
|
declare const getLanguageConfig: (deviceType: IDeviceType) => Record<string, string>[];
|
|
4565
|
-
type
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4551
|
+
type DeviceSettingsDurationOption = {
|
|
4552
|
+
label: string;
|
|
4553
|
+
valueMs: number;
|
|
4554
|
+
};
|
|
4555
|
+
type DeviceSettingsValueOption<T> = {
|
|
4556
|
+
label: string;
|
|
4557
|
+
value: T;
|
|
4558
|
+
};
|
|
4559
|
+
declare const getAutoLockOptions: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsDurationOption[];
|
|
4560
|
+
declare const getAutoShutDownOptions: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsDurationOption[];
|
|
4561
|
+
type DeviceSettingsCapabilities = {
|
|
4562
|
+
protocol: DeviceSettingsProtocol;
|
|
4563
|
+
supportedFields: readonly DeviceSettingsField[];
|
|
4564
|
+
languageOptions: ReadonlyArray<Record<string, string>>;
|
|
4565
|
+
autoLockDelayOptions: readonly DeviceSettingsDurationOption[];
|
|
4566
|
+
autoShutdownDelayOptions: readonly DeviceSettingsDurationOption[];
|
|
4567
|
+
ranges: {
|
|
4568
|
+
brightness?: {
|
|
4569
|
+
min: number;
|
|
4570
|
+
max: number;
|
|
4571
|
+
};
|
|
4572
|
+
};
|
|
4573
|
+
safetyCheckOptions: ReadonlyArray<DeviceSettingsValueOption<Enum_SafetyCheckLevel>>;
|
|
4574
|
+
onDeviceConfirmationFields: readonly DeviceSettingsField[];
|
|
4570
4575
|
};
|
|
4571
|
-
declare const
|
|
4572
|
-
declare const getAutoShutDownOptions: (_deviceType: IDeviceType) => DurationParts[];
|
|
4576
|
+
declare const getDeviceSettingsCapabilities: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsCapabilities;
|
|
4573
4577
|
|
|
4574
4578
|
declare const getHDPath: (path: string) => Array<number>;
|
|
4575
4579
|
declare const getScriptType: (path: Array<number>) => InputScriptType;
|
|
@@ -4606,8 +4610,8 @@ declare const getEnv: () => "web" | "webextension" | "electron" | "react-native"
|
|
|
4606
4610
|
declare const corsValidator: (url?: string) => string | undefined;
|
|
4607
4611
|
declare const parseConnectSettings: (input?: Partial<ConnectSettings>) => ConnectSettings;
|
|
4608
4612
|
|
|
4609
|
-
declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, cancel,
|
|
4610
|
-
declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel,
|
|
4613
|
+
declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, cancel, updateSettings, switchTransport, }: InjectApi) => CoreApi;
|
|
4614
|
+
declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, updateSettings, switchTransport, }: LowLevelInjectApi) => LowLevelCoreApi;
|
|
4611
4615
|
declare const HardwareTopLevelSdk: () => CoreApi;
|
|
4612
4616
|
|
|
4613
|
-
export { AccountAddress, AccountAddresses, AlephiumAddress, AlephiumGetAddressParams, AlephiumSignMessageParams, AlephiumSignTransactionParams, AlephiumSignedTx, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AllFirmwareRelease, AllNetworkAddressParams, AllNetworkGetAddressParams, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignInMessageParams, AptosSignInMessageSignature, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BenfenAddress, BenfenGetAddressParams, BenfenGetPublicKeyParams, BenfenPublicKey, BenfenSignMessageParams, BenfenSignTransactionParams, BenfenSignedTx, BleReleaseInfoEvent, BleReleaseInfoPayload, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignMessageMethodParams, CardanoSignMessageParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, ClearSessionCacheParams, ClearSessionCachePayload, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesMode, DeviceFeaturesPayload, DeviceFeaturesProtocol, DeviceFeaturesRaw, DeviceFeaturesRawPatch, DeviceFeaturesVerify, DeviceFirmwareRange, DeviceFlagsParams, DeviceModelToTypes, DeviceProgress, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSendState, DeviceSendSupportFeatures, DeviceSettingsParams, DeviceState, DeviceStateEvent, DeviceStateIdentity, DeviceStateMode, DeviceStatePatch, DeviceStateProtocol, DeviceStateScope, DeviceStateSection, DeviceStateSettings, DeviceStateStatus, DeviceStateUpdateSource, DeviceStateVersions, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceTypeToModels, DeviceUploadResourceParams, DeviceUploadResourceResponse, DeviceVerifyParams, DeviceVerifySignature, DnxAddress, DnxGetAddressParams, DnxSignTransactionParams, DnxSignature, DnxTxKey, EOneKeyDeviceMode, EVMAccessList, EVMAddress, EVMAuthorization, EVMAuthorizationSignature, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMTransactionEIP7702, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareEvent, FirmwareMessage, FirmwareProcessing, FirmwareProgress, FirmwareRange, FirmwareRelease, FirmwareTip, FirmwareUpdateBinaryParams, FirmwareUpdateParams, FirmwareUpdateTipMessage, FirmwareUpdateV3Params, FirmwareUpdateV4Params, GetDeviceStateParams, GetPassphraseStateParams, HardwareSDKLowLevel, HardwareTopLevelSdk, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareField, IFirmwareReleaseInfo, IFirmwareUpdateProgressType, IFirmwareUpdateTipMessage, IFrameBridge, IFrameCallMessage, IFrameCallback, IFrameCallbackMessage, IFrameCancelMessage,
|
|
4617
|
+
export { AccountAddress, AccountAddresses, AlephiumAddress, AlephiumGetAddressParams, AlephiumSignMessageParams, AlephiumSignTransactionParams, AlephiumSignedTx, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AllFirmwareRelease, AllNetworkAddressParams, AllNetworkGetAddressParams, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignInMessageParams, AptosSignInMessageSignature, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BenfenAddress, BenfenGetAddressParams, BenfenGetPublicKeyParams, BenfenPublicKey, BenfenSignMessageParams, BenfenSignTransactionParams, BenfenSignedTx, BleReleaseInfoEvent, BleReleaseInfoPayload, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignMessageMethodParams, CardanoSignMessageParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, ClearSessionCacheParams, ClearSessionCachePayload, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DEVICE_SETTINGS_SHARED_FIELDS, DEVICE_SETTINGS_V1_ONLY_FIELDS, DEVICE_SETTINGS_V2_ONLY_FIELDS, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesMode, DeviceFeaturesPayload, DeviceFeaturesProtocol, DeviceFeaturesRaw, DeviceFeaturesRawPatch, DeviceFeaturesVerify, DeviceFirmwareRange, DeviceFlagsParams, DeviceModelToTypes, DeviceProgress, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSendState, DeviceSendSupportFeatures, DeviceSettingsCapabilities, DeviceSettingsDurationOption, DeviceSettingsField, DeviceSettingsParams, DeviceSettingsProtocol, DeviceSettingsValueOption, DeviceState, DeviceStateEvent, DeviceStateIdentity, DeviceStateMode, DeviceStatePatch, DeviceStateProtocol, DeviceStateScope, DeviceStateSection, DeviceStateSettings, DeviceStateStatus, DeviceStateUpdateSource, DeviceStateVersions, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceTypeToModels, DeviceUploadResourceParams, DeviceUploadResourceResponse, DeviceVerifyParams, DeviceVerifySignature, DnxAddress, DnxGetAddressParams, DnxSignTransactionParams, DnxSignature, DnxTxKey, EOneKeyDeviceMode, EVMAccessList, EVMAddress, EVMAuthorization, EVMAuthorizationSignature, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMTransactionEIP7702, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareEvent, FirmwareMessage, FirmwareProcessing, FirmwareProgress, FirmwareRange, FirmwareRelease, FirmwareTip, FirmwareUpdateBinaryParams, FirmwareUpdateParams, FirmwareUpdateTipMessage, FirmwareUpdateV3Params, FirmwareUpdateV4Params, GetDeviceStateParams, GetPassphraseStateParams, HardwareSDKLowLevel, HardwareTopLevelSdk, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareField, IFirmwareReleaseInfo, IFirmwareUpdateProgressType, IFirmwareUpdateTipMessage, IFrameBridge, IFrameCallMessage, IFrameCallback, IFrameCallbackMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, IFrameSwitchTransport, IFrameSwitchTransportMessage, ILocale, IProtocolV2FirmwareComponent, IProtocolV2FirmwareComponentTarget, IProtocolV2ResourceBundle, ITransportStatus, IVersionArray, IVersionRange, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KnownDevice, LOG, LOG_EVENT, LogBlockEvent, LogEvent, LogEventMessage, LogOutput, LoggerNames, LowLevelCoreApi, LowLevelInjectApi, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, NervosAddress, NervosGetAddressParams, NervosSignTransactionParams, NervosSignedTx, NexaAddress, NexaGetAddressParams, NexaSignInputParams, NexaSignOutputParams, NexaSignTransactionParams, NexaSignature, NormalizedFeatures, OnekeyFeatures, OpenWalletSessionParams, OpenWalletSessionPayload, PRO2_WALLPAPER_HEIGHT, PRO2_WALLPAPER_WIDTH, PROTOCOL_V2_NEVER_TIMEOUT_MS, Params, PassphraseRequestPayload, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, Pro2WallpaperColorFormat, ProtocolV2UiCompletion, ProtocolV2UiEventMetadata, ProtocolV2UiEventSource, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, RequestContext, Response, ScdoAddress, ScdoGetAddressParams, ScdoSignMessageParams, ScdoSignTransactionParams, ScdoSignedTx, SdkTracingContext, SearchDevice, SignedTransaction, SolSignMessageParams, SolSignMessageResponse, SolSignOffchainMessageParams, SolSignOffchainMessageResponse, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignMessageParams, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TonAddress, TonGetAddressParams, TonSignDataParams, TonSignMessageParams, TonSignProofParams, TopLevelInjectApi, TransactionOptions, TransportReleaseStatus, TronAddress, TronDelegateResourceContract, TronFreezeBalanceV2Contract, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, TronUnDelegateResourceContract, TronUnfreezeBalanceV2Contract, TronWithdrawBalanceContract, TronWithdrawExpireUnfreezeContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestFirmwareProgressing, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestSelectDeviceForSwitchFirmwareWebDevice, UiRequestSelectDeviceInBootloaderForWebDevice, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UiResponseSelectDeviceForSwitchFirmwareWebDevice, UiResponseSelectDeviceInBootloaderForWebDevice, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBootForClassicAndMini, checkNeedUpdateBootForTouch, cleanupCallback, cleanupSdkInstance, completeRequestContext, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createRequestContext, createResponseMessage, createSdkTracingContext, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, encodePro2Wallpaper, executeCallback, formatRequestContext, generateInstanceId, generateSdkInstanceId, getActiveRequestsByDeviceInstance, getAutoLockOptions, getAutoShutDownOptions, getDeviceBLEFirmwareVersion, getDeviceBleName, getDeviceBoardloaderVersion, getDeviceBootloaderVersion, getDeviceFirmwareVersion, getDeviceLabel, getDeviceSerialNo, getDeviceSettingsCapabilities, getDeviceType, getDeviceTypeByBleName, getDeviceUUID, getEnv, getFirmwareType, getFirmwareUpdateField, getFirmwareUpdateFieldArray, getHDPath, getHomeScreenDefaultList, getHomeScreenHex, getHomeScreenSize, getLanguageConfig, getLog, getLogBlockLabel, getLogger, getMethodVersionRange, getOutputScriptType, getSDKVersion, getScriptType, getTimeStamp, httpRequest, init$1 as initCore, isBleConnect, isMethodVersionRangeUnsupported, isValidVersionArray, isValidVersionString, normalizeSafetyCheckLevel, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, preloadSessionCache, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, transportEnv, updateRequestContext, versionCompare, versionSplit, wait, whitelist, whitelistExtension };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAU,MAAM,UAAU,CAAC;AAIpE,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,IAAI,IAAI,QAAQ,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAE5E,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,M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