@onekeyfe/hd-core 1.2.0-alpha.45 → 1.2.0-alpha.46
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__/deviceUploadNft.test.ts +21 -0
- package/__tests__/open-wallet-session.test.ts +33 -1
- package/__tests__/protocol-v2-resources.test.ts +3 -38
- package/__tests__/protocol-v2.test.ts +7 -109
- package/__tests__/uiPromiseRegistry.test.ts +86 -0
- package/dist/api/FirmwareUpdateV4.d.ts +0 -2
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/uiPromiseRegistry.d.ts +4 -0
- package/dist/core/uiPromiseRegistry.d.ts.map +1 -0
- package/dist/data-manager/DataManager.d.ts +0 -1
- package/dist/data-manager/DataManager.d.ts.map +1 -1
- package/dist/events/ui-promise.d.ts +4 -2
- package/dist/events/ui-promise.d.ts.map +1 -1
- package/dist/events/ui-request.d.ts +3 -0
- package/dist/events/ui-request.d.ts.map +1 -1
- package/dist/events/ui-response.d.ts +10 -2
- package/dist/events/ui-response.d.ts.map +1 -1
- package/dist/index.d.ts +52 -58
- package/dist/index.js +52 -109
- package/dist/protocols/protocol-v2/resources.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/walletSession.d.ts.map +1 -1
- package/dist/types/api/firmwareUpdate.d.ts +1 -2
- package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
- package/dist/types/settings.d.ts +0 -10
- package/dist/types/settings.d.ts.map +1 -1
- package/dist/utils/pro2Nft.d.ts +2 -2
- package/dist/utils/pro2Nft.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/FirmwareUpdateV4.ts +6 -76
- package/src/core/index.ts +20 -4
- package/src/core/uiPromiseRegistry.ts +41 -0
- package/src/data-manager/DataManager.ts +0 -4
- package/src/events/ui-promise.ts +4 -2
- package/src/events/ui-request.ts +3 -0
- package/src/events/ui-response.ts +12 -2
- package/src/protocols/protocol-v2/resources.ts +1 -33
- package/src/protocols/protocol-v2/walletSession.ts +5 -1
- package/src/types/api/firmwareUpdate.ts +0 -3
- package/src/types/settings.ts +0 -16
- package/src/utils/pro2Nft.ts +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -215,23 +215,8 @@ type IProtocolV2Resource = {
|
|
|
215
215
|
/** SHA3-512 header_hash from the signed okpkg header. */
|
|
216
216
|
headerHash: string;
|
|
217
217
|
};
|
|
218
|
-
/** Optional Pro2 startup-resource CRATE installed by the bootloader updater. */
|
|
219
|
-
type IProtocolV2BootResources = {
|
|
220
|
-
required: false;
|
|
221
|
-
target: 'CRATE';
|
|
222
|
-
url: string;
|
|
223
|
-
/** Complete CRATE file size in bytes. */
|
|
224
|
-
size: number;
|
|
225
|
-
/** SHA-256 of the complete CRATE file. */
|
|
226
|
-
fileHash: string;
|
|
227
|
-
/** SHA3-512 payload_hash from the signed CRATE header. */
|
|
228
|
-
payloadHash: string;
|
|
229
|
-
/** SHA3-512 header_hash from the signed CRATE header. */
|
|
230
|
-
headerHash: string;
|
|
231
|
-
};
|
|
232
218
|
type IProtocolV2Resources = {
|
|
233
219
|
stable: IProtocolV2Resource[];
|
|
234
|
-
boot?: IProtocolV2BootResources;
|
|
235
220
|
};
|
|
236
221
|
/** Pro2 RESC bundle okpkg descriptor for incremental FileWrite synchronization. */
|
|
237
222
|
type IProtocolV2ResourceBundle = {
|
|
@@ -1266,7 +1251,7 @@ interface FirmwareUpdateV3Params {
|
|
|
1266
1251
|
* firmwareUpdateV4 target binaries grouped by DeviceFirmwareTargetType.
|
|
1267
1252
|
* Except for romloader, each field maps to a target accepted by bootloader.
|
|
1268
1253
|
*/
|
|
1269
|
-
type FirmwareUpdateV4Target = 'boot' | '
|
|
1254
|
+
type FirmwareUpdateV4Target = 'boot' | 'app_v1' | 'app_v2' | 'coprocessor' | 'resource' | 'se01' | 'se02' | 'se03' | 'se04';
|
|
1270
1255
|
interface FirmwareUpdateV4Params {
|
|
1271
1256
|
platform: IPlatform;
|
|
1272
1257
|
chunkSize?: number;
|
|
@@ -1276,8 +1261,6 @@ interface FirmwareUpdateV4Params {
|
|
|
1276
1261
|
romloaderBinary?: ArrayBuffer;
|
|
1277
1262
|
/** FW_MGMT_TARGET_BOOTLOADER = 3 */
|
|
1278
1263
|
bootloaderBinary?: ArrayBuffer;
|
|
1279
|
-
/** FW_MGMT_TARGET_CRATE = 1; optional Pro2 startup resources. */
|
|
1280
|
-
bootResourcesBinary?: ArrayBuffer;
|
|
1281
1264
|
/** FW_MGMT_TARGET_APPLICATION_P1 = 4 */
|
|
1282
1265
|
applicationP1Binary?: ArrayBuffer;
|
|
1283
1266
|
/** FW_MGMT_TARGET_APPLICATION_P2 = 5 */
|
|
@@ -3901,6 +3884,51 @@ type DeviceEventMessage = DeviceEvent & {
|
|
|
3901
3884
|
type DeviceEventListenerFn = (type: typeof DEVICE_EVENT, cb: (event: DeviceEventMessage) => void) => void;
|
|
3902
3885
|
declare const createDeviceMessage: MessageFactoryFn<typeof DEVICE_EVENT, DeviceEvent>;
|
|
3903
3886
|
|
|
3887
|
+
declare const UI_RESPONSE: {
|
|
3888
|
+
readonly RECEIVE_PIN: "ui-receive_pin";
|
|
3889
|
+
readonly RECEIVE_PASSPHRASE: "ui-receive_passphrase";
|
|
3890
|
+
readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "ui-receive_select-device-in-bootloader-for-web-device";
|
|
3891
|
+
readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "ui-receive_select-device-for-switch-firmware-web-device";
|
|
3892
|
+
};
|
|
3893
|
+
interface UiResponseCorrelation {
|
|
3894
|
+
interactionId: string;
|
|
3895
|
+
deviceId: string;
|
|
3896
|
+
}
|
|
3897
|
+
interface UiResponseCorrelationFields {
|
|
3898
|
+
interactionId?: string;
|
|
3899
|
+
deviceId?: string;
|
|
3900
|
+
}
|
|
3901
|
+
interface UiResponsePin extends UiResponseCorrelationFields {
|
|
3902
|
+
type: typeof UI_RESPONSE.RECEIVE_PIN;
|
|
3903
|
+
payload: string;
|
|
3904
|
+
}
|
|
3905
|
+
interface UiResponsePassphrase extends UiResponseCorrelationFields {
|
|
3906
|
+
type: typeof UI_RESPONSE.RECEIVE_PASSPHRASE;
|
|
3907
|
+
payload: {
|
|
3908
|
+
value: string;
|
|
3909
|
+
passphraseOnDevice?: boolean;
|
|
3910
|
+
attachPinOnDevice?: boolean;
|
|
3911
|
+
save?: boolean;
|
|
3912
|
+
};
|
|
3913
|
+
}
|
|
3914
|
+
interface UiResponseSelectDeviceInBootloaderForWebDevice {
|
|
3915
|
+
type: typeof UI_RESPONSE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE;
|
|
3916
|
+
payload: {
|
|
3917
|
+
deviceId: string;
|
|
3918
|
+
};
|
|
3919
|
+
}
|
|
3920
|
+
interface UiResponseSelectDeviceForSwitchFirmwareWebDevice {
|
|
3921
|
+
type: typeof UI_RESPONSE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE;
|
|
3922
|
+
payload: {
|
|
3923
|
+
deviceId: string;
|
|
3924
|
+
};
|
|
3925
|
+
}
|
|
3926
|
+
type UiResponseEvent = UiResponsePin | UiResponsePassphrase | UiResponseSelectDeviceInBootloaderForWebDevice | UiResponseSelectDeviceForSwitchFirmwareWebDevice;
|
|
3927
|
+
type UiResponseMessage = UiResponseEvent & {
|
|
3928
|
+
event: typeof UI_EVENT;
|
|
3929
|
+
};
|
|
3930
|
+
declare const createUiResponse: MessageFactoryFn<typeof UI_EVENT, UiResponseEvent>;
|
|
3931
|
+
|
|
3904
3932
|
declare const UI_EVENT = "UI_EVENT";
|
|
3905
3933
|
declare const UI_REQUEST: {
|
|
3906
3934
|
readonly REQUEST_PIN: "ui-request_pin";
|
|
@@ -3985,6 +4013,7 @@ type UiRequestDeviceAction = {
|
|
|
3985
4013
|
payload: ProtocolV2UiEventMetadata & {
|
|
3986
4014
|
device: Device$1;
|
|
3987
4015
|
type?: Messages.PinMatrixRequestType | 'ButtonRequest_PinEntry' | 'ButtonRequest_AttachPin';
|
|
4016
|
+
responseCorrelation?: UiResponseCorrelation;
|
|
3988
4017
|
};
|
|
3989
4018
|
};
|
|
3990
4019
|
interface UiRequestButton {
|
|
@@ -4002,6 +4031,7 @@ interface UiRequestPassphrase {
|
|
|
4002
4031
|
reason?: 'open-wallet' | 'session-recovery';
|
|
4003
4032
|
expectedPassphraseState?: string;
|
|
4004
4033
|
interaction?: HardwareUiInteractionMeta;
|
|
4034
|
+
responseCorrelation?: UiResponseCorrelation;
|
|
4005
4035
|
};
|
|
4006
4036
|
}
|
|
4007
4037
|
interface UiRequestPassphraseOnDevice {
|
|
@@ -4208,43 +4238,6 @@ interface MethodResponseMessage {
|
|
|
4208
4238
|
declare const createResponseMessage: (id: number, success: boolean, payload: any) => MethodResponseMessage;
|
|
4209
4239
|
type CallMethodKeys = keyof CoreApi;
|
|
4210
4240
|
|
|
4211
|
-
declare const UI_RESPONSE: {
|
|
4212
|
-
readonly RECEIVE_PIN: "ui-receive_pin";
|
|
4213
|
-
readonly RECEIVE_PASSPHRASE: "ui-receive_passphrase";
|
|
4214
|
-
readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "ui-receive_select-device-in-bootloader-for-web-device";
|
|
4215
|
-
readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "ui-receive_select-device-for-switch-firmware-web-device";
|
|
4216
|
-
};
|
|
4217
|
-
interface UiResponsePin {
|
|
4218
|
-
type: typeof UI_RESPONSE.RECEIVE_PIN;
|
|
4219
|
-
payload: string;
|
|
4220
|
-
}
|
|
4221
|
-
interface UiResponsePassphrase {
|
|
4222
|
-
type: typeof UI_RESPONSE.RECEIVE_PASSPHRASE;
|
|
4223
|
-
payload: {
|
|
4224
|
-
value: string;
|
|
4225
|
-
passphraseOnDevice?: boolean;
|
|
4226
|
-
attachPinOnDevice?: boolean;
|
|
4227
|
-
save?: boolean;
|
|
4228
|
-
};
|
|
4229
|
-
}
|
|
4230
|
-
interface UiResponseSelectDeviceInBootloaderForWebDevice {
|
|
4231
|
-
type: typeof UI_RESPONSE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE;
|
|
4232
|
-
payload: {
|
|
4233
|
-
deviceId: string;
|
|
4234
|
-
};
|
|
4235
|
-
}
|
|
4236
|
-
interface UiResponseSelectDeviceForSwitchFirmwareWebDevice {
|
|
4237
|
-
type: typeof UI_RESPONSE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE;
|
|
4238
|
-
payload: {
|
|
4239
|
-
deviceId: string;
|
|
4240
|
-
};
|
|
4241
|
-
}
|
|
4242
|
-
type UiResponseEvent = UiResponsePin | UiResponsePassphrase | UiResponseSelectDeviceInBootloaderForWebDevice | UiResponseSelectDeviceForSwitchFirmwareWebDevice;
|
|
4243
|
-
type UiResponseMessage = UiResponseEvent & {
|
|
4244
|
-
event: typeof UI_EVENT;
|
|
4245
|
-
};
|
|
4246
|
-
declare const createUiResponse: MessageFactoryFn<typeof UI_EVENT, UiResponseEvent>;
|
|
4247
|
-
|
|
4248
4241
|
declare const LOG_EVENT = "LOG_EVENT";
|
|
4249
4242
|
declare const LOG: {
|
|
4250
4243
|
readonly OUTPUT: "log-output";
|
|
@@ -4320,7 +4313,9 @@ type UiPromiseResponse = UiResponseEvent | {
|
|
|
4320
4313
|
};
|
|
4321
4314
|
type UiPromise<T extends UiPromiseResponse['type']> = Deferred<Extract<UiPromiseResponse, {
|
|
4322
4315
|
type: T;
|
|
4323
|
-
}>, T, Device
|
|
4316
|
+
}>, T, Device> & {
|
|
4317
|
+
responseCorrelation?: UiResponseCorrelation;
|
|
4318
|
+
};
|
|
4324
4319
|
|
|
4325
4320
|
declare const LogBlockEvent: Set<string>;
|
|
4326
4321
|
declare function getLogBlockLabel(message: unknown): string | undefined;
|
|
@@ -4548,7 +4543,6 @@ declare class DataManager {
|
|
|
4548
4543
|
/** Force a fresh remote config before an update is allowed to mutate the device. */
|
|
4549
4544
|
static forceReloadData(): Promise<void>;
|
|
4550
4545
|
static getProtocolV2Resources(): IProtocolV2Resource[] | undefined;
|
|
4551
|
-
static getProtocolV2BootResources(): IProtocolV2BootResources | undefined;
|
|
4552
4546
|
static getProtobufMessages(schema?: ProtobufMessageSchema): JSON;
|
|
4553
4547
|
static getSettings(key?: undefined): ConnectSettings;
|
|
4554
4548
|
static getSettings<T extends keyof ConnectSettings>(key: T): ConnectSettings[T];
|
|
@@ -4661,4 +4655,4 @@ declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, can
|
|
|
4661
4655
|
declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, updateSettings, switchTransport, }: LowLevelInjectApi) => LowLevelCoreApi;
|
|
4662
4656
|
declare const HardwareTopLevelSdk: () => CoreApi;
|
|
4663
4657
|
|
|
4664
|
-
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, FirmwareUpdateV4Target, GetDeviceStateParams, GetPassphraseStateParams, HardwareSDKLowLevel, HardwareTopLevelSdk, HardwareUiInteractionMeta, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareField, IFirmwareReleaseInfo, IFirmwareUpdateProgressType, IFirmwareUpdateTipMessage, IFrameBridge, IFrameCallMessage, IFrameCallback, IFrameCallbackMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, IFrameSwitchTransport, IFrameSwitchTransportMessage, ILocale,
|
|
4658
|
+
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, FirmwareUpdateV4Target, GetDeviceStateParams, GetPassphraseStateParams, HardwareSDKLowLevel, HardwareTopLevelSdk, HardwareUiInteractionMeta, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareField, IFirmwareReleaseInfo, IFirmwareUpdateProgressType, IFirmwareUpdateTipMessage, IFrameBridge, IFrameCallMessage, IFrameCallback, IFrameCallbackMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, IFrameSwitchTransport, IFrameSwitchTransportMessage, ILocale, IProtocolV2FirmwareComponent, IProtocolV2FirmwareComponentTarget, IProtocolV2Resource, IProtocolV2ResourceBundle, IProtocolV2ResourceType, IProtocolV2Resources, ITransportStatus, IVersionArray, IVersionRange, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KaspaStreamingSignInputParams, KaspaStreamingSignOutputParams, 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, OpenWalletSessionMode, OpenWalletSessionModeValue, OpenWalletSessionParams, OpenWalletSessionPayload, PRO2_WALLPAPER_HEIGHT, PRO2_WALLPAPER_WIDTH, PROTOCOL_V2_NEVER_TIMEOUT_MS, Params, PassphraseRequestPayload, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, Pro2WallpaperColorFormat, ProtocolV2FirmwareComponentRelease, ProtocolV2FirmwareComponentReleaseStatus, ProtocolV2FirmwareReleaseStatus, 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, TestProtocolV2PingParams, 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, UiRequestWindowClose, UiRequestWithoutPayload, UiResponseCorrelation, UiResponseCorrelationFields, 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, formatLogMethodLabel, 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, getNftSize, getOutputScriptType, getSDKVersion, getSafeLogPayload, getScriptType, getTimeStamp, httpRequest, init$1 as initCore, isBleConnect, isValidVersionArray, isValidVersionString, normalizeSafetyCheckLevel, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, preloadSessionCache, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, transportEnv, updateRequestContext, versionCompare, versionSplit, wait, whitelist, whitelistExtension };
|
package/dist/index.js
CHANGED
|
@@ -39569,33 +39569,6 @@ function validateResource(value, index) {
|
|
|
39569
39569
|
headerHash: normalizeHex$1(resource.headerHash, SHA3_512_HEX_LENGTH, 'headerHash'),
|
|
39570
39570
|
};
|
|
39571
39571
|
}
|
|
39572
|
-
function validateBootResources(value) {
|
|
39573
|
-
if (!value || typeof value !== 'object') {
|
|
39574
|
-
throw new Error('Invalid Pro2 boot resources config');
|
|
39575
|
-
}
|
|
39576
|
-
const resource = value;
|
|
39577
|
-
if (resource.required !== false) {
|
|
39578
|
-
throw new Error('Invalid Pro2 boot resources required flag: expected false');
|
|
39579
|
-
}
|
|
39580
|
-
if (resource.target !== 'CRATE') {
|
|
39581
|
-
throw new Error('Invalid Pro2 boot resources target: expected CRATE');
|
|
39582
|
-
}
|
|
39583
|
-
if (typeof resource.url !== 'string' || !resource.url.startsWith('https://')) {
|
|
39584
|
-
throw new Error('Invalid Pro2 boot resources url');
|
|
39585
|
-
}
|
|
39586
|
-
if (!Number.isSafeInteger(resource.size) || Number(resource.size) <= 0) {
|
|
39587
|
-
throw new Error('Invalid Pro2 boot resources size');
|
|
39588
|
-
}
|
|
39589
|
-
return {
|
|
39590
|
-
required: false,
|
|
39591
|
-
target: 'CRATE',
|
|
39592
|
-
url: resource.url,
|
|
39593
|
-
size: Number(resource.size),
|
|
39594
|
-
fileHash: normalizeHex$1(resource.fileHash, SHA256_HEX_LENGTH, 'boot fileHash'),
|
|
39595
|
-
payloadHash: normalizeHex$1(resource.payloadHash, SHA3_512_HEX_LENGTH, 'boot payloadHash'),
|
|
39596
|
-
headerHash: normalizeHex$1(resource.headerHash, SHA3_512_HEX_LENGTH, 'boot headerHash'),
|
|
39597
|
-
};
|
|
39598
|
-
}
|
|
39599
39572
|
function parseProtocolV2Resources(value) {
|
|
39600
39573
|
if (value === undefined)
|
|
39601
39574
|
return undefined;
|
|
@@ -39604,8 +39577,7 @@ function parseProtocolV2Resources(value) {
|
|
|
39604
39577
|
!Array.isArray(value.stable)) {
|
|
39605
39578
|
throw new Error('Invalid Pro2 resources config: stable must be an array');
|
|
39606
39579
|
}
|
|
39607
|
-
const
|
|
39608
|
-
const stable = config.stable.map(validateResource);
|
|
39580
|
+
const stable = value.stable.map(validateResource);
|
|
39609
39581
|
const types = new Set(stable.map(resource => resource.type));
|
|
39610
39582
|
if (stable.length !== PROTOCOL_V2_RESOURCE_TYPES.length || types.size !== stable.length) {
|
|
39611
39583
|
throw new Error('Invalid Pro2 resources config: stable must contain six unique resource types');
|
|
@@ -39615,14 +39587,15 @@ function parseProtocolV2Resources(value) {
|
|
|
39615
39587
|
throw new Error(`Invalid Pro2 resources config: stable is missing ${type}`);
|
|
39616
39588
|
}
|
|
39617
39589
|
}
|
|
39618
|
-
|
|
39619
|
-
|
|
39590
|
+
return {
|
|
39591
|
+
stable: PROTOCOL_V2_RESOURCE_TYPES.map(type => {
|
|
39620
39592
|
const resource = stable.find(item => item.type === type);
|
|
39621
39593
|
if (!resource) {
|
|
39622
39594
|
throw new Error(`Invalid Pro2 resources config: stable is missing ${type}`);
|
|
39623
39595
|
}
|
|
39624
39596
|
return resource;
|
|
39625
|
-
})
|
|
39597
|
+
}),
|
|
39598
|
+
};
|
|
39626
39599
|
}
|
|
39627
39600
|
function buildProtocolV2ResourceUpdatePlan({ resources, inventory, mode, forced = false, }) {
|
|
39628
39601
|
if (mode === 'bootloader-recovery' || forced) {
|
|
@@ -39804,10 +39777,6 @@ class DataManager {
|
|
|
39804
39777
|
var _b, _c;
|
|
39805
39778
|
return (_c = (_b = this.deviceMap[hdShared.EDeviceType.Pro2]) === null || _b === void 0 ? void 0 : _b.resources) === null || _c === void 0 ? void 0 : _c.stable;
|
|
39806
39779
|
}
|
|
39807
|
-
static getProtocolV2BootResources() {
|
|
39808
|
-
var _b, _c;
|
|
39809
|
-
return (_c = (_b = this.deviceMap[hdShared.EDeviceType.Pro2]) === null || _b === void 0 ? void 0 : _b.resources) === null || _c === void 0 ? void 0 : _c.boot;
|
|
39810
|
-
}
|
|
39811
39780
|
static getProtobufMessages(schema = 'v1CurrentSchema') {
|
|
39812
39781
|
return this.messages[schema];
|
|
39813
39782
|
}
|
|
@@ -40386,7 +40355,7 @@ const askDevicePassphrase = (device, requestPayload) => __awaiter(void 0, void 0
|
|
|
40386
40355
|
yield refreshProtocolV2DeviceStatus(device);
|
|
40387
40356
|
});
|
|
40388
40357
|
const selectDeviceSession = (device, expectedPassphraseState, deriveCardano) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40389
|
-
var _a, _b, _c;
|
|
40358
|
+
var _a, _b, _c, _d;
|
|
40390
40359
|
const existsAttachPinUser = ((_a = device.features) === null || _a === void 0 ? void 0 : _a.attachToPinEnabled) === true;
|
|
40391
40360
|
const metadata = Object.assign({ source: 'wallet-session-coordinator', reason: expectedPassphraseState ? 'session-recovery' : 'open-wallet' }, (expectedPassphraseState ? { expectedPassphraseState } : {}));
|
|
40392
40361
|
const passphraseInteraction = (_b = device.createProtocolV2UiPhaseMetadata) === null || _b === void 0 ? void 0 : _b.call(device, 'passphrase', 'start');
|
|
@@ -40427,7 +40396,8 @@ const selectDeviceSession = (device, expectedPassphraseState, deriveCardano) =>
|
|
|
40427
40396
|
});
|
|
40428
40397
|
return getDeviceSession(device, buildDeviceSessionGetRequest({ deriveCardano }));
|
|
40429
40398
|
}
|
|
40430
|
-
|
|
40399
|
+
const passphraseOnDeviceInteraction = (_d = device.createProtocolV2UiPhaseMetadata) === null || _d === void 0 ? void 0 : _d.call(device, 'passphrase-on-device', 'start');
|
|
40400
|
+
device.emit(DEVICE.PASSPHRASE_ON_DEVICE, device, Object.assign(Object.assign({}, metadata), (passphraseOnDeviceInteraction ? { interaction: passphraseOnDeviceInteraction } : {})));
|
|
40431
40401
|
yield askDevicePassphrase(device, { on_device: true });
|
|
40432
40402
|
return getDeviceSession(device, buildDeviceSessionGetRequest({ deriveCardano }));
|
|
40433
40403
|
});
|
|
@@ -41399,8 +41369,8 @@ const PRO2_NFT_IMAGE_HEIGHT = 540;
|
|
|
41399
41369
|
const PRO2_NFT_THUMBNAIL_WIDTH = 263;
|
|
41400
41370
|
const PRO2_NFT_THUMBNAIL_HEIGHT = 263;
|
|
41401
41371
|
const PRO2_NFT_DIRECTORY = 'vol1:/nft';
|
|
41402
|
-
const PRO2_NFT_DEFAULT_CHUNK_SIZE =
|
|
41403
|
-
const PRO2_NFT_DEFAULT_PACE_MS =
|
|
41372
|
+
const PRO2_NFT_DEFAULT_CHUNK_SIZE = 2048;
|
|
41373
|
+
const PRO2_NFT_DEFAULT_PACE_MS = 0;
|
|
41404
41374
|
const PRO2_NFT_DEFAULT_TIMEOUT_MS = 15000;
|
|
41405
41375
|
const PRO2_NFT_MIN_CHUNK_SIZE = 64;
|
|
41406
41376
|
const PRO2_NFT_MAX_CHUNK_SIZE = 2048;
|
|
@@ -49106,7 +49076,6 @@ const PROTOCOL_V2_OKPP_HEADER_SIZE = 0x52a0;
|
|
|
49106
49076
|
const PROTOCOL_V2_OKPP_PAYLOAD_HASH_OFFSET = 0x200;
|
|
49107
49077
|
const PROTOCOL_V2_OKPP_HEADER_HASH_OFFSET = 0x240;
|
|
49108
49078
|
const PROTOCOL_V2_OKPP_HASH_SIZE = 64;
|
|
49109
|
-
const PROTOCOL_V2_BOOT_RESOURCES_FILE_NAME = 'boot_resources.crate.okpkg';
|
|
49110
49079
|
const getProtocolV2DeviceTransferProgress = (bytesBeforeChunk, bytesAfterChunk, totalBytes) => {
|
|
49111
49080
|
if (!Number.isFinite(totalBytes) || totalBytes <= 0) {
|
|
49112
49081
|
return 100;
|
|
@@ -49298,7 +49267,7 @@ const isProtocolV2FirmwareFingerprintValid = (binary, fingerprint) => {
|
|
|
49298
49267
|
};
|
|
49299
49268
|
const assertProtocolV2ReconnectIdentity = (expectedSerialNumber, actualSerialNumber) => {
|
|
49300
49269
|
if (!expectedSerialNumber || !actualSerialNumber) {
|
|
49301
|
-
|
|
49270
|
+
return;
|
|
49302
49271
|
}
|
|
49303
49272
|
if (actualSerialNumber !== expectedSerialNumber) {
|
|
49304
49273
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceNotFound, `Protocol V2 reconnect physical identity mismatch: expected ${expectedSerialNumber}, received ${actualSerialNumber}`);
|
|
@@ -49331,7 +49300,6 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
49331
49300
|
{ name: 'chunkSize', type: 'number' },
|
|
49332
49301
|
{ name: 'forcedUpdateRes', type: 'boolean' },
|
|
49333
49302
|
{ name: 'bootloaderBinary', type: 'buffer' },
|
|
49334
|
-
{ name: 'bootResourcesBinary', type: 'buffer' },
|
|
49335
49303
|
{ name: 'romloaderBinary', type: 'buffer' },
|
|
49336
49304
|
{ name: 'applicationP1Binary', type: 'buffer' },
|
|
49337
49305
|
{ name: 'applicationP2Binary', type: 'buffer' },
|
|
@@ -49349,7 +49317,6 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
49349
49317
|
chunkSize: payload.chunkSize,
|
|
49350
49318
|
forcedUpdateRes: payload.forcedUpdateRes,
|
|
49351
49319
|
bootloaderBinary: payload.bootloaderBinary,
|
|
49352
|
-
bootResourcesBinary: payload.bootResourcesBinary,
|
|
49353
49320
|
romloaderBinary: payload.romloaderBinary,
|
|
49354
49321
|
applicationP1Binary: payload.applicationP1Binary,
|
|
49355
49322
|
applicationP2Binary: payload.applicationP2Binary,
|
|
@@ -49385,7 +49352,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
49385
49352
|
});
|
|
49386
49353
|
}
|
|
49387
49354
|
runProtocolV2() {
|
|
49388
|
-
var _a, _b, _c, _d
|
|
49355
|
+
var _a, _b, _c, _d;
|
|
49389
49356
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49390
49357
|
yield this.captureProtocolV2PhysicalIdentity();
|
|
49391
49358
|
const deviceFeatures = yield this.getProtocolV2DeviceFeatures();
|
|
@@ -49394,7 +49361,6 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
49394
49361
|
const resourceRecoveryMode = Boolean(this.isProtocolV2BootloaderMode() || this.isProtocolV2RomloaderMode());
|
|
49395
49362
|
let fwBinaryMap = [];
|
|
49396
49363
|
let bootloaderBinary = null;
|
|
49397
|
-
let bootResourcesInstallItem;
|
|
49398
49364
|
let installItems;
|
|
49399
49365
|
let resourceBundles;
|
|
49400
49366
|
try {
|
|
@@ -49404,9 +49370,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
49404
49370
|
const needsRemoteFirmware = !this.hasExplicitProtocolV2Payload(fwBinaryMap);
|
|
49405
49371
|
const needsRemoteResources = !((_b = this.params.resourceBundleFiles) === null || _b === void 0 ? void 0 : _b.length) &&
|
|
49406
49372
|
!!((_c = this.params.targetsToUpdate) === null || _c === void 0 ? void 0 : _c.includes('resource'));
|
|
49407
|
-
|
|
49408
|
-
!!((_d = this.params.targetsToUpdate) === null || _d === void 0 ? void 0 : _d.includes('boot_resources'));
|
|
49409
|
-
if (needsRemoteFirmware || needsRemoteResources || needsRemoteBootResources) {
|
|
49373
|
+
if (needsRemoteFirmware || needsRemoteResources) {
|
|
49410
49374
|
yield DataManager.forceReloadData();
|
|
49411
49375
|
}
|
|
49412
49376
|
if (needsRemoteFirmware) {
|
|
@@ -49415,23 +49379,13 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
49415
49379
|
fwBinaryMap = remoteBinaries.fwBinaryMap;
|
|
49416
49380
|
installItems = remoteBinaries.installItems;
|
|
49417
49381
|
}
|
|
49418
|
-
bootResourcesInstallItem = yield this.prepareProtocolV2BootResources();
|
|
49419
|
-
if (bootResourcesInstallItem) {
|
|
49420
|
-
installItems = [
|
|
49421
|
-
bootResourcesInstallItem,
|
|
49422
|
-
...(installItems !== null && installItems !== void 0 ? installItems : this.buildProtocolV2InstallItems({ bootloaderBinary, fwBinaryMap })),
|
|
49423
|
-
];
|
|
49424
|
-
}
|
|
49425
49382
|
resourceBundles = yield this.prepareProtocolV2ResourceBundles(resourceRecoveryMode);
|
|
49426
49383
|
this.postTipMessage(exports.FirmwareUpdateTipMessage.FinishDownloadFirmware);
|
|
49427
49384
|
}
|
|
49428
49385
|
catch (err) {
|
|
49429
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FirmwareUpdateDownloadFailed, (
|
|
49386
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FirmwareUpdateDownloadFailed, (_d = err.message) !== null && _d !== void 0 ? _d : err);
|
|
49430
49387
|
}
|
|
49431
|
-
if (!bootloaderBinary &&
|
|
49432
|
-
fwBinaryMap.length === 0 &&
|
|
49433
|
-
!(installItems === null || installItems === void 0 ? void 0 : installItems.length) &&
|
|
49434
|
-
!(resourceBundles === null || resourceBundles === void 0 ? void 0 : resourceBundles.length)) {
|
|
49388
|
+
if (!bootloaderBinary && fwBinaryMap.length === 0 && !(resourceBundles === null || resourceBundles === void 0 ? void 0 : resourceBundles.length)) {
|
|
49435
49389
|
if (resourceBundles !== undefined) {
|
|
49436
49390
|
this.postTipMessage(exports.FirmwareUpdateTipMessage.FirmwareUpdateCompleted);
|
|
49437
49391
|
return this.getProtocolV2VersionResult(deviceFeatures);
|
|
@@ -49500,7 +49454,6 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
49500
49454
|
var _a;
|
|
49501
49455
|
return (!!((_a = this.params.resourceBundleFiles) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
49502
49456
|
!!this.params.bootloaderBinary ||
|
|
49503
|
-
!!this.params.bootResourcesBinary ||
|
|
49504
49457
|
fwBinaryMap.length > 0);
|
|
49505
49458
|
}
|
|
49506
49459
|
buildProtocolV2InstallItems({ bootloaderBinary, fwBinaryMap, }) {
|
|
@@ -49615,50 +49568,6 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
49615
49568
|
};
|
|
49616
49569
|
});
|
|
49617
49570
|
}
|
|
49618
|
-
validateProtocolV2BootResourcesBinary(binary, resource) {
|
|
49619
|
-
if (resource && !isProtocolV2ResourceFileValid(binary, resource)) {
|
|
49620
|
-
throw new Error('Pro2 boot resources file verification failed');
|
|
49621
|
-
}
|
|
49622
|
-
const header = parseProtocolV2OkppHeader(toProtocolV2Bytes(binary));
|
|
49623
|
-
if (!header || header.type !== 'CRAT') {
|
|
49624
|
-
throw new Error('Invalid Pro2 boot resources CRATE header');
|
|
49625
|
-
}
|
|
49626
|
-
if (resource) {
|
|
49627
|
-
const expectedPayloadHash = normalizeProtocolV2Hex(resource.payloadHash);
|
|
49628
|
-
const expectedHeaderHash = normalizeProtocolV2Hex(resource.headerHash);
|
|
49629
|
-
if (header.payloadHash !== expectedPayloadHash) {
|
|
49630
|
-
throw new Error('Pro2 boot resources payload hash mismatch');
|
|
49631
|
-
}
|
|
49632
|
-
if (header.headerHash !== expectedHeaderHash) {
|
|
49633
|
-
throw new Error('Pro2 boot resources header hash mismatch');
|
|
49634
|
-
}
|
|
49635
|
-
}
|
|
49636
|
-
}
|
|
49637
|
-
prepareProtocolV2BootResources() {
|
|
49638
|
-
var _a;
|
|
49639
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
49640
|
-
let binary = this.params.bootResourcesBinary;
|
|
49641
|
-
let resource;
|
|
49642
|
-
if (!binary) {
|
|
49643
|
-
if (!((_a = this.params.targetsToUpdate) === null || _a === void 0 ? void 0 : _a.includes('boot_resources'))) {
|
|
49644
|
-
return undefined;
|
|
49645
|
-
}
|
|
49646
|
-
resource = DataManager.getProtocolV2BootResources();
|
|
49647
|
-
if (!resource) {
|
|
49648
|
-
throw new Error('Missing Pro2 boot resources configuration');
|
|
49649
|
-
}
|
|
49650
|
-
Log$5.log('[FirmwareUpdateV4] downloading Pro2 boot resources CRATE');
|
|
49651
|
-
({ binary } = yield getSysResourceBinary(resource.url));
|
|
49652
|
-
}
|
|
49653
|
-
this.validateProtocolV2BootResourcesBinary(binary, resource);
|
|
49654
|
-
return {
|
|
49655
|
-
fileName: PROTOCOL_V2_BOOT_RESOURCES_FILE_NAME,
|
|
49656
|
-
binary,
|
|
49657
|
-
targetId: ProtocolV2FirmwareTargetType.FW_MGMT_TARGET_CRATE,
|
|
49658
|
-
kind: 'boot_resources',
|
|
49659
|
-
};
|
|
49660
|
-
});
|
|
49661
|
-
}
|
|
49662
49571
|
prepareProtocolV2ResourceBundles(recoveryMode) {
|
|
49663
49572
|
var _a, _b;
|
|
49664
49573
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -60916,6 +60825,27 @@ class RequestQueue {
|
|
|
60916
60825
|
}
|
|
60917
60826
|
}
|
|
60918
60827
|
|
|
60828
|
+
const isSensitiveUiResponse = (response) => response.type === UI_RESPONSE.RECEIVE_PIN || response.type === UI_RESPONSE.RECEIVE_PASSPHRASE;
|
|
60829
|
+
const findUiPromiseForResponse = (uiPromises, response) => {
|
|
60830
|
+
const candidates = uiPromises.filter(promise => promise.id === response.type);
|
|
60831
|
+
if (!isSensitiveUiResponse(response)) {
|
|
60832
|
+
return candidates[0];
|
|
60833
|
+
}
|
|
60834
|
+
const hasInteractionId = typeof response.interactionId === 'string';
|
|
60835
|
+
const hasDeviceId = typeof response.deviceId === 'string';
|
|
60836
|
+
if (hasInteractionId !== hasDeviceId) {
|
|
60837
|
+
return undefined;
|
|
60838
|
+
}
|
|
60839
|
+
if (hasInteractionId && hasDeviceId) {
|
|
60840
|
+
return candidates.find(promise => {
|
|
60841
|
+
const correlation = promise.responseCorrelation;
|
|
60842
|
+
return ((correlation === null || correlation === void 0 ? void 0 : correlation.interactionId) === response.interactionId &&
|
|
60843
|
+
(correlation === null || correlation === void 0 ? void 0 : correlation.deviceId) === response.deviceId);
|
|
60844
|
+
});
|
|
60845
|
+
}
|
|
60846
|
+
return candidates.length === 1 ? candidates[0] : undefined;
|
|
60847
|
+
};
|
|
60848
|
+
|
|
60919
60849
|
function registerHardwareUiEventListeners(device, handlers) {
|
|
60920
60850
|
device.on(DEVICE.PIN, handlers.pin);
|
|
60921
60851
|
device.on(DEVICE.PIN_ON_DEVICE, handlers.pinOnDevice);
|
|
@@ -61851,6 +61781,7 @@ const onDevicePinHandler = (...[device, type, callback]) => __awaiter(void 0, vo
|
|
|
61851
61781
|
postMessage(createUiMessage(UI_REQUEST.REQUEST_PIN, {
|
|
61852
61782
|
device: device.toMessageObject(),
|
|
61853
61783
|
type,
|
|
61784
|
+
responseCorrelation: uiPromise.responseCorrelation,
|
|
61854
61785
|
}));
|
|
61855
61786
|
const uiResp = yield uiPromise.promise;
|
|
61856
61787
|
callback(null, uiResp.payload);
|
|
@@ -61878,7 +61809,7 @@ const onDeviceStateHandler = (...[_, stateEvent]) => {
|
|
|
61878
61809
|
const onDevicePassphraseHandler = (...[device, requestPayload, callback]) => __awaiter(void 0, void 0, void 0, function* () {
|
|
61879
61810
|
Log.debug('onDevicePassphraseHandler');
|
|
61880
61811
|
const uiPromise = createUiPromise(UI_RESPONSE.RECEIVE_PASSPHRASE, device);
|
|
61881
|
-
postMessage(createUiMessage(UI_REQUEST.REQUEST_PASSPHRASE, Object.assign({ device: device.toMessageObject(), passphraseState: device.passphraseState, existsAttachPinUser: requestPayload.existsAttachPinUser, deviceOnly: requestPayload.deviceOnly, source: requestPayload.source, reason: requestPayload.reason, expectedPassphraseState: requestPayload.expectedPassphraseState }, (requestPayload.interaction ? { interaction: requestPayload.interaction } : {}))));
|
|
61812
|
+
postMessage(createUiMessage(UI_REQUEST.REQUEST_PASSPHRASE, Object.assign(Object.assign({ device: device.toMessageObject(), passphraseState: device.passphraseState, existsAttachPinUser: requestPayload.existsAttachPinUser, deviceOnly: requestPayload.deviceOnly, source: requestPayload.source, reason: requestPayload.reason, expectedPassphraseState: requestPayload.expectedPassphraseState }, (requestPayload.interaction ? { interaction: requestPayload.interaction } : {})), { responseCorrelation: uiPromise.responseCorrelation })));
|
|
61882
61813
|
const uiResp = yield uiPromise.promise;
|
|
61883
61814
|
const { value, passphraseOnDevice, save, attachPinOnDevice } = uiResp.payload;
|
|
61884
61815
|
callback({
|
|
@@ -61932,11 +61863,19 @@ const postMessage = (message) => {
|
|
|
61932
61863
|
_core.emit(CORE_EVENT, message);
|
|
61933
61864
|
};
|
|
61934
61865
|
const createUiPromise = (promiseEvent, device) => {
|
|
61866
|
+
var _a;
|
|
61935
61867
|
const uiPromise = hdShared.createDeferred(promiseEvent, device);
|
|
61868
|
+
if (device &&
|
|
61869
|
+
(promiseEvent === UI_RESPONSE.RECEIVE_PIN || promiseEvent === UI_RESPONSE.RECEIVE_PASSPHRASE)) {
|
|
61870
|
+
const publicDeviceId = (_a = device.toMessageObject()) === null || _a === void 0 ? void 0 : _a.deviceId;
|
|
61871
|
+
uiPromise.responseCorrelation = {
|
|
61872
|
+
interactionId: generateInstanceId('UiResponse', device.sdkInstanceId),
|
|
61873
|
+
deviceId: publicDeviceId || device.instanceId,
|
|
61874
|
+
};
|
|
61875
|
+
}
|
|
61936
61876
|
_uiPromises.push(uiPromise);
|
|
61937
61877
|
return uiPromise;
|
|
61938
61878
|
};
|
|
61939
|
-
const findUiPromise = (promiseEvent) => _uiPromises.find(p => p.id === promiseEvent);
|
|
61940
61879
|
const removeUiPromise = (promise) => {
|
|
61941
61880
|
_uiPromises = _uiPromises.filter(p => p !== promise);
|
|
61942
61881
|
};
|
|
@@ -61974,12 +61913,16 @@ class Core extends events.exports {
|
|
|
61974
61913
|
case UI_RESPONSE.RECEIVE_PASSPHRASE:
|
|
61975
61914
|
case UI_RESPONSE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE:
|
|
61976
61915
|
case UI_RESPONSE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: {
|
|
61977
|
-
const uiPromise =
|
|
61916
|
+
const uiPromise = findUiPromiseForResponse(_uiPromises, message);
|
|
61978
61917
|
if (uiPromise) {
|
|
61979
61918
|
Log.log('receive UI Response: ', message.type);
|
|
61980
61919
|
uiPromise.resolve(message);
|
|
61981
61920
|
removeUiPromise(uiPromise);
|
|
61982
61921
|
}
|
|
61922
|
+
else if (message.type === UI_RESPONSE.RECEIVE_PIN ||
|
|
61923
|
+
message.type === UI_RESPONSE.RECEIVE_PASSPHRASE) {
|
|
61924
|
+
Log.warn('Ignored unmatched or ambiguous sensitive UI response:', message.type);
|
|
61925
|
+
}
|
|
61983
61926
|
break;
|
|
61984
61927
|
}
|
|
61985
61928
|
case UI_REQUEST.BLUETOOTH_UNSUPPORTED:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../src/protocols/protocol-v2/resources.ts"],"names":[],"mappings":"A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AAS,EACT,IAAI,EACJ,MAAc,GACf,EAAE;IACD,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC1C,SAAS,CAAC,EAAE,SAAS,+BAA+B,EAAE,CAAC;IACvD,IAAI,EAAE,4BAA4B,CAAC;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,4BAA4B,CAyB/B;AAOD,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,IAAI,CAAC,mBAAmB,EAAE,MAAM,GAAG,UAAU,CAAC,GACvD,OAAO,CAGT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletSession.d.ts","sourceRoot":"","sources":["../../../src/protocols/protocol-v2/walletSession.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAuBlD,wBAAsB,6BAA6B,CAAC,MAAM,EAAE,MAAM,0DAGjE;AAED,wBAAsB,6BAA6B,CAAC,MAAM,EAAE,MAAM,qCAGjE;AAED,wBAAsB,qCAAqC,CAAC,MAAM,EAAE,MAAM,oBAgBzE;
|
|
1
|
+
{"version":3,"file":"walletSession.d.ts","sourceRoot":"","sources":["../../../src/protocols/protocol-v2/walletSession.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAuBlD,wBAAsB,6BAA6B,CAAC,MAAM,EAAE,MAAM,0DAGjE;AAED,wBAAsB,6BAA6B,CAAC,MAAM,EAAE,MAAM,qCAGjE;AAED,wBAAsB,qCAAqC,CAAC,MAAM,EAAE,MAAM,oBAgBzE;AA0HD,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IACR,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;;;;;GA8NF;AAED,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,MAAM,EACd,uBAAuB,EAAE,MAAM,EAC/B,aAAa,CAAC,EAAE,OAAO;;;;;GAOxB"}
|
|
@@ -38,7 +38,7 @@ export interface FirmwareUpdateV3Params {
|
|
|
38
38
|
firmwareType?: EFirmwareType;
|
|
39
39
|
platform: IPlatform;
|
|
40
40
|
}
|
|
41
|
-
export type FirmwareUpdateV4Target = 'boot' | '
|
|
41
|
+
export type FirmwareUpdateV4Target = 'boot' | 'app_v1' | 'app_v2' | 'coprocessor' | 'resource' | 'se01' | 'se02' | 'se03' | 'se04';
|
|
42
42
|
export interface FirmwareUpdateV4Params {
|
|
43
43
|
platform: IPlatform;
|
|
44
44
|
chunkSize?: number;
|
|
@@ -46,7 +46,6 @@ export interface FirmwareUpdateV4Params {
|
|
|
46
46
|
targetsToUpdate?: FirmwareUpdateV4Target[];
|
|
47
47
|
romloaderBinary?: ArrayBuffer;
|
|
48
48
|
bootloaderBinary?: ArrayBuffer;
|
|
49
|
-
bootResourcesBinary?: ArrayBuffer;
|
|
50
49
|
applicationP1Binary?: ArrayBuffer;
|
|
51
50
|
applicationP2Binary?: ArrayBuffer;
|
|
52
51
|
coprocessorBinary?: ArrayBuffer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firmwareUpdate.d.ts","sourceRoot":"","sources":["../../../src/types/api/firmwareUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAElD,KAAK,WA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AC,OAAO,UAAU,gBAAgB,CACtC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,CAAC,sBAAsB,CAAC,GACrC,QAAQ,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC,CAAC"}
|
package/dist/types/settings.d.ts
CHANGED
|
@@ -40,18 +40,8 @@ export type IProtocolV2Resource = {
|
|
|
40
40
|
fileHash: string;
|
|
41
41
|
headerHash: string;
|
|
42
42
|
};
|
|
43
|
-
export type IProtocolV2BootResources = {
|
|
44
|
-
required: false;
|
|
45
|
-
target: 'CRATE';
|
|
46
|
-
url: string;
|
|
47
|
-
size: number;
|
|
48
|
-
fileHash: string;
|
|
49
|
-
payloadHash: string;
|
|
50
|
-
headerHash: string;
|
|
51
|
-
};
|
|
52
43
|
export type IProtocolV2Resources = {
|
|
53
44
|
stable: IProtocolV2Resource[];
|
|
54
|
-
boot?: IProtocolV2BootResources;
|
|
55
45
|
};
|
|
56
46
|
export type IProtocolV2ResourceBundle = {
|
|
57
47
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/types/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,KAAK,GACL,cAAc,GACd,UAAU,GACV,cAAc,GACd,QAAQ,GACR,gBAAgB,GAChB,iBAAiB,GACjB,UAAU,GACV,UAAU,GACV,UAAU,CAAC;AACf,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC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