@onekeyfe/hd-core 1.2.2-alpha.100 → 1.2.2-alpha.3
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__/AllNetworkGetAddressBase.tracing.test.ts +20 -4
- package/__tests__/DeviceCommands.test.ts +13 -0
- package/__tests__/check-all-firmware-release-protocol-v2.test.ts +0 -2
- package/__tests__/check-firmware-release-protocol-v2.test.ts +0 -2
- package/__tests__/device-lifecycle-events.test.ts +19 -0
- package/__tests__/deviceUploadNft.test.ts +68 -0
- package/__tests__/evmSignTypedData.test.ts +42 -0
- package/__tests__/firmware-update/firmware-update-v4-install-poll.test.ts +825 -12
- package/__tests__/open-wallet-session.test.ts +144 -37
- package/__tests__/pro2HostAssetPackage.test.ts +58 -0
- package/__tests__/protocol-v2-resources.test.ts +7 -4
- package/__tests__/protocol-v2-unlock-policy.test.ts +35 -1
- package/__tests__/protocol-v2.test.ts +720 -51
- package/dist/api/FirmwareUpdateV4.d.ts +4 -0
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/OpenWalletSession.d.ts.map +1 -1
- package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
- package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +2 -2
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
- package/dist/api/firmware/getBinary.d.ts +2 -2
- package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceUploadNft.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts.map +1 -1
- package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/device/Device.d.ts +1 -1
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DeviceConnector.d.ts +1 -1
- package/dist/device/DeviceConnector.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/index.d.ts +21 -5
- package/dist/index.js +2288 -1439
- package/dist/protocols/protocol-v2/resources.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/unlockPolicyRunner.d.ts +2 -0
- package/dist/protocols/protocol-v2/unlockPolicyRunner.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/walletSession.d.ts +3 -0
- package/dist/protocols/protocol-v2/walletSession.d.ts.map +1 -1
- package/dist/types/settings.d.ts +2 -2
- package/dist/types/settings.d.ts.map +1 -1
- package/dist/utils/deviceFeaturesUtils.d.ts +3 -0
- package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/patch.d.ts.map +1 -1
- package/dist/utils/pro2HostAssetPackage.d.ts +8 -0
- package/dist/utils/pro2HostAssetPackage.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/api/FirmwareUpdateV4.ts +434 -75
- package/src/api/OpenWalletSession.ts +39 -9
- package/src/api/allnetwork/AllNetworkGetAddressBase.ts +5 -2
- package/src/api/evm/EVMSignTypedData.ts +1 -0
- package/src/api/firmware/FirmwareUpdateBaseMethod.ts +9 -3
- package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +7 -1
- package/src/api/protocol-v2/DeviceUploadNft.ts +31 -8
- package/src/api/protocol-v2/DeviceUploadWallpaper.ts +27 -8
- package/src/api/protocol-v2/helpers.ts +8 -0
- package/src/core/index.ts +130 -14
- package/src/data/messages/messages-protocol-v2.json +1541 -1332
- package/src/device/Device.ts +3 -1
- package/src/device/DeviceConnector.ts +7 -3
- package/src/events/ui-request.ts +3 -0
- package/src/protocols/protocol-v2/resources.ts +9 -1
- package/src/protocols/protocol-v2/unlockPolicyRunner.ts +8 -1
- package/src/protocols/protocol-v2/walletSession.ts +88 -50
- package/src/types/settings.ts +4 -2
- package/src/utils/deviceFeaturesUtils.ts +4 -0
- package/src/utils/pro2HostAssetPackage.ts +354 -0
package/dist/index.js
CHANGED
|
@@ -27030,500 +27030,6 @@ var MessagesLegacyV1JSON = {
|
|
|
27030
27030
|
};
|
|
27031
27031
|
|
|
27032
27032
|
var nested = {
|
|
27033
|
-
wire_in: {
|
|
27034
|
-
type: "bool",
|
|
27035
|
-
id: 50002,
|
|
27036
|
-
extend: "google.protobuf.EnumValueOptions"
|
|
27037
|
-
},
|
|
27038
|
-
wire_out: {
|
|
27039
|
-
type: "bool",
|
|
27040
|
-
id: 50003,
|
|
27041
|
-
extend: "google.protobuf.EnumValueOptions"
|
|
27042
|
-
},
|
|
27043
|
-
wire_debug_in: {
|
|
27044
|
-
type: "bool",
|
|
27045
|
-
id: 50004,
|
|
27046
|
-
extend: "google.protobuf.EnumValueOptions"
|
|
27047
|
-
},
|
|
27048
|
-
wire_debug_out: {
|
|
27049
|
-
type: "bool",
|
|
27050
|
-
id: 50005,
|
|
27051
|
-
extend: "google.protobuf.EnumValueOptions"
|
|
27052
|
-
},
|
|
27053
|
-
wire_tiny: {
|
|
27054
|
-
type: "bool",
|
|
27055
|
-
id: 50006,
|
|
27056
|
-
extend: "google.protobuf.EnumValueOptions"
|
|
27057
|
-
},
|
|
27058
|
-
wire_bootloader: {
|
|
27059
|
-
type: "bool",
|
|
27060
|
-
id: 50007,
|
|
27061
|
-
extend: "google.protobuf.EnumValueOptions"
|
|
27062
|
-
},
|
|
27063
|
-
wire_no_fsm: {
|
|
27064
|
-
type: "bool",
|
|
27065
|
-
id: 50008,
|
|
27066
|
-
extend: "google.protobuf.EnumValueOptions"
|
|
27067
|
-
},
|
|
27068
|
-
bitcoin_only: {
|
|
27069
|
-
type: "bool",
|
|
27070
|
-
id: 60000,
|
|
27071
|
-
extend: "google.protobuf.EnumValueOptions"
|
|
27072
|
-
},
|
|
27073
|
-
has_bitcoin_only_values: {
|
|
27074
|
-
type: "bool",
|
|
27075
|
-
id: 51001,
|
|
27076
|
-
extend: "google.protobuf.EnumOptions"
|
|
27077
|
-
},
|
|
27078
|
-
experimental_message: {
|
|
27079
|
-
type: "bool",
|
|
27080
|
-
id: 52001,
|
|
27081
|
-
extend: "google.protobuf.MessageOptions"
|
|
27082
|
-
},
|
|
27083
|
-
wire_type: {
|
|
27084
|
-
type: "uint32",
|
|
27085
|
-
id: 52002,
|
|
27086
|
-
extend: "google.protobuf.MessageOptions"
|
|
27087
|
-
},
|
|
27088
|
-
experimental_field: {
|
|
27089
|
-
type: "bool",
|
|
27090
|
-
id: 53001,
|
|
27091
|
-
extend: "google.protobuf.FieldOptions"
|
|
27092
|
-
},
|
|
27093
|
-
include_in_bitcoin_only: {
|
|
27094
|
-
type: "bool",
|
|
27095
|
-
id: 60000,
|
|
27096
|
-
extend: "google.protobuf.FileOptions"
|
|
27097
|
-
},
|
|
27098
|
-
MessageType: {
|
|
27099
|
-
options: {
|
|
27100
|
-
"(has_bitcoin_only_values)": true
|
|
27101
|
-
},
|
|
27102
|
-
values: {
|
|
27103
|
-
MessageType_Initialize: 0,
|
|
27104
|
-
MessageType_ChangePin: 4,
|
|
27105
|
-
MessageType_WipeDevice: 5,
|
|
27106
|
-
MessageType_GetEntropy: 9,
|
|
27107
|
-
MessageType_Entropy: 10,
|
|
27108
|
-
MessageType_LoadDevice: 13,
|
|
27109
|
-
MessageType_ResetDevice: 14,
|
|
27110
|
-
MessageType_SetBusy: 16,
|
|
27111
|
-
MessageType_Features: 17,
|
|
27112
|
-
MessageType_Cancel: 20,
|
|
27113
|
-
MessageType_LockDevice: 24,
|
|
27114
|
-
MessageType_ApplySettings: 25,
|
|
27115
|
-
MessageType_ButtonRequest: 26,
|
|
27116
|
-
MessageType_ButtonAck: 27,
|
|
27117
|
-
MessageType_ApplyFlags: 28,
|
|
27118
|
-
MessageType_GetNonce: 31,
|
|
27119
|
-
MessageType_Nonce: 33,
|
|
27120
|
-
MessageType_BackupDevice: 34,
|
|
27121
|
-
MessageType_EntropyRequest: 35,
|
|
27122
|
-
MessageType_EntropyAck: 36,
|
|
27123
|
-
MessageType_PassphraseRequest: 41,
|
|
27124
|
-
MessageType_PassphraseAck: 42,
|
|
27125
|
-
MessageType_RecoveryDevice: 45,
|
|
27126
|
-
MessageType_WordRequest: 46,
|
|
27127
|
-
MessageType_WordAck: 47,
|
|
27128
|
-
MessageType_GetFeatures: 55,
|
|
27129
|
-
MessageType_SdProtect: 79,
|
|
27130
|
-
MessageType_ChangeWipeCode: 82,
|
|
27131
|
-
MessageType_DoPreauthorized: 84,
|
|
27132
|
-
MessageType_PreauthorizedRequest: 85,
|
|
27133
|
-
MessageType_CancelAuthorization: 86,
|
|
27134
|
-
MessageType_GetFirmwareHash: 88,
|
|
27135
|
-
MessageType_FirmwareHash: 89,
|
|
27136
|
-
MessageType_UnlockPath: 93,
|
|
27137
|
-
MessageType_UnlockedPathRequest: 94,
|
|
27138
|
-
MessageType_SetU2FCounter: 63,
|
|
27139
|
-
MessageType_GetNextU2FCounter: 80,
|
|
27140
|
-
MessageType_NextU2FCounter: 81,
|
|
27141
|
-
MessageType_Deprecated_PassphraseStateRequest: 77,
|
|
27142
|
-
MessageType_Deprecated_PassphraseStateAck: 78,
|
|
27143
|
-
MessageType_GetPublicKey: 11,
|
|
27144
|
-
MessageType_PublicKey: 12,
|
|
27145
|
-
MessageType_SignTx: 15,
|
|
27146
|
-
MessageType_TxRequest: 21,
|
|
27147
|
-
MessageType_TxAck: 22,
|
|
27148
|
-
MessageType_GetAddress: 29,
|
|
27149
|
-
MessageType_Address: 30,
|
|
27150
|
-
MessageType_TxAckPaymentRequest: 37,
|
|
27151
|
-
MessageType_SignMessage: 38,
|
|
27152
|
-
MessageType_VerifyMessage: 39,
|
|
27153
|
-
MessageType_MessageSignature: 40,
|
|
27154
|
-
MessageType_GetOwnershipId: 43,
|
|
27155
|
-
MessageType_OwnershipId: 44,
|
|
27156
|
-
MessageType_GetOwnershipProof: 49,
|
|
27157
|
-
MessageType_OwnershipProof: 50,
|
|
27158
|
-
MessageType_AuthorizeCoinJoin: 51,
|
|
27159
|
-
MessageType_SignPsbt: 10052,
|
|
27160
|
-
MessageType_SignedPsbt: 10053,
|
|
27161
|
-
MessageType_CipherKeyValue: 23,
|
|
27162
|
-
MessageType_CipheredKeyValue: 48,
|
|
27163
|
-
MessageType_SignIdentity: 53,
|
|
27164
|
-
MessageType_SignedIdentity: 54,
|
|
27165
|
-
MessageType_GetECDHSessionKey: 61,
|
|
27166
|
-
MessageType_ECDHSessionKey: 62,
|
|
27167
|
-
MessageType_CosiCommit: 71,
|
|
27168
|
-
MessageType_CosiCommitment: 72,
|
|
27169
|
-
MessageType_CosiSign: 73,
|
|
27170
|
-
MessageType_CosiSignature: 74,
|
|
27171
|
-
MessageType_BatchGetPublickeys: 10016,
|
|
27172
|
-
MessageType_EcdsaPublicKeys: 10017,
|
|
27173
|
-
MessageType_EthereumGetPublicKey: 450,
|
|
27174
|
-
MessageType_EthereumPublicKey: 451,
|
|
27175
|
-
MessageType_EthereumGetAddress: 56,
|
|
27176
|
-
MessageType_EthereumAddress: 57,
|
|
27177
|
-
MessageType_EthereumSignTx: 58,
|
|
27178
|
-
MessageType_EthereumSignTxEIP1559: 452,
|
|
27179
|
-
MessageType_EthereumTxRequest: 59,
|
|
27180
|
-
MessageType_EthereumTxAck: 60,
|
|
27181
|
-
MessageType_EthereumSignMessage: 64,
|
|
27182
|
-
MessageType_EthereumVerifyMessage: 65,
|
|
27183
|
-
MessageType_EthereumMessageSignature: 66,
|
|
27184
|
-
MessageType_EthereumSignTypedData: 464,
|
|
27185
|
-
MessageType_EthereumTypedDataStructRequest: 465,
|
|
27186
|
-
MessageType_EthereumTypedDataStructAck: 466,
|
|
27187
|
-
MessageType_EthereumTypedDataValueRequest: 467,
|
|
27188
|
-
MessageType_EthereumTypedDataValueAck: 468,
|
|
27189
|
-
MessageType_EthereumTypedDataSignature: 469,
|
|
27190
|
-
MessageType_EthereumSignTypedHash: 470,
|
|
27191
|
-
MessageType_EthereumGetPublicKeyOneKey: 20100,
|
|
27192
|
-
MessageType_EthereumPublicKeyOneKey: 20101,
|
|
27193
|
-
MessageType_EthereumGetAddressOneKey: 20102,
|
|
27194
|
-
MessageType_EthereumAddressOneKey: 20103,
|
|
27195
|
-
MessageType_EthereumSignTxOneKey: 20104,
|
|
27196
|
-
MessageType_EthereumSignTxEIP1559OneKey: 20105,
|
|
27197
|
-
MessageType_EthereumTxRequestOneKey: 20106,
|
|
27198
|
-
MessageType_EthereumTxAckOneKey: 20107,
|
|
27199
|
-
MessageType_EthereumSignMessageOneKey: 20108,
|
|
27200
|
-
MessageType_EthereumVerifyMessageOneKey: 20109,
|
|
27201
|
-
MessageType_EthereumMessageSignatureOneKey: 20110,
|
|
27202
|
-
MessageType_EthereumSignTypedDataOneKey: 20111,
|
|
27203
|
-
MessageType_EthereumTypedDataStructRequestOneKey: 20112,
|
|
27204
|
-
MessageType_EthereumTypedDataStructAckOneKey: 20113,
|
|
27205
|
-
MessageType_EthereumTypedDataValueRequestOneKey: 20114,
|
|
27206
|
-
MessageType_EthereumTypedDataValueAckOneKey: 20115,
|
|
27207
|
-
MessageType_EthereumTypedDataSignatureOneKey: 20116,
|
|
27208
|
-
MessageType_EthereumSignTypedHashOneKey: 20117,
|
|
27209
|
-
MessageType_EthereumGnosisSafeTxAck: 20118,
|
|
27210
|
-
MessageType_EthereumGnosisSafeTxRequest: 20119,
|
|
27211
|
-
MessageType_EthereumSignTxEIP7702OneKey: 20120,
|
|
27212
|
-
MessageType_EthereumSignTypedDataQR: 20121,
|
|
27213
|
-
MessageType_NEMGetAddress: 67,
|
|
27214
|
-
MessageType_NEMAddress: 68,
|
|
27215
|
-
MessageType_NEMSignTx: 69,
|
|
27216
|
-
MessageType_NEMSignedTx: 70,
|
|
27217
|
-
MessageType_NEMDecryptMessage: 75,
|
|
27218
|
-
MessageType_NEMDecryptedMessage: 76,
|
|
27219
|
-
MessageType_TezosGetAddress: 150,
|
|
27220
|
-
MessageType_TezosAddress: 151,
|
|
27221
|
-
MessageType_TezosSignTx: 152,
|
|
27222
|
-
MessageType_TezosSignedTx: 153,
|
|
27223
|
-
MessageType_TezosGetPublicKey: 154,
|
|
27224
|
-
MessageType_TezosPublicKey: 155,
|
|
27225
|
-
MessageType_StellarSignTx: 202,
|
|
27226
|
-
MessageType_StellarTxOpRequest: 203,
|
|
27227
|
-
MessageType_StellarGetAddress: 207,
|
|
27228
|
-
MessageType_StellarAddress: 208,
|
|
27229
|
-
MessageType_StellarCreateAccountOp: 210,
|
|
27230
|
-
MessageType_StellarPaymentOp: 211,
|
|
27231
|
-
MessageType_StellarPathPaymentStrictReceiveOp: 212,
|
|
27232
|
-
MessageType_StellarManageSellOfferOp: 213,
|
|
27233
|
-
MessageType_StellarCreatePassiveSellOfferOp: 214,
|
|
27234
|
-
MessageType_StellarSetOptionsOp: 215,
|
|
27235
|
-
MessageType_StellarChangeTrustOp: 216,
|
|
27236
|
-
MessageType_StellarAllowTrustOp: 217,
|
|
27237
|
-
MessageType_StellarAccountMergeOp: 218,
|
|
27238
|
-
MessageType_StellarManageDataOp: 220,
|
|
27239
|
-
MessageType_StellarBumpSequenceOp: 221,
|
|
27240
|
-
MessageType_StellarManageBuyOfferOp: 222,
|
|
27241
|
-
MessageType_StellarPathPaymentStrictSendOp: 223,
|
|
27242
|
-
MessageType_StellarSignedTx: 230,
|
|
27243
|
-
MessageType_CardanoGetPublicKey: 305,
|
|
27244
|
-
MessageType_CardanoPublicKey: 306,
|
|
27245
|
-
MessageType_CardanoGetAddress: 307,
|
|
27246
|
-
MessageType_CardanoAddress: 308,
|
|
27247
|
-
MessageType_CardanoTxItemAck: 313,
|
|
27248
|
-
MessageType_CardanoTxAuxiliaryDataSupplement: 314,
|
|
27249
|
-
MessageType_CardanoTxWitnessRequest: 315,
|
|
27250
|
-
MessageType_CardanoTxWitnessResponse: 316,
|
|
27251
|
-
MessageType_CardanoTxHostAck: 317,
|
|
27252
|
-
MessageType_CardanoTxBodyHash: 318,
|
|
27253
|
-
MessageType_CardanoSignTxFinished: 319,
|
|
27254
|
-
MessageType_CardanoSignTxInit: 320,
|
|
27255
|
-
MessageType_CardanoTxInput: 321,
|
|
27256
|
-
MessageType_CardanoTxOutput: 322,
|
|
27257
|
-
MessageType_CardanoAssetGroup: 323,
|
|
27258
|
-
MessageType_CardanoToken: 324,
|
|
27259
|
-
MessageType_CardanoTxCertificate: 325,
|
|
27260
|
-
MessageType_CardanoTxWithdrawal: 326,
|
|
27261
|
-
MessageType_CardanoTxAuxiliaryData: 327,
|
|
27262
|
-
MessageType_CardanoPoolOwner: 328,
|
|
27263
|
-
MessageType_CardanoPoolRelayParameters: 329,
|
|
27264
|
-
MessageType_CardanoGetNativeScriptHash: 330,
|
|
27265
|
-
MessageType_CardanoNativeScriptHash: 331,
|
|
27266
|
-
MessageType_CardanoTxMint: 332,
|
|
27267
|
-
MessageType_CardanoTxCollateralInput: 333,
|
|
27268
|
-
MessageType_CardanoTxRequiredSigner: 334,
|
|
27269
|
-
MessageType_CardanoTxInlineDatumChunk: 335,
|
|
27270
|
-
MessageType_CardanoTxReferenceScriptChunk: 336,
|
|
27271
|
-
MessageType_CardanoTxReferenceInput: 337,
|
|
27272
|
-
MessageType_CardanoSignMessage: 350,
|
|
27273
|
-
MessageType_CardanoMessageSignature: 351,
|
|
27274
|
-
MessageType_RippleGetAddress: 400,
|
|
27275
|
-
MessageType_RippleAddress: 401,
|
|
27276
|
-
MessageType_RippleSignTx: 402,
|
|
27277
|
-
MessageType_RippleSignedTx: 403,
|
|
27278
|
-
MessageType_MoneroTransactionInitRequest: 501,
|
|
27279
|
-
MessageType_MoneroTransactionInitAck: 502,
|
|
27280
|
-
MessageType_MoneroTransactionSetInputRequest: 503,
|
|
27281
|
-
MessageType_MoneroTransactionSetInputAck: 504,
|
|
27282
|
-
MessageType_MoneroTransactionInputViniRequest: 507,
|
|
27283
|
-
MessageType_MoneroTransactionInputViniAck: 508,
|
|
27284
|
-
MessageType_MoneroTransactionAllInputsSetRequest: 509,
|
|
27285
|
-
MessageType_MoneroTransactionAllInputsSetAck: 510,
|
|
27286
|
-
MessageType_MoneroTransactionSetOutputRequest: 511,
|
|
27287
|
-
MessageType_MoneroTransactionSetOutputAck: 512,
|
|
27288
|
-
MessageType_MoneroTransactionAllOutSetRequest: 513,
|
|
27289
|
-
MessageType_MoneroTransactionAllOutSetAck: 514,
|
|
27290
|
-
MessageType_MoneroTransactionSignInputRequest: 515,
|
|
27291
|
-
MessageType_MoneroTransactionSignInputAck: 516,
|
|
27292
|
-
MessageType_MoneroTransactionFinalRequest: 517,
|
|
27293
|
-
MessageType_MoneroTransactionFinalAck: 518,
|
|
27294
|
-
MessageType_MoneroKeyImageExportInitRequest: 530,
|
|
27295
|
-
MessageType_MoneroKeyImageExportInitAck: 531,
|
|
27296
|
-
MessageType_MoneroKeyImageSyncStepRequest: 532,
|
|
27297
|
-
MessageType_MoneroKeyImageSyncStepAck: 533,
|
|
27298
|
-
MessageType_MoneroKeyImageSyncFinalRequest: 534,
|
|
27299
|
-
MessageType_MoneroKeyImageSyncFinalAck: 535,
|
|
27300
|
-
MessageType_MoneroGetAddress: 540,
|
|
27301
|
-
MessageType_MoneroAddress: 541,
|
|
27302
|
-
MessageType_MoneroGetWatchKey: 542,
|
|
27303
|
-
MessageType_MoneroWatchKey: 543,
|
|
27304
|
-
MessageType_DebugMoneroDiagRequest: 546,
|
|
27305
|
-
MessageType_DebugMoneroDiagAck: 547,
|
|
27306
|
-
MessageType_MoneroGetTxKeyRequest: 550,
|
|
27307
|
-
MessageType_MoneroGetTxKeyAck: 551,
|
|
27308
|
-
MessageType_MoneroLiveRefreshStartRequest: 552,
|
|
27309
|
-
MessageType_MoneroLiveRefreshStartAck: 553,
|
|
27310
|
-
MessageType_MoneroLiveRefreshStepRequest: 554,
|
|
27311
|
-
MessageType_MoneroLiveRefreshStepAck: 555,
|
|
27312
|
-
MessageType_MoneroLiveRefreshFinalRequest: 556,
|
|
27313
|
-
MessageType_MoneroLiveRefreshFinalAck: 557,
|
|
27314
|
-
MessageType_EosGetPublicKey: 600,
|
|
27315
|
-
MessageType_EosPublicKey: 601,
|
|
27316
|
-
MessageType_EosSignTx: 602,
|
|
27317
|
-
MessageType_EosTxActionRequest: 603,
|
|
27318
|
-
MessageType_EosTxActionAck: 604,
|
|
27319
|
-
MessageType_EosSignedTx: 605,
|
|
27320
|
-
MessageType_BinanceGetAddress: 700,
|
|
27321
|
-
MessageType_BinanceAddress: 701,
|
|
27322
|
-
MessageType_BinanceGetPublicKey: 702,
|
|
27323
|
-
MessageType_BinancePublicKey: 703,
|
|
27324
|
-
MessageType_BinanceSignTx: 704,
|
|
27325
|
-
MessageType_BinanceTxRequest: 705,
|
|
27326
|
-
MessageType_BinanceTransferMsg: 706,
|
|
27327
|
-
MessageType_BinanceOrderMsg: 707,
|
|
27328
|
-
MessageType_BinanceCancelMsg: 708,
|
|
27329
|
-
MessageType_BinanceSignedTx: 709,
|
|
27330
|
-
MessageType_StarcoinGetAddress: 10300,
|
|
27331
|
-
MessageType_StarcoinAddress: 10301,
|
|
27332
|
-
MessageType_StarcoinGetPublicKey: 10302,
|
|
27333
|
-
MessageType_StarcoinPublicKey: 10303,
|
|
27334
|
-
MessageType_StarcoinSignTx: 10304,
|
|
27335
|
-
MessageType_StarcoinSignedTx: 10305,
|
|
27336
|
-
MessageType_StarcoinSignMessage: 10306,
|
|
27337
|
-
MessageType_StarcoinMessageSignature: 10307,
|
|
27338
|
-
MessageType_StarcoinVerifyMessage: 10308,
|
|
27339
|
-
MessageType_ConfluxGetAddress: 10112,
|
|
27340
|
-
MessageType_ConfluxAddress: 10113,
|
|
27341
|
-
MessageType_ConfluxSignTx: 10114,
|
|
27342
|
-
MessageType_ConfluxTxRequest: 10115,
|
|
27343
|
-
MessageType_ConfluxTxAck: 10116,
|
|
27344
|
-
MessageType_ConfluxSignMessage: 10117,
|
|
27345
|
-
MessageType_ConfluxSignMessageCIP23: 10118,
|
|
27346
|
-
MessageType_ConfluxMessageSignature: 10119,
|
|
27347
|
-
MessageType_TronGetAddress: 10501,
|
|
27348
|
-
MessageType_TronAddress: 10502,
|
|
27349
|
-
MessageType_TronSignTx: 10503,
|
|
27350
|
-
MessageType_TronSignedTx: 10504,
|
|
27351
|
-
MessageType_TronSignMessage: 10505,
|
|
27352
|
-
MessageType_TronMessageSignature: 10506,
|
|
27353
|
-
MessageType_NearGetAddress: 10701,
|
|
27354
|
-
MessageType_NearAddress: 10702,
|
|
27355
|
-
MessageType_NearSignTx: 10703,
|
|
27356
|
-
MessageType_NearSignedTx: 10704,
|
|
27357
|
-
MessageType_AptosGetAddress: 10600,
|
|
27358
|
-
MessageType_AptosAddress: 10601,
|
|
27359
|
-
MessageType_AptosSignTx: 10602,
|
|
27360
|
-
MessageType_AptosSignedTx: 10603,
|
|
27361
|
-
MessageType_AptosSignMessage: 10604,
|
|
27362
|
-
MessageType_AptosMessageSignature: 10605,
|
|
27363
|
-
MessageType_AptosSignSIWAMessage: 10606,
|
|
27364
|
-
MessageType_WebAuthnListResidentCredentials: 800,
|
|
27365
|
-
MessageType_WebAuthnCredentials: 801,
|
|
27366
|
-
MessageType_WebAuthnAddResidentCredential: 802,
|
|
27367
|
-
MessageType_WebAuthnRemoveResidentCredential: 803,
|
|
27368
|
-
MessageType_SolanaGetAddress: 10100,
|
|
27369
|
-
MessageType_SolanaAddress: 10101,
|
|
27370
|
-
MessageType_SolanaSignTx: 10102,
|
|
27371
|
-
MessageType_SolanaSignedTx: 10103,
|
|
27372
|
-
MessageType_SolanaSignOffChainMessage: 10104,
|
|
27373
|
-
MessageType_SolanaMessageSignature: 10105,
|
|
27374
|
-
MessageType_SolanaSignUnsafeMessage: 10106,
|
|
27375
|
-
MessageType_CosmosGetAddress: 10800,
|
|
27376
|
-
MessageType_CosmosAddress: 10801,
|
|
27377
|
-
MessageType_CosmosSignTx: 10802,
|
|
27378
|
-
MessageType_CosmosSignedTx: 10803,
|
|
27379
|
-
MessageType_AlgorandGetAddress: 10900,
|
|
27380
|
-
MessageType_AlgorandAddress: 10901,
|
|
27381
|
-
MessageType_AlgorandSignTx: 10902,
|
|
27382
|
-
MessageType_AlgorandSignedTx: 10903,
|
|
27383
|
-
MessageType_PolkadotGetAddress: 11000,
|
|
27384
|
-
MessageType_PolkadotAddress: 11001,
|
|
27385
|
-
MessageType_PolkadotSignTx: 11002,
|
|
27386
|
-
MessageType_PolkadotSignedTx: 11003,
|
|
27387
|
-
MessageType_SuiGetAddress: 11100,
|
|
27388
|
-
MessageType_SuiAddress: 11101,
|
|
27389
|
-
MessageType_SuiSignTx: 11102,
|
|
27390
|
-
MessageType_SuiSignedTx: 11103,
|
|
27391
|
-
MessageType_SuiSignMessage: 11104,
|
|
27392
|
-
MessageType_SuiMessageSignature: 11105,
|
|
27393
|
-
MessageType_SuiTxRequest: 11106,
|
|
27394
|
-
MessageType_SuiTxAck: 11107,
|
|
27395
|
-
MessageType_FilecoinGetAddress: 11200,
|
|
27396
|
-
MessageType_FilecoinAddress: 11201,
|
|
27397
|
-
MessageType_FilecoinSignTx: 11202,
|
|
27398
|
-
MessageType_FilecoinSignedTx: 11203,
|
|
27399
|
-
MessageType_KaspaGetAddress: 11300,
|
|
27400
|
-
MessageType_KaspaAddress: 11301,
|
|
27401
|
-
MessageType_KaspaSignTx: 11302,
|
|
27402
|
-
MessageType_KaspaSignedTx: 11303,
|
|
27403
|
-
MessageType_KaspaTxInputRequest: 11304,
|
|
27404
|
-
MessageType_KaspaTxInputAck: 11305,
|
|
27405
|
-
MessageType_NexaGetAddress: 11400,
|
|
27406
|
-
MessageType_NexaAddress: 11401,
|
|
27407
|
-
MessageType_NexaSignTx: 11402,
|
|
27408
|
-
MessageType_NexaSignedTx: 11403,
|
|
27409
|
-
MessageType_NexaTxInputRequest: 11404,
|
|
27410
|
-
MessageType_NexaTxInputAck: 11405,
|
|
27411
|
-
MessageType_NostrGetPublicKey: 11500,
|
|
27412
|
-
MessageType_NostrPublicKey: 11501,
|
|
27413
|
-
MessageType_NostrSignEvent: 11502,
|
|
27414
|
-
MessageType_NostrSignedEvent: 11503,
|
|
27415
|
-
MessageType_NostrEncryptMessage: 11504,
|
|
27416
|
-
MessageType_NostrEncryptedMessage: 11505,
|
|
27417
|
-
MessageType_NostrDecryptMessage: 11506,
|
|
27418
|
-
MessageType_NostrDecryptedMessage: 11507,
|
|
27419
|
-
MessageType_NostrSignSchnorr: 11508,
|
|
27420
|
-
MessageType_NostrSignedSchnorr: 11509,
|
|
27421
|
-
MessageType_LnurlAuth: 11600,
|
|
27422
|
-
MessageType_LnurlAuthResp: 11601,
|
|
27423
|
-
MessageType_NervosGetAddress: 11701,
|
|
27424
|
-
MessageType_NervosAddress: 11702,
|
|
27425
|
-
MessageType_NervosSignTx: 11703,
|
|
27426
|
-
MessageType_NervosSignedTx: 11704,
|
|
27427
|
-
MessageType_NervosTxRequest: 11705,
|
|
27428
|
-
MessageType_NervosTxAck: 11706,
|
|
27429
|
-
MessageType_TonGetAddress: 11901,
|
|
27430
|
-
MessageType_TonAddress: 11902,
|
|
27431
|
-
MessageType_TonSignMessage: 11903,
|
|
27432
|
-
MessageType_TonSignedMessage: 11904,
|
|
27433
|
-
MessageType_TonSignProof: 11905,
|
|
27434
|
-
MessageType_TonSignedProof: 11906,
|
|
27435
|
-
MessageType_TonTxAck: 11907,
|
|
27436
|
-
MessageType_AlephiumGetAddress: 12101,
|
|
27437
|
-
MessageType_AlephiumAddress: 12102,
|
|
27438
|
-
MessageType_AlephiumSignTx: 12103,
|
|
27439
|
-
MessageType_AlephiumSignedTx: 12104,
|
|
27440
|
-
MessageType_AlephiumTxRequest: 12105,
|
|
27441
|
-
MessageType_AlephiumTxAck: 12106,
|
|
27442
|
-
MessageType_AlephiumBytecodeRequest: 12107,
|
|
27443
|
-
MessageType_AlephiumBytecodeAck: 12108,
|
|
27444
|
-
MessageType_AlephiumSignMessage: 12109,
|
|
27445
|
-
MessageType_AlephiumMessageSignature: 12110,
|
|
27446
|
-
MessageType_BenfenGetAddress: 12201,
|
|
27447
|
-
MessageType_BenfenAddress: 12202,
|
|
27448
|
-
MessageType_BenfenSignTx: 12203,
|
|
27449
|
-
MessageType_BenfenSignedTx: 12204,
|
|
27450
|
-
MessageType_BenfenSignMessage: 12205,
|
|
27451
|
-
MessageType_BenfenMessageSignature: 12206,
|
|
27452
|
-
MessageType_BenfenTxRequest: 12207,
|
|
27453
|
-
MessageType_BenfenTxAck: 12208,
|
|
27454
|
-
MessageType_NeoGetAddress: 12301,
|
|
27455
|
-
MessageType_NeoAddress: 12302,
|
|
27456
|
-
MessageType_NeoSignTx: 12303,
|
|
27457
|
-
MessageType_NeoSignedTx: 12304,
|
|
27458
|
-
MessageType_DeviceFactoryInfoSet: 60000,
|
|
27459
|
-
MessageType_DeviceFactoryInfoGet: 60001,
|
|
27460
|
-
MessageType_DeviceFactoryInfo: 60002,
|
|
27461
|
-
MessageType_DeviceFactoryPermanentLock: 60003,
|
|
27462
|
-
MessageType_DeviceFactoryTest: 60004,
|
|
27463
|
-
MessageType_ProtocolInfoRequest: 60200,
|
|
27464
|
-
MessageType_ProtocolInfo: 60201,
|
|
27465
|
-
MessageType_Ping: 60206,
|
|
27466
|
-
MessageType_Success: 60207,
|
|
27467
|
-
MessageType_Failure: 60208,
|
|
27468
|
-
MessageType_DeviceReboot: 60400,
|
|
27469
|
-
MessageType_DeviceSettings: 60410,
|
|
27470
|
-
MessageType_DeviceSettingsGet: 60411,
|
|
27471
|
-
MessageType_DeviceSettingsSet: 60412,
|
|
27472
|
-
MessageType_DeviceSettingsPageShow: 60413,
|
|
27473
|
-
MessageType_DeviceCertificate: 60420,
|
|
27474
|
-
MessageType_DeviceCertificateWrite: 60421,
|
|
27475
|
-
MessageType_DeviceCertificateRead: 60422,
|
|
27476
|
-
MessageType_DeviceCertificateSignature: 60423,
|
|
27477
|
-
MessageType_DeviceCertificateSign: 60424,
|
|
27478
|
-
MessageType_DeviceMiscUsbMscControl: 60440,
|
|
27479
|
-
MessageType_DeviceInfoGet: 60600,
|
|
27480
|
-
MessageType_DeviceInfo: 60601,
|
|
27481
|
-
MessageType_DeviceStatusGet: 60602,
|
|
27482
|
-
MessageType_DeviceStatus: 60603,
|
|
27483
|
-
MessageType_FilesystemPermissionFix: 60800,
|
|
27484
|
-
MessageType_FilesystemPathInfo: 60801,
|
|
27485
|
-
MessageType_FilesystemPathInfoQuery: 60802,
|
|
27486
|
-
MessageType_FilesystemFile: 60803,
|
|
27487
|
-
MessageType_FilesystemFileRead: 60804,
|
|
27488
|
-
MessageType_FilesystemFileWrite: 60805,
|
|
27489
|
-
MessageType_FilesystemFileDelete: 60806,
|
|
27490
|
-
MessageType_FilesystemDir: 60807,
|
|
27491
|
-
MessageType_FilesystemDirList: 60808,
|
|
27492
|
-
MessageType_FilesystemDirMake: 60809,
|
|
27493
|
-
MessageType_FilesystemDirRemove: 60810,
|
|
27494
|
-
MessageType_FilesystemFormat: 60811,
|
|
27495
|
-
MessageType_DeviceFirmwareUpdateStage: 61000,
|
|
27496
|
-
MessageType_DeviceFirmwareUpdateRequest: 61001,
|
|
27497
|
-
MessageType_DeviceFirmwareUpdateStatusGet: 61002,
|
|
27498
|
-
MessageType_DeviceFirmwareUpdateStatus: 61003,
|
|
27499
|
-
MessageType_DeviceSessionGet: 61200,
|
|
27500
|
-
MessageType_DeviceSession: 61201,
|
|
27501
|
-
MessageType_DeviceSessionAskPin: 61202,
|
|
27502
|
-
MessageType_DeviceSessionAskPassphrase: 61203,
|
|
27503
|
-
MessageType_PortfolioUpdate: 61400,
|
|
27504
|
-
MessageType_NftUpdate: 61500,
|
|
27505
|
-
MessageType_OnboardingStatusGet: 61600,
|
|
27506
|
-
MessageType_OnboardingStatus: 61601
|
|
27507
|
-
},
|
|
27508
|
-
reserved: [
|
|
27509
|
-
[
|
|
27510
|
-
90,
|
|
27511
|
-
92
|
|
27512
|
-
],
|
|
27513
|
-
[
|
|
27514
|
-
114,
|
|
27515
|
-
122
|
|
27516
|
-
],
|
|
27517
|
-
[
|
|
27518
|
-
300,
|
|
27519
|
-
304
|
|
27520
|
-
],
|
|
27521
|
-
[
|
|
27522
|
-
309,
|
|
27523
|
-
312
|
|
27524
|
-
]
|
|
27525
|
-
]
|
|
27526
|
-
},
|
|
27527
27033
|
AlephiumGetAddress: {
|
|
27528
27034
|
fields: {
|
|
27529
27035
|
address_n: {
|
|
@@ -31697,349 +31203,6 @@ var nested = {
|
|
|
31697
31203
|
}
|
|
31698
31204
|
}
|
|
31699
31205
|
},
|
|
31700
|
-
EthereumGetPublicKey: {
|
|
31701
|
-
fields: {
|
|
31702
|
-
address_n: {
|
|
31703
|
-
rule: "repeated",
|
|
31704
|
-
type: "uint32",
|
|
31705
|
-
id: 1,
|
|
31706
|
-
options: {
|
|
31707
|
-
packed: false
|
|
31708
|
-
}
|
|
31709
|
-
},
|
|
31710
|
-
show_display: {
|
|
31711
|
-
type: "bool",
|
|
31712
|
-
id: 2
|
|
31713
|
-
}
|
|
31714
|
-
}
|
|
31715
|
-
},
|
|
31716
|
-
EthereumPublicKey: {
|
|
31717
|
-
fields: {
|
|
31718
|
-
node: {
|
|
31719
|
-
rule: "required",
|
|
31720
|
-
type: "HDNodeType",
|
|
31721
|
-
id: 1
|
|
31722
|
-
},
|
|
31723
|
-
xpub: {
|
|
31724
|
-
rule: "required",
|
|
31725
|
-
type: "string",
|
|
31726
|
-
id: 2
|
|
31727
|
-
}
|
|
31728
|
-
}
|
|
31729
|
-
},
|
|
31730
|
-
EthereumGetAddress: {
|
|
31731
|
-
fields: {
|
|
31732
|
-
address_n: {
|
|
31733
|
-
rule: "repeated",
|
|
31734
|
-
type: "uint32",
|
|
31735
|
-
id: 1,
|
|
31736
|
-
options: {
|
|
31737
|
-
packed: false
|
|
31738
|
-
}
|
|
31739
|
-
},
|
|
31740
|
-
show_display: {
|
|
31741
|
-
type: "bool",
|
|
31742
|
-
id: 2
|
|
31743
|
-
},
|
|
31744
|
-
encoded_network: {
|
|
31745
|
-
type: "bytes",
|
|
31746
|
-
id: 3
|
|
31747
|
-
}
|
|
31748
|
-
}
|
|
31749
|
-
},
|
|
31750
|
-
EthereumAddress: {
|
|
31751
|
-
fields: {
|
|
31752
|
-
_old_address: {
|
|
31753
|
-
type: "bytes",
|
|
31754
|
-
id: 1,
|
|
31755
|
-
options: {
|
|
31756
|
-
deprecated: true
|
|
31757
|
-
}
|
|
31758
|
-
},
|
|
31759
|
-
address: {
|
|
31760
|
-
type: "string",
|
|
31761
|
-
id: 2
|
|
31762
|
-
}
|
|
31763
|
-
}
|
|
31764
|
-
},
|
|
31765
|
-
EthereumSignTx: {
|
|
31766
|
-
fields: {
|
|
31767
|
-
address_n: {
|
|
31768
|
-
rule: "repeated",
|
|
31769
|
-
type: "uint32",
|
|
31770
|
-
id: 1,
|
|
31771
|
-
options: {
|
|
31772
|
-
packed: false
|
|
31773
|
-
}
|
|
31774
|
-
},
|
|
31775
|
-
nonce: {
|
|
31776
|
-
type: "bytes",
|
|
31777
|
-
id: 2,
|
|
31778
|
-
options: {
|
|
31779
|
-
"default": ""
|
|
31780
|
-
}
|
|
31781
|
-
},
|
|
31782
|
-
gas_price: {
|
|
31783
|
-
rule: "required",
|
|
31784
|
-
type: "bytes",
|
|
31785
|
-
id: 3
|
|
31786
|
-
},
|
|
31787
|
-
gas_limit: {
|
|
31788
|
-
rule: "required",
|
|
31789
|
-
type: "bytes",
|
|
31790
|
-
id: 4
|
|
31791
|
-
},
|
|
31792
|
-
to: {
|
|
31793
|
-
type: "string",
|
|
31794
|
-
id: 11,
|
|
31795
|
-
options: {
|
|
31796
|
-
"default": ""
|
|
31797
|
-
}
|
|
31798
|
-
},
|
|
31799
|
-
value: {
|
|
31800
|
-
type: "bytes",
|
|
31801
|
-
id: 6,
|
|
31802
|
-
options: {
|
|
31803
|
-
"default": ""
|
|
31804
|
-
}
|
|
31805
|
-
},
|
|
31806
|
-
data_initial_chunk: {
|
|
31807
|
-
type: "bytes",
|
|
31808
|
-
id: 7,
|
|
31809
|
-
options: {
|
|
31810
|
-
"default": ""
|
|
31811
|
-
}
|
|
31812
|
-
},
|
|
31813
|
-
data_length: {
|
|
31814
|
-
type: "uint32",
|
|
31815
|
-
id: 8,
|
|
31816
|
-
options: {
|
|
31817
|
-
"default": 0
|
|
31818
|
-
}
|
|
31819
|
-
},
|
|
31820
|
-
chain_id: {
|
|
31821
|
-
rule: "required",
|
|
31822
|
-
type: "uint64",
|
|
31823
|
-
id: 9
|
|
31824
|
-
},
|
|
31825
|
-
tx_type: {
|
|
31826
|
-
type: "uint32",
|
|
31827
|
-
id: 10
|
|
31828
|
-
},
|
|
31829
|
-
definitions: {
|
|
31830
|
-
type: "EthereumDefinitions",
|
|
31831
|
-
id: 12
|
|
31832
|
-
}
|
|
31833
|
-
}
|
|
31834
|
-
},
|
|
31835
|
-
EthereumSignTxEIP1559: {
|
|
31836
|
-
fields: {
|
|
31837
|
-
address_n: {
|
|
31838
|
-
rule: "repeated",
|
|
31839
|
-
type: "uint32",
|
|
31840
|
-
id: 1,
|
|
31841
|
-
options: {
|
|
31842
|
-
packed: false
|
|
31843
|
-
}
|
|
31844
|
-
},
|
|
31845
|
-
nonce: {
|
|
31846
|
-
rule: "required",
|
|
31847
|
-
type: "bytes",
|
|
31848
|
-
id: 2
|
|
31849
|
-
},
|
|
31850
|
-
max_gas_fee: {
|
|
31851
|
-
rule: "required",
|
|
31852
|
-
type: "bytes",
|
|
31853
|
-
id: 3
|
|
31854
|
-
},
|
|
31855
|
-
max_priority_fee: {
|
|
31856
|
-
rule: "required",
|
|
31857
|
-
type: "bytes",
|
|
31858
|
-
id: 4
|
|
31859
|
-
},
|
|
31860
|
-
gas_limit: {
|
|
31861
|
-
rule: "required",
|
|
31862
|
-
type: "bytes",
|
|
31863
|
-
id: 5
|
|
31864
|
-
},
|
|
31865
|
-
to: {
|
|
31866
|
-
type: "string",
|
|
31867
|
-
id: 6,
|
|
31868
|
-
options: {
|
|
31869
|
-
"default": ""
|
|
31870
|
-
}
|
|
31871
|
-
},
|
|
31872
|
-
value: {
|
|
31873
|
-
rule: "required",
|
|
31874
|
-
type: "bytes",
|
|
31875
|
-
id: 7
|
|
31876
|
-
},
|
|
31877
|
-
data_initial_chunk: {
|
|
31878
|
-
type: "bytes",
|
|
31879
|
-
id: 8,
|
|
31880
|
-
options: {
|
|
31881
|
-
"default": ""
|
|
31882
|
-
}
|
|
31883
|
-
},
|
|
31884
|
-
data_length: {
|
|
31885
|
-
rule: "required",
|
|
31886
|
-
type: "uint32",
|
|
31887
|
-
id: 9
|
|
31888
|
-
},
|
|
31889
|
-
chain_id: {
|
|
31890
|
-
rule: "required",
|
|
31891
|
-
type: "uint64",
|
|
31892
|
-
id: 10
|
|
31893
|
-
},
|
|
31894
|
-
access_list: {
|
|
31895
|
-
rule: "repeated",
|
|
31896
|
-
type: "EthereumAccessList",
|
|
31897
|
-
id: 11
|
|
31898
|
-
},
|
|
31899
|
-
definitions: {
|
|
31900
|
-
type: "EthereumDefinitions",
|
|
31901
|
-
id: 12
|
|
31902
|
-
}
|
|
31903
|
-
},
|
|
31904
|
-
nested: {
|
|
31905
|
-
EthereumAccessList: {
|
|
31906
|
-
fields: {
|
|
31907
|
-
address: {
|
|
31908
|
-
rule: "required",
|
|
31909
|
-
type: "string",
|
|
31910
|
-
id: 1
|
|
31911
|
-
},
|
|
31912
|
-
storage_keys: {
|
|
31913
|
-
rule: "repeated",
|
|
31914
|
-
type: "bytes",
|
|
31915
|
-
id: 2
|
|
31916
|
-
}
|
|
31917
|
-
}
|
|
31918
|
-
}
|
|
31919
|
-
}
|
|
31920
|
-
},
|
|
31921
|
-
EthereumTxRequest: {
|
|
31922
|
-
fields: {
|
|
31923
|
-
data_length: {
|
|
31924
|
-
type: "uint32",
|
|
31925
|
-
id: 1
|
|
31926
|
-
},
|
|
31927
|
-
signature_v: {
|
|
31928
|
-
type: "uint32",
|
|
31929
|
-
id: 2
|
|
31930
|
-
},
|
|
31931
|
-
signature_r: {
|
|
31932
|
-
type: "bytes",
|
|
31933
|
-
id: 3
|
|
31934
|
-
},
|
|
31935
|
-
signature_s: {
|
|
31936
|
-
type: "bytes",
|
|
31937
|
-
id: 4
|
|
31938
|
-
}
|
|
31939
|
-
}
|
|
31940
|
-
},
|
|
31941
|
-
EthereumTxAck: {
|
|
31942
|
-
fields: {
|
|
31943
|
-
data_chunk: {
|
|
31944
|
-
rule: "required",
|
|
31945
|
-
type: "bytes",
|
|
31946
|
-
id: 1
|
|
31947
|
-
}
|
|
31948
|
-
}
|
|
31949
|
-
},
|
|
31950
|
-
EthereumSignMessage: {
|
|
31951
|
-
fields: {
|
|
31952
|
-
address_n: {
|
|
31953
|
-
rule: "repeated",
|
|
31954
|
-
type: "uint32",
|
|
31955
|
-
id: 1,
|
|
31956
|
-
options: {
|
|
31957
|
-
packed: false
|
|
31958
|
-
}
|
|
31959
|
-
},
|
|
31960
|
-
message: {
|
|
31961
|
-
rule: "required",
|
|
31962
|
-
type: "bytes",
|
|
31963
|
-
id: 2
|
|
31964
|
-
},
|
|
31965
|
-
encoded_network: {
|
|
31966
|
-
type: "bytes",
|
|
31967
|
-
id: 3
|
|
31968
|
-
}
|
|
31969
|
-
}
|
|
31970
|
-
},
|
|
31971
|
-
EthereumMessageSignature: {
|
|
31972
|
-
fields: {
|
|
31973
|
-
signature: {
|
|
31974
|
-
rule: "required",
|
|
31975
|
-
type: "bytes",
|
|
31976
|
-
id: 2
|
|
31977
|
-
},
|
|
31978
|
-
address: {
|
|
31979
|
-
rule: "required",
|
|
31980
|
-
type: "string",
|
|
31981
|
-
id: 3
|
|
31982
|
-
}
|
|
31983
|
-
}
|
|
31984
|
-
},
|
|
31985
|
-
EthereumVerifyMessage: {
|
|
31986
|
-
fields: {
|
|
31987
|
-
signature: {
|
|
31988
|
-
rule: "required",
|
|
31989
|
-
type: "bytes",
|
|
31990
|
-
id: 2
|
|
31991
|
-
},
|
|
31992
|
-
message: {
|
|
31993
|
-
rule: "required",
|
|
31994
|
-
type: "bytes",
|
|
31995
|
-
id: 3
|
|
31996
|
-
},
|
|
31997
|
-
address: {
|
|
31998
|
-
rule: "required",
|
|
31999
|
-
type: "string",
|
|
32000
|
-
id: 4
|
|
32001
|
-
}
|
|
32002
|
-
}
|
|
32003
|
-
},
|
|
32004
|
-
EthereumSignTypedHash: {
|
|
32005
|
-
fields: {
|
|
32006
|
-
address_n: {
|
|
32007
|
-
rule: "repeated",
|
|
32008
|
-
type: "uint32",
|
|
32009
|
-
id: 1,
|
|
32010
|
-
options: {
|
|
32011
|
-
packed: false
|
|
32012
|
-
}
|
|
32013
|
-
},
|
|
32014
|
-
domain_separator_hash: {
|
|
32015
|
-
rule: "required",
|
|
32016
|
-
type: "bytes",
|
|
32017
|
-
id: 2
|
|
32018
|
-
},
|
|
32019
|
-
message_hash: {
|
|
32020
|
-
type: "bytes",
|
|
32021
|
-
id: 3
|
|
32022
|
-
},
|
|
32023
|
-
encoded_network: {
|
|
32024
|
-
type: "bytes",
|
|
32025
|
-
id: 4
|
|
32026
|
-
}
|
|
32027
|
-
}
|
|
32028
|
-
},
|
|
32029
|
-
EthereumTypedDataSignature: {
|
|
32030
|
-
fields: {
|
|
32031
|
-
signature: {
|
|
32032
|
-
rule: "required",
|
|
32033
|
-
type: "bytes",
|
|
32034
|
-
id: 1
|
|
32035
|
-
},
|
|
32036
|
-
address: {
|
|
32037
|
-
rule: "required",
|
|
32038
|
-
type: "string",
|
|
32039
|
-
id: 2
|
|
32040
|
-
}
|
|
32041
|
-
}
|
|
32042
|
-
},
|
|
32043
31206
|
EthereumDefinitionType: {
|
|
32044
31207
|
values: {
|
|
32045
31208
|
NETWORK: 0,
|
|
@@ -32119,122 +31282,6 @@ var nested = {
|
|
|
32119
31282
|
}
|
|
32120
31283
|
}
|
|
32121
31284
|
},
|
|
32122
|
-
EthereumSignTypedData: {
|
|
32123
|
-
fields: {
|
|
32124
|
-
address_n: {
|
|
32125
|
-
rule: "repeated",
|
|
32126
|
-
type: "uint32",
|
|
32127
|
-
id: 1,
|
|
32128
|
-
options: {
|
|
32129
|
-
packed: false
|
|
32130
|
-
}
|
|
32131
|
-
},
|
|
32132
|
-
primary_type: {
|
|
32133
|
-
rule: "required",
|
|
32134
|
-
type: "string",
|
|
32135
|
-
id: 2
|
|
32136
|
-
},
|
|
32137
|
-
metamask_v4_compat: {
|
|
32138
|
-
type: "bool",
|
|
32139
|
-
id: 3,
|
|
32140
|
-
options: {
|
|
32141
|
-
"default": true
|
|
32142
|
-
}
|
|
32143
|
-
},
|
|
32144
|
-
definitions: {
|
|
32145
|
-
type: "EthereumDefinitions",
|
|
32146
|
-
id: 4
|
|
32147
|
-
}
|
|
32148
|
-
}
|
|
32149
|
-
},
|
|
32150
|
-
EthereumTypedDataStructRequest: {
|
|
32151
|
-
fields: {
|
|
32152
|
-
name: {
|
|
32153
|
-
rule: "required",
|
|
32154
|
-
type: "string",
|
|
32155
|
-
id: 1
|
|
32156
|
-
}
|
|
32157
|
-
}
|
|
32158
|
-
},
|
|
32159
|
-
EthereumTypedDataStructAck: {
|
|
32160
|
-
fields: {
|
|
32161
|
-
members: {
|
|
32162
|
-
rule: "repeated",
|
|
32163
|
-
type: "EthereumStructMember",
|
|
32164
|
-
id: 1
|
|
32165
|
-
}
|
|
32166
|
-
},
|
|
32167
|
-
nested: {
|
|
32168
|
-
EthereumStructMember: {
|
|
32169
|
-
fields: {
|
|
32170
|
-
type: {
|
|
32171
|
-
rule: "required",
|
|
32172
|
-
type: "EthereumFieldType",
|
|
32173
|
-
id: 1
|
|
32174
|
-
},
|
|
32175
|
-
name: {
|
|
32176
|
-
rule: "required",
|
|
32177
|
-
type: "string",
|
|
32178
|
-
id: 2
|
|
32179
|
-
}
|
|
32180
|
-
}
|
|
32181
|
-
},
|
|
32182
|
-
EthereumFieldType: {
|
|
32183
|
-
fields: {
|
|
32184
|
-
data_type: {
|
|
32185
|
-
rule: "required",
|
|
32186
|
-
type: "EthereumDataType",
|
|
32187
|
-
id: 1
|
|
32188
|
-
},
|
|
32189
|
-
size: {
|
|
32190
|
-
type: "uint32",
|
|
32191
|
-
id: 2
|
|
32192
|
-
},
|
|
32193
|
-
entry_type: {
|
|
32194
|
-
type: "EthereumFieldType",
|
|
32195
|
-
id: 3
|
|
32196
|
-
},
|
|
32197
|
-
struct_name: {
|
|
32198
|
-
type: "string",
|
|
32199
|
-
id: 4
|
|
32200
|
-
}
|
|
32201
|
-
}
|
|
32202
|
-
},
|
|
32203
|
-
EthereumDataType: {
|
|
32204
|
-
values: {
|
|
32205
|
-
UINT: 1,
|
|
32206
|
-
INT: 2,
|
|
32207
|
-
BYTES: 3,
|
|
32208
|
-
STRING: 4,
|
|
32209
|
-
BOOL: 5,
|
|
32210
|
-
ADDRESS: 6,
|
|
32211
|
-
ARRAY: 7,
|
|
32212
|
-
STRUCT: 8
|
|
32213
|
-
}
|
|
32214
|
-
}
|
|
32215
|
-
}
|
|
32216
|
-
},
|
|
32217
|
-
EthereumTypedDataValueRequest: {
|
|
32218
|
-
fields: {
|
|
32219
|
-
member_path: {
|
|
32220
|
-
rule: "repeated",
|
|
32221
|
-
type: "uint32",
|
|
32222
|
-
id: 1,
|
|
32223
|
-
options: {
|
|
32224
|
-
packed: false
|
|
32225
|
-
}
|
|
32226
|
-
}
|
|
32227
|
-
}
|
|
32228
|
-
},
|
|
32229
|
-
EthereumTypedDataValueAck: {
|
|
32230
|
-
fields: {
|
|
32231
|
-
value: {
|
|
32232
|
-
rule: "required",
|
|
32233
|
-
type: "bytes",
|
|
32234
|
-
id: 1
|
|
32235
|
-
}
|
|
32236
|
-
}
|
|
32237
|
-
},
|
|
32238
31285
|
EthereumSignTypedDataOneKey: {
|
|
32239
31286
|
fields: {
|
|
32240
31287
|
address_n: {
|
|
@@ -32452,6 +31499,126 @@ var nested = {
|
|
|
32452
31499
|
request_id: {
|
|
32453
31500
|
type: "bytes",
|
|
32454
31501
|
id: 5
|
|
31502
|
+
},
|
|
31503
|
+
source_fingerprint: {
|
|
31504
|
+
type: "uint32",
|
|
31505
|
+
id: 6
|
|
31506
|
+
}
|
|
31507
|
+
}
|
|
31508
|
+
},
|
|
31509
|
+
EthereumSignTypedData: {
|
|
31510
|
+
fields: {
|
|
31511
|
+
address_n: {
|
|
31512
|
+
rule: "repeated",
|
|
31513
|
+
type: "uint32",
|
|
31514
|
+
id: 1,
|
|
31515
|
+
options: {
|
|
31516
|
+
packed: false
|
|
31517
|
+
}
|
|
31518
|
+
},
|
|
31519
|
+
primary_type: {
|
|
31520
|
+
rule: "required",
|
|
31521
|
+
type: "string",
|
|
31522
|
+
id: 2
|
|
31523
|
+
},
|
|
31524
|
+
metamask_v4_compat: {
|
|
31525
|
+
type: "bool",
|
|
31526
|
+
id: 3,
|
|
31527
|
+
options: {
|
|
31528
|
+
"default": true
|
|
31529
|
+
}
|
|
31530
|
+
},
|
|
31531
|
+
definitions: {
|
|
31532
|
+
type: "EthereumDefinitions",
|
|
31533
|
+
id: 4
|
|
31534
|
+
}
|
|
31535
|
+
}
|
|
31536
|
+
},
|
|
31537
|
+
EthereumTypedDataStructRequest: {
|
|
31538
|
+
fields: {
|
|
31539
|
+
name: {
|
|
31540
|
+
rule: "required",
|
|
31541
|
+
type: "string",
|
|
31542
|
+
id: 1
|
|
31543
|
+
}
|
|
31544
|
+
}
|
|
31545
|
+
},
|
|
31546
|
+
EthereumTypedDataStructAck: {
|
|
31547
|
+
fields: {
|
|
31548
|
+
members: {
|
|
31549
|
+
rule: "repeated",
|
|
31550
|
+
type: "EthereumStructMember",
|
|
31551
|
+
id: 1
|
|
31552
|
+
}
|
|
31553
|
+
},
|
|
31554
|
+
nested: {
|
|
31555
|
+
EthereumStructMember: {
|
|
31556
|
+
fields: {
|
|
31557
|
+
type: {
|
|
31558
|
+
rule: "required",
|
|
31559
|
+
type: "EthereumFieldType",
|
|
31560
|
+
id: 1
|
|
31561
|
+
},
|
|
31562
|
+
name: {
|
|
31563
|
+
rule: "required",
|
|
31564
|
+
type: "string",
|
|
31565
|
+
id: 2
|
|
31566
|
+
}
|
|
31567
|
+
}
|
|
31568
|
+
},
|
|
31569
|
+
EthereumFieldType: {
|
|
31570
|
+
fields: {
|
|
31571
|
+
data_type: {
|
|
31572
|
+
rule: "required",
|
|
31573
|
+
type: "EthereumDataType",
|
|
31574
|
+
id: 1
|
|
31575
|
+
},
|
|
31576
|
+
size: {
|
|
31577
|
+
type: "uint32",
|
|
31578
|
+
id: 2
|
|
31579
|
+
},
|
|
31580
|
+
entry_type: {
|
|
31581
|
+
type: "EthereumFieldType",
|
|
31582
|
+
id: 3
|
|
31583
|
+
},
|
|
31584
|
+
struct_name: {
|
|
31585
|
+
type: "string",
|
|
31586
|
+
id: 4
|
|
31587
|
+
}
|
|
31588
|
+
}
|
|
31589
|
+
},
|
|
31590
|
+
EthereumDataType: {
|
|
31591
|
+
values: {
|
|
31592
|
+
UINT: 1,
|
|
31593
|
+
INT: 2,
|
|
31594
|
+
BYTES: 3,
|
|
31595
|
+
STRING: 4,
|
|
31596
|
+
BOOL: 5,
|
|
31597
|
+
ADDRESS: 6,
|
|
31598
|
+
ARRAY: 7,
|
|
31599
|
+
STRUCT: 8
|
|
31600
|
+
}
|
|
31601
|
+
}
|
|
31602
|
+
}
|
|
31603
|
+
},
|
|
31604
|
+
EthereumTypedDataValueRequest: {
|
|
31605
|
+
fields: {
|
|
31606
|
+
member_path: {
|
|
31607
|
+
rule: "repeated",
|
|
31608
|
+
type: "uint32",
|
|
31609
|
+
id: 1,
|
|
31610
|
+
options: {
|
|
31611
|
+
packed: false
|
|
31612
|
+
}
|
|
31613
|
+
}
|
|
31614
|
+
}
|
|
31615
|
+
},
|
|
31616
|
+
EthereumTypedDataValueAck: {
|
|
31617
|
+
fields: {
|
|
31618
|
+
value: {
|
|
31619
|
+
rule: "required",
|
|
31620
|
+
type: "bytes",
|
|
31621
|
+
id: 1
|
|
32455
31622
|
}
|
|
32456
31623
|
}
|
|
32457
31624
|
},
|
|
@@ -32587,6 +31754,14 @@ var nested = {
|
|
|
32587
31754
|
tx_type: {
|
|
32588
31755
|
type: "uint32",
|
|
32589
31756
|
id: 10
|
|
31757
|
+
},
|
|
31758
|
+
expected_address: {
|
|
31759
|
+
type: "bytes",
|
|
31760
|
+
id: 12
|
|
31761
|
+
},
|
|
31762
|
+
source_fingerprint: {
|
|
31763
|
+
type: "uint32",
|
|
31764
|
+
id: 13
|
|
32590
31765
|
}
|
|
32591
31766
|
}
|
|
32592
31767
|
},
|
|
@@ -32667,6 +31842,14 @@ var nested = {
|
|
|
32667
31842
|
rule: "repeated",
|
|
32668
31843
|
type: "EthereumAccessListOneKey",
|
|
32669
31844
|
id: 11
|
|
31845
|
+
},
|
|
31846
|
+
expected_address: {
|
|
31847
|
+
type: "bytes",
|
|
31848
|
+
id: 12
|
|
31849
|
+
},
|
|
31850
|
+
source_fingerprint: {
|
|
31851
|
+
type: "uint32",
|
|
31852
|
+
id: 13
|
|
32670
31853
|
}
|
|
32671
31854
|
}
|
|
32672
31855
|
},
|
|
@@ -32843,6 +32026,10 @@ var nested = {
|
|
|
32843
32026
|
chain_id: {
|
|
32844
32027
|
type: "uint64",
|
|
32845
32028
|
id: 3
|
|
32029
|
+
},
|
|
32030
|
+
source_fingerprint: {
|
|
32031
|
+
type: "uint32",
|
|
32032
|
+
id: 4
|
|
32846
32033
|
}
|
|
32847
32034
|
}
|
|
32848
32035
|
},
|
|
@@ -32922,6 +32109,349 @@ var nested = {
|
|
|
32922
32109
|
}
|
|
32923
32110
|
}
|
|
32924
32111
|
},
|
|
32112
|
+
EthereumGetPublicKey: {
|
|
32113
|
+
fields: {
|
|
32114
|
+
address_n: {
|
|
32115
|
+
rule: "repeated",
|
|
32116
|
+
type: "uint32",
|
|
32117
|
+
id: 1,
|
|
32118
|
+
options: {
|
|
32119
|
+
packed: false
|
|
32120
|
+
}
|
|
32121
|
+
},
|
|
32122
|
+
show_display: {
|
|
32123
|
+
type: "bool",
|
|
32124
|
+
id: 2
|
|
32125
|
+
}
|
|
32126
|
+
}
|
|
32127
|
+
},
|
|
32128
|
+
EthereumPublicKey: {
|
|
32129
|
+
fields: {
|
|
32130
|
+
node: {
|
|
32131
|
+
rule: "required",
|
|
32132
|
+
type: "HDNodeType",
|
|
32133
|
+
id: 1
|
|
32134
|
+
},
|
|
32135
|
+
xpub: {
|
|
32136
|
+
rule: "required",
|
|
32137
|
+
type: "string",
|
|
32138
|
+
id: 2
|
|
32139
|
+
}
|
|
32140
|
+
}
|
|
32141
|
+
},
|
|
32142
|
+
EthereumGetAddress: {
|
|
32143
|
+
fields: {
|
|
32144
|
+
address_n: {
|
|
32145
|
+
rule: "repeated",
|
|
32146
|
+
type: "uint32",
|
|
32147
|
+
id: 1,
|
|
32148
|
+
options: {
|
|
32149
|
+
packed: false
|
|
32150
|
+
}
|
|
32151
|
+
},
|
|
32152
|
+
show_display: {
|
|
32153
|
+
type: "bool",
|
|
32154
|
+
id: 2
|
|
32155
|
+
},
|
|
32156
|
+
encoded_network: {
|
|
32157
|
+
type: "bytes",
|
|
32158
|
+
id: 3
|
|
32159
|
+
}
|
|
32160
|
+
}
|
|
32161
|
+
},
|
|
32162
|
+
EthereumAddress: {
|
|
32163
|
+
fields: {
|
|
32164
|
+
_old_address: {
|
|
32165
|
+
type: "bytes",
|
|
32166
|
+
id: 1,
|
|
32167
|
+
options: {
|
|
32168
|
+
deprecated: true
|
|
32169
|
+
}
|
|
32170
|
+
},
|
|
32171
|
+
address: {
|
|
32172
|
+
type: "string",
|
|
32173
|
+
id: 2
|
|
32174
|
+
}
|
|
32175
|
+
}
|
|
32176
|
+
},
|
|
32177
|
+
EthereumSignTx: {
|
|
32178
|
+
fields: {
|
|
32179
|
+
address_n: {
|
|
32180
|
+
rule: "repeated",
|
|
32181
|
+
type: "uint32",
|
|
32182
|
+
id: 1,
|
|
32183
|
+
options: {
|
|
32184
|
+
packed: false
|
|
32185
|
+
}
|
|
32186
|
+
},
|
|
32187
|
+
nonce: {
|
|
32188
|
+
type: "bytes",
|
|
32189
|
+
id: 2,
|
|
32190
|
+
options: {
|
|
32191
|
+
"default": ""
|
|
32192
|
+
}
|
|
32193
|
+
},
|
|
32194
|
+
gas_price: {
|
|
32195
|
+
rule: "required",
|
|
32196
|
+
type: "bytes",
|
|
32197
|
+
id: 3
|
|
32198
|
+
},
|
|
32199
|
+
gas_limit: {
|
|
32200
|
+
rule: "required",
|
|
32201
|
+
type: "bytes",
|
|
32202
|
+
id: 4
|
|
32203
|
+
},
|
|
32204
|
+
to: {
|
|
32205
|
+
type: "string",
|
|
32206
|
+
id: 11,
|
|
32207
|
+
options: {
|
|
32208
|
+
"default": ""
|
|
32209
|
+
}
|
|
32210
|
+
},
|
|
32211
|
+
value: {
|
|
32212
|
+
type: "bytes",
|
|
32213
|
+
id: 6,
|
|
32214
|
+
options: {
|
|
32215
|
+
"default": ""
|
|
32216
|
+
}
|
|
32217
|
+
},
|
|
32218
|
+
data_initial_chunk: {
|
|
32219
|
+
type: "bytes",
|
|
32220
|
+
id: 7,
|
|
32221
|
+
options: {
|
|
32222
|
+
"default": ""
|
|
32223
|
+
}
|
|
32224
|
+
},
|
|
32225
|
+
data_length: {
|
|
32226
|
+
type: "uint32",
|
|
32227
|
+
id: 8,
|
|
32228
|
+
options: {
|
|
32229
|
+
"default": 0
|
|
32230
|
+
}
|
|
32231
|
+
},
|
|
32232
|
+
chain_id: {
|
|
32233
|
+
rule: "required",
|
|
32234
|
+
type: "uint64",
|
|
32235
|
+
id: 9
|
|
32236
|
+
},
|
|
32237
|
+
tx_type: {
|
|
32238
|
+
type: "uint32",
|
|
32239
|
+
id: 10
|
|
32240
|
+
},
|
|
32241
|
+
definitions: {
|
|
32242
|
+
type: "EthereumDefinitions",
|
|
32243
|
+
id: 12
|
|
32244
|
+
}
|
|
32245
|
+
}
|
|
32246
|
+
},
|
|
32247
|
+
EthereumSignTxEIP1559: {
|
|
32248
|
+
fields: {
|
|
32249
|
+
address_n: {
|
|
32250
|
+
rule: "repeated",
|
|
32251
|
+
type: "uint32",
|
|
32252
|
+
id: 1,
|
|
32253
|
+
options: {
|
|
32254
|
+
packed: false
|
|
32255
|
+
}
|
|
32256
|
+
},
|
|
32257
|
+
nonce: {
|
|
32258
|
+
rule: "required",
|
|
32259
|
+
type: "bytes",
|
|
32260
|
+
id: 2
|
|
32261
|
+
},
|
|
32262
|
+
max_gas_fee: {
|
|
32263
|
+
rule: "required",
|
|
32264
|
+
type: "bytes",
|
|
32265
|
+
id: 3
|
|
32266
|
+
},
|
|
32267
|
+
max_priority_fee: {
|
|
32268
|
+
rule: "required",
|
|
32269
|
+
type: "bytes",
|
|
32270
|
+
id: 4
|
|
32271
|
+
},
|
|
32272
|
+
gas_limit: {
|
|
32273
|
+
rule: "required",
|
|
32274
|
+
type: "bytes",
|
|
32275
|
+
id: 5
|
|
32276
|
+
},
|
|
32277
|
+
to: {
|
|
32278
|
+
type: "string",
|
|
32279
|
+
id: 6,
|
|
32280
|
+
options: {
|
|
32281
|
+
"default": ""
|
|
32282
|
+
}
|
|
32283
|
+
},
|
|
32284
|
+
value: {
|
|
32285
|
+
rule: "required",
|
|
32286
|
+
type: "bytes",
|
|
32287
|
+
id: 7
|
|
32288
|
+
},
|
|
32289
|
+
data_initial_chunk: {
|
|
32290
|
+
type: "bytes",
|
|
32291
|
+
id: 8,
|
|
32292
|
+
options: {
|
|
32293
|
+
"default": ""
|
|
32294
|
+
}
|
|
32295
|
+
},
|
|
32296
|
+
data_length: {
|
|
32297
|
+
rule: "required",
|
|
32298
|
+
type: "uint32",
|
|
32299
|
+
id: 9
|
|
32300
|
+
},
|
|
32301
|
+
chain_id: {
|
|
32302
|
+
rule: "required",
|
|
32303
|
+
type: "uint64",
|
|
32304
|
+
id: 10
|
|
32305
|
+
},
|
|
32306
|
+
access_list: {
|
|
32307
|
+
rule: "repeated",
|
|
32308
|
+
type: "EthereumAccessList",
|
|
32309
|
+
id: 11
|
|
32310
|
+
},
|
|
32311
|
+
definitions: {
|
|
32312
|
+
type: "EthereumDefinitions",
|
|
32313
|
+
id: 12
|
|
32314
|
+
}
|
|
32315
|
+
},
|
|
32316
|
+
nested: {
|
|
32317
|
+
EthereumAccessList: {
|
|
32318
|
+
fields: {
|
|
32319
|
+
address: {
|
|
32320
|
+
rule: "required",
|
|
32321
|
+
type: "string",
|
|
32322
|
+
id: 1
|
|
32323
|
+
},
|
|
32324
|
+
storage_keys: {
|
|
32325
|
+
rule: "repeated",
|
|
32326
|
+
type: "bytes",
|
|
32327
|
+
id: 2
|
|
32328
|
+
}
|
|
32329
|
+
}
|
|
32330
|
+
}
|
|
32331
|
+
}
|
|
32332
|
+
},
|
|
32333
|
+
EthereumTxRequest: {
|
|
32334
|
+
fields: {
|
|
32335
|
+
data_length: {
|
|
32336
|
+
type: "uint32",
|
|
32337
|
+
id: 1
|
|
32338
|
+
},
|
|
32339
|
+
signature_v: {
|
|
32340
|
+
type: "uint32",
|
|
32341
|
+
id: 2
|
|
32342
|
+
},
|
|
32343
|
+
signature_r: {
|
|
32344
|
+
type: "bytes",
|
|
32345
|
+
id: 3
|
|
32346
|
+
},
|
|
32347
|
+
signature_s: {
|
|
32348
|
+
type: "bytes",
|
|
32349
|
+
id: 4
|
|
32350
|
+
}
|
|
32351
|
+
}
|
|
32352
|
+
},
|
|
32353
|
+
EthereumTxAck: {
|
|
32354
|
+
fields: {
|
|
32355
|
+
data_chunk: {
|
|
32356
|
+
rule: "required",
|
|
32357
|
+
type: "bytes",
|
|
32358
|
+
id: 1
|
|
32359
|
+
}
|
|
32360
|
+
}
|
|
32361
|
+
},
|
|
32362
|
+
EthereumSignMessage: {
|
|
32363
|
+
fields: {
|
|
32364
|
+
address_n: {
|
|
32365
|
+
rule: "repeated",
|
|
32366
|
+
type: "uint32",
|
|
32367
|
+
id: 1,
|
|
32368
|
+
options: {
|
|
32369
|
+
packed: false
|
|
32370
|
+
}
|
|
32371
|
+
},
|
|
32372
|
+
message: {
|
|
32373
|
+
rule: "required",
|
|
32374
|
+
type: "bytes",
|
|
32375
|
+
id: 2
|
|
32376
|
+
},
|
|
32377
|
+
encoded_network: {
|
|
32378
|
+
type: "bytes",
|
|
32379
|
+
id: 3
|
|
32380
|
+
}
|
|
32381
|
+
}
|
|
32382
|
+
},
|
|
32383
|
+
EthereumMessageSignature: {
|
|
32384
|
+
fields: {
|
|
32385
|
+
signature: {
|
|
32386
|
+
rule: "required",
|
|
32387
|
+
type: "bytes",
|
|
32388
|
+
id: 2
|
|
32389
|
+
},
|
|
32390
|
+
address: {
|
|
32391
|
+
rule: "required",
|
|
32392
|
+
type: "string",
|
|
32393
|
+
id: 3
|
|
32394
|
+
}
|
|
32395
|
+
}
|
|
32396
|
+
},
|
|
32397
|
+
EthereumVerifyMessage: {
|
|
32398
|
+
fields: {
|
|
32399
|
+
signature: {
|
|
32400
|
+
rule: "required",
|
|
32401
|
+
type: "bytes",
|
|
32402
|
+
id: 2
|
|
32403
|
+
},
|
|
32404
|
+
message: {
|
|
32405
|
+
rule: "required",
|
|
32406
|
+
type: "bytes",
|
|
32407
|
+
id: 3
|
|
32408
|
+
},
|
|
32409
|
+
address: {
|
|
32410
|
+
rule: "required",
|
|
32411
|
+
type: "string",
|
|
32412
|
+
id: 4
|
|
32413
|
+
}
|
|
32414
|
+
}
|
|
32415
|
+
},
|
|
32416
|
+
EthereumSignTypedHash: {
|
|
32417
|
+
fields: {
|
|
32418
|
+
address_n: {
|
|
32419
|
+
rule: "repeated",
|
|
32420
|
+
type: "uint32",
|
|
32421
|
+
id: 1,
|
|
32422
|
+
options: {
|
|
32423
|
+
packed: false
|
|
32424
|
+
}
|
|
32425
|
+
},
|
|
32426
|
+
domain_separator_hash: {
|
|
32427
|
+
rule: "required",
|
|
32428
|
+
type: "bytes",
|
|
32429
|
+
id: 2
|
|
32430
|
+
},
|
|
32431
|
+
message_hash: {
|
|
32432
|
+
type: "bytes",
|
|
32433
|
+
id: 3
|
|
32434
|
+
},
|
|
32435
|
+
encoded_network: {
|
|
32436
|
+
type: "bytes",
|
|
32437
|
+
id: 4
|
|
32438
|
+
}
|
|
32439
|
+
}
|
|
32440
|
+
},
|
|
32441
|
+
EthereumTypedDataSignature: {
|
|
32442
|
+
fields: {
|
|
32443
|
+
signature: {
|
|
32444
|
+
rule: "required",
|
|
32445
|
+
type: "bytes",
|
|
32446
|
+
id: 1
|
|
32447
|
+
},
|
|
32448
|
+
address: {
|
|
32449
|
+
rule: "required",
|
|
32450
|
+
type: "string",
|
|
32451
|
+
id: 2
|
|
32452
|
+
}
|
|
32453
|
+
}
|
|
32454
|
+
},
|
|
32925
32455
|
FilecoinGetAddress: {
|
|
32926
32456
|
fields: {
|
|
32927
32457
|
address_n: {
|
|
@@ -36545,6 +36075,10 @@ var nested = {
|
|
|
36545
36075
|
rule: "required",
|
|
36546
36076
|
type: "bytes",
|
|
36547
36077
|
id: 2
|
|
36078
|
+
},
|
|
36079
|
+
source_fingerprint: {
|
|
36080
|
+
type: "uint32",
|
|
36081
|
+
id: 3
|
|
36548
36082
|
}
|
|
36549
36083
|
}
|
|
36550
36084
|
},
|
|
@@ -36589,6 +36123,10 @@ var nested = {
|
|
|
36589
36123
|
application_domain: {
|
|
36590
36124
|
type: "bytes",
|
|
36591
36125
|
id: 5
|
|
36126
|
+
},
|
|
36127
|
+
source_fingerprint: {
|
|
36128
|
+
type: "uint32",
|
|
36129
|
+
id: 6
|
|
36592
36130
|
}
|
|
36593
36131
|
}
|
|
36594
36132
|
},
|
|
@@ -36606,6 +36144,10 @@ var nested = {
|
|
|
36606
36144
|
rule: "required",
|
|
36607
36145
|
type: "bytes",
|
|
36608
36146
|
id: 2
|
|
36147
|
+
},
|
|
36148
|
+
source_fingerprint: {
|
|
36149
|
+
type: "uint32",
|
|
36150
|
+
id: 3
|
|
36609
36151
|
}
|
|
36610
36152
|
}
|
|
36611
36153
|
},
|
|
@@ -38518,60 +38060,557 @@ var nested = {
|
|
|
38518
38060
|
id: 1
|
|
38519
38061
|
}
|
|
38520
38062
|
},
|
|
38521
|
-
nested: {
|
|
38522
|
-
WebAuthnCredential: {
|
|
38523
|
-
fields: {
|
|
38524
|
-
index: {
|
|
38525
|
-
type: "uint32",
|
|
38526
|
-
id: 1
|
|
38527
|
-
},
|
|
38528
|
-
id: {
|
|
38529
|
-
type: "bytes",
|
|
38530
|
-
id: 2
|
|
38531
|
-
},
|
|
38532
|
-
rp_id: {
|
|
38533
|
-
type: "string",
|
|
38534
|
-
id: 3
|
|
38535
|
-
},
|
|
38536
|
-
rp_name: {
|
|
38537
|
-
type: "string",
|
|
38538
|
-
id: 4
|
|
38539
|
-
},
|
|
38540
|
-
user_id: {
|
|
38541
|
-
type: "bytes",
|
|
38542
|
-
id: 5
|
|
38543
|
-
},
|
|
38544
|
-
user_name: {
|
|
38545
|
-
type: "string",
|
|
38546
|
-
id: 6
|
|
38547
|
-
},
|
|
38548
|
-
user_display_name: {
|
|
38549
|
-
type: "string",
|
|
38550
|
-
id: 7
|
|
38551
|
-
},
|
|
38552
|
-
creation_time: {
|
|
38553
|
-
type: "uint32",
|
|
38554
|
-
id: 8
|
|
38555
|
-
},
|
|
38556
|
-
hmac_secret: {
|
|
38557
|
-
type: "bool",
|
|
38558
|
-
id: 9
|
|
38559
|
-
},
|
|
38560
|
-
use_sign_count: {
|
|
38561
|
-
type: "bool",
|
|
38562
|
-
id: 10
|
|
38563
|
-
},
|
|
38564
|
-
algorithm: {
|
|
38565
|
-
type: "sint32",
|
|
38566
|
-
id: 11
|
|
38567
|
-
},
|
|
38568
|
-
curve: {
|
|
38569
|
-
type: "sint32",
|
|
38570
|
-
id: 12
|
|
38571
|
-
}
|
|
38572
|
-
}
|
|
38573
|
-
}
|
|
38574
|
-
}
|
|
38063
|
+
nested: {
|
|
38064
|
+
WebAuthnCredential: {
|
|
38065
|
+
fields: {
|
|
38066
|
+
index: {
|
|
38067
|
+
type: "uint32",
|
|
38068
|
+
id: 1
|
|
38069
|
+
},
|
|
38070
|
+
id: {
|
|
38071
|
+
type: "bytes",
|
|
38072
|
+
id: 2
|
|
38073
|
+
},
|
|
38074
|
+
rp_id: {
|
|
38075
|
+
type: "string",
|
|
38076
|
+
id: 3
|
|
38077
|
+
},
|
|
38078
|
+
rp_name: {
|
|
38079
|
+
type: "string",
|
|
38080
|
+
id: 4
|
|
38081
|
+
},
|
|
38082
|
+
user_id: {
|
|
38083
|
+
type: "bytes",
|
|
38084
|
+
id: 5
|
|
38085
|
+
},
|
|
38086
|
+
user_name: {
|
|
38087
|
+
type: "string",
|
|
38088
|
+
id: 6
|
|
38089
|
+
},
|
|
38090
|
+
user_display_name: {
|
|
38091
|
+
type: "string",
|
|
38092
|
+
id: 7
|
|
38093
|
+
},
|
|
38094
|
+
creation_time: {
|
|
38095
|
+
type: "uint32",
|
|
38096
|
+
id: 8
|
|
38097
|
+
},
|
|
38098
|
+
hmac_secret: {
|
|
38099
|
+
type: "bool",
|
|
38100
|
+
id: 9
|
|
38101
|
+
},
|
|
38102
|
+
use_sign_count: {
|
|
38103
|
+
type: "bool",
|
|
38104
|
+
id: 10
|
|
38105
|
+
},
|
|
38106
|
+
algorithm: {
|
|
38107
|
+
type: "sint32",
|
|
38108
|
+
id: 11
|
|
38109
|
+
},
|
|
38110
|
+
curve: {
|
|
38111
|
+
type: "sint32",
|
|
38112
|
+
id: 12
|
|
38113
|
+
}
|
|
38114
|
+
}
|
|
38115
|
+
}
|
|
38116
|
+
}
|
|
38117
|
+
},
|
|
38118
|
+
wire_in: {
|
|
38119
|
+
type: "bool",
|
|
38120
|
+
id: 50002,
|
|
38121
|
+
extend: "google.protobuf.EnumValueOptions"
|
|
38122
|
+
},
|
|
38123
|
+
wire_out: {
|
|
38124
|
+
type: "bool",
|
|
38125
|
+
id: 50003,
|
|
38126
|
+
extend: "google.protobuf.EnumValueOptions"
|
|
38127
|
+
},
|
|
38128
|
+
wire_debug_in: {
|
|
38129
|
+
type: "bool",
|
|
38130
|
+
id: 50004,
|
|
38131
|
+
extend: "google.protobuf.EnumValueOptions"
|
|
38132
|
+
},
|
|
38133
|
+
wire_debug_out: {
|
|
38134
|
+
type: "bool",
|
|
38135
|
+
id: 50005,
|
|
38136
|
+
extend: "google.protobuf.EnumValueOptions"
|
|
38137
|
+
},
|
|
38138
|
+
wire_tiny: {
|
|
38139
|
+
type: "bool",
|
|
38140
|
+
id: 50006,
|
|
38141
|
+
extend: "google.protobuf.EnumValueOptions"
|
|
38142
|
+
},
|
|
38143
|
+
wire_bootloader: {
|
|
38144
|
+
type: "bool",
|
|
38145
|
+
id: 50007,
|
|
38146
|
+
extend: "google.protobuf.EnumValueOptions"
|
|
38147
|
+
},
|
|
38148
|
+
wire_no_fsm: {
|
|
38149
|
+
type: "bool",
|
|
38150
|
+
id: 50008,
|
|
38151
|
+
extend: "google.protobuf.EnumValueOptions"
|
|
38152
|
+
},
|
|
38153
|
+
bitcoin_only: {
|
|
38154
|
+
type: "bool",
|
|
38155
|
+
id: 60000,
|
|
38156
|
+
extend: "google.protobuf.EnumValueOptions"
|
|
38157
|
+
},
|
|
38158
|
+
has_bitcoin_only_values: {
|
|
38159
|
+
type: "bool",
|
|
38160
|
+
id: 51001,
|
|
38161
|
+
extend: "google.protobuf.EnumOptions"
|
|
38162
|
+
},
|
|
38163
|
+
experimental_message: {
|
|
38164
|
+
type: "bool",
|
|
38165
|
+
id: 52001,
|
|
38166
|
+
extend: "google.protobuf.MessageOptions"
|
|
38167
|
+
},
|
|
38168
|
+
wire_type: {
|
|
38169
|
+
type: "uint32",
|
|
38170
|
+
id: 52002,
|
|
38171
|
+
extend: "google.protobuf.MessageOptions"
|
|
38172
|
+
},
|
|
38173
|
+
experimental_field: {
|
|
38174
|
+
type: "bool",
|
|
38175
|
+
id: 53001,
|
|
38176
|
+
extend: "google.protobuf.FieldOptions"
|
|
38177
|
+
},
|
|
38178
|
+
include_in_bitcoin_only: {
|
|
38179
|
+
type: "bool",
|
|
38180
|
+
id: 60000,
|
|
38181
|
+
extend: "google.protobuf.FileOptions"
|
|
38182
|
+
},
|
|
38183
|
+
MessageType: {
|
|
38184
|
+
options: {
|
|
38185
|
+
"(has_bitcoin_only_values)": true
|
|
38186
|
+
},
|
|
38187
|
+
values: {
|
|
38188
|
+
MessageType_Initialize: 0,
|
|
38189
|
+
MessageType_ChangePin: 4,
|
|
38190
|
+
MessageType_WipeDevice: 5,
|
|
38191
|
+
MessageType_GetEntropy: 9,
|
|
38192
|
+
MessageType_Entropy: 10,
|
|
38193
|
+
MessageType_LoadDevice: 13,
|
|
38194
|
+
MessageType_ResetDevice: 14,
|
|
38195
|
+
MessageType_SetBusy: 16,
|
|
38196
|
+
MessageType_Features: 17,
|
|
38197
|
+
MessageType_Cancel: 20,
|
|
38198
|
+
MessageType_LockDevice: 24,
|
|
38199
|
+
MessageType_ApplySettings: 25,
|
|
38200
|
+
MessageType_ButtonRequest: 26,
|
|
38201
|
+
MessageType_ButtonAck: 27,
|
|
38202
|
+
MessageType_ApplyFlags: 28,
|
|
38203
|
+
MessageType_GetNonce: 31,
|
|
38204
|
+
MessageType_Nonce: 33,
|
|
38205
|
+
MessageType_BackupDevice: 34,
|
|
38206
|
+
MessageType_EntropyRequest: 35,
|
|
38207
|
+
MessageType_EntropyAck: 36,
|
|
38208
|
+
MessageType_PassphraseRequest: 41,
|
|
38209
|
+
MessageType_PassphraseAck: 42,
|
|
38210
|
+
MessageType_RecoveryDevice: 45,
|
|
38211
|
+
MessageType_WordRequest: 46,
|
|
38212
|
+
MessageType_WordAck: 47,
|
|
38213
|
+
MessageType_GetFeatures: 55,
|
|
38214
|
+
MessageType_SdProtect: 79,
|
|
38215
|
+
MessageType_ChangeWipeCode: 82,
|
|
38216
|
+
MessageType_DoPreauthorized: 84,
|
|
38217
|
+
MessageType_PreauthorizedRequest: 85,
|
|
38218
|
+
MessageType_CancelAuthorization: 86,
|
|
38219
|
+
MessageType_GetFirmwareHash: 88,
|
|
38220
|
+
MessageType_FirmwareHash: 89,
|
|
38221
|
+
MessageType_UnlockPath: 93,
|
|
38222
|
+
MessageType_UnlockedPathRequest: 94,
|
|
38223
|
+
MessageType_SetU2FCounter: 63,
|
|
38224
|
+
MessageType_GetNextU2FCounter: 80,
|
|
38225
|
+
MessageType_NextU2FCounter: 81,
|
|
38226
|
+
MessageType_Deprecated_PassphraseStateRequest: 77,
|
|
38227
|
+
MessageType_Deprecated_PassphraseStateAck: 78,
|
|
38228
|
+
MessageType_GetPublicKey: 11,
|
|
38229
|
+
MessageType_PublicKey: 12,
|
|
38230
|
+
MessageType_SignTx: 15,
|
|
38231
|
+
MessageType_TxRequest: 21,
|
|
38232
|
+
MessageType_TxAck: 22,
|
|
38233
|
+
MessageType_GetAddress: 29,
|
|
38234
|
+
MessageType_Address: 30,
|
|
38235
|
+
MessageType_TxAckPaymentRequest: 37,
|
|
38236
|
+
MessageType_SignMessage: 38,
|
|
38237
|
+
MessageType_VerifyMessage: 39,
|
|
38238
|
+
MessageType_MessageSignature: 40,
|
|
38239
|
+
MessageType_GetOwnershipId: 43,
|
|
38240
|
+
MessageType_OwnershipId: 44,
|
|
38241
|
+
MessageType_GetOwnershipProof: 49,
|
|
38242
|
+
MessageType_OwnershipProof: 50,
|
|
38243
|
+
MessageType_AuthorizeCoinJoin: 51,
|
|
38244
|
+
MessageType_SignPsbt: 10052,
|
|
38245
|
+
MessageType_SignedPsbt: 10053,
|
|
38246
|
+
MessageType_CipherKeyValue: 23,
|
|
38247
|
+
MessageType_CipheredKeyValue: 48,
|
|
38248
|
+
MessageType_SignIdentity: 53,
|
|
38249
|
+
MessageType_SignedIdentity: 54,
|
|
38250
|
+
MessageType_GetECDHSessionKey: 61,
|
|
38251
|
+
MessageType_ECDHSessionKey: 62,
|
|
38252
|
+
MessageType_CosiCommit: 71,
|
|
38253
|
+
MessageType_CosiCommitment: 72,
|
|
38254
|
+
MessageType_CosiSign: 73,
|
|
38255
|
+
MessageType_CosiSignature: 74,
|
|
38256
|
+
MessageType_BatchGetPublickeys: 10016,
|
|
38257
|
+
MessageType_EcdsaPublicKeys: 10017,
|
|
38258
|
+
MessageType_EthereumGetPublicKey: 450,
|
|
38259
|
+
MessageType_EthereumPublicKey: 451,
|
|
38260
|
+
MessageType_EthereumGetAddress: 56,
|
|
38261
|
+
MessageType_EthereumAddress: 57,
|
|
38262
|
+
MessageType_EthereumSignTx: 58,
|
|
38263
|
+
MessageType_EthereumSignTxEIP1559: 452,
|
|
38264
|
+
MessageType_EthereumTxRequest: 59,
|
|
38265
|
+
MessageType_EthereumTxAck: 60,
|
|
38266
|
+
MessageType_EthereumSignMessage: 64,
|
|
38267
|
+
MessageType_EthereumVerifyMessage: 65,
|
|
38268
|
+
MessageType_EthereumMessageSignature: 66,
|
|
38269
|
+
MessageType_EthereumSignTypedData: 464,
|
|
38270
|
+
MessageType_EthereumTypedDataStructRequest: 465,
|
|
38271
|
+
MessageType_EthereumTypedDataStructAck: 466,
|
|
38272
|
+
MessageType_EthereumTypedDataValueRequest: 467,
|
|
38273
|
+
MessageType_EthereumTypedDataValueAck: 468,
|
|
38274
|
+
MessageType_EthereumTypedDataSignature: 469,
|
|
38275
|
+
MessageType_EthereumSignTypedHash: 470,
|
|
38276
|
+
MessageType_EthereumGetPublicKeyOneKey: 20100,
|
|
38277
|
+
MessageType_EthereumPublicKeyOneKey: 20101,
|
|
38278
|
+
MessageType_EthereumGetAddressOneKey: 20102,
|
|
38279
|
+
MessageType_EthereumAddressOneKey: 20103,
|
|
38280
|
+
MessageType_EthereumSignTxOneKey: 20104,
|
|
38281
|
+
MessageType_EthereumSignTxEIP1559OneKey: 20105,
|
|
38282
|
+
MessageType_EthereumTxRequestOneKey: 20106,
|
|
38283
|
+
MessageType_EthereumTxAckOneKey: 20107,
|
|
38284
|
+
MessageType_EthereumSignMessageOneKey: 20108,
|
|
38285
|
+
MessageType_EthereumVerifyMessageOneKey: 20109,
|
|
38286
|
+
MessageType_EthereumMessageSignatureOneKey: 20110,
|
|
38287
|
+
MessageType_EthereumSignTypedDataOneKey: 20111,
|
|
38288
|
+
MessageType_EthereumTypedDataStructRequestOneKey: 20112,
|
|
38289
|
+
MessageType_EthereumTypedDataStructAckOneKey: 20113,
|
|
38290
|
+
MessageType_EthereumTypedDataValueRequestOneKey: 20114,
|
|
38291
|
+
MessageType_EthereumTypedDataValueAckOneKey: 20115,
|
|
38292
|
+
MessageType_EthereumTypedDataSignatureOneKey: 20116,
|
|
38293
|
+
MessageType_EthereumSignTypedHashOneKey: 20117,
|
|
38294
|
+
MessageType_EthereumGnosisSafeTxAck: 20118,
|
|
38295
|
+
MessageType_EthereumGnosisSafeTxRequest: 20119,
|
|
38296
|
+
MessageType_EthereumSignTxEIP7702OneKey: 20120,
|
|
38297
|
+
MessageType_EthereumSignTypedDataQR: 20121,
|
|
38298
|
+
MessageType_NEMGetAddress: 67,
|
|
38299
|
+
MessageType_NEMAddress: 68,
|
|
38300
|
+
MessageType_NEMSignTx: 69,
|
|
38301
|
+
MessageType_NEMSignedTx: 70,
|
|
38302
|
+
MessageType_NEMDecryptMessage: 75,
|
|
38303
|
+
MessageType_NEMDecryptedMessage: 76,
|
|
38304
|
+
MessageType_TezosGetAddress: 150,
|
|
38305
|
+
MessageType_TezosAddress: 151,
|
|
38306
|
+
MessageType_TezosSignTx: 152,
|
|
38307
|
+
MessageType_TezosSignedTx: 153,
|
|
38308
|
+
MessageType_TezosGetPublicKey: 154,
|
|
38309
|
+
MessageType_TezosPublicKey: 155,
|
|
38310
|
+
MessageType_StellarSignTx: 202,
|
|
38311
|
+
MessageType_StellarTxOpRequest: 203,
|
|
38312
|
+
MessageType_StellarGetAddress: 207,
|
|
38313
|
+
MessageType_StellarAddress: 208,
|
|
38314
|
+
MessageType_StellarCreateAccountOp: 210,
|
|
38315
|
+
MessageType_StellarPaymentOp: 211,
|
|
38316
|
+
MessageType_StellarPathPaymentStrictReceiveOp: 212,
|
|
38317
|
+
MessageType_StellarManageSellOfferOp: 213,
|
|
38318
|
+
MessageType_StellarCreatePassiveSellOfferOp: 214,
|
|
38319
|
+
MessageType_StellarSetOptionsOp: 215,
|
|
38320
|
+
MessageType_StellarChangeTrustOp: 216,
|
|
38321
|
+
MessageType_StellarAllowTrustOp: 217,
|
|
38322
|
+
MessageType_StellarAccountMergeOp: 218,
|
|
38323
|
+
MessageType_StellarManageDataOp: 220,
|
|
38324
|
+
MessageType_StellarBumpSequenceOp: 221,
|
|
38325
|
+
MessageType_StellarManageBuyOfferOp: 222,
|
|
38326
|
+
MessageType_StellarPathPaymentStrictSendOp: 223,
|
|
38327
|
+
MessageType_StellarSignedTx: 230,
|
|
38328
|
+
MessageType_CardanoGetPublicKey: 305,
|
|
38329
|
+
MessageType_CardanoPublicKey: 306,
|
|
38330
|
+
MessageType_CardanoGetAddress: 307,
|
|
38331
|
+
MessageType_CardanoAddress: 308,
|
|
38332
|
+
MessageType_CardanoTxItemAck: 313,
|
|
38333
|
+
MessageType_CardanoTxAuxiliaryDataSupplement: 314,
|
|
38334
|
+
MessageType_CardanoTxWitnessRequest: 315,
|
|
38335
|
+
MessageType_CardanoTxWitnessResponse: 316,
|
|
38336
|
+
MessageType_CardanoTxHostAck: 317,
|
|
38337
|
+
MessageType_CardanoTxBodyHash: 318,
|
|
38338
|
+
MessageType_CardanoSignTxFinished: 319,
|
|
38339
|
+
MessageType_CardanoSignTxInit: 320,
|
|
38340
|
+
MessageType_CardanoTxInput: 321,
|
|
38341
|
+
MessageType_CardanoTxOutput: 322,
|
|
38342
|
+
MessageType_CardanoAssetGroup: 323,
|
|
38343
|
+
MessageType_CardanoToken: 324,
|
|
38344
|
+
MessageType_CardanoTxCertificate: 325,
|
|
38345
|
+
MessageType_CardanoTxWithdrawal: 326,
|
|
38346
|
+
MessageType_CardanoTxAuxiliaryData: 327,
|
|
38347
|
+
MessageType_CardanoPoolOwner: 328,
|
|
38348
|
+
MessageType_CardanoPoolRelayParameters: 329,
|
|
38349
|
+
MessageType_CardanoGetNativeScriptHash: 330,
|
|
38350
|
+
MessageType_CardanoNativeScriptHash: 331,
|
|
38351
|
+
MessageType_CardanoTxMint: 332,
|
|
38352
|
+
MessageType_CardanoTxCollateralInput: 333,
|
|
38353
|
+
MessageType_CardanoTxRequiredSigner: 334,
|
|
38354
|
+
MessageType_CardanoTxInlineDatumChunk: 335,
|
|
38355
|
+
MessageType_CardanoTxReferenceScriptChunk: 336,
|
|
38356
|
+
MessageType_CardanoTxReferenceInput: 337,
|
|
38357
|
+
MessageType_CardanoSignMessage: 350,
|
|
38358
|
+
MessageType_CardanoMessageSignature: 351,
|
|
38359
|
+
MessageType_RippleGetAddress: 400,
|
|
38360
|
+
MessageType_RippleAddress: 401,
|
|
38361
|
+
MessageType_RippleSignTx: 402,
|
|
38362
|
+
MessageType_RippleSignedTx: 403,
|
|
38363
|
+
MessageType_MoneroTransactionInitRequest: 501,
|
|
38364
|
+
MessageType_MoneroTransactionInitAck: 502,
|
|
38365
|
+
MessageType_MoneroTransactionSetInputRequest: 503,
|
|
38366
|
+
MessageType_MoneroTransactionSetInputAck: 504,
|
|
38367
|
+
MessageType_MoneroTransactionInputViniRequest: 507,
|
|
38368
|
+
MessageType_MoneroTransactionInputViniAck: 508,
|
|
38369
|
+
MessageType_MoneroTransactionAllInputsSetRequest: 509,
|
|
38370
|
+
MessageType_MoneroTransactionAllInputsSetAck: 510,
|
|
38371
|
+
MessageType_MoneroTransactionSetOutputRequest: 511,
|
|
38372
|
+
MessageType_MoneroTransactionSetOutputAck: 512,
|
|
38373
|
+
MessageType_MoneroTransactionAllOutSetRequest: 513,
|
|
38374
|
+
MessageType_MoneroTransactionAllOutSetAck: 514,
|
|
38375
|
+
MessageType_MoneroTransactionSignInputRequest: 515,
|
|
38376
|
+
MessageType_MoneroTransactionSignInputAck: 516,
|
|
38377
|
+
MessageType_MoneroTransactionFinalRequest: 517,
|
|
38378
|
+
MessageType_MoneroTransactionFinalAck: 518,
|
|
38379
|
+
MessageType_MoneroKeyImageExportInitRequest: 530,
|
|
38380
|
+
MessageType_MoneroKeyImageExportInitAck: 531,
|
|
38381
|
+
MessageType_MoneroKeyImageSyncStepRequest: 532,
|
|
38382
|
+
MessageType_MoneroKeyImageSyncStepAck: 533,
|
|
38383
|
+
MessageType_MoneroKeyImageSyncFinalRequest: 534,
|
|
38384
|
+
MessageType_MoneroKeyImageSyncFinalAck: 535,
|
|
38385
|
+
MessageType_MoneroGetAddress: 540,
|
|
38386
|
+
MessageType_MoneroAddress: 541,
|
|
38387
|
+
MessageType_MoneroGetWatchKey: 542,
|
|
38388
|
+
MessageType_MoneroWatchKey: 543,
|
|
38389
|
+
MessageType_DebugMoneroDiagRequest: 546,
|
|
38390
|
+
MessageType_DebugMoneroDiagAck: 547,
|
|
38391
|
+
MessageType_MoneroGetTxKeyRequest: 550,
|
|
38392
|
+
MessageType_MoneroGetTxKeyAck: 551,
|
|
38393
|
+
MessageType_MoneroLiveRefreshStartRequest: 552,
|
|
38394
|
+
MessageType_MoneroLiveRefreshStartAck: 553,
|
|
38395
|
+
MessageType_MoneroLiveRefreshStepRequest: 554,
|
|
38396
|
+
MessageType_MoneroLiveRefreshStepAck: 555,
|
|
38397
|
+
MessageType_MoneroLiveRefreshFinalRequest: 556,
|
|
38398
|
+
MessageType_MoneroLiveRefreshFinalAck: 557,
|
|
38399
|
+
MessageType_EosGetPublicKey: 600,
|
|
38400
|
+
MessageType_EosPublicKey: 601,
|
|
38401
|
+
MessageType_EosSignTx: 602,
|
|
38402
|
+
MessageType_EosTxActionRequest: 603,
|
|
38403
|
+
MessageType_EosTxActionAck: 604,
|
|
38404
|
+
MessageType_EosSignedTx: 605,
|
|
38405
|
+
MessageType_BinanceGetAddress: 700,
|
|
38406
|
+
MessageType_BinanceAddress: 701,
|
|
38407
|
+
MessageType_BinanceGetPublicKey: 702,
|
|
38408
|
+
MessageType_BinancePublicKey: 703,
|
|
38409
|
+
MessageType_BinanceSignTx: 704,
|
|
38410
|
+
MessageType_BinanceTxRequest: 705,
|
|
38411
|
+
MessageType_BinanceTransferMsg: 706,
|
|
38412
|
+
MessageType_BinanceOrderMsg: 707,
|
|
38413
|
+
MessageType_BinanceCancelMsg: 708,
|
|
38414
|
+
MessageType_BinanceSignedTx: 709,
|
|
38415
|
+
MessageType_StarcoinGetAddress: 10300,
|
|
38416
|
+
MessageType_StarcoinAddress: 10301,
|
|
38417
|
+
MessageType_StarcoinGetPublicKey: 10302,
|
|
38418
|
+
MessageType_StarcoinPublicKey: 10303,
|
|
38419
|
+
MessageType_StarcoinSignTx: 10304,
|
|
38420
|
+
MessageType_StarcoinSignedTx: 10305,
|
|
38421
|
+
MessageType_StarcoinSignMessage: 10306,
|
|
38422
|
+
MessageType_StarcoinMessageSignature: 10307,
|
|
38423
|
+
MessageType_StarcoinVerifyMessage: 10308,
|
|
38424
|
+
MessageType_ConfluxGetAddress: 10112,
|
|
38425
|
+
MessageType_ConfluxAddress: 10113,
|
|
38426
|
+
MessageType_ConfluxSignTx: 10114,
|
|
38427
|
+
MessageType_ConfluxTxRequest: 10115,
|
|
38428
|
+
MessageType_ConfluxTxAck: 10116,
|
|
38429
|
+
MessageType_ConfluxSignMessage: 10117,
|
|
38430
|
+
MessageType_ConfluxSignMessageCIP23: 10118,
|
|
38431
|
+
MessageType_ConfluxMessageSignature: 10119,
|
|
38432
|
+
MessageType_TronGetAddress: 10501,
|
|
38433
|
+
MessageType_TronAddress: 10502,
|
|
38434
|
+
MessageType_TronSignTx: 10503,
|
|
38435
|
+
MessageType_TronSignedTx: 10504,
|
|
38436
|
+
MessageType_TronSignMessage: 10505,
|
|
38437
|
+
MessageType_TronMessageSignature: 10506,
|
|
38438
|
+
MessageType_NearGetAddress: 10701,
|
|
38439
|
+
MessageType_NearAddress: 10702,
|
|
38440
|
+
MessageType_NearSignTx: 10703,
|
|
38441
|
+
MessageType_NearSignedTx: 10704,
|
|
38442
|
+
MessageType_AptosGetAddress: 10600,
|
|
38443
|
+
MessageType_AptosAddress: 10601,
|
|
38444
|
+
MessageType_AptosSignTx: 10602,
|
|
38445
|
+
MessageType_AptosSignedTx: 10603,
|
|
38446
|
+
MessageType_AptosSignMessage: 10604,
|
|
38447
|
+
MessageType_AptosMessageSignature: 10605,
|
|
38448
|
+
MessageType_AptosSignSIWAMessage: 10606,
|
|
38449
|
+
MessageType_WebAuthnListResidentCredentials: 800,
|
|
38450
|
+
MessageType_WebAuthnCredentials: 801,
|
|
38451
|
+
MessageType_WebAuthnAddResidentCredential: 802,
|
|
38452
|
+
MessageType_WebAuthnRemoveResidentCredential: 803,
|
|
38453
|
+
MessageType_SolanaGetAddress: 10100,
|
|
38454
|
+
MessageType_SolanaAddress: 10101,
|
|
38455
|
+
MessageType_SolanaSignTx: 10102,
|
|
38456
|
+
MessageType_SolanaSignedTx: 10103,
|
|
38457
|
+
MessageType_SolanaSignOffChainMessage: 10104,
|
|
38458
|
+
MessageType_SolanaMessageSignature: 10105,
|
|
38459
|
+
MessageType_SolanaSignUnsafeMessage: 10106,
|
|
38460
|
+
MessageType_CosmosGetAddress: 10800,
|
|
38461
|
+
MessageType_CosmosAddress: 10801,
|
|
38462
|
+
MessageType_CosmosSignTx: 10802,
|
|
38463
|
+
MessageType_CosmosSignedTx: 10803,
|
|
38464
|
+
MessageType_AlgorandGetAddress: 10900,
|
|
38465
|
+
MessageType_AlgorandAddress: 10901,
|
|
38466
|
+
MessageType_AlgorandSignTx: 10902,
|
|
38467
|
+
MessageType_AlgorandSignedTx: 10903,
|
|
38468
|
+
MessageType_PolkadotGetAddress: 11000,
|
|
38469
|
+
MessageType_PolkadotAddress: 11001,
|
|
38470
|
+
MessageType_PolkadotSignTx: 11002,
|
|
38471
|
+
MessageType_PolkadotSignedTx: 11003,
|
|
38472
|
+
MessageType_SuiGetAddress: 11100,
|
|
38473
|
+
MessageType_SuiAddress: 11101,
|
|
38474
|
+
MessageType_SuiSignTx: 11102,
|
|
38475
|
+
MessageType_SuiSignedTx: 11103,
|
|
38476
|
+
MessageType_SuiSignMessage: 11104,
|
|
38477
|
+
MessageType_SuiMessageSignature: 11105,
|
|
38478
|
+
MessageType_SuiTxRequest: 11106,
|
|
38479
|
+
MessageType_SuiTxAck: 11107,
|
|
38480
|
+
MessageType_FilecoinGetAddress: 11200,
|
|
38481
|
+
MessageType_FilecoinAddress: 11201,
|
|
38482
|
+
MessageType_FilecoinSignTx: 11202,
|
|
38483
|
+
MessageType_FilecoinSignedTx: 11203,
|
|
38484
|
+
MessageType_KaspaGetAddress: 11300,
|
|
38485
|
+
MessageType_KaspaAddress: 11301,
|
|
38486
|
+
MessageType_KaspaSignTx: 11302,
|
|
38487
|
+
MessageType_KaspaSignedTx: 11303,
|
|
38488
|
+
MessageType_KaspaTxInputRequest: 11304,
|
|
38489
|
+
MessageType_KaspaTxInputAck: 11305,
|
|
38490
|
+
MessageType_NexaGetAddress: 11400,
|
|
38491
|
+
MessageType_NexaAddress: 11401,
|
|
38492
|
+
MessageType_NexaSignTx: 11402,
|
|
38493
|
+
MessageType_NexaSignedTx: 11403,
|
|
38494
|
+
MessageType_NexaTxInputRequest: 11404,
|
|
38495
|
+
MessageType_NexaTxInputAck: 11405,
|
|
38496
|
+
MessageType_NostrGetPublicKey: 11500,
|
|
38497
|
+
MessageType_NostrPublicKey: 11501,
|
|
38498
|
+
MessageType_NostrSignEvent: 11502,
|
|
38499
|
+
MessageType_NostrSignedEvent: 11503,
|
|
38500
|
+
MessageType_NostrEncryptMessage: 11504,
|
|
38501
|
+
MessageType_NostrEncryptedMessage: 11505,
|
|
38502
|
+
MessageType_NostrDecryptMessage: 11506,
|
|
38503
|
+
MessageType_NostrDecryptedMessage: 11507,
|
|
38504
|
+
MessageType_NostrSignSchnorr: 11508,
|
|
38505
|
+
MessageType_NostrSignedSchnorr: 11509,
|
|
38506
|
+
MessageType_LnurlAuth: 11600,
|
|
38507
|
+
MessageType_LnurlAuthResp: 11601,
|
|
38508
|
+
MessageType_NervosGetAddress: 11701,
|
|
38509
|
+
MessageType_NervosAddress: 11702,
|
|
38510
|
+
MessageType_NervosSignTx: 11703,
|
|
38511
|
+
MessageType_NervosSignedTx: 11704,
|
|
38512
|
+
MessageType_NervosTxRequest: 11705,
|
|
38513
|
+
MessageType_NervosTxAck: 11706,
|
|
38514
|
+
MessageType_TonGetAddress: 11901,
|
|
38515
|
+
MessageType_TonAddress: 11902,
|
|
38516
|
+
MessageType_TonSignMessage: 11903,
|
|
38517
|
+
MessageType_TonSignedMessage: 11904,
|
|
38518
|
+
MessageType_TonSignProof: 11905,
|
|
38519
|
+
MessageType_TonSignedProof: 11906,
|
|
38520
|
+
MessageType_TonTxAck: 11907,
|
|
38521
|
+
MessageType_AlephiumGetAddress: 12101,
|
|
38522
|
+
MessageType_AlephiumAddress: 12102,
|
|
38523
|
+
MessageType_AlephiumSignTx: 12103,
|
|
38524
|
+
MessageType_AlephiumSignedTx: 12104,
|
|
38525
|
+
MessageType_AlephiumTxRequest: 12105,
|
|
38526
|
+
MessageType_AlephiumTxAck: 12106,
|
|
38527
|
+
MessageType_AlephiumBytecodeRequest: 12107,
|
|
38528
|
+
MessageType_AlephiumBytecodeAck: 12108,
|
|
38529
|
+
MessageType_AlephiumSignMessage: 12109,
|
|
38530
|
+
MessageType_AlephiumMessageSignature: 12110,
|
|
38531
|
+
MessageType_BenfenGetAddress: 12201,
|
|
38532
|
+
MessageType_BenfenAddress: 12202,
|
|
38533
|
+
MessageType_BenfenSignTx: 12203,
|
|
38534
|
+
MessageType_BenfenSignedTx: 12204,
|
|
38535
|
+
MessageType_BenfenSignMessage: 12205,
|
|
38536
|
+
MessageType_BenfenMessageSignature: 12206,
|
|
38537
|
+
MessageType_BenfenTxRequest: 12207,
|
|
38538
|
+
MessageType_BenfenTxAck: 12208,
|
|
38539
|
+
MessageType_NeoGetAddress: 12301,
|
|
38540
|
+
MessageType_NeoAddress: 12302,
|
|
38541
|
+
MessageType_NeoSignTx: 12303,
|
|
38542
|
+
MessageType_NeoSignedTx: 12304,
|
|
38543
|
+
MessageType_DeviceFactoryInfoSet: 60000,
|
|
38544
|
+
MessageType_DeviceFactoryInfoGet: 60001,
|
|
38545
|
+
MessageType_DeviceFactoryInfo: 60002,
|
|
38546
|
+
MessageType_DeviceFactoryPermanentLock: 60003,
|
|
38547
|
+
MessageType_DeviceFactoryTest: 60004,
|
|
38548
|
+
MessageType_ProtocolInfoRequest: 60200,
|
|
38549
|
+
MessageType_ProtocolInfo: 60201,
|
|
38550
|
+
MessageType_Ping: 60206,
|
|
38551
|
+
MessageType_Success: 60207,
|
|
38552
|
+
MessageType_Failure: 60208,
|
|
38553
|
+
MessageType_DeviceReboot: 60400,
|
|
38554
|
+
MessageType_DeviceSettings: 60410,
|
|
38555
|
+
MessageType_DeviceSettingsGet: 60411,
|
|
38556
|
+
MessageType_DeviceSettingsSet: 60412,
|
|
38557
|
+
MessageType_DeviceSettingsPageShow: 60413,
|
|
38558
|
+
MessageType_DeviceCertificate: 60420,
|
|
38559
|
+
MessageType_DeviceCertificateWrite: 60421,
|
|
38560
|
+
MessageType_DeviceCertificateRead: 60422,
|
|
38561
|
+
MessageType_DeviceCertificateSignature: 60423,
|
|
38562
|
+
MessageType_DeviceCertificateSign: 60424,
|
|
38563
|
+
MessageType_DeviceMiscUsbMscControl: 60440,
|
|
38564
|
+
MessageType_DeviceFindMyTokenState: 60450,
|
|
38565
|
+
MessageType_DeviceFindMyTokenUpdate: 60451,
|
|
38566
|
+
MessageType_DeviceFindMyTokenStateGet: 60452,
|
|
38567
|
+
MessageType_DeviceInfoGet: 60600,
|
|
38568
|
+
MessageType_DeviceInfo: 60601,
|
|
38569
|
+
MessageType_DeviceStatusGet: 60602,
|
|
38570
|
+
MessageType_DeviceStatus: 60603,
|
|
38571
|
+
MessageType_FilesystemPermissionFix: 60800,
|
|
38572
|
+
MessageType_FilesystemPathInfo: 60801,
|
|
38573
|
+
MessageType_FilesystemPathInfoQuery: 60802,
|
|
38574
|
+
MessageType_FilesystemFile: 60803,
|
|
38575
|
+
MessageType_FilesystemFileRead: 60804,
|
|
38576
|
+
MessageType_FilesystemFileWrite: 60805,
|
|
38577
|
+
MessageType_FilesystemFileDelete: 60806,
|
|
38578
|
+
MessageType_FilesystemDir: 60807,
|
|
38579
|
+
MessageType_FilesystemDirList: 60808,
|
|
38580
|
+
MessageType_FilesystemDirMake: 60809,
|
|
38581
|
+
MessageType_FilesystemDirRemove: 60810,
|
|
38582
|
+
MessageType_FilesystemFormat: 60811,
|
|
38583
|
+
MessageType_DeviceFirmwareUpdateStage: 61000,
|
|
38584
|
+
MessageType_DeviceFirmwareUpdateRequest: 61001,
|
|
38585
|
+
MessageType_DeviceFirmwareUpdateStatusGet: 61002,
|
|
38586
|
+
MessageType_DeviceFirmwareUpdateStatus: 61003,
|
|
38587
|
+
MessageType_DeviceSessionGet: 61200,
|
|
38588
|
+
MessageType_DeviceSession: 61201,
|
|
38589
|
+
MessageType_DeviceSessionAskPin: 61202,
|
|
38590
|
+
MessageType_DeviceSessionAskPassphrase: 61203,
|
|
38591
|
+
MessageType_PortfolioUpdate: 61400,
|
|
38592
|
+
MessageType_NftUpdate: 61500,
|
|
38593
|
+
MessageType_OnboardingStatusGet: 61600,
|
|
38594
|
+
MessageType_OnboardingStatus: 61601
|
|
38595
|
+
},
|
|
38596
|
+
reserved: [
|
|
38597
|
+
[
|
|
38598
|
+
90,
|
|
38599
|
+
92
|
|
38600
|
+
],
|
|
38601
|
+
[
|
|
38602
|
+
114,
|
|
38603
|
+
122
|
|
38604
|
+
],
|
|
38605
|
+
[
|
|
38606
|
+
300,
|
|
38607
|
+
304
|
|
38608
|
+
],
|
|
38609
|
+
[
|
|
38610
|
+
309,
|
|
38611
|
+
312
|
|
38612
|
+
]
|
|
38613
|
+
]
|
|
38575
38614
|
},
|
|
38576
38615
|
ProtocolInfoRequest: {
|
|
38577
38616
|
fields: {
|
|
@@ -38841,6 +38880,28 @@ var nested = {
|
|
|
38841
38880
|
}
|
|
38842
38881
|
}
|
|
38843
38882
|
},
|
|
38883
|
+
DeviceFindMyTokenUpdate: {
|
|
38884
|
+
fields: {
|
|
38885
|
+
token: {
|
|
38886
|
+
rule: "required",
|
|
38887
|
+
type: "bytes",
|
|
38888
|
+
id: 1
|
|
38889
|
+
}
|
|
38890
|
+
}
|
|
38891
|
+
},
|
|
38892
|
+
DeviceFindMyTokenStateGet: {
|
|
38893
|
+
fields: {
|
|
38894
|
+
}
|
|
38895
|
+
},
|
|
38896
|
+
DeviceFindMyTokenState: {
|
|
38897
|
+
fields: {
|
|
38898
|
+
burned: {
|
|
38899
|
+
rule: "required",
|
|
38900
|
+
type: "bool",
|
|
38901
|
+
id: 1
|
|
38902
|
+
}
|
|
38903
|
+
}
|
|
38904
|
+
},
|
|
38844
38905
|
DeviceFactoryAck: {
|
|
38845
38906
|
values: {
|
|
38846
38907
|
FACTORY_ACK_SUCCESS: 0,
|
|
@@ -38971,6 +39032,13 @@ var nested = {
|
|
|
38971
39032
|
FW_MGMT_UPDATER_TASK_STATUS_FAILED_ENTRY_OUT_OF_BOUNDS: 10
|
|
38972
39033
|
}
|
|
38973
39034
|
},
|
|
39035
|
+
DeviceFirmwareUpdatePhase: {
|
|
39036
|
+
values: {
|
|
39037
|
+
FW_MGMT_UPDATER_PHASE_PREPARE: 0,
|
|
39038
|
+
FW_MGMT_UPDATER_PHASE_INSTALL: 1,
|
|
39039
|
+
FW_MGMT_UPDATER_PHASE_VERIFY: 2
|
|
39040
|
+
}
|
|
39041
|
+
},
|
|
38974
39042
|
DeviceFirmwareTarget: {
|
|
38975
39043
|
fields: {
|
|
38976
39044
|
target_id: {
|
|
@@ -38996,6 +39064,24 @@ var nested = {
|
|
|
38996
39064
|
},
|
|
38997
39065
|
DeviceFirmwareUpdateRequest: {
|
|
38998
39066
|
fields: {
|
|
39067
|
+
reboot_after_update: {
|
|
39068
|
+
type: "bool",
|
|
39069
|
+
id: 1
|
|
39070
|
+
}
|
|
39071
|
+
}
|
|
39072
|
+
},
|
|
39073
|
+
DeviceFirmwareUpdatePhaseInfo: {
|
|
39074
|
+
fields: {
|
|
39075
|
+
phase: {
|
|
39076
|
+
rule: "required",
|
|
39077
|
+
type: "DeviceFirmwareUpdatePhase",
|
|
39078
|
+
id: 1
|
|
39079
|
+
},
|
|
39080
|
+
progress_percent: {
|
|
39081
|
+
rule: "required",
|
|
39082
|
+
type: "uint32",
|
|
39083
|
+
id: 2
|
|
39084
|
+
}
|
|
38999
39085
|
}
|
|
39000
39086
|
},
|
|
39001
39087
|
DeviceFirmwareUpdateRecord: {
|
|
@@ -39009,6 +39095,14 @@ var nested = {
|
|
|
39009
39095
|
type: "DeviceFirmwareUpdateTaskStatus",
|
|
39010
39096
|
id: 10
|
|
39011
39097
|
},
|
|
39098
|
+
progress_percent: {
|
|
39099
|
+
type: "uint32",
|
|
39100
|
+
id: 11
|
|
39101
|
+
},
|
|
39102
|
+
phase_info: {
|
|
39103
|
+
type: "DeviceFirmwareUpdatePhaseInfo",
|
|
39104
|
+
id: 12
|
|
39105
|
+
},
|
|
39012
39106
|
payload_version: {
|
|
39013
39107
|
type: "uint32",
|
|
39014
39108
|
id: 20
|
|
@@ -39025,6 +39119,14 @@ var nested = {
|
|
|
39025
39119
|
type: "bool",
|
|
39026
39120
|
id: 10
|
|
39027
39121
|
},
|
|
39122
|
+
progress_percent: {
|
|
39123
|
+
type: "bool",
|
|
39124
|
+
id: 11
|
|
39125
|
+
},
|
|
39126
|
+
phase_info: {
|
|
39127
|
+
type: "bool",
|
|
39128
|
+
id: 12
|
|
39129
|
+
},
|
|
39028
39130
|
payload_version: {
|
|
39029
39131
|
type: "bool",
|
|
39030
39132
|
id: 20
|
|
@@ -39299,11 +39401,6 @@ var nested = {
|
|
|
39299
39401
|
btc_test_address: {
|
|
39300
39402
|
type: "string",
|
|
39301
39403
|
id: 2
|
|
39302
|
-
},
|
|
39303
|
-
seed_domains: {
|
|
39304
|
-
rule: "repeated",
|
|
39305
|
-
type: "DeviceSessionSeedDomain",
|
|
39306
|
-
id: 3
|
|
39307
39404
|
}
|
|
39308
39405
|
}
|
|
39309
39406
|
},
|
|
@@ -39344,6 +39441,11 @@ var nested = {
|
|
|
39344
39441
|
rule: "required",
|
|
39345
39442
|
type: "bool",
|
|
39346
39443
|
id: 2
|
|
39444
|
+
},
|
|
39445
|
+
seed_domains: {
|
|
39446
|
+
rule: "repeated",
|
|
39447
|
+
type: "DeviceSessionSeedDomain",
|
|
39448
|
+
id: 3
|
|
39347
39449
|
}
|
|
39348
39450
|
}
|
|
39349
39451
|
},
|
|
@@ -39747,7 +39849,14 @@ var nested = {
|
|
|
39747
39849
|
type: "string",
|
|
39748
39850
|
id: 2
|
|
39749
39851
|
}
|
|
39750
|
-
}
|
|
39852
|
+
},
|
|
39853
|
+
reserved: [
|
|
39854
|
+
[
|
|
39855
|
+
3,
|
|
39856
|
+
3
|
|
39857
|
+
],
|
|
39858
|
+
"symbol"
|
|
39859
|
+
]
|
|
39751
39860
|
},
|
|
39752
39861
|
ViewDetail: {
|
|
39753
39862
|
fields: {
|
|
@@ -39773,6 +39882,20 @@ var nested = {
|
|
|
39773
39882
|
}
|
|
39774
39883
|
}
|
|
39775
39884
|
},
|
|
39885
|
+
ViewCustomField: {
|
|
39886
|
+
fields: {
|
|
39887
|
+
key: {
|
|
39888
|
+
rule: "required",
|
|
39889
|
+
type: "string",
|
|
39890
|
+
id: 1
|
|
39891
|
+
},
|
|
39892
|
+
value: {
|
|
39893
|
+
rule: "required",
|
|
39894
|
+
type: "string",
|
|
39895
|
+
id: 2
|
|
39896
|
+
}
|
|
39897
|
+
}
|
|
39898
|
+
},
|
|
39776
39899
|
ViewTipType: {
|
|
39777
39900
|
values: {
|
|
39778
39901
|
Default: 0,
|
|
@@ -39796,20 +39919,80 @@ var nested = {
|
|
|
39796
39919
|
text_id: {
|
|
39797
39920
|
type: "uint32",
|
|
39798
39921
|
id: 3
|
|
39922
|
+
},
|
|
39923
|
+
text_arg: {
|
|
39924
|
+
type: "string",
|
|
39925
|
+
id: 4
|
|
39799
39926
|
}
|
|
39800
39927
|
}
|
|
39801
39928
|
},
|
|
39802
|
-
|
|
39929
|
+
ViewActionCard: {
|
|
39803
39930
|
fields: {
|
|
39804
39931
|
initial_data: {
|
|
39805
39932
|
rule: "required",
|
|
39806
39933
|
type: "string",
|
|
39807
39934
|
id: 1
|
|
39935
|
+
}
|
|
39936
|
+
},
|
|
39937
|
+
reserved: [
|
|
39938
|
+
[
|
|
39939
|
+
2,
|
|
39940
|
+
2
|
|
39941
|
+
],
|
|
39942
|
+
"placeholder"
|
|
39943
|
+
]
|
|
39944
|
+
},
|
|
39945
|
+
ViewContentPreview: {
|
|
39946
|
+
fields: {
|
|
39947
|
+
content_key: {
|
|
39948
|
+
rule: "required",
|
|
39949
|
+
type: "uint32",
|
|
39950
|
+
id: 1
|
|
39951
|
+
},
|
|
39952
|
+
preview: {
|
|
39953
|
+
rule: "required",
|
|
39954
|
+
type: "bytes",
|
|
39955
|
+
id: 2
|
|
39956
|
+
},
|
|
39957
|
+
total_bytes: {
|
|
39958
|
+
type: "uint32",
|
|
39959
|
+
id: 3
|
|
39960
|
+
}
|
|
39961
|
+
}
|
|
39962
|
+
},
|
|
39963
|
+
ViewContentEntry: {
|
|
39964
|
+
fields: {
|
|
39965
|
+
entry_key: {
|
|
39966
|
+
rule: "required",
|
|
39967
|
+
type: "uint32",
|
|
39968
|
+
id: 1
|
|
39969
|
+
},
|
|
39970
|
+
value: {
|
|
39971
|
+
rule: "required",
|
|
39972
|
+
type: "bytes",
|
|
39973
|
+
id: 2
|
|
39974
|
+
}
|
|
39975
|
+
}
|
|
39976
|
+
},
|
|
39977
|
+
ViewContentPage: {
|
|
39978
|
+
fields: {
|
|
39979
|
+
page_index: {
|
|
39980
|
+
rule: "required",
|
|
39981
|
+
type: "uint32",
|
|
39982
|
+
id: 1
|
|
39808
39983
|
},
|
|
39809
|
-
|
|
39984
|
+
page_count: {
|
|
39810
39985
|
rule: "required",
|
|
39811
39986
|
type: "uint32",
|
|
39812
39987
|
id: 2
|
|
39988
|
+
},
|
|
39989
|
+
chunk: {
|
|
39990
|
+
type: "bytes",
|
|
39991
|
+
id: 3
|
|
39992
|
+
},
|
|
39993
|
+
entry: {
|
|
39994
|
+
type: "ViewContentEntry",
|
|
39995
|
+
id: 4
|
|
39813
39996
|
}
|
|
39814
39997
|
}
|
|
39815
39998
|
},
|
|
@@ -39842,8 +40025,8 @@ var nested = {
|
|
|
39842
40025
|
type: "ViewTip",
|
|
39843
40026
|
id: 4
|
|
39844
40027
|
},
|
|
39845
|
-
|
|
39846
|
-
type: "
|
|
40028
|
+
action_card: {
|
|
40029
|
+
type: "ViewActionCard",
|
|
39847
40030
|
id: 5
|
|
39848
40031
|
},
|
|
39849
40032
|
slide_to_confirm: {
|
|
@@ -39863,6 +40046,40 @@ var nested = {
|
|
|
39863
40046
|
title_id: {
|
|
39864
40047
|
type: "uint32",
|
|
39865
40048
|
id: 8
|
|
40049
|
+
},
|
|
40050
|
+
title_arg: {
|
|
40051
|
+
type: "string",
|
|
40052
|
+
id: 9
|
|
40053
|
+
},
|
|
40054
|
+
content: {
|
|
40055
|
+
type: "ViewContentPreview",
|
|
40056
|
+
id: 10
|
|
40057
|
+
},
|
|
40058
|
+
custom_field: {
|
|
40059
|
+
type: "ViewCustomField",
|
|
40060
|
+
id: 11
|
|
40061
|
+
}
|
|
40062
|
+
}
|
|
40063
|
+
},
|
|
40064
|
+
ViewWarningPage: {
|
|
40065
|
+
fields: {
|
|
40066
|
+
title_id: {
|
|
40067
|
+
rule: "required",
|
|
40068
|
+
type: "uint32",
|
|
40069
|
+
id: 1
|
|
40070
|
+
},
|
|
40071
|
+
text_id: {
|
|
40072
|
+
rule: "required",
|
|
40073
|
+
type: "uint32",
|
|
40074
|
+
id: 2
|
|
40075
|
+
},
|
|
40076
|
+
text_arg: {
|
|
40077
|
+
type: "string",
|
|
40078
|
+
id: 3
|
|
40079
|
+
},
|
|
40080
|
+
cancellable: {
|
|
40081
|
+
type: "bool",
|
|
40082
|
+
id: 4
|
|
39866
40083
|
}
|
|
39867
40084
|
}
|
|
39868
40085
|
},
|
|
@@ -39901,6 +40118,10 @@ var nested = {
|
|
|
39901
40118
|
chain_id: {
|
|
39902
40119
|
type: "uint32",
|
|
39903
40120
|
id: 8
|
|
40121
|
+
},
|
|
40122
|
+
content: {
|
|
40123
|
+
type: "ViewContentPreview",
|
|
40124
|
+
id: 9
|
|
39904
40125
|
}
|
|
39905
40126
|
}
|
|
39906
40127
|
},
|
|
@@ -40716,7 +40937,12 @@ function isProtocolV2ResourceArchiveEntryName(entryName) {
|
|
|
40716
40937
|
const fileName = (_a = parts[parts.length - 1]) !== null && _a !== void 0 ? _a : '';
|
|
40717
40938
|
return (fileName.length > 0 &&
|
|
40718
40939
|
!fileName.startsWith('.') &&
|
|
40719
|
-
!parts.some(part => part
|
|
40940
|
+
!parts.some(part => !part ||
|
|
40941
|
+
part === '.' ||
|
|
40942
|
+
part === '..' ||
|
|
40943
|
+
part === '.DS_Store' ||
|
|
40944
|
+
part.startsWith('._') ||
|
|
40945
|
+
part.toUpperCase() === '__MACOSX'));
|
|
40720
40946
|
}
|
|
40721
40947
|
function isSafeResourceDevicePath(path) {
|
|
40722
40948
|
return !(path.includes('\\') ||
|
|
@@ -41568,17 +41794,19 @@ const negotiateEventlessWalletSession = (device) => __awaiter(void 0, void 0, vo
|
|
|
41568
41794
|
yield device.ensureProtocolV2RuntimeContext();
|
|
41569
41795
|
});
|
|
41570
41796
|
const getDeviceSession = (device, request) => __awaiter(void 0, void 0, void 0, function* () { return device.commands.typedCall('DeviceSessionGet', 'DeviceSession', request); });
|
|
41571
|
-
const
|
|
41572
|
-
|
|
41573
|
-
|
|
41574
|
-
|
|
41575
|
-
|
|
41576
|
-
|
|
41577
|
-
const
|
|
41578
|
-
|
|
41797
|
+
const buildDeviceSessionSeedDomains = (deriveCardano) => deriveCardano === undefined
|
|
41798
|
+
? []
|
|
41799
|
+
: [
|
|
41800
|
+
hdTransport.DeviceSessionSeedDomain.SeedDomain_Standard,
|
|
41801
|
+
...(deriveCardano ? [hdTransport.DeviceSessionSeedDomain.SeedDomain_Cardano] : []),
|
|
41802
|
+
];
|
|
41803
|
+
const buildDeviceSessionGetRequest = ({ sessionId, expectedPassphraseState, } = {}) => (Object.assign(Object.assign({}, (sessionId ? { session_id: sessionId } : {})), (expectedPassphraseState ? { btc_test_address: expectedPassphraseState } : {})));
|
|
41804
|
+
const askDevicePassphrase = (device, requestPayload, deriveCardano, onStatusRefreshed) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41805
|
+
yield device.commands.typedCall('DeviceSessionAskPassphrase', 'Success', Object.assign(Object.assign({}, requestPayload), { seed_domains: buildDeviceSessionSeedDomains(deriveCardano) }));
|
|
41579
41806
|
yield refreshProtocolV2DeviceStatus(device);
|
|
41807
|
+
onStatusRefreshed === null || onStatusRefreshed === void 0 ? void 0 : onStatusRefreshed();
|
|
41580
41808
|
});
|
|
41581
|
-
const selectDeviceSession = (device, expectedPassphraseState, deriveCardano) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41809
|
+
const selectDeviceSession = (device, expectedPassphraseState, deriveCardano, onStatusRefreshed) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41582
41810
|
var _a, _b, _c, _d;
|
|
41583
41811
|
const existsAttachPinUser = ((_a = device.features) === null || _a === void 0 ? void 0 : _a.attachToPinEnabled) === true;
|
|
41584
41812
|
const metadata = Object.assign({ source: 'wallet-session-coordinator', reason: expectedPassphraseState ? 'session-recovery' : 'open-wallet' }, (expectedPassphraseState ? { expectedPassphraseState } : {}));
|
|
@@ -41611,19 +41839,20 @@ const selectDeviceSession = (device, expectedPassphraseState, deriveCardano) =>
|
|
|
41611
41839
|
emitUiEvent: false,
|
|
41612
41840
|
interaction: attachPinInteraction,
|
|
41613
41841
|
});
|
|
41614
|
-
|
|
41842
|
+
onStatusRefreshed === null || onStatusRefreshed === void 0 ? void 0 : onStatusRefreshed();
|
|
41843
|
+
return getDeviceSession(device, buildDeviceSessionGetRequest());
|
|
41615
41844
|
}
|
|
41616
41845
|
if (hasHostPassphrase) {
|
|
41617
41846
|
yield askDevicePassphrase(device, {
|
|
41618
41847
|
passphrase: hostPassphrase,
|
|
41619
41848
|
on_device: false,
|
|
41620
|
-
});
|
|
41621
|
-
return getDeviceSession(device, buildDeviceSessionGetRequest(
|
|
41849
|
+
}, deriveCardano, onStatusRefreshed);
|
|
41850
|
+
return getDeviceSession(device, buildDeviceSessionGetRequest());
|
|
41622
41851
|
}
|
|
41623
41852
|
const passphraseOnDeviceInteraction = (_d = device.createProtocolV2UiPhaseMetadata) === null || _d === void 0 ? void 0 : _d.call(device, 'passphrase-on-device', 'start');
|
|
41624
41853
|
device.emit(DEVICE.PASSPHRASE_ON_DEVICE, device, Object.assign(Object.assign({}, metadata), (passphraseOnDeviceInteraction ? { interaction: passphraseOnDeviceInteraction } : {})));
|
|
41625
|
-
yield askDevicePassphrase(device, { on_device: true });
|
|
41626
|
-
return getDeviceSession(device, buildDeviceSessionGetRequest(
|
|
41854
|
+
yield askDevicePassphrase(device, { on_device: true }, deriveCardano, onStatusRefreshed);
|
|
41855
|
+
return getDeviceSession(device, buildDeviceSessionGetRequest());
|
|
41627
41856
|
});
|
|
41628
41857
|
function getProtocolV2WalletSession(device, options) {
|
|
41629
41858
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
@@ -41656,9 +41885,15 @@ function getProtocolV2WalletSession(device, options) {
|
|
|
41656
41885
|
: undefined;
|
|
41657
41886
|
let response;
|
|
41658
41887
|
let resumed = false;
|
|
41659
|
-
let
|
|
41660
|
-
|
|
41661
|
-
|
|
41888
|
+
let walletStatusRefreshed = false;
|
|
41889
|
+
const markWalletStatusRefreshed = () => {
|
|
41890
|
+
walletStatusRefreshed = true;
|
|
41891
|
+
};
|
|
41892
|
+
let mainPinAuthenticated = (options === null || options === void 0 ? void 0 : options.mainPinSelected) === true ||
|
|
41893
|
+
((options === null || options === void 0 ? void 0 : options.onlyMainPin) === true &&
|
|
41894
|
+
((_d = device.features) === null || _d === void 0 ? void 0 : _d.unlocked) === true &&
|
|
41895
|
+
((_e = device.features) === null || _e === void 0 ? void 0 : _e.unlockedAttachPin) === false);
|
|
41896
|
+
let standardWalletSelected = (options === null || options === void 0 ? void 0 : options.mainPinSelected) === true;
|
|
41662
41897
|
const clearCurrentWalletSession = () => {
|
|
41663
41898
|
var _a;
|
|
41664
41899
|
if (options === null || options === void 0 ? void 0 : options.onlyMainPin) {
|
|
@@ -41671,6 +41906,7 @@ function getProtocolV2WalletSession(device, options) {
|
|
|
41671
41906
|
const rejectMismatchedAttachPinWallet = () => __awaiter(this, void 0, void 0, function* () {
|
|
41672
41907
|
var _k;
|
|
41673
41908
|
const features = yield refreshProtocolV2DeviceStatus(device);
|
|
41909
|
+
markWalletStatusRefreshed();
|
|
41674
41910
|
if (features.unlockedAttachPin !== true) {
|
|
41675
41911
|
return;
|
|
41676
41912
|
}
|
|
@@ -41692,35 +41928,42 @@ function getProtocolV2WalletSession(device, options) {
|
|
|
41692
41928
|
yield rejectMismatchedAttachPinWallet();
|
|
41693
41929
|
}
|
|
41694
41930
|
const selectMainPin = (force = false) => __awaiter(this, void 0, void 0, function* () {
|
|
41695
|
-
if (force || !
|
|
41931
|
+
if (force || !mainPinAuthenticated) {
|
|
41696
41932
|
yield device.unlockDevice(hdTransport.DeviceSessionPinType.Main, {
|
|
41697
41933
|
source: 'wallet-session-coordinator',
|
|
41698
41934
|
reason: expectedPassphraseState ? 'session-recovery' : 'open-wallet',
|
|
41699
41935
|
deviceOnly: true,
|
|
41700
41936
|
});
|
|
41701
|
-
|
|
41937
|
+
markWalletStatusRefreshed();
|
|
41938
|
+
mainPinAuthenticated = true;
|
|
41939
|
+
standardWalletSelected = true;
|
|
41702
41940
|
}
|
|
41703
41941
|
});
|
|
41704
41942
|
const selectStandardWallet = () => __awaiter(this, void 0, void 0, function* () {
|
|
41705
41943
|
var _m;
|
|
41706
|
-
yield selectMainPin();
|
|
41707
41944
|
if (((_m = device.features) === null || _m === void 0 ? void 0 : _m.passphraseProtection) === true) {
|
|
41945
|
+
yield selectMainPin();
|
|
41708
41946
|
yield askDevicePassphrase(device, {
|
|
41709
41947
|
passphrase: '',
|
|
41710
41948
|
on_device: false,
|
|
41711
|
-
});
|
|
41949
|
+
}, options === null || options === void 0 ? void 0 : options.deriveCardano, markWalletStatusRefreshed);
|
|
41950
|
+
standardWalletSelected = true;
|
|
41951
|
+
}
|
|
41952
|
+
else if (!standardWalletSelected) {
|
|
41953
|
+
yield selectMainPin(true);
|
|
41712
41954
|
}
|
|
41713
41955
|
});
|
|
41714
41956
|
if (readCurrentAttachPinSession) {
|
|
41715
41957
|
const status = yield requestProtocolV2DeviceStatus$1(device);
|
|
41716
41958
|
device.updateProtocolV2Status(status);
|
|
41959
|
+
markWalletStatusRefreshed();
|
|
41717
41960
|
if (status.unlocked !== true ||
|
|
41718
41961
|
status.passphrase_enabled !== true ||
|
|
41719
41962
|
status.unlocked_by_attach_to_pin !== true) {
|
|
41720
41963
|
device.clearInternalState();
|
|
41721
41964
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceCheckUnlockTypeError);
|
|
41722
41965
|
}
|
|
41723
|
-
response = yield getDeviceSession(device, buildDeviceSessionGetRequest(
|
|
41966
|
+
response = yield getDeviceSession(device, buildDeviceSessionGetRequest());
|
|
41724
41967
|
}
|
|
41725
41968
|
else if (options === null || options === void 0 ? void 0 : options.onlyMainPin) {
|
|
41726
41969
|
expectedPassphraseState = cachedStandardSession === null || cachedStandardSession === void 0 ? void 0 : cachedStandardSession.passphraseState;
|
|
@@ -41732,7 +41975,6 @@ function getProtocolV2WalletSession(device, options) {
|
|
|
41732
41975
|
response = yield getDeviceSession(device, buildDeviceSessionGetRequest({
|
|
41733
41976
|
sessionId: cachedStandardSession.sessionId,
|
|
41734
41977
|
expectedPassphraseState,
|
|
41735
|
-
deriveCardano: options === null || options === void 0 ? void 0 : options.deriveCardano,
|
|
41736
41978
|
}));
|
|
41737
41979
|
resumed = true;
|
|
41738
41980
|
}
|
|
@@ -41746,7 +41988,7 @@ function getProtocolV2WalletSession(device, options) {
|
|
|
41746
41988
|
}
|
|
41747
41989
|
if (!response) {
|
|
41748
41990
|
yield selectStandardWallet();
|
|
41749
|
-
response = yield getDeviceSession(device, buildDeviceSessionGetRequest(
|
|
41991
|
+
response = yield getDeviceSession(device, buildDeviceSessionGetRequest());
|
|
41750
41992
|
}
|
|
41751
41993
|
}
|
|
41752
41994
|
else if (cachedSessionId && expectedPassphraseState) {
|
|
@@ -41754,7 +41996,6 @@ function getProtocolV2WalletSession(device, options) {
|
|
|
41754
41996
|
response = yield getDeviceSession(device, buildDeviceSessionGetRequest({
|
|
41755
41997
|
sessionId: cachedSessionId,
|
|
41756
41998
|
expectedPassphraseState,
|
|
41757
|
-
deriveCardano: options === null || options === void 0 ? void 0 : options.deriveCardano,
|
|
41758
41999
|
}));
|
|
41759
42000
|
resumed = true;
|
|
41760
42001
|
}
|
|
@@ -41770,7 +42011,6 @@ function getProtocolV2WalletSession(device, options) {
|
|
|
41770
42011
|
try {
|
|
41771
42012
|
response = yield getDeviceSession(device, buildDeviceSessionGetRequest({
|
|
41772
42013
|
expectedPassphraseState,
|
|
41773
|
-
deriveCardano: options === null || options === void 0 ? void 0 : options.deriveCardano,
|
|
41774
42014
|
}));
|
|
41775
42015
|
}
|
|
41776
42016
|
catch (error) {
|
|
@@ -41784,7 +42024,7 @@ function getProtocolV2WalletSession(device, options) {
|
|
|
41784
42024
|
device.clearInternalState();
|
|
41785
42025
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.WalletSessionInvalid);
|
|
41786
42026
|
}
|
|
41787
|
-
response = yield selectDeviceSession(device, expectedPassphraseState, options === null || options === void 0 ? void 0 : options.deriveCardano);
|
|
42027
|
+
response = yield selectDeviceSession(device, expectedPassphraseState, options === null || options === void 0 ? void 0 : options.deriveCardano, markWalletStatusRefreshed);
|
|
41788
42028
|
}
|
|
41789
42029
|
let { message } = response;
|
|
41790
42030
|
try {
|
|
@@ -41809,11 +42049,11 @@ function getProtocolV2WalletSession(device, options) {
|
|
|
41809
42049
|
if (options === null || options === void 0 ? void 0 : options.onlyMainPin) {
|
|
41810
42050
|
(_h = device.clearStandardInternalState) === null || _h === void 0 ? void 0 : _h.call(device);
|
|
41811
42051
|
yield selectStandardWallet();
|
|
41812
|
-
response = yield getDeviceSession(device, buildDeviceSessionGetRequest(
|
|
42052
|
+
response = yield getDeviceSession(device, buildDeviceSessionGetRequest());
|
|
41813
42053
|
}
|
|
41814
42054
|
else {
|
|
41815
42055
|
device.clearInternalState();
|
|
41816
|
-
response = yield selectDeviceSession(device, expectedPassphraseState, options === null || options === void 0 ? void 0 : options.deriveCardano);
|
|
42056
|
+
response = yield selectDeviceSession(device, expectedPassphraseState, options === null || options === void 0 ? void 0 : options.deriveCardano, markWalletStatusRefreshed);
|
|
41817
42057
|
}
|
|
41818
42058
|
message = response.message;
|
|
41819
42059
|
try {
|
|
@@ -41851,7 +42091,7 @@ function getProtocolV2WalletSession(device, options) {
|
|
|
41851
42091
|
if (readCurrentAttachPinSession) {
|
|
41852
42092
|
unlockedAttachPin = true;
|
|
41853
42093
|
}
|
|
41854
|
-
else if (
|
|
42094
|
+
else if (mainPinAuthenticated) {
|
|
41855
42095
|
unlockedAttachPin = false;
|
|
41856
42096
|
}
|
|
41857
42097
|
return {
|
|
@@ -41859,6 +42099,7 @@ function getProtocolV2WalletSession(device, options) {
|
|
|
41859
42099
|
newSession: message.session_id,
|
|
41860
42100
|
unlockedAttachPin,
|
|
41861
42101
|
resumed,
|
|
42102
|
+
walletStatusRefreshed,
|
|
41862
42103
|
};
|
|
41863
42104
|
});
|
|
41864
42105
|
}
|
|
@@ -41926,6 +42167,7 @@ const getPassphraseStateWithRefreshDeviceInfo = (device, options) => __awaiter(v
|
|
|
41926
42167
|
onlyMainPin: options === null || options === void 0 ? void 0 : options.onlyMainPin,
|
|
41927
42168
|
deriveCardano: options === null || options === void 0 ? void 0 : options.deriveCardano,
|
|
41928
42169
|
rejectAttachPinForMainWallet: options === null || options === void 0 ? void 0 : options.rejectAttachPinForMainWallet,
|
|
42170
|
+
mainPinSelected: options === null || options === void 0 ? void 0 : options.mainPinSelected,
|
|
41929
42171
|
});
|
|
41930
42172
|
}
|
|
41931
42173
|
const { features } = device;
|
|
@@ -41971,6 +42213,7 @@ const getPassphraseState = (device, options) => __awaiter(void 0, void 0, void 0
|
|
|
41971
42213
|
onlyMainPin: options === null || options === void 0 ? void 0 : options.onlyMainPin,
|
|
41972
42214
|
deriveCardano: options === null || options === void 0 ? void 0 : options.deriveCardano,
|
|
41973
42215
|
rejectAttachPinForMainWallet: options === null || options === void 0 ? void 0 : options.rejectAttachPinForMainWallet,
|
|
42216
|
+
mainPinSelected: options === null || options === void 0 ? void 0 : options.mainPinSelected,
|
|
41974
42217
|
});
|
|
41975
42218
|
}
|
|
41976
42219
|
const supportAttachPinCapability = existCapability(features, hdTransport.Enum_Capability.Capability_AttachToPin);
|
|
@@ -42489,7 +42732,7 @@ function invalidParameter$2(message) {
|
|
|
42489
42732
|
function asBytes(rgba) {
|
|
42490
42733
|
return rgba instanceof Uint8Array ? rgba : new Uint8Array(rgba);
|
|
42491
42734
|
}
|
|
42492
|
-
function align(value, boundary) {
|
|
42735
|
+
function align$1(value, boundary) {
|
|
42493
42736
|
return Math.ceil(value / boundary) * boundary;
|
|
42494
42737
|
}
|
|
42495
42738
|
function encodePro2Image(options) {
|
|
@@ -42517,7 +42760,7 @@ function encodePro2Image(options) {
|
|
|
42517
42760
|
}
|
|
42518
42761
|
}
|
|
42519
42762
|
const colorFormat = hasTransparency ? 'RGB565A8' : 'RGB565';
|
|
42520
|
-
const stride = align(width * 2, 4);
|
|
42763
|
+
const stride = align$1(width * 2, 4);
|
|
42521
42764
|
const alphaStride = stride / 2;
|
|
42522
42765
|
const rgbSize = stride * height;
|
|
42523
42766
|
const alphaSize = hasTransparency ? alphaStride * height : 0;
|
|
@@ -46455,7 +46698,7 @@ class Device extends events.exports {
|
|
|
46455
46698
|
return Promise.resolve(features);
|
|
46456
46699
|
});
|
|
46457
46700
|
}
|
|
46458
|
-
checkPassphraseStateSafety(passphraseState, useEmptyPassphrase, skipPassphraseCheck, deriveCardano) {
|
|
46701
|
+
checkPassphraseStateSafety(passphraseState, useEmptyPassphrase, skipPassphraseCheck, deriveCardano, mainPinSelected) {
|
|
46459
46702
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46460
46703
|
if (this.isUnacquired())
|
|
46461
46704
|
return false;
|
|
@@ -46465,6 +46708,7 @@ class Device extends events.exports {
|
|
|
46465
46708
|
onlyMainPin: useEmptyPassphrase,
|
|
46466
46709
|
deriveCardano,
|
|
46467
46710
|
rejectAttachPinForMainWallet: useEmptyPassphrase === true,
|
|
46711
|
+
mainPinSelected,
|
|
46468
46712
|
});
|
|
46469
46713
|
const mainWalletUseAttachPin = unlockedAttachPin && useEmptyPassphrase;
|
|
46470
46714
|
const useErrorAttachPin = unlockedAttachPin &&
|
|
@@ -47289,6 +47533,10 @@ const wasResumed = (session) => !!session &&
|
|
|
47289
47533
|
typeof session === 'object' &&
|
|
47290
47534
|
'resumed' in session &&
|
|
47291
47535
|
session.resumed === true;
|
|
47536
|
+
const wasWalletStatusRefreshed = (session) => !!session &&
|
|
47537
|
+
typeof session === 'object' &&
|
|
47538
|
+
'walletStatusRefreshed' in session &&
|
|
47539
|
+
session.walletStatusRefreshed === true;
|
|
47292
47540
|
const requireHiddenWalletResponse = (session) => {
|
|
47293
47541
|
if (!session.passphraseState) {
|
|
47294
47542
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceInitializeFailed, 'Hidden wallet response is missing passphraseState');
|
|
@@ -47331,12 +47579,20 @@ class OpenWalletSession extends BaseMethod {
|
|
|
47331
47579
|
this.unlockPolicy = 'unlock-before-run';
|
|
47332
47580
|
this.skipForceUpdateCheck = true;
|
|
47333
47581
|
this.params = normalizeParams(this.payload);
|
|
47582
|
+
this.protocolV2PreUnlockPinType =
|
|
47583
|
+
this.params.mode === OpenWalletSessionMode.SelectHidden
|
|
47584
|
+
? hdTransport.DeviceSessionPinType.Any
|
|
47585
|
+
: hdTransport.DeviceSessionPinType.Main;
|
|
47334
47586
|
this.payload.useEmptyPassphrase = this.params.mode === OpenWalletSessionMode.Standard;
|
|
47335
47587
|
}
|
|
47336
47588
|
run() {
|
|
47589
|
+
var _a, _b;
|
|
47337
47590
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47338
47591
|
const isProtocolV2 = this.device.isProtocolV2();
|
|
47339
|
-
|
|
47592
|
+
const reusePreflightStatus = isProtocolV2 && ((_a = this.protocolV2UnlockContext) === null || _a === void 0 ? void 0 : _a.preflightStatusRefreshed) === true;
|
|
47593
|
+
let state = reusePreflightStatus
|
|
47594
|
+
? yield this.device.getDeviceState()
|
|
47595
|
+
: yield this.device.getDeviceState({ refreshSections: ['status'] });
|
|
47340
47596
|
let currentDeviceId = state.identity.deviceId;
|
|
47341
47597
|
const hasAuthoritativeProtocolV2WalletStatus = (candidate) => candidate.status.unlocked === true &&
|
|
47342
47598
|
typeof candidate.status.passphraseProtection === 'boolean' &&
|
|
@@ -47358,9 +47614,18 @@ class OpenWalletSession extends BaseMethod {
|
|
|
47358
47614
|
currentDeviceId = state.identity.deviceId;
|
|
47359
47615
|
return state;
|
|
47360
47616
|
});
|
|
47617
|
+
const resolveProtocolV2DeviceStateAfterSession = (session) => __awaiter(this, void 0, void 0, function* () {
|
|
47618
|
+
if (!wasWalletStatusRefreshed(session)) {
|
|
47619
|
+
return refreshProtocolV2DeviceState();
|
|
47620
|
+
}
|
|
47621
|
+
state = yield this.device.getDeviceState();
|
|
47622
|
+
currentDeviceId = state.identity.deviceId;
|
|
47623
|
+
return state;
|
|
47624
|
+
});
|
|
47361
47625
|
const ensureProtocolV2WalletStatus = () => __awaiter(this, void 0, void 0, function* () {
|
|
47626
|
+
var _d;
|
|
47362
47627
|
if (isProtocolV2 && !hasAuthoritativeProtocolV2WalletStatus(state)) {
|
|
47363
|
-
yield this.device.unlockDevice(hdTransport.DeviceSessionPinType.Main, {
|
|
47628
|
+
yield this.device.unlockDevice((_d = this.protocolV2PreUnlockPinType) !== null && _d !== void 0 ? _d : hdTransport.DeviceSessionPinType.Main, {
|
|
47364
47629
|
source: 'unlock-coordinator',
|
|
47365
47630
|
reason: 'device-locked',
|
|
47366
47631
|
deviceOnly: true,
|
|
@@ -47379,13 +47644,14 @@ class OpenWalletSession extends BaseMethod {
|
|
|
47379
47644
|
deriveCardano: this.payload.deriveCardano,
|
|
47380
47645
|
selectMainWalletBeforeRestore: !hasAuthoritativeProtocolV2WalletStatus(state) ||
|
|
47381
47646
|
state.status.unlockedAttachPin === true,
|
|
47647
|
+
mainPinSelected: (_b = this.protocolV2UnlockContext) === null || _b === void 0 ? void 0 : _b.preflightMainPinSelected,
|
|
47382
47648
|
})
|
|
47383
47649
|
: yield getPassphraseStateWithRefreshDeviceInfo(this.device, {
|
|
47384
47650
|
onlyMainPin: true,
|
|
47385
47651
|
initSession: this.payload.initSession,
|
|
47386
47652
|
});
|
|
47387
47653
|
const refreshedState = isProtocolV2
|
|
47388
|
-
? requireAuthoritativeProtocolV2WalletStatus(yield
|
|
47654
|
+
? requireAuthoritativeProtocolV2WalletStatus(yield resolveProtocolV2DeviceStateAfterSession(session))
|
|
47389
47655
|
: state;
|
|
47390
47656
|
const deviceId = requireDeviceId();
|
|
47391
47657
|
if (session.unlockedAttachPin ||
|
|
@@ -47393,7 +47659,7 @@ class OpenWalletSession extends BaseMethod {
|
|
|
47393
47659
|
try {
|
|
47394
47660
|
yield this.device.lockDevice();
|
|
47395
47661
|
}
|
|
47396
|
-
catch (
|
|
47662
|
+
catch (_c) {
|
|
47397
47663
|
}
|
|
47398
47664
|
this.device.clearInternalState();
|
|
47399
47665
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceCheckUnlockTypeError);
|
|
@@ -47457,7 +47723,7 @@ class OpenWalletSession extends BaseMethod {
|
|
|
47457
47723
|
: { forceWalletSelection: true })), { deriveCardano: this.payload.deriveCardano }))
|
|
47458
47724
|
: yield getPassphraseStateWithRefreshDeviceInfo(this.device, { initSession: true });
|
|
47459
47725
|
const refreshedState = isProtocolV2
|
|
47460
|
-
? requireAuthoritativeProtocolV2WalletStatus(yield
|
|
47726
|
+
? requireAuthoritativeProtocolV2WalletStatus(yield resolveProtocolV2DeviceStateAfterSession(session))
|
|
47461
47727
|
: state;
|
|
47462
47728
|
const deviceId = requireDeviceId();
|
|
47463
47729
|
if (isProtocolV2 && refreshedState.status.passphraseProtection !== true) {
|
|
@@ -51659,6 +51925,12 @@ const getProtocolV2UnknownErrorText = (error) => {
|
|
|
51659
51925
|
return parts.filter(Boolean).join(' ');
|
|
51660
51926
|
};
|
|
51661
51927
|
const isProtocolV2DeviceDisconnectedError = (error) => {
|
|
51928
|
+
var _a;
|
|
51929
|
+
const errorCode = error && typeof error === 'object'
|
|
51930
|
+
? (_a = error.errorCode) !== null && _a !== void 0 ? _a : error.code
|
|
51931
|
+
: undefined;
|
|
51932
|
+
if (errorCode === hdShared.HardwareErrorCode.BleDeviceDisconnected)
|
|
51933
|
+
return true;
|
|
51662
51934
|
const message = getProtocolV2UnknownErrorText(error).toLowerCase();
|
|
51663
51935
|
const compactMessage = message.replace(/\s+/g, '');
|
|
51664
51936
|
return (message.includes('notfounderror') ||
|
|
@@ -51703,14 +51975,289 @@ const INSTALLABLE_FIRMWARE_TARGET_IDS = new Set([
|
|
|
51703
51975
|
]);
|
|
51704
51976
|
new Map(Object.entries(ProtocolV2FirmwareTargetType).flatMap(([key, value]) => INSTALLABLE_FIRMWARE_TARGET_IDS.has(value) ? [[key, value]] : []));
|
|
51705
51977
|
|
|
51706
|
-
const Log$7 = getLogger(exports.LoggerNames.
|
|
51978
|
+
const Log$7 = getLogger(exports.LoggerNames.Core);
|
|
51979
|
+
const MIN_FILE_CHUNK_SIZE = 64;
|
|
51980
|
+
const FILE_TRANSFER_RATE_WINDOW_MS = 1000;
|
|
51981
|
+
const FILE_TRANSFER_LOG_INTERVAL_MS = 10000;
|
|
51707
51982
|
const SESSION_ERROR$1 = 'session not found';
|
|
51983
|
+
function formatFileTransferRate(bytesPerSecond) {
|
|
51984
|
+
return (Math.max(bytesPerSecond, 0) / 1024).toFixed(2);
|
|
51985
|
+
}
|
|
51986
|
+
function getAverageFileTransferRate(transferredBytes, elapsedMs) {
|
|
51987
|
+
if (elapsedMs <= 0)
|
|
51988
|
+
return 0;
|
|
51989
|
+
return Math.round((Math.max(transferredBytes, 0) / elapsedMs) * 1000);
|
|
51990
|
+
}
|
|
51991
|
+
function getFileTransferTransport() {
|
|
51992
|
+
const env = DataManager.getSettings('env');
|
|
51993
|
+
return env && DataManager.isBleConnect(env) ? 'BLE' : String(env !== null && env !== void 0 ? env : 'unknown');
|
|
51994
|
+
}
|
|
51995
|
+
function logFileTransferMetrics({ transport, status, path, transferredBytes, totalBytes, elapsedMs, rateBytesPerSecond, hostWriteElapsedMs, responseWaitElapsedMs, measuredAttempts, }) {
|
|
51996
|
+
const segmentedMetrics = measuredAttempts > 0
|
|
51997
|
+
? ` hostWriteTotal=${(hostWriteElapsedMs / 1000).toFixed(2)}s responseWaitTotal=${(responseWaitElapsedMs / 1000).toFixed(2)}s measuredAttempts=${measuredAttempts}`
|
|
51998
|
+
: '';
|
|
51999
|
+
Log$7.log(`[FileWrite] metrics transport=${transport} status=${status} path=${path} bytes=${transferredBytes}/${totalBytes} elapsed=${(elapsedMs / 1000).toFixed(2)}s speed=${formatFileTransferRate(rateBytesPerSecond)} KiB/s${segmentedMetrics}`);
|
|
52000
|
+
}
|
|
52001
|
+
function isProtocolV2ResponseTimeout(error) {
|
|
52002
|
+
var _a, _b;
|
|
52003
|
+
if (!error || typeof error !== 'object')
|
|
52004
|
+
return false;
|
|
52005
|
+
const candidate = error;
|
|
52006
|
+
const code = (_a = candidate.errorCode) !== null && _a !== void 0 ? _a : candidate.code;
|
|
52007
|
+
return (code === hdShared.HardwareErrorCode.BleTimeoutError ||
|
|
52008
|
+
code === 'response-timeout' ||
|
|
52009
|
+
/(?:BLE|Lowlevel|Protocol V2) response timeout/i.test((_b = candidate.message) !== null && _b !== void 0 ? _b : ''));
|
|
52010
|
+
}
|
|
52011
|
+
function getProtocolV2FileChunkLimit() {
|
|
52012
|
+
const env = DataManager.getSettings('env');
|
|
52013
|
+
return env && DataManager.isBleConnect(env)
|
|
52014
|
+
? hdTransport.PROTOCOL_V2_BLE_FILE_CHUNK_SIZE
|
|
52015
|
+
: hdTransport.PROTOCOL_V2_WEBUSB_FILE_CHUNK_SIZE;
|
|
52016
|
+
}
|
|
52017
|
+
function dataToUint8Array(data) {
|
|
52018
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52019
|
+
if (typeof data === 'string')
|
|
52020
|
+
return new TextEncoder().encode(data);
|
|
52021
|
+
if (data instanceof ArrayBuffer)
|
|
52022
|
+
return new Uint8Array(data);
|
|
52023
|
+
if (ArrayBuffer.isView(data)) {
|
|
52024
|
+
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
52025
|
+
}
|
|
52026
|
+
if (typeof Blob !== 'undefined' && data instanceof Blob) {
|
|
52027
|
+
return new Uint8Array(yield data.arrayBuffer());
|
|
52028
|
+
}
|
|
52029
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallMethodInvalidParameter, 'Unsupported FilesystemFileWrite data');
|
|
52030
|
+
});
|
|
52031
|
+
}
|
|
52032
|
+
function normalizeChunkSize(value, maxChunkSize) {
|
|
52033
|
+
const numeric = Number(value);
|
|
52034
|
+
if (!Number.isFinite(numeric) || numeric <= 0)
|
|
52035
|
+
return maxChunkSize;
|
|
52036
|
+
return Math.min(Math.max(Math.floor(numeric), MIN_FILE_CHUNK_SIZE), maxChunkSize);
|
|
52037
|
+
}
|
|
52038
|
+
function getDeviceTransferProgress(before, after, total) {
|
|
52039
|
+
if (!Number.isFinite(total) || total <= 0)
|
|
52040
|
+
return 100;
|
|
52041
|
+
if (before <= 0 && after < total)
|
|
52042
|
+
return 0;
|
|
52043
|
+
if (after >= total)
|
|
52044
|
+
return 100;
|
|
52045
|
+
return Math.min(Math.max(Math.ceil((after / total) * 100), 1), 99);
|
|
52046
|
+
}
|
|
52047
|
+
function getConfirmedProgress(processed, total, written, length) {
|
|
52048
|
+
if (Number.isFinite(processed) && Number.isFinite(total) && total > 0) {
|
|
52049
|
+
if (processed >= total)
|
|
52050
|
+
return 100;
|
|
52051
|
+
return Math.min(Math.max(Math.floor((processed / total) * 100), 0), 99);
|
|
52052
|
+
}
|
|
52053
|
+
if (length > 0)
|
|
52054
|
+
return written >= length ? 100 : Math.floor((written / length) * 100);
|
|
52055
|
+
return 100;
|
|
52056
|
+
}
|
|
52057
|
+
function writeProtocolV2File(options) {
|
|
52058
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
52059
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52060
|
+
(_a = options.throwIfAborted) === null || _a === void 0 ? void 0 : _a.call(options);
|
|
52061
|
+
const data = yield dataToUint8Array(options.data);
|
|
52062
|
+
const dataLength = data.byteLength;
|
|
52063
|
+
const startOffset = Number.isFinite(options.offset) && Number(options.offset) > 0 ? Number(options.offset) : 0;
|
|
52064
|
+
const totalSize = Number.isFinite(options.totalSize) && Number(options.totalSize) > 0
|
|
52065
|
+
? Number(options.totalSize)
|
|
52066
|
+
: startOffset + dataLength;
|
|
52067
|
+
if (totalSize < startOffset + dataLength) {
|
|
52068
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `FilesystemFileWrite totalSize ${totalSize} is smaller than offset + data length ${startOffset + dataLength}`);
|
|
52069
|
+
}
|
|
52070
|
+
const defaultChunkSizeLimit = getProtocolV2FileChunkLimit();
|
|
52071
|
+
const configuredChunkSizeLimit = Number(options.chunkSizeLimit);
|
|
52072
|
+
const chunkSizeLimit = Number.isFinite(configuredChunkSizeLimit) && configuredChunkSizeLimit > 0
|
|
52073
|
+
? Math.floor(configuredChunkSizeLimit)
|
|
52074
|
+
: defaultChunkSizeLimit;
|
|
52075
|
+
const chunkSize = normalizeChunkSize((_b = options.chunkSize) !== null && _b !== void 0 ? _b : options.chunkLen, chunkSizeLimit);
|
|
52076
|
+
let written = 0;
|
|
52077
|
+
let chunks = 0;
|
|
52078
|
+
let lastMessage;
|
|
52079
|
+
const startTime = Date.now();
|
|
52080
|
+
let rateWindowStartedAt = startTime;
|
|
52081
|
+
let rateWindowStartedBytes = 0;
|
|
52082
|
+
let rateBytesPerSecond;
|
|
52083
|
+
let lastConfirmedAt = startTime;
|
|
52084
|
+
let logWindowStartedAt = startTime;
|
|
52085
|
+
let logWindowStartedBytes = 0;
|
|
52086
|
+
let hostWriteElapsedMs = 0;
|
|
52087
|
+
let responseWaitElapsedMs = 0;
|
|
52088
|
+
let measuredAttempts = 0;
|
|
52089
|
+
const transport = getFileTransferTransport();
|
|
52090
|
+
Log$7.log(`[FileWrite] started transport=${transport} path=${options.path} bytes=${dataLength} offset=${startOffset} chunk=${chunkSize}`);
|
|
52091
|
+
try {
|
|
52092
|
+
while (written < dataLength) {
|
|
52093
|
+
(_c = options.throwIfAborted) === null || _c === void 0 ? void 0 : _c.call(options);
|
|
52094
|
+
const chunk = data.slice(written, Math.min(written + chunkSize, dataLength));
|
|
52095
|
+
const offset = startOffset + written;
|
|
52096
|
+
const progress = (_f = (_d = options.uiPercentage) !== null && _d !== void 0 ? _d : (_e = options.getUiPercentage) === null || _e === void 0 ? void 0 : _e.call(options, {
|
|
52097
|
+
offset,
|
|
52098
|
+
chunkLength: chunk.byteLength,
|
|
52099
|
+
totalSize,
|
|
52100
|
+
})) !== null && _f !== void 0 ? _f : getDeviceTransferProgress(offset, offset + chunk.byteLength, totalSize);
|
|
52101
|
+
const request = {
|
|
52102
|
+
file: { path: options.path, offset, total_size: totalSize, data: chunk },
|
|
52103
|
+
overwrite: chunks === 0 ? (_g = options.overwrite) !== null && _g !== void 0 ? _g : false : false,
|
|
52104
|
+
append: (_h = options.append) !== null && _h !== void 0 ? _h : false,
|
|
52105
|
+
ui_percentage: progress,
|
|
52106
|
+
};
|
|
52107
|
+
const maxChunkRetries = Math.max(Math.floor((_j = options.maxChunkRetries) !== null && _j !== void 0 ? _j : 0), 0);
|
|
52108
|
+
let retryCount = 0;
|
|
52109
|
+
let response;
|
|
52110
|
+
let isWritePending = true;
|
|
52111
|
+
while (isWritePending) {
|
|
52112
|
+
let currentHostWriteElapsedMs;
|
|
52113
|
+
let responseWaitStartedAt;
|
|
52114
|
+
try {
|
|
52115
|
+
const callOptions = options.writeWithResponse === undefined
|
|
52116
|
+
? {
|
|
52117
|
+
timeoutMs: options.timeoutMs,
|
|
52118
|
+
onWriteCompleted: ({ elapsedMs }) => {
|
|
52119
|
+
currentHostWriteElapsedMs = elapsedMs;
|
|
52120
|
+
responseWaitStartedAt = Date.now();
|
|
52121
|
+
},
|
|
52122
|
+
}
|
|
52123
|
+
: Object.assign(Object.assign({}, (options.timeoutMs === undefined ? {} : { timeoutMs: options.timeoutMs })), { writeWithResponse: options.writeWithResponse, onWriteCompleted: ({ elapsedMs }) => {
|
|
52124
|
+
currentHostWriteElapsedMs = elapsedMs;
|
|
52125
|
+
responseWaitStartedAt = Date.now();
|
|
52126
|
+
} });
|
|
52127
|
+
response = yield options.commands.typedCall('FilesystemFileWrite', 'FilesystemFile', request, callOptions);
|
|
52128
|
+
isWritePending = false;
|
|
52129
|
+
}
|
|
52130
|
+
catch (error) {
|
|
52131
|
+
if (retryCount >= maxChunkRetries || !isProtocolV2ResponseTimeout(error))
|
|
52132
|
+
throw error;
|
|
52133
|
+
retryCount += 1;
|
|
52134
|
+
(_k = options.throwIfAborted) === null || _k === void 0 ? void 0 : _k.call(options);
|
|
52135
|
+
}
|
|
52136
|
+
finally {
|
|
52137
|
+
if (currentHostWriteElapsedMs !== undefined && responseWaitStartedAt !== undefined) {
|
|
52138
|
+
hostWriteElapsedMs += currentHostWriteElapsedMs;
|
|
52139
|
+
responseWaitElapsedMs += Math.max(Date.now() - responseWaitStartedAt, 0);
|
|
52140
|
+
measuredAttempts += 1;
|
|
52141
|
+
}
|
|
52142
|
+
}
|
|
52143
|
+
}
|
|
52144
|
+
if (!response) {
|
|
52145
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'FilesystemFileWrite completed without a response');
|
|
52146
|
+
}
|
|
52147
|
+
const responseType = response.type;
|
|
52148
|
+
if (responseType && responseType !== 'FilesystemFile') {
|
|
52149
|
+
const responseError = (_l = response.message) === null || _l === void 0 ? void 0 : _l.error;
|
|
52150
|
+
if (typeof responseError === 'string' && responseError.includes(SESSION_ERROR$1)) {
|
|
52151
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, SESSION_ERROR$1);
|
|
52152
|
+
}
|
|
52153
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `FilesystemFileWrite received unexpected response ${responseType}`);
|
|
52154
|
+
}
|
|
52155
|
+
(_m = options.throwIfAborted) === null || _m === void 0 ? void 0 : _m.call(options);
|
|
52156
|
+
lastMessage = response.message;
|
|
52157
|
+
const rawProcessedByte = (_o = response.message) === null || _o === void 0 ? void 0 : _o.processed_byte;
|
|
52158
|
+
const processedByte = Number(rawProcessedByte);
|
|
52159
|
+
if (rawProcessedByte !== undefined &&
|
|
52160
|
+
(!Number.isFinite(processedByte) ||
|
|
52161
|
+
processedByte <= offset ||
|
|
52162
|
+
processedByte > offset + chunk.byteLength)) {
|
|
52163
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `FilesystemFileWrite invalid processed_byte ${processedByte}`);
|
|
52164
|
+
}
|
|
52165
|
+
written =
|
|
52166
|
+
rawProcessedByte === undefined ? written + chunk.byteLength : processedByte - startOffset;
|
|
52167
|
+
chunks += 1;
|
|
52168
|
+
const now = Date.now();
|
|
52169
|
+
lastConfirmedAt = now;
|
|
52170
|
+
const elapsedMs = now - startTime;
|
|
52171
|
+
const transferredBytes = Math.min(written, dataLength);
|
|
52172
|
+
const rateWindowElapsedMs = now - rateWindowStartedAt;
|
|
52173
|
+
if (rateWindowElapsedMs >= FILE_TRANSFER_RATE_WINDOW_MS) {
|
|
52174
|
+
const rateWindowBytes = Math.max(transferredBytes - rateWindowStartedBytes, 0);
|
|
52175
|
+
rateBytesPerSecond = Math.round((rateWindowBytes / rateWindowElapsedMs) * 1000);
|
|
52176
|
+
rateWindowStartedAt = now;
|
|
52177
|
+
rateWindowStartedBytes = transferredBytes;
|
|
52178
|
+
}
|
|
52179
|
+
else if (rateBytesPerSecond === undefined && elapsedMs > 0) {
|
|
52180
|
+
rateBytesPerSecond = Math.round((transferredBytes / elapsedMs) * 1000);
|
|
52181
|
+
}
|
|
52182
|
+
(_p = options.onProgress) === null || _p === void 0 ? void 0 : _p.call(options, {
|
|
52183
|
+
progress: getConfirmedProgress(startOffset + written, totalSize, written, dataLength),
|
|
52184
|
+
transferredBytes,
|
|
52185
|
+
totalBytes: dataLength,
|
|
52186
|
+
rateBytesPerSecond,
|
|
52187
|
+
elapsedMs,
|
|
52188
|
+
});
|
|
52189
|
+
const logWindowElapsedMs = now - logWindowStartedAt;
|
|
52190
|
+
if (logWindowElapsedMs >= FILE_TRANSFER_LOG_INTERVAL_MS && transferredBytes < dataLength) {
|
|
52191
|
+
const logWindowBytes = Math.max(transferredBytes - logWindowStartedBytes, 0);
|
|
52192
|
+
logFileTransferMetrics({
|
|
52193
|
+
transport,
|
|
52194
|
+
status: 'progress',
|
|
52195
|
+
path: options.path,
|
|
52196
|
+
transferredBytes,
|
|
52197
|
+
totalBytes: dataLength,
|
|
52198
|
+
elapsedMs,
|
|
52199
|
+
rateBytesPerSecond: getAverageFileTransferRate(logWindowBytes, logWindowElapsedMs),
|
|
52200
|
+
hostWriteElapsedMs,
|
|
52201
|
+
responseWaitElapsedMs,
|
|
52202
|
+
measuredAttempts,
|
|
52203
|
+
});
|
|
52204
|
+
logWindowStartedAt = now;
|
|
52205
|
+
logWindowStartedBytes = transferredBytes;
|
|
52206
|
+
}
|
|
52207
|
+
if (options.paceMs && options.paceMs > 0) {
|
|
52208
|
+
yield new Promise(resolve => {
|
|
52209
|
+
setTimeout(resolve, options.paceMs);
|
|
52210
|
+
});
|
|
52211
|
+
}
|
|
52212
|
+
}
|
|
52213
|
+
}
|
|
52214
|
+
catch (error) {
|
|
52215
|
+
const now = Date.now();
|
|
52216
|
+
const elapsedMs = Math.max(now - startTime, 0);
|
|
52217
|
+
const logWindowElapsedMs = Math.max(now - logWindowStartedAt, 0);
|
|
52218
|
+
const logWindowBytes = Math.max(written - logWindowStartedBytes, 0);
|
|
52219
|
+
logFileTransferMetrics({
|
|
52220
|
+
transport,
|
|
52221
|
+
status: 'failed',
|
|
52222
|
+
path: options.path,
|
|
52223
|
+
transferredBytes: written,
|
|
52224
|
+
totalBytes: dataLength,
|
|
52225
|
+
elapsedMs,
|
|
52226
|
+
rateBytesPerSecond: getAverageFileTransferRate(logWindowBytes, logWindowElapsedMs),
|
|
52227
|
+
hostWriteElapsedMs,
|
|
52228
|
+
responseWaitElapsedMs,
|
|
52229
|
+
measuredAttempts,
|
|
52230
|
+
});
|
|
52231
|
+
throw error;
|
|
52232
|
+
}
|
|
52233
|
+
const elapsedMs = Math.max(lastConfirmedAt - startTime, 0);
|
|
52234
|
+
const logWindowElapsedMs = Math.max(lastConfirmedAt - logWindowStartedAt, 0);
|
|
52235
|
+
const logWindowBytes = Math.max(written - logWindowStartedBytes, 0);
|
|
52236
|
+
logFileTransferMetrics({
|
|
52237
|
+
transport,
|
|
52238
|
+
status: 'completed',
|
|
52239
|
+
path: options.path,
|
|
52240
|
+
transferredBytes: written,
|
|
52241
|
+
totalBytes: dataLength,
|
|
52242
|
+
elapsedMs,
|
|
52243
|
+
rateBytesPerSecond: getAverageFileTransferRate(logWindowBytes, logWindowElapsedMs),
|
|
52244
|
+
hostWriteElapsedMs,
|
|
52245
|
+
responseWaitElapsedMs,
|
|
52246
|
+
measuredAttempts,
|
|
52247
|
+
});
|
|
52248
|
+
return Object.assign(Object.assign({}, lastMessage), { path: options.path, offset: startOffset, total_size: totalSize, processed_byte: startOffset + written, chunks });
|
|
52249
|
+
});
|
|
52250
|
+
}
|
|
52251
|
+
|
|
52252
|
+
const Log$6 = getLogger(exports.LoggerNames.Method);
|
|
52253
|
+
const SESSION_ERROR = 'session not found';
|
|
51708
52254
|
const PROTOCOL_V2_BOOTLOADER_RECONNECT_TIMEOUT = 90 * 1000;
|
|
51709
52255
|
const PROTOCOL_V2_FINAL_RECONNECT_TIMEOUT = 3 * 60 * 1000;
|
|
51710
52256
|
const PROTOCOL_V2_SHORT_RESPONSE_TIMEOUT = 5 * 1000;
|
|
51711
52257
|
const PROTOCOL_V2_FIRMWARE_STATUS_RESPONSE_TIMEOUT = 15 * 1000;
|
|
51712
52258
|
const PROTOCOL_V2_INSTALL_TIMEOUT = 5 * 60 * 1000;
|
|
51713
52259
|
const PROTOCOL_V2_INSTALL_STATUS_INITIAL_DELAY = 1000;
|
|
52260
|
+
const PROTOCOL_V2_INSTALL_FINISHED_AFTER_DISCONNECT_POLLS = 4;
|
|
51714
52261
|
const PROTOCOL_V2_TARGET_STATUS_PENDING = 0;
|
|
51715
52262
|
const PROTOCOL_V2_TARGET_STATUS_IN_PROGRESS = 1;
|
|
51716
52263
|
const PROTOCOL_V2_TARGET_STATUS_FINISHED = 2;
|
|
@@ -51864,13 +52411,21 @@ const isProtocolV2FirmwareStatusEndpointUnavailable = (error) => {
|
|
|
51864
52411
|
message.includes('message handler not found') ||
|
|
51865
52412
|
message.includes('unsupported message'));
|
|
51866
52413
|
};
|
|
52414
|
+
const isProtocolV2InstallResponseTimeout = (error) => {
|
|
52415
|
+
if (!error || typeof error !== 'object')
|
|
52416
|
+
return false;
|
|
52417
|
+
const { code } = error;
|
|
52418
|
+
return (code === 'response-timeout' ||
|
|
52419
|
+
/\bresponse timeout\b/i.test(getProtocolV2UnknownErrorText(error)));
|
|
52420
|
+
};
|
|
51867
52421
|
const isProtocolV2TerminalInstallStatusError = (error) => {
|
|
51868
52422
|
var _a;
|
|
51869
|
-
return
|
|
51870
|
-
(error
|
|
51871
|
-
error.errorCode === hdShared.HardwareErrorCode.
|
|
51872
|
-
|
|
51873
|
-
|
|
52423
|
+
return hdShared.isBleStaleBondHardwareError(error) ||
|
|
52424
|
+
(error instanceof hdShared.HardwareError &&
|
|
52425
|
+
(error.errorCode === hdShared.HardwareErrorCode.ActionCancelled ||
|
|
52426
|
+
error.errorCode === hdShared.HardwareErrorCode.FirmwareError ||
|
|
52427
|
+
error.errorCode === hdShared.HardwareErrorCode.FirmwareVerificationFailed ||
|
|
52428
|
+
((_a = error.params) === null || _a === void 0 ? void 0 : _a.firmwareUpdateCode) === PROTOCOL_V2_INSTALL_STATUS_CONFLICT_CODE));
|
|
51874
52429
|
};
|
|
51875
52430
|
const isProtocolV2TargetStatusFinished = (status) => normalizeProtocolV2TargetStatus(status) === PROTOCOL_V2_TARGET_STATUS_FINISHED;
|
|
51876
52431
|
const isProtocolV2TargetStatusInProgress = (status) => normalizeProtocolV2TargetStatus(status) === PROTOCOL_V2_TARGET_STATUS_PENDING ||
|
|
@@ -51894,6 +52449,14 @@ const normalizeProtocolV2TargetStatus = (status) => {
|
|
|
51894
52449
|
}
|
|
51895
52450
|
return undefined;
|
|
51896
52451
|
};
|
|
52452
|
+
const PROTOCOL_V2_INSTALL_PHASE_BY_DECODED_VALUE = new Map([
|
|
52453
|
+
[0, 'prepare'],
|
|
52454
|
+
[1, 'install'],
|
|
52455
|
+
[2, 'verify'],
|
|
52456
|
+
['FW_MGMT_UPDATER_PHASE_PREPARE', 'prepare'],
|
|
52457
|
+
['FW_MGMT_UPDATER_PHASE_INSTALL', 'install'],
|
|
52458
|
+
['FW_MGMT_UPDATER_PHASE_VERIFY', 'verify'],
|
|
52459
|
+
]);
|
|
51897
52460
|
const normalizeProtocolV2Hex = (value) => value === null || value === void 0 ? void 0 : value.replace(/^0x/i, '').toLowerCase();
|
|
51898
52461
|
const versionArrayToNumber = (version) => {
|
|
51899
52462
|
if (!version)
|
|
@@ -51949,6 +52512,10 @@ const toProtocolV2FiniteNumber = (value) => {
|
|
|
51949
52512
|
}
|
|
51950
52513
|
return undefined;
|
|
51951
52514
|
};
|
|
52515
|
+
const normalizeProtocolV2ProgressPercent = (value) => {
|
|
52516
|
+
const progress = toProtocolV2FiniteNumber(value);
|
|
52517
|
+
return progress === undefined ? undefined : Math.min(100, Math.max(0, progress));
|
|
52518
|
+
};
|
|
51952
52519
|
const isProtocolV2FirmwareFingerprintValid = (binary, fingerprint) => {
|
|
51953
52520
|
const expectedFingerprint = normalizeProtocolV2Hex(fingerprint);
|
|
51954
52521
|
if (!expectedFingerprint)
|
|
@@ -51977,6 +52544,9 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
51977
52544
|
this.protocolV2CompletedTargetVersions = new Map();
|
|
51978
52545
|
this.protocolV2CompletedTargetIds = new Set();
|
|
51979
52546
|
this.protocolV2InstallBaselineVersions = new Map();
|
|
52547
|
+
this.protocolV2InstallNeedsReconnect = false;
|
|
52548
|
+
this.protocolV2InstallDisconnectObserved = false;
|
|
52549
|
+
this.protocolV2InstallTerminalSuccessObserved = false;
|
|
51980
52550
|
this.protocolV2LastTransferProgressAt = 0;
|
|
51981
52551
|
}
|
|
51982
52552
|
getSupportedProtocols() {
|
|
@@ -52147,7 +52717,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52147
52717
|
}
|
|
52148
52718
|
run() {
|
|
52149
52719
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52150
|
-
Log$
|
|
52720
|
+
Log$6.debug('FirmwareUpdateV4 strategy: Protocol V2');
|
|
52151
52721
|
return this.runProtocolV2();
|
|
52152
52722
|
});
|
|
52153
52723
|
}
|
|
@@ -52579,7 +53149,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52579
53149
|
if (!observedVersion) {
|
|
52580
53150
|
const hasCompleteTargetEvidence = targetId !== undefined && this.protocolV2CompletedTargetIds.has(targetId);
|
|
52581
53151
|
if (hasCompleteTargetEvidence) {
|
|
52582
|
-
Log$
|
|
53152
|
+
Log$6.warn(`Protocol V2 target ${target} has no observable final version; install completion is authoritative`);
|
|
52583
53153
|
}
|
|
52584
53154
|
else {
|
|
52585
53155
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FirmwareVerificationFailed, `Protocol V2 target ${target} has no observable final version after status fallback`);
|
|
@@ -52942,7 +53512,10 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52942
53512
|
return true;
|
|
52943
53513
|
}
|
|
52944
53514
|
catch (error) {
|
|
52945
|
-
|
|
53515
|
+
if (hdShared.isBleStaleBondHardwareError(error)) {
|
|
53516
|
+
throw error;
|
|
53517
|
+
}
|
|
53518
|
+
Log$6.log(`[FirmwareUpdateV4] RESC bundle ${bundle.name} header check failed: `, error);
|
|
52946
53519
|
return false;
|
|
52947
53520
|
}
|
|
52948
53521
|
});
|
|
@@ -52982,7 +53555,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52982
53555
|
if (error instanceof hdShared.HardwareError) {
|
|
52983
53556
|
throw error;
|
|
52984
53557
|
}
|
|
52985
|
-
Log$
|
|
53558
|
+
Log$6.log('Protocol V2 auto go to bootloader mode failed: ', error);
|
|
52986
53559
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure);
|
|
52987
53560
|
}
|
|
52988
53561
|
});
|
|
@@ -52990,12 +53563,12 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
52990
53563
|
enterProtocolV2BootloaderMode() {
|
|
52991
53564
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52992
53565
|
if (this.isProtocolV2RomloaderMode()) {
|
|
52993
|
-
Log$
|
|
53566
|
+
Log$6.debug('Protocol V2 device is in romloader mode; start firmware update directly');
|
|
52994
53567
|
this.protocolV2ExecutionInLoader = true;
|
|
52995
53568
|
return false;
|
|
52996
53569
|
}
|
|
52997
53570
|
if (this.isProtocolV2BootloaderMode()) {
|
|
52998
|
-
Log$
|
|
53571
|
+
Log$6.debug('Protocol V2 device is already in bootloader mode, skip reboot');
|
|
52999
53572
|
this.protocolV2ExecutionInLoader = true;
|
|
53000
53573
|
this.postTipMessage(exports.FirmwareUpdateTipMessage.GoToBootloaderSuccess);
|
|
53001
53574
|
return false;
|
|
@@ -53026,12 +53599,12 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53026
53599
|
lastError = new Error('Protocol V2 device is reachable but is not in bootloader mode');
|
|
53027
53600
|
}
|
|
53028
53601
|
catch (error) {
|
|
53029
|
-
if (this.isProtocolV2ReconnectIdentityError(error)) {
|
|
53602
|
+
if (hdShared.isBleStaleBondHardwareError(error) || this.isProtocolV2ReconnectIdentityError(error)) {
|
|
53030
53603
|
throw error;
|
|
53031
53604
|
}
|
|
53032
53605
|
shouldReconnect = true;
|
|
53033
53606
|
lastError = error;
|
|
53034
|
-
Log$
|
|
53607
|
+
Log$6.log('Protocol V2 bootloader mode not ready, polling reconnect: ', error);
|
|
53035
53608
|
}
|
|
53036
53609
|
yield hdShared.wait(retryInterval);
|
|
53037
53610
|
}
|
|
@@ -53127,7 +53700,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53127
53700
|
const resourcesToSync = [];
|
|
53128
53701
|
for (const resource of resourceSources) {
|
|
53129
53702
|
if (yield this.isProtocolV2ResourceBundleUpToDate(resource)) {
|
|
53130
|
-
Log$
|
|
53703
|
+
Log$6.log(`[FirmwareUpdateV4] skip RESC bundle ${resource.name}; already up to date`);
|
|
53131
53704
|
}
|
|
53132
53705
|
else {
|
|
53133
53706
|
resourcesToSync.push(resource);
|
|
@@ -53229,6 +53802,9 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53229
53802
|
return processedSize + source.size;
|
|
53230
53803
|
}
|
|
53231
53804
|
catch (error) {
|
|
53805
|
+
if (hdShared.isBleStaleBondHardwareError(error)) {
|
|
53806
|
+
throw error;
|
|
53807
|
+
}
|
|
53232
53808
|
lastError = error;
|
|
53233
53809
|
if (attempt < PROTOCOL_V2_FILE_TRANSFER_RETRY_COUNT) {
|
|
53234
53810
|
yield this.recoverProtocolV2FileTransfer();
|
|
@@ -53252,12 +53828,25 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53252
53828
|
}
|
|
53253
53829
|
});
|
|
53254
53830
|
}
|
|
53255
|
-
|
|
53256
|
-
|
|
53831
|
+
collectProtocolV2LiveTargetIds(statusTargets, expectedTargetIds, liveTargetIds) {
|
|
53832
|
+
statusTargets.forEach(target => {
|
|
53833
|
+
const targetId = normalizeProtocolV2TargetId(target.target_id);
|
|
53834
|
+
if (targetId !== undefined &&
|
|
53835
|
+
expectedTargetIds.has(targetId) &&
|
|
53836
|
+
isProtocolV2TargetStatusInProgress(target.status)) {
|
|
53837
|
+
liveTargetIds.add(targetId);
|
|
53838
|
+
}
|
|
53839
|
+
});
|
|
53840
|
+
}
|
|
53841
|
+
assertProtocolV2TargetStatus(statusTargets, expectedTargetIds, expectedPaths, liveTargetIds) {
|
|
53842
|
+
const resolvedExpectedPaths = expectedPaths !== null && expectedPaths !== void 0 ? expectedPaths : new Map();
|
|
53843
|
+
Log$6.log(`[FirmwareUpdateV4] DeviceFirmwareUpdateStatus records=${JSON.stringify(statusTargets)}`);
|
|
53257
53844
|
const failedTarget = statusTargets.find(target => {
|
|
53258
53845
|
var _a;
|
|
53259
|
-
|
|
53260
|
-
|
|
53846
|
+
const targetId = (_a = normalizeProtocolV2TargetId(target.target_id)) !== null && _a !== void 0 ? _a : -1;
|
|
53847
|
+
return (expectedTargetIds.has(targetId) &&
|
|
53848
|
+
isProtocolV2TargetStatusFailed(target.status) &&
|
|
53849
|
+
(!liveTargetIds || liveTargetIds.has(targetId)));
|
|
53261
53850
|
});
|
|
53262
53851
|
if (failedTarget) {
|
|
53263
53852
|
const failedTargetDetails = JSON.stringify({
|
|
@@ -53266,26 +53855,51 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53266
53855
|
payloadVersion: failedTarget.payload_version,
|
|
53267
53856
|
path: failedTarget.path,
|
|
53268
53857
|
});
|
|
53269
|
-
Log$
|
|
53858
|
+
Log$6.error(`[FirmwareUpdateV4] firmware install failed target=${failedTargetDetails}`);
|
|
53270
53859
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FirmwareError, 'Protocol V2 firmware install failed', {
|
|
53271
53860
|
firmwareUpdateCode: PROTOCOL_V2_INSTALL_FAILED_CODE,
|
|
53272
53861
|
});
|
|
53273
53862
|
}
|
|
53863
|
+
if (liveTargetIds) {
|
|
53864
|
+
const staleFailedTargets = statusTargets.filter(target => {
|
|
53865
|
+
var _a;
|
|
53866
|
+
const targetId = (_a = normalizeProtocolV2TargetId(target.target_id)) !== null && _a !== void 0 ? _a : -1;
|
|
53867
|
+
return (expectedTargetIds.has(targetId) &&
|
|
53868
|
+
isProtocolV2TargetStatusFailed(target.status) &&
|
|
53869
|
+
!liveTargetIds.has(targetId));
|
|
53870
|
+
});
|
|
53871
|
+
if (staleFailedTargets.length > 0) {
|
|
53872
|
+
Log$6.log(`[FirmwareUpdateV4] ignoring stale failed firmware status until those targets start: ${JSON.stringify(staleFailedTargets.map(target => ({
|
|
53873
|
+
targetId: target.target_id,
|
|
53874
|
+
status: target.status,
|
|
53875
|
+
path: target.path,
|
|
53876
|
+
})))}`);
|
|
53877
|
+
}
|
|
53878
|
+
}
|
|
53274
53879
|
const matchingTargets = statusTargets.filter(target => { var _a; return expectedTargetIds.has((_a = normalizeProtocolV2TargetId(target.target_id)) !== null && _a !== void 0 ? _a : -1); });
|
|
53275
53880
|
const seenTargetIds = new Set();
|
|
53276
53881
|
for (const target of matchingTargets) {
|
|
53277
53882
|
const targetId = normalizeProtocolV2TargetId(target.target_id);
|
|
53883
|
+
const pathConflictsWithCurrentInstall = targetId !== undefined &&
|
|
53884
|
+
Boolean(target.path) &&
|
|
53885
|
+
Boolean(resolvedExpectedPaths.get(targetId)) &&
|
|
53886
|
+
target.path !== resolvedExpectedPaths.get(targetId) &&
|
|
53887
|
+
(!liveTargetIds || liveTargetIds.has(targetId));
|
|
53278
53888
|
if (targetId === undefined ||
|
|
53279
53889
|
seenTargetIds.has(targetId) ||
|
|
53280
|
-
|
|
53281
|
-
Log$
|
|
53890
|
+
pathConflictsWithCurrentInstall) {
|
|
53891
|
+
Log$6.error(`[FirmwareUpdateV4] install status conflicts with target=${target.target_id}`);
|
|
53282
53892
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FirmwareError, 'Protocol V2 firmware install status conflict', {
|
|
53283
53893
|
firmwareUpdateCode: PROTOCOL_V2_INSTALL_STATUS_CONFLICT_CODE,
|
|
53284
53894
|
});
|
|
53285
53895
|
}
|
|
53286
53896
|
seenTargetIds.add(targetId);
|
|
53287
53897
|
}
|
|
53288
|
-
const completedTargets = matchingTargets.filter(target =>
|
|
53898
|
+
const completedTargets = matchingTargets.filter(target => {
|
|
53899
|
+
const targetId = normalizeProtocolV2TargetId(target.target_id);
|
|
53900
|
+
return (isProtocolV2TargetStatusFinished(target.status) &&
|
|
53901
|
+
(!liveTargetIds || (targetId !== undefined && liveTargetIds.has(targetId))));
|
|
53902
|
+
});
|
|
53289
53903
|
const completedTargetIds = new Set();
|
|
53290
53904
|
completedTargets.forEach(target => {
|
|
53291
53905
|
const targetId = normalizeProtocolV2TargetId(target.target_id);
|
|
@@ -53315,10 +53929,41 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53315
53929
|
return true;
|
|
53316
53930
|
}
|
|
53317
53931
|
if (expectedTargetIds.size > 0 && matchingTargets.length > 0) {
|
|
53318
|
-
|
|
53932
|
+
let detailedProgress = completedTargetIds.size * 100;
|
|
53933
|
+
let installProgressMetadata;
|
|
53934
|
+
let hasInProgressTarget = false;
|
|
53935
|
+
matchingTargets.forEach(target => {
|
|
53936
|
+
var _a, _b;
|
|
53937
|
+
const targetId = normalizeProtocolV2TargetId(target.target_id);
|
|
53938
|
+
if (targetId === undefined ||
|
|
53939
|
+
completedTargetIds.has(targetId) ||
|
|
53940
|
+
!isProtocolV2TargetStatusInProgress(target.status) ||
|
|
53941
|
+
(liveTargetIds && !liveTargetIds.has(targetId))) {
|
|
53942
|
+
return;
|
|
53943
|
+
}
|
|
53944
|
+
hasInProgressTarget = true;
|
|
53945
|
+
detailedProgress += (_a = normalizeProtocolV2ProgressPercent(target.progress_percent)) !== null && _a !== void 0 ? _a : 0;
|
|
53946
|
+
const installPhase = target.phase_info
|
|
53947
|
+
? PROTOCOL_V2_INSTALL_PHASE_BY_DECODED_VALUE.get(target.phase_info.phase)
|
|
53948
|
+
: undefined;
|
|
53949
|
+
const installPhaseProgress = normalizeProtocolV2ProgressPercent((_b = target.phase_info) === null || _b === void 0 ? void 0 : _b.progress_percent);
|
|
53950
|
+
if (installPhase && installPhaseProgress !== undefined && !installProgressMetadata) {
|
|
53951
|
+
installProgressMetadata = {
|
|
53952
|
+
installTargetId: targetId,
|
|
53953
|
+
installPhase,
|
|
53954
|
+
installPhaseProgress,
|
|
53955
|
+
};
|
|
53956
|
+
}
|
|
53957
|
+
});
|
|
53319
53958
|
const completedProgress = Math.floor((completedTargetIds.size / expectedTargetIds.size) * 100);
|
|
53320
|
-
const
|
|
53321
|
-
|
|
53959
|
+
const reportedProgress = Math.floor(detailedProgress / expectedTargetIds.size);
|
|
53960
|
+
const progress = Math.min(99, Math.max(completedProgress, reportedProgress, hasInProgressTarget ? 1 : 0));
|
|
53961
|
+
if (installProgressMetadata) {
|
|
53962
|
+
this.postProgressMessage(progress, 'installingFirmware', installProgressMetadata);
|
|
53963
|
+
}
|
|
53964
|
+
else {
|
|
53965
|
+
this.postProgressMessage(progress, 'installingFirmware');
|
|
53966
|
+
}
|
|
53322
53967
|
}
|
|
53323
53968
|
return false;
|
|
53324
53969
|
}
|
|
@@ -53371,43 +54016,65 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53371
54016
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53372
54017
|
const expectedTargetIds = new Set(targets.map(target => target.target_id));
|
|
53373
54018
|
const expectedPaths = new Map(targets.map(target => [target.target_id, target.path]));
|
|
54019
|
+
const isBleInstall = this.isBleReconnect();
|
|
53374
54020
|
const startTime = Date.now();
|
|
53375
54021
|
let lastError;
|
|
53376
|
-
let shouldReconnect =
|
|
54022
|
+
let shouldReconnect = this.protocolV2InstallNeedsReconnect;
|
|
54023
|
+
this.protocolV2InstallNeedsReconnect = false;
|
|
53377
54024
|
let deviceInfo;
|
|
53378
|
-
let
|
|
54025
|
+
let bleInstallLinkReady = false;
|
|
54026
|
+
let installStatusDisconnectObserved = isBleInstall && this.protocolV2InstallDisconnectObserved;
|
|
54027
|
+
this.protocolV2InstallDisconnectObserved = false;
|
|
54028
|
+
let installReconnectObserved = false;
|
|
54029
|
+
let finishedStatusSnapshotKey;
|
|
54030
|
+
let finishedStatusSnapshotPolls = 0;
|
|
54031
|
+
let fastFinishedInstallProgressReported = false;
|
|
54032
|
+
let installEvidenceObserved = this.protocolV2InstallTerminalSuccessObserved;
|
|
53379
54033
|
let currentInstallStatusObserved = false;
|
|
54034
|
+
const liveTargetIds = new Set();
|
|
54035
|
+
const recordBleInstallDisconnect = (error) => {
|
|
54036
|
+
if (!isBleInstall ||
|
|
54037
|
+
!isProtocolV2DeviceDisconnectedError(error) ||
|
|
54038
|
+
isProtocolV2InstallResponseTimeout(error)) {
|
|
54039
|
+
return;
|
|
54040
|
+
}
|
|
54041
|
+
installStatusDisconnectObserved = true;
|
|
54042
|
+
installReconnectObserved = false;
|
|
54043
|
+
finishedStatusSnapshotKey = undefined;
|
|
54044
|
+
finishedStatusSnapshotPolls = 0;
|
|
54045
|
+
};
|
|
53380
54046
|
while (Date.now() - startTime < PROTOCOL_V2_INSTALL_TIMEOUT) {
|
|
53381
54047
|
this.throwIfAborted();
|
|
53382
54048
|
try {
|
|
53383
54049
|
if (shouldReconnect) {
|
|
53384
|
-
|
|
53385
|
-
|
|
54050
|
+
const isBleInstallReconnect = this.isBleReconnect();
|
|
54051
|
+
yield this.reconnectProtocolV2Device({ skipProtocolProbe: true });
|
|
54052
|
+
bleInstallLinkReady = isBleInstallReconnect;
|
|
54053
|
+
deviceInfo = isBleInstallReconnect
|
|
54054
|
+
? undefined
|
|
54055
|
+
: yield this.verifyProtocolV2ReconnectIdentity();
|
|
54056
|
+
if (isBleInstallReconnect && installStatusDisconnectObserved) {
|
|
54057
|
+
installReconnectObserved = true;
|
|
54058
|
+
}
|
|
53386
54059
|
shouldReconnect = false;
|
|
53387
54060
|
}
|
|
53388
|
-
|
|
54061
|
+
let currentDeviceInfo = deviceInfo;
|
|
53389
54062
|
try {
|
|
53390
|
-
const statusResponse = yield this.device.getCommands().typedCall('DeviceFirmwareUpdateStatusGet',
|
|
54063
|
+
const statusResponse = yield this.device.getCommands().typedCall('DeviceFirmwareUpdateStatusGet', 'DeviceFirmwareUpdateStatus', {
|
|
53391
54064
|
fields: {
|
|
53392
54065
|
status: true,
|
|
54066
|
+
progress_percent: true,
|
|
54067
|
+
phase_info: true,
|
|
53393
54068
|
payload_version: true,
|
|
53394
54069
|
path: true,
|
|
53395
54070
|
},
|
|
53396
54071
|
}, { timeoutMs: PROTOCOL_V2_FIRMWARE_STATUS_RESPONSE_TIMEOUT });
|
|
53397
|
-
if (
|
|
54072
|
+
if (this.protocolV2InstallTerminalSuccessObserved) {
|
|
53398
54073
|
installEvidenceObserved = true;
|
|
53399
|
-
lastError = new Error('Protocol V2 firmware install acknowledged; waiting for target status');
|
|
53400
54074
|
}
|
|
53401
|
-
const statusTargets = statusResponse.
|
|
53402
|
-
|
|
53403
|
-
|
|
53404
|
-
const hasInProgressTarget = statusTargets.some(target => {
|
|
53405
|
-
const targetId = normalizeProtocolV2TargetId(target.target_id);
|
|
53406
|
-
return (targetId !== undefined &&
|
|
53407
|
-
expectedTargetIds.has(targetId) &&
|
|
53408
|
-
isProtocolV2TargetStatusInProgress(target.status));
|
|
53409
|
-
});
|
|
53410
|
-
if (hasInProgressTarget) {
|
|
54075
|
+
const statusTargets = ((_a = statusResponse.message.records) !== null && _a !== void 0 ? _a : []);
|
|
54076
|
+
this.collectProtocolV2LiveTargetIds(statusTargets, expectedTargetIds, liveTargetIds);
|
|
54077
|
+
if (liveTargetIds.size > 0) {
|
|
53411
54078
|
currentInstallStatusObserved = true;
|
|
53412
54079
|
}
|
|
53413
54080
|
const hasMatchingTargetStatus = statusTargets.some(target => {
|
|
@@ -53422,31 +54089,102 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53422
54089
|
const targetId = normalizeProtocolV2TargetId(target.target_id);
|
|
53423
54090
|
return targetId !== undefined && expectedTargetIds.has(targetId);
|
|
53424
54091
|
});
|
|
53425
|
-
const
|
|
54092
|
+
const matchingFinishedTargetIds = new Set();
|
|
54093
|
+
const matchingFinishedStatus = matchingStatusTargets
|
|
54094
|
+
.map(target => {
|
|
54095
|
+
var _a;
|
|
54096
|
+
const targetId = normalizeProtocolV2TargetId(target.target_id);
|
|
54097
|
+
const expectedPath = targetId === undefined ? undefined : expectedPaths.get(targetId);
|
|
54098
|
+
const expectedVersion = targetId === undefined
|
|
54099
|
+
? undefined
|
|
54100
|
+
: this.getExpectedProtocolV2TargetVersion(targetId);
|
|
54101
|
+
const payloadVersion = toProtocolV2FiniteNumber(target.payload_version);
|
|
54102
|
+
if (targetId === undefined ||
|
|
54103
|
+
matchingFinishedTargetIds.has(targetId) ||
|
|
54104
|
+
!isProtocolV2TargetStatusFinished(target.status) ||
|
|
54105
|
+
(Boolean(target.path) && Boolean(expectedPath) && target.path !== expectedPath) ||
|
|
54106
|
+
(expectedVersion !== undefined &&
|
|
54107
|
+
payloadVersion !== undefined &&
|
|
54108
|
+
payloadVersion !== expectedVersion)) {
|
|
54109
|
+
return undefined;
|
|
54110
|
+
}
|
|
54111
|
+
matchingFinishedTargetIds.add(targetId);
|
|
54112
|
+
return [targetId, (_a = target.path) !== null && _a !== void 0 ? _a : null, payloadVersion !== null && payloadVersion !== void 0 ? payloadVersion : null];
|
|
54113
|
+
})
|
|
54114
|
+
.filter((target) => !!target)
|
|
54115
|
+
.sort(([leftTargetId], [rightTargetId]) => leftTargetId - rightTargetId);
|
|
54116
|
+
const hasCompleteMatchingFinishedStatus = matchingFinishedStatus.length === expectedTargetIds.size &&
|
|
54117
|
+
matchingFinishedTargetIds.size === expectedTargetIds.size &&
|
|
54118
|
+
expectedTargetIds.size > 0;
|
|
54119
|
+
if (requireCurrentInstallStatus &&
|
|
54120
|
+
installReconnectObserved &&
|
|
54121
|
+
hasCompleteMatchingFinishedStatus) {
|
|
54122
|
+
const nextSnapshotKey = JSON.stringify(matchingFinishedStatus);
|
|
54123
|
+
if (nextSnapshotKey === finishedStatusSnapshotKey) {
|
|
54124
|
+
finishedStatusSnapshotPolls += 1;
|
|
54125
|
+
}
|
|
54126
|
+
else {
|
|
54127
|
+
finishedStatusSnapshotKey = nextSnapshotKey;
|
|
54128
|
+
finishedStatusSnapshotPolls = 1;
|
|
54129
|
+
}
|
|
54130
|
+
}
|
|
54131
|
+
else {
|
|
54132
|
+
finishedStatusSnapshotKey = undefined;
|
|
54133
|
+
finishedStatusSnapshotPolls = 0;
|
|
54134
|
+
}
|
|
54135
|
+
if (requireCurrentInstallStatus &&
|
|
54136
|
+
installReconnectObserved &&
|
|
54137
|
+
hasCompleteMatchingFinishedStatus &&
|
|
54138
|
+
!currentInstallStatusObserved &&
|
|
54139
|
+
!this.protocolV2InstallTerminalSuccessObserved &&
|
|
54140
|
+
!fastFinishedInstallProgressReported) {
|
|
54141
|
+
this.postProgressMessage(1, 'installingFirmware');
|
|
54142
|
+
fastFinishedInstallProgressReported = true;
|
|
54143
|
+
}
|
|
54144
|
+
const finishedAfterDisconnectObserved = finishedStatusSnapshotPolls >= PROTOCOL_V2_INSTALL_FINISHED_AFTER_DISCONNECT_POLLS;
|
|
54145
|
+
const hasCurrentInstallEvidence = currentInstallStatusObserved ||
|
|
54146
|
+
this.protocolV2InstallTerminalSuccessObserved ||
|
|
54147
|
+
finishedAfterDisconnectObserved;
|
|
54148
|
+
if (hasCurrentInstallEvidence) {
|
|
54149
|
+
installEvidenceObserved = true;
|
|
54150
|
+
}
|
|
54151
|
+
const shouldVerifyTargetCompletion = !requireCurrentInstallStatus || hasCurrentInstallEvidence;
|
|
53426
54152
|
if (shouldVerifyTargetCompletion &&
|
|
53427
|
-
this.assertProtocolV2TargetStatus(statusTargets, expectedTargetIds, expectedPaths
|
|
54153
|
+
this.assertProtocolV2TargetStatus(statusTargets, expectedTargetIds, expectedPaths, requireCurrentInstallStatus &&
|
|
54154
|
+
!this.protocolV2InstallTerminalSuccessObserved &&
|
|
54155
|
+
!finishedAfterDisconnectObserved
|
|
54156
|
+
? liveTargetIds
|
|
54157
|
+
: undefined)) {
|
|
53428
54158
|
return;
|
|
53429
54159
|
}
|
|
54160
|
+
if (!hasCurrentInstallEvidence) {
|
|
54161
|
+
this.device.setCancelableAction(() => this.device.getCommands().cancelDevice());
|
|
54162
|
+
}
|
|
53430
54163
|
if (requireCurrentInstallStatus &&
|
|
53431
|
-
!
|
|
54164
|
+
!hasCurrentInstallEvidence &&
|
|
53432
54165
|
matchingStatusTargets.length > 0) {
|
|
53433
54166
|
lastError = new Error('Protocol V2 firmware status is stale; waiting for the current install to start');
|
|
53434
54167
|
}
|
|
54168
|
+
if (statusTargets.length === 0 &&
|
|
54169
|
+
!currentDeviceInfo &&
|
|
54170
|
+
bleInstallLinkReady &&
|
|
54171
|
+
installEvidenceObserved) {
|
|
54172
|
+
currentDeviceInfo = yield this.verifyProtocolV2ReconnectIdentity();
|
|
54173
|
+
deviceInfo = currentDeviceInfo;
|
|
54174
|
+
}
|
|
53435
54175
|
if (statusTargets.length === 0 && currentDeviceInfo) {
|
|
53436
54176
|
const isNormalMode = yield this.probeProtocolV2NormalMode(currentDeviceInfo);
|
|
53437
54177
|
if (isNormalMode &&
|
|
53438
54178
|
(installEvidenceObserved ||
|
|
53439
54179
|
this.hasProtocolV2InstallVersionChanged(expectedTargetIds))) {
|
|
53440
|
-
Log$
|
|
54180
|
+
Log$6.log('[FirmwareUpdateV4] empty firmware status after confirmed App reboot; update complete');
|
|
53441
54181
|
this.recordProtocolV2AuthoritativeInstallCompletion(expectedTargetIds);
|
|
53442
54182
|
this.postProgressMessage(100, 'installingFirmware');
|
|
53443
54183
|
return;
|
|
53444
54184
|
}
|
|
53445
54185
|
}
|
|
53446
54186
|
if (statusTargets.length === 0) {
|
|
53447
|
-
|
|
53448
|
-
lastError = new Error('Protocol V2 firmware update is waiting for user confirmation or target status');
|
|
53449
|
-
}
|
|
54187
|
+
lastError = new Error('Protocol V2 firmware update is waiting for user confirmation or target status');
|
|
53450
54188
|
}
|
|
53451
54189
|
else {
|
|
53452
54190
|
const missingTargetIds = this.getProtocolV2MissingTargetIds(statusTargets, expectedTargetIds);
|
|
@@ -53465,13 +54203,20 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53465
54203
|
}
|
|
53466
54204
|
if (isProtocolV2FirmwareStatusEndpointUnavailable(error)) {
|
|
53467
54205
|
if (!currentDeviceInfo) {
|
|
54206
|
+
if (!bleInstallLinkReady) {
|
|
54207
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 device identity is unavailable during install polling');
|
|
54208
|
+
}
|
|
54209
|
+
deviceInfo = yield this.verifyProtocolV2ReconnectIdentity();
|
|
54210
|
+
}
|
|
54211
|
+
const reconnectDeviceInfo = currentDeviceInfo !== null && currentDeviceInfo !== void 0 ? currentDeviceInfo : deviceInfo;
|
|
54212
|
+
if (!reconnectDeviceInfo) {
|
|
53468
54213
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 device identity is unavailable during install polling');
|
|
53469
54214
|
}
|
|
53470
|
-
const isNormalMode = yield this.probeProtocolV2NormalMode(
|
|
54215
|
+
const isNormalMode = yield this.probeProtocolV2NormalMode(reconnectDeviceInfo);
|
|
53471
54216
|
if (isNormalMode &&
|
|
53472
54217
|
(installEvidenceObserved ||
|
|
53473
54218
|
this.hasProtocolV2InstallVersionChanged(expectedTargetIds))) {
|
|
53474
|
-
Log$
|
|
54219
|
+
Log$6.log('[FirmwareUpdateV4] firmware status endpoint unavailable after confirmed App reboot');
|
|
53475
54220
|
this.recordProtocolV2AuthoritativeInstallCompletion(expectedTargetIds);
|
|
53476
54221
|
this.postProgressMessage(100, 'installingFirmware');
|
|
53477
54222
|
return;
|
|
@@ -53484,10 +54229,12 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53484
54229
|
}
|
|
53485
54230
|
}
|
|
53486
54231
|
else {
|
|
54232
|
+
recordBleInstallDisconnect(error);
|
|
53487
54233
|
shouldReconnect = true;
|
|
53488
54234
|
deviceInfo = undefined;
|
|
54235
|
+
bleInstallLinkReady = false;
|
|
53489
54236
|
lastError = error;
|
|
53490
|
-
Log$
|
|
54237
|
+
Log$6.log('[FirmwareUpdateV4] DeviceFirmwareUpdateStatusGet unavailable during install: ', error);
|
|
53491
54238
|
}
|
|
53492
54239
|
}
|
|
53493
54240
|
}
|
|
@@ -53503,13 +54250,15 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53503
54250
|
((_b = error.params) === null || _b === void 0 ? void 0 : _b.firmwareUpdateCode) === 'FirmwareInstallStatusUnavailable') {
|
|
53504
54251
|
throw error;
|
|
53505
54252
|
}
|
|
54253
|
+
recordBleInstallDisconnect(error);
|
|
53506
54254
|
shouldReconnect = true;
|
|
53507
54255
|
deviceInfo = undefined;
|
|
53508
|
-
|
|
54256
|
+
bleInstallLinkReady = false;
|
|
54257
|
+
Log$6.log('Protocol V2 firmware install device readiness probe failed: ', error);
|
|
53509
54258
|
}
|
|
53510
54259
|
yield hdShared.wait(1000);
|
|
53511
54260
|
}
|
|
53512
|
-
Log$
|
|
54261
|
+
Log$6.error(`[FirmwareUpdateV4] install timed out after ${PROTOCOL_V2_INSTALL_TIMEOUT / 1000}s: ${this.normalizeErrorMessage(lastError)}`);
|
|
53513
54262
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FirmwareError, 'Protocol V2 firmware install timed out', {
|
|
53514
54263
|
firmwareUpdateCode: PROTOCOL_V2_INSTALL_TIMEOUT_CODE,
|
|
53515
54264
|
});
|
|
@@ -53521,12 +54270,15 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53521
54270
|
const deviceInfo = yield this.verifyProtocolV2ReconnectIdentity();
|
|
53522
54271
|
try {
|
|
53523
54272
|
if (yield this.probeProtocolV2NormalMode(deviceInfo)) {
|
|
53524
|
-
Log$
|
|
54273
|
+
Log$6.log('[FirmwareUpdateV4] device already returned to App mode; skip Normal reboot');
|
|
53525
54274
|
return;
|
|
53526
54275
|
}
|
|
53527
54276
|
}
|
|
53528
54277
|
catch (error) {
|
|
53529
|
-
|
|
54278
|
+
if (hdShared.isBleStaleBondHardwareError(error)) {
|
|
54279
|
+
throw error;
|
|
54280
|
+
}
|
|
54281
|
+
Log$6.log('[FirmwareUpdateV4] unable to confirm App mode before Normal reboot: ', error);
|
|
53530
54282
|
}
|
|
53531
54283
|
yield this.protocolV2Reboot(hdTransport.DeviceRebootType.Normal);
|
|
53532
54284
|
this.protocolV2ExecutionInLoader = false;
|
|
@@ -53554,7 +54306,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53554
54306
|
const firmwareVersion = getDeviceFirmwareVersion(features).join('.');
|
|
53555
54307
|
this.protocolV2LatestFinalFeatures = features;
|
|
53556
54308
|
if (firmwareVersion === '0.0.0') {
|
|
53557
|
-
Log$
|
|
54309
|
+
Log$6.warn('Protocol V2 firmware update finished but app firmware version is still 0.0.0. This is allowed for Pro2 debug BLE-only update flows.');
|
|
53558
54310
|
}
|
|
53559
54311
|
return {
|
|
53560
54312
|
bootloaderVersion,
|
|
@@ -53600,29 +54352,49 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53600
54352
|
lastError = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceNotFound, 'Protocol V2 device is still in bootloader mode');
|
|
53601
54353
|
}
|
|
53602
54354
|
catch (error) {
|
|
53603
|
-
if (this.isProtocolV2ReconnectIdentityError(error)) {
|
|
54355
|
+
if (hdShared.isBleStaleBondHardwareError(error) || this.isProtocolV2ReconnectIdentityError(error)) {
|
|
53604
54356
|
throw error;
|
|
53605
54357
|
}
|
|
53606
54358
|
shouldReconnect = true;
|
|
53607
54359
|
lastError = error;
|
|
53608
|
-
Log$
|
|
54360
|
+
Log$6.log('Protocol V2 normal mode not ready, polling Ping: ', error);
|
|
53609
54361
|
}
|
|
53610
54362
|
yield hdShared.wait(1000);
|
|
53611
54363
|
}
|
|
53612
54364
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceNotFound, `Protocol V2 final features not ready within ${timeout / 1000}s: ${this.normalizeErrorMessage(lastError)}`);
|
|
53613
54365
|
});
|
|
53614
54366
|
}
|
|
53615
|
-
reconnectProtocolV2Device() {
|
|
53616
|
-
var _a, _b, _c, _d, _e, _f;
|
|
54367
|
+
reconnectProtocolV2Device(options) {
|
|
54368
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
53617
54369
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53618
54370
|
if (this.isBleReconnect()) {
|
|
53619
|
-
yield this.acquireProtocolV2BleDevice();
|
|
54371
|
+
yield this.acquireProtocolV2BleDevice(options === null || options === void 0 ? void 0 : options.skipProtocolProbe);
|
|
53620
54372
|
return;
|
|
53621
54373
|
}
|
|
53622
54374
|
const deviceDiff = yield ((_a = this.device.deviceConnector) === null || _a === void 0 ? void 0 : _a.enumerate());
|
|
53623
54375
|
const devicesDescriptor = (_b = deviceDiff === null || deviceDiff === void 0 ? void 0 : deviceDiff.descriptors) !== null && _b !== void 0 ? _b : [];
|
|
53624
|
-
|
|
53625
|
-
|
|
54376
|
+
const env = DataManager.getSettings('env');
|
|
54377
|
+
const isWebUsb = DataManager.isBrowserWebUsb(env) || DataManager.isDesktopWebUsb(env);
|
|
54378
|
+
if (isWebUsb && (options === null || options === void 0 ? void 0 : options.skipProtocolProbe)) {
|
|
54379
|
+
const expectedSerialNumber = (_c = this.protocolV2ExpectedSerialNumber) === null || _c === void 0 ? void 0 : _c.trim();
|
|
54380
|
+
const expectedPath = (_d = this.protocolV2ExpectedPath) === null || _d === void 0 ? void 0 : _d.trim();
|
|
54381
|
+
const reconnectDescriptor = devicesDescriptor.find(descriptor => {
|
|
54382
|
+
var _a;
|
|
54383
|
+
const descriptorPath = (_a = descriptor.path) === null || _a === void 0 ? void 0 : _a.trim();
|
|
54384
|
+
return ((!!expectedSerialNumber && descriptorPath === expectedSerialNumber) ||
|
|
54385
|
+
(!!expectedPath && descriptorPath === expectedPath));
|
|
54386
|
+
});
|
|
54387
|
+
if (!(reconnectDescriptor === null || reconnectDescriptor === void 0 ? void 0 : reconnectDescriptor.path)) {
|
|
54388
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceNotFound);
|
|
54389
|
+
}
|
|
54390
|
+
this.device.updateDescriptor(Object.assign(Object.assign({}, reconnectDescriptor), { protocolType: PROTOCOL_V2_CONNECT_PROTOCOL }), true);
|
|
54391
|
+
const mainId = yield ((_e = this.device.deviceConnector) === null || _e === void 0 ? void 0 : _e.acquire(reconnectDescriptor.path, null, undefined, PROTOCOL_V2_CONNECT_PROTOCOL, undefined, undefined, true));
|
|
54392
|
+
this.device.mainId = typeof mainId === 'string' ? mainId : reconnectDescriptor.path;
|
|
54393
|
+
this.device.commands.disposed = false;
|
|
54394
|
+
this.device.getCommands().mainId = this.device.mainId;
|
|
54395
|
+
return;
|
|
54396
|
+
}
|
|
54397
|
+
if (isWebUsb && devicesDescriptor.length === 1) {
|
|
53626
54398
|
const descriptor = devicesDescriptor[0];
|
|
53627
54399
|
if (!this.protocolV2ExpectedSerialNumber && descriptor.path !== this.protocolV2ExpectedPath) {
|
|
53628
54400
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceNotFound);
|
|
@@ -53630,14 +54402,14 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53630
54402
|
this.device.updateDescriptor(Object.assign(Object.assign({}, descriptor), { protocolType: PROTOCOL_V2_CONNECT_PROTOCOL }), true);
|
|
53631
54403
|
yield this.ensureProtocolV2DeviceAcquired();
|
|
53632
54404
|
this.device.commands.disposed = false;
|
|
53633
|
-
this.device.getCommands().mainId = (
|
|
54405
|
+
this.device.getCommands().mainId = (_f = this.device.mainId) !== null && _f !== void 0 ? _f : '';
|
|
53634
54406
|
return;
|
|
53635
54407
|
}
|
|
53636
54408
|
const { deviceList } = yield DevicePool.getDevices(devicesDescriptor, undefined, {
|
|
53637
54409
|
connectProtocol: PROTOCOL_V2_CONNECT_PROTOCOL,
|
|
53638
54410
|
});
|
|
53639
|
-
const expectedSerialNumber = (
|
|
53640
|
-
const expectedPath = (
|
|
54411
|
+
const expectedSerialNumber = (_g = this.protocolV2ExpectedSerialNumber) === null || _g === void 0 ? void 0 : _g.trim();
|
|
54412
|
+
const expectedPath = (_h = this.protocolV2ExpectedPath) === null || _h === void 0 ? void 0 : _h.trim();
|
|
53641
54413
|
const reconnectDevice = deviceList.find(candidate => {
|
|
53642
54414
|
var _a;
|
|
53643
54415
|
const candidateSerialNumber = (_a = candidate.getCurrentSerialNo) === null || _a === void 0 ? void 0 : _a.call(candidate).trim();
|
|
@@ -53649,11 +54421,11 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53649
54421
|
if (!reconnectDevice) {
|
|
53650
54422
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceNotFound);
|
|
53651
54423
|
}
|
|
53652
|
-
Log$
|
|
54424
|
+
Log$6.debug('Protocol V2 firmware reconnect using matched device:', reconnectDevice.getConnectId());
|
|
53653
54425
|
this.device.updateFromCache(reconnectDevice);
|
|
53654
54426
|
yield this.ensureProtocolV2DeviceAcquired();
|
|
53655
54427
|
this.device.commands.disposed = false;
|
|
53656
|
-
this.device.getCommands().mainId = (
|
|
54428
|
+
this.device.getCommands().mainId = (_j = this.device.mainId) !== null && _j !== void 0 ? _j : '';
|
|
53657
54429
|
});
|
|
53658
54430
|
}
|
|
53659
54431
|
ensureProtocolV2DeviceAcquired() {
|
|
@@ -53690,8 +54462,8 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53690
54462
|
});
|
|
53691
54463
|
if (writeRes.type !== 'FilesystemFile') {
|
|
53692
54464
|
if (writeRes.type === 'CallMethodError') {
|
|
53693
|
-
if (((_a = writeRes.message.error) !== null && _a !== void 0 ? _a : '').indexOf(SESSION_ERROR
|
|
53694
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, SESSION_ERROR
|
|
54465
|
+
if (((_a = writeRes.message.error) !== null && _a !== void 0 ? _a : '').indexOf(SESSION_ERROR) > -1) {
|
|
54466
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, SESSION_ERROR);
|
|
53695
54467
|
}
|
|
53696
54468
|
}
|
|
53697
54469
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.EmmcFileWriteFirmwareError, 'transfer data error');
|
|
@@ -53711,21 +54483,53 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53711
54483
|
yield hdShared.wait(2000);
|
|
53712
54484
|
});
|
|
53713
54485
|
}
|
|
53714
|
-
acquireProtocolV2BleDevice() {
|
|
53715
|
-
var _a;
|
|
54486
|
+
acquireProtocolV2BleDevice(skipProtocolProbe = false) {
|
|
53716
54487
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53717
|
-
|
|
54488
|
+
const connector = this.device.deviceConnector;
|
|
54489
|
+
const expectedId = this.device.originalDescriptor.id;
|
|
54490
|
+
if (!skipProtocolProbe) {
|
|
54491
|
+
yield (connector === null || connector === void 0 ? void 0 : connector.acquire(expectedId, null, true, PROTOCOL_V2_CONNECT_PROTOCOL));
|
|
54492
|
+
return;
|
|
54493
|
+
}
|
|
54494
|
+
yield (connector === null || connector === void 0 ? void 0 : connector.acquire(expectedId, null, true, PROTOCOL_V2_CONNECT_PROTOCOL, undefined, undefined, skipProtocolProbe));
|
|
54495
|
+
this.device.commands.disposed = false;
|
|
54496
|
+
this.device.getCommands().mainId = expectedId;
|
|
53718
54497
|
});
|
|
53719
54498
|
}
|
|
53720
54499
|
protocolV2StartFirmwareUpdate({ targets, }) {
|
|
53721
54500
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53722
54501
|
this.protocolV2LastRuntimeProbeFeatures = undefined;
|
|
54502
|
+
this.protocolV2InstallNeedsReconnect = false;
|
|
54503
|
+
this.protocolV2InstallDisconnectObserved = false;
|
|
54504
|
+
this.protocolV2InstallTerminalSuccessObserved = false;
|
|
53723
54505
|
const commands = this.device.getCommands();
|
|
53724
54506
|
yield commands.typedCall('DeviceFirmwareUpdateStage', 'Success', { targets });
|
|
53725
|
-
this.device.setCancelableAction(() =>
|
|
54507
|
+
this.device.setCancelableAction(() => this.device.getCommands().cancelDevice());
|
|
53726
54508
|
const interaction = this.device.createProtocolV2UiPhaseMetadata('button', 'start');
|
|
53727
54509
|
this.postMessage(createUiMessage(UI_REQUEST.REQUEST_BUTTON, Object.assign({ device: this.device.toMessageObject(), source: 'method-lifecycle', reason: 'firmware-update', completion: 'operation-completed', deviceOnly: true, operation: this.name }, (interaction ? { interaction } : {}))));
|
|
53728
|
-
|
|
54510
|
+
try {
|
|
54511
|
+
yield commands.call('DeviceFirmwareUpdateRequest', {}, {
|
|
54512
|
+
returnAfterWrite: true,
|
|
54513
|
+
expectedTypes: ['Success'],
|
|
54514
|
+
onResponseAfterWrite: response => {
|
|
54515
|
+
if (response.type !== 'Success')
|
|
54516
|
+
return;
|
|
54517
|
+
this.protocolV2InstallTerminalSuccessObserved = true;
|
|
54518
|
+
this.device.clearCancelableAction();
|
|
54519
|
+
Log$6.log('[FirmwareUpdateV4] firmware install completed by device response');
|
|
54520
|
+
},
|
|
54521
|
+
});
|
|
54522
|
+
Log$6.log('[FirmwareUpdateV4] firmware install request written; continue with status polling');
|
|
54523
|
+
}
|
|
54524
|
+
catch (error) {
|
|
54525
|
+
this.throwIfAborted();
|
|
54526
|
+
if (!isProtocolV2DeviceDisconnectedError(error)) {
|
|
54527
|
+
throw error;
|
|
54528
|
+
}
|
|
54529
|
+
Log$6.log('[FirmwareUpdateV4] transport released while writing install request; continue status polling');
|
|
54530
|
+
this.protocolV2InstallNeedsReconnect = true;
|
|
54531
|
+
this.protocolV2InstallDisconnectObserved = !isProtocolV2InstallResponseTimeout(error);
|
|
54532
|
+
}
|
|
53729
54533
|
});
|
|
53730
54534
|
}
|
|
53731
54535
|
protocolV2Reboot(rebootType) {
|
|
@@ -53734,12 +54538,14 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53734
54538
|
try {
|
|
53735
54539
|
const res = yield typedCall('DeviceReboot', 'Success', {
|
|
53736
54540
|
reboot_type: rebootType,
|
|
53737
|
-
});
|
|
54541
|
+
}, { timeoutMs: PROTOCOL_V2_SHORT_RESPONSE_TIMEOUT });
|
|
53738
54542
|
this.device.markProtocolV2Reboot(rebootType);
|
|
53739
54543
|
return res.message;
|
|
53740
54544
|
}
|
|
53741
54545
|
catch (error) {
|
|
53742
|
-
if (isProtocolV2DeviceDisconnectedError(error) ||
|
|
54546
|
+
if (isProtocolV2DeviceDisconnectedError(error) ||
|
|
54547
|
+
isProtocolV2ReconnectProbeError(error) ||
|
|
54548
|
+
isProtocolV2ResponseTimeout(error)) {
|
|
53743
54549
|
this.device.markProtocolV2Reboot(rebootType);
|
|
53744
54550
|
return { message: 'Device rebooted successfully' };
|
|
53745
54551
|
}
|
|
@@ -53755,7 +54561,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53755
54561
|
}
|
|
53756
54562
|
}
|
|
53757
54563
|
|
|
53758
|
-
const Log$
|
|
54564
|
+
const Log$5 = getLogger(exports.LoggerNames.Method);
|
|
53759
54565
|
class PromptWebDeviceAccess extends BaseMethod {
|
|
53760
54566
|
init() {
|
|
53761
54567
|
this.useDevice = false;
|
|
@@ -53810,7 +54616,7 @@ class PromptWebDeviceAccess extends BaseMethod {
|
|
|
53810
54616
|
return { device: null };
|
|
53811
54617
|
}
|
|
53812
54618
|
catch (error) {
|
|
53813
|
-
Log$
|
|
54619
|
+
Log$5.debug(error);
|
|
53814
54620
|
return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Please select the device to connect'));
|
|
53815
54621
|
}
|
|
53816
54622
|
});
|
|
@@ -53915,281 +54721,234 @@ function decodeJpegBase64ToRgba({ jpegBase64, parameterName, expectedWidth, expe
|
|
|
53915
54721
|
return decoded;
|
|
53916
54722
|
}
|
|
53917
54723
|
|
|
53918
|
-
const
|
|
53919
|
-
const
|
|
53920
|
-
const
|
|
53921
|
-
const
|
|
53922
|
-
const
|
|
53923
|
-
|
|
53924
|
-
|
|
54724
|
+
const PRO2_HOST_ASSET_PACKAGE_MIN_VERSION = '1.0.1';
|
|
54725
|
+
const CONTAINER_HEADER_SIZE = 0x5f90;
|
|
54726
|
+
const CONTAINER_HEADER_HASH_INPUT_LENGTH = 0x240;
|
|
54727
|
+
const CONTAINER_HASH_SECTION_OFFSET = 0x200;
|
|
54728
|
+
const CONTAINER_SIGNATURE_ALGORITHM_OFFSET = 0x408;
|
|
54729
|
+
const CONTAINER_HEADER_MAGIC = 0x50504b4f;
|
|
54730
|
+
const CONTAINER_HEADER_VERSION = 1;
|
|
54731
|
+
const CONTAINER_RESOURCE_TYPE_MAGIC = 0x43534552;
|
|
54732
|
+
const CONTAINER_ED25519_SIGNATURE_ALGORITHM = 0x71717171;
|
|
54733
|
+
const HOST_ASSET_PACKAGE_MAX_SIZE = 4 * 1024 * 1024;
|
|
54734
|
+
const ARCHIVE_MAGIC = 0x52414b4f;
|
|
54735
|
+
const ARCHIVE_VERSION = 1;
|
|
54736
|
+
const ARCHIVE_HEADER_SIZE = 42;
|
|
54737
|
+
const ARCHIVE_ENTRY_SIZE = 296;
|
|
54738
|
+
const ARCHIVE_ENTRY_NAME_MAX_LENGTH = 255;
|
|
54739
|
+
const ARCHIVE_COMPRESS_LZ4_BLOCKED = 1;
|
|
54740
|
+
const ARCHIVE_ALIGNMENT = 4;
|
|
54741
|
+
const LZ4_BLOCK_SIZE_LOG2 = 12;
|
|
54742
|
+
function supportsPro2HostAssetPackage(firmwareVersion) {
|
|
54743
|
+
return Boolean(firmwareVersion &&
|
|
54744
|
+
semver__default["default"].valid(firmwareVersion) &&
|
|
54745
|
+
semver__default["default"].gte(firmwareVersion, PRO2_HOST_ASSET_PACKAGE_MIN_VERSION));
|
|
53925
54746
|
}
|
|
53926
|
-
function
|
|
53927
|
-
|
|
53928
|
-
|
|
53929
|
-
|
|
54747
|
+
function concatBytes(parts) {
|
|
54748
|
+
const output = new Uint8Array(parts.reduce((length, part) => length + part.byteLength, 0));
|
|
54749
|
+
let offset = 0;
|
|
54750
|
+
for (const part of parts) {
|
|
54751
|
+
output.set(part, offset);
|
|
54752
|
+
offset += part.byteLength;
|
|
54753
|
+
}
|
|
54754
|
+
return output;
|
|
53930
54755
|
}
|
|
53931
|
-
|
|
53932
|
-
|
|
53933
|
-
|
|
54756
|
+
const LZ4_MIN_MATCH = 4;
|
|
54757
|
+
const LZ4_LAST_LITERALS = 5;
|
|
54758
|
+
const LZ4_MATCH_FIND_LIMIT = 12;
|
|
54759
|
+
const LZ4_MAX_OFFSET = 0xffff;
|
|
54760
|
+
const LZ4_LENGTH_MASK = 15;
|
|
54761
|
+
const LZ4_HASH_LOG = 16;
|
|
54762
|
+
const LZ4_HASH_MULTIPLIER = 2654435761;
|
|
54763
|
+
const LZ4_SKIP_TRIGGER = 6;
|
|
54764
|
+
function writeExtendedLength(output, offset, length) {
|
|
54765
|
+
let remaining = length;
|
|
54766
|
+
let nextOffset = offset;
|
|
54767
|
+
while (remaining >= 255) {
|
|
54768
|
+
output[nextOffset] = 255;
|
|
54769
|
+
nextOffset += 1;
|
|
54770
|
+
remaining -= 255;
|
|
54771
|
+
}
|
|
54772
|
+
output[nextOffset] = remaining;
|
|
54773
|
+
return nextOffset + 1;
|
|
53934
54774
|
}
|
|
53935
|
-
function
|
|
53936
|
-
|
|
53937
|
-
|
|
53938
|
-
: '';
|
|
53939
|
-
Log$5.log(`[FileWrite] metrics transport=${transport} status=${status} path=${path} bytes=${transferredBytes}/${totalBytes} elapsed=${(elapsedMs / 1000).toFixed(2)}s speed=${formatFileTransferRate(rateBytesPerSecond)} KiB/s${segmentedMetrics}`);
|
|
54775
|
+
function copyBytes(output, outputOffset, input, inputOffset, length) {
|
|
54776
|
+
output.set(input.subarray(inputOffset, inputOffset + length), outputOffset);
|
|
54777
|
+
return outputOffset + length;
|
|
53940
54778
|
}
|
|
53941
|
-
function
|
|
53942
|
-
|
|
53943
|
-
|
|
53944
|
-
|
|
53945
|
-
|
|
53946
|
-
|
|
53947
|
-
|
|
53948
|
-
|
|
53949
|
-
|
|
54779
|
+
function emitSequence(output, outputOffset, input, anchor, literalLength, matchOffset, matchLengthCode) {
|
|
54780
|
+
const tokenOffset = outputOffset;
|
|
54781
|
+
let nextOffset = outputOffset + 1;
|
|
54782
|
+
let token = 0;
|
|
54783
|
+
if (literalLength >= LZ4_LENGTH_MASK) {
|
|
54784
|
+
token = LZ4_LENGTH_MASK << 4;
|
|
54785
|
+
nextOffset = writeExtendedLength(output, nextOffset, literalLength - LZ4_LENGTH_MASK);
|
|
54786
|
+
}
|
|
54787
|
+
else {
|
|
54788
|
+
token = literalLength << 4;
|
|
54789
|
+
}
|
|
54790
|
+
nextOffset = copyBytes(output, nextOffset, input, anchor, literalLength);
|
|
54791
|
+
output[nextOffset] = matchOffset & 0xff;
|
|
54792
|
+
output[nextOffset + 1] = (matchOffset >>> 8) & 0xff;
|
|
54793
|
+
nextOffset += 2;
|
|
54794
|
+
if (matchLengthCode >= LZ4_LENGTH_MASK) {
|
|
54795
|
+
token |= LZ4_LENGTH_MASK;
|
|
54796
|
+
nextOffset = writeExtendedLength(output, nextOffset, matchLengthCode - LZ4_LENGTH_MASK);
|
|
54797
|
+
}
|
|
54798
|
+
else {
|
|
54799
|
+
token |= matchLengthCode;
|
|
54800
|
+
}
|
|
54801
|
+
output[tokenOffset] = token;
|
|
54802
|
+
return nextOffset;
|
|
53950
54803
|
}
|
|
53951
|
-
function
|
|
53952
|
-
const
|
|
53953
|
-
|
|
53954
|
-
|
|
53955
|
-
|
|
54804
|
+
function emitLastLiterals(output, outputOffset, input, anchor, literalLength) {
|
|
54805
|
+
const tokenOffset = outputOffset;
|
|
54806
|
+
let nextOffset = outputOffset + 1;
|
|
54807
|
+
if (literalLength >= LZ4_LENGTH_MASK) {
|
|
54808
|
+
output[tokenOffset] = LZ4_LENGTH_MASK << 4;
|
|
54809
|
+
nextOffset = writeExtendedLength(output, nextOffset, literalLength - LZ4_LENGTH_MASK);
|
|
54810
|
+
}
|
|
54811
|
+
else {
|
|
54812
|
+
output[tokenOffset] = literalLength << 4;
|
|
54813
|
+
}
|
|
54814
|
+
return copyBytes(output, nextOffset, input, anchor, literalLength);
|
|
53956
54815
|
}
|
|
53957
|
-
function
|
|
53958
|
-
|
|
53959
|
-
|
|
53960
|
-
|
|
53961
|
-
|
|
53962
|
-
|
|
53963
|
-
|
|
53964
|
-
|
|
54816
|
+
function compressRawLz4Block(input, hashTable) {
|
|
54817
|
+
const output = new Uint8Array(input.byteLength + Math.floor(input.byteLength / 255) + 16);
|
|
54818
|
+
const inputView = new DataView(input.buffer, input.byteOffset, input.byteLength);
|
|
54819
|
+
const matchFindLimit = input.byteLength - LZ4_MATCH_FIND_LIMIT;
|
|
54820
|
+
const matchExtendLimit = input.byteLength - LZ4_LAST_LITERALS;
|
|
54821
|
+
let anchor = 0;
|
|
54822
|
+
let inputOffset = 0;
|
|
54823
|
+
let outputOffset = 0;
|
|
54824
|
+
let searchMatchCount = 1 << LZ4_SKIP_TRIGGER;
|
|
54825
|
+
hashTable.fill(0);
|
|
54826
|
+
while (inputOffset < matchFindLimit) {
|
|
54827
|
+
const sequence = inputView.getUint32(inputOffset, true);
|
|
54828
|
+
const hash = Math.imul(sequence, LZ4_HASH_MULTIPLIER) >>> (32 - LZ4_HASH_LOG);
|
|
54829
|
+
const candidate = hashTable[hash] - 1;
|
|
54830
|
+
hashTable[hash] = inputOffset + 1;
|
|
54831
|
+
const hasMatch = !(candidate < 0 ||
|
|
54832
|
+
inputOffset - candidate > LZ4_MAX_OFFSET ||
|
|
54833
|
+
inputView.getUint32(candidate, true) !== sequence);
|
|
54834
|
+
if (!hasMatch) {
|
|
54835
|
+
inputOffset += searchMatchCount >> LZ4_SKIP_TRIGGER;
|
|
54836
|
+
searchMatchCount += 1;
|
|
53965
54837
|
}
|
|
53966
|
-
|
|
53967
|
-
|
|
54838
|
+
else {
|
|
54839
|
+
searchMatchCount = 1 << LZ4_SKIP_TRIGGER;
|
|
54840
|
+
let matchEnd = inputOffset + LZ4_MIN_MATCH;
|
|
54841
|
+
let reference = candidate + LZ4_MIN_MATCH;
|
|
54842
|
+
while (matchEnd < matchExtendLimit && input[matchEnd] === input[reference]) {
|
|
54843
|
+
matchEnd += 1;
|
|
54844
|
+
reference += 1;
|
|
54845
|
+
}
|
|
54846
|
+
outputOffset = emitSequence(output, outputOffset, input, anchor, inputOffset - anchor, inputOffset - candidate, matchEnd - inputOffset - LZ4_MIN_MATCH);
|
|
54847
|
+
inputOffset = matchEnd;
|
|
54848
|
+
anchor = inputOffset;
|
|
53968
54849
|
}
|
|
53969
|
-
|
|
53970
|
-
|
|
53971
|
-
|
|
53972
|
-
function normalizeChunkSize(value, maxChunkSize) {
|
|
53973
|
-
const numeric = Number(value);
|
|
53974
|
-
if (!Number.isFinite(numeric) || numeric <= 0)
|
|
53975
|
-
return maxChunkSize;
|
|
53976
|
-
return Math.min(Math.max(Math.floor(numeric), MIN_FILE_CHUNK_SIZE), maxChunkSize);
|
|
54850
|
+
}
|
|
54851
|
+
outputOffset = emitLastLiterals(output, outputOffset, input, anchor, input.byteLength - anchor);
|
|
54852
|
+
return output.slice(0, outputOffset);
|
|
53977
54853
|
}
|
|
53978
|
-
function
|
|
53979
|
-
|
|
53980
|
-
|
|
53981
|
-
|
|
53982
|
-
|
|
53983
|
-
|
|
53984
|
-
|
|
53985
|
-
|
|
54854
|
+
function encodeLz4Blocked(data) {
|
|
54855
|
+
const blockSize = 1 << LZ4_BLOCK_SIZE_LOG2;
|
|
54856
|
+
const blockCount = Math.ceil(data.byteLength / blockSize);
|
|
54857
|
+
const hashTable = new Uint32Array(1 << LZ4_HASH_LOG);
|
|
54858
|
+
const blocks = [];
|
|
54859
|
+
const header = new Uint8Array(8 + blockCount * 4);
|
|
54860
|
+
const headerView = new DataView(header.buffer);
|
|
54861
|
+
headerView.setUint16(0, blockCount, true);
|
|
54862
|
+
headerView.setUint16(2, LZ4_BLOCK_SIZE_LOG2, true);
|
|
54863
|
+
for (let index = 0; index < blockCount; index += 1) {
|
|
54864
|
+
const block = compressRawLz4Block(data.subarray(index * blockSize, Math.min((index + 1) * blockSize, data.byteLength)), hashTable);
|
|
54865
|
+
headerView.setUint32(8 + index * 4, block.byteLength, true);
|
|
54866
|
+
blocks.push(block);
|
|
54867
|
+
}
|
|
54868
|
+
return concatBytes([header, ...blocks]);
|
|
53986
54869
|
}
|
|
53987
|
-
|
|
53988
|
-
|
|
53989
|
-
|
|
53990
|
-
|
|
53991
|
-
|
|
54870
|
+
const CRC32_TABLE = (() => {
|
|
54871
|
+
const table = new Uint32Array(256);
|
|
54872
|
+
for (let index = 0; index < table.length; index += 1) {
|
|
54873
|
+
let value = index;
|
|
54874
|
+
for (let bit = 0; bit < 8; bit += 1) {
|
|
54875
|
+
value = value & 1 ? 0xedb88320 ^ (value >>> 1) : value >>> 1;
|
|
54876
|
+
}
|
|
54877
|
+
table[index] = value >>> 0;
|
|
53992
54878
|
}
|
|
53993
|
-
|
|
53994
|
-
|
|
53995
|
-
|
|
54879
|
+
return table;
|
|
54880
|
+
})();
|
|
54881
|
+
function crc32(data) {
|
|
54882
|
+
let value = 0xffffffff;
|
|
54883
|
+
for (const byte of data) {
|
|
54884
|
+
value = CRC32_TABLE[(value ^ byte) & 0xff] ^ (value >>> 8);
|
|
54885
|
+
}
|
|
54886
|
+
return (value ^ 0xffffffff) >>> 0;
|
|
53996
54887
|
}
|
|
53997
|
-
function
|
|
53998
|
-
|
|
53999
|
-
|
|
54000
|
-
|
|
54001
|
-
|
|
54002
|
-
|
|
54003
|
-
|
|
54004
|
-
const
|
|
54005
|
-
|
|
54006
|
-
|
|
54007
|
-
if (totalSize < startOffset + dataLength) {
|
|
54008
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `FilesystemFileWrite totalSize ${totalSize} is smaller than offset + data length ${startOffset + dataLength}`);
|
|
54009
|
-
}
|
|
54010
|
-
const defaultChunkSizeLimit = getProtocolV2FileChunkLimit();
|
|
54011
|
-
const configuredChunkSizeLimit = Number(options.chunkSizeLimit);
|
|
54012
|
-
const chunkSizeLimit = Number.isFinite(configuredChunkSizeLimit) && configuredChunkSizeLimit > 0
|
|
54013
|
-
? Math.floor(configuredChunkSizeLimit)
|
|
54014
|
-
: defaultChunkSizeLimit;
|
|
54015
|
-
const chunkSize = normalizeChunkSize((_b = options.chunkSize) !== null && _b !== void 0 ? _b : options.chunkLen, chunkSizeLimit);
|
|
54016
|
-
let written = 0;
|
|
54017
|
-
let chunks = 0;
|
|
54018
|
-
let lastMessage;
|
|
54019
|
-
const startTime = Date.now();
|
|
54020
|
-
let rateWindowStartedAt = startTime;
|
|
54021
|
-
let rateWindowStartedBytes = 0;
|
|
54022
|
-
let rateBytesPerSecond;
|
|
54023
|
-
let lastConfirmedAt = startTime;
|
|
54024
|
-
let logWindowStartedAt = startTime;
|
|
54025
|
-
let logWindowStartedBytes = 0;
|
|
54026
|
-
let hostWriteElapsedMs = 0;
|
|
54027
|
-
let responseWaitElapsedMs = 0;
|
|
54028
|
-
let measuredAttempts = 0;
|
|
54029
|
-
const transport = getFileTransferTransport();
|
|
54030
|
-
Log$5.log(`[FileWrite] started transport=${transport} path=${options.path} bytes=${dataLength} offset=${startOffset} chunk=${chunkSize}`);
|
|
54031
|
-
try {
|
|
54032
|
-
while (written < dataLength) {
|
|
54033
|
-
(_c = options.throwIfAborted) === null || _c === void 0 ? void 0 : _c.call(options);
|
|
54034
|
-
const chunk = data.slice(written, Math.min(written + chunkSize, dataLength));
|
|
54035
|
-
const offset = startOffset + written;
|
|
54036
|
-
const progress = (_f = (_d = options.uiPercentage) !== null && _d !== void 0 ? _d : (_e = options.getUiPercentage) === null || _e === void 0 ? void 0 : _e.call(options, {
|
|
54037
|
-
offset,
|
|
54038
|
-
chunkLength: chunk.byteLength,
|
|
54039
|
-
totalSize,
|
|
54040
|
-
})) !== null && _f !== void 0 ? _f : getDeviceTransferProgress(offset, offset + chunk.byteLength, totalSize);
|
|
54041
|
-
const request = {
|
|
54042
|
-
file: { path: options.path, offset, total_size: totalSize, data: chunk },
|
|
54043
|
-
overwrite: chunks === 0 ? (_g = options.overwrite) !== null && _g !== void 0 ? _g : false : false,
|
|
54044
|
-
append: (_h = options.append) !== null && _h !== void 0 ? _h : false,
|
|
54045
|
-
ui_percentage: progress,
|
|
54046
|
-
};
|
|
54047
|
-
const maxChunkRetries = Math.max(Math.floor((_j = options.maxChunkRetries) !== null && _j !== void 0 ? _j : 0), 0);
|
|
54048
|
-
let retryCount = 0;
|
|
54049
|
-
let response;
|
|
54050
|
-
let isWritePending = true;
|
|
54051
|
-
while (isWritePending) {
|
|
54052
|
-
let currentHostWriteElapsedMs;
|
|
54053
|
-
let responseWaitStartedAt;
|
|
54054
|
-
try {
|
|
54055
|
-
const callOptions = options.writeWithResponse === undefined
|
|
54056
|
-
? {
|
|
54057
|
-
timeoutMs: options.timeoutMs,
|
|
54058
|
-
onWriteCompleted: ({ elapsedMs }) => {
|
|
54059
|
-
currentHostWriteElapsedMs = elapsedMs;
|
|
54060
|
-
responseWaitStartedAt = Date.now();
|
|
54061
|
-
},
|
|
54062
|
-
}
|
|
54063
|
-
: Object.assign(Object.assign({}, (options.timeoutMs === undefined ? {} : { timeoutMs: options.timeoutMs })), { writeWithResponse: options.writeWithResponse, onWriteCompleted: ({ elapsedMs }) => {
|
|
54064
|
-
currentHostWriteElapsedMs = elapsedMs;
|
|
54065
|
-
responseWaitStartedAt = Date.now();
|
|
54066
|
-
} });
|
|
54067
|
-
response = yield options.commands.typedCall('FilesystemFileWrite', 'FilesystemFile', request, callOptions);
|
|
54068
|
-
isWritePending = false;
|
|
54069
|
-
}
|
|
54070
|
-
catch (error) {
|
|
54071
|
-
if (retryCount >= maxChunkRetries || !isProtocolV2ResponseTimeout(error))
|
|
54072
|
-
throw error;
|
|
54073
|
-
retryCount += 1;
|
|
54074
|
-
(_k = options.throwIfAborted) === null || _k === void 0 ? void 0 : _k.call(options);
|
|
54075
|
-
}
|
|
54076
|
-
finally {
|
|
54077
|
-
if (currentHostWriteElapsedMs !== undefined && responseWaitStartedAt !== undefined) {
|
|
54078
|
-
hostWriteElapsedMs += currentHostWriteElapsedMs;
|
|
54079
|
-
responseWaitElapsedMs += Math.max(Date.now() - responseWaitStartedAt, 0);
|
|
54080
|
-
measuredAttempts += 1;
|
|
54081
|
-
}
|
|
54082
|
-
}
|
|
54083
|
-
}
|
|
54084
|
-
if (!response) {
|
|
54085
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'FilesystemFileWrite completed without a response');
|
|
54086
|
-
}
|
|
54087
|
-
const responseType = response.type;
|
|
54088
|
-
if (responseType && responseType !== 'FilesystemFile') {
|
|
54089
|
-
const responseError = (_l = response.message) === null || _l === void 0 ? void 0 : _l.error;
|
|
54090
|
-
if (typeof responseError === 'string' && responseError.includes(SESSION_ERROR)) {
|
|
54091
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, SESSION_ERROR);
|
|
54092
|
-
}
|
|
54093
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `FilesystemFileWrite received unexpected response ${responseType}`);
|
|
54094
|
-
}
|
|
54095
|
-
(_m = options.throwIfAborted) === null || _m === void 0 ? void 0 : _m.call(options);
|
|
54096
|
-
lastMessage = response.message;
|
|
54097
|
-
const rawProcessedByte = (_o = response.message) === null || _o === void 0 ? void 0 : _o.processed_byte;
|
|
54098
|
-
const processedByte = Number(rawProcessedByte);
|
|
54099
|
-
if (rawProcessedByte !== undefined &&
|
|
54100
|
-
(!Number.isFinite(processedByte) ||
|
|
54101
|
-
processedByte <= offset ||
|
|
54102
|
-
processedByte > offset + chunk.byteLength)) {
|
|
54103
|
-
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `FilesystemFileWrite invalid processed_byte ${processedByte}`);
|
|
54104
|
-
}
|
|
54105
|
-
written =
|
|
54106
|
-
rawProcessedByte === undefined ? written + chunk.byteLength : processedByte - startOffset;
|
|
54107
|
-
chunks += 1;
|
|
54108
|
-
const now = Date.now();
|
|
54109
|
-
lastConfirmedAt = now;
|
|
54110
|
-
const elapsedMs = now - startTime;
|
|
54111
|
-
const transferredBytes = Math.min(written, dataLength);
|
|
54112
|
-
const rateWindowElapsedMs = now - rateWindowStartedAt;
|
|
54113
|
-
if (rateWindowElapsedMs >= FILE_TRANSFER_RATE_WINDOW_MS) {
|
|
54114
|
-
const rateWindowBytes = Math.max(transferredBytes - rateWindowStartedBytes, 0);
|
|
54115
|
-
rateBytesPerSecond = Math.round((rateWindowBytes / rateWindowElapsedMs) * 1000);
|
|
54116
|
-
rateWindowStartedAt = now;
|
|
54117
|
-
rateWindowStartedBytes = transferredBytes;
|
|
54118
|
-
}
|
|
54119
|
-
else if (rateBytesPerSecond === undefined && elapsedMs > 0) {
|
|
54120
|
-
rateBytesPerSecond = Math.round((transferredBytes / elapsedMs) * 1000);
|
|
54121
|
-
}
|
|
54122
|
-
(_p = options.onProgress) === null || _p === void 0 ? void 0 : _p.call(options, {
|
|
54123
|
-
progress: getConfirmedProgress(startOffset + written, totalSize, written, dataLength),
|
|
54124
|
-
transferredBytes,
|
|
54125
|
-
totalBytes: dataLength,
|
|
54126
|
-
rateBytesPerSecond,
|
|
54127
|
-
elapsedMs,
|
|
54128
|
-
});
|
|
54129
|
-
const logWindowElapsedMs = now - logWindowStartedAt;
|
|
54130
|
-
if (logWindowElapsedMs >= FILE_TRANSFER_LOG_INTERVAL_MS && transferredBytes < dataLength) {
|
|
54131
|
-
const logWindowBytes = Math.max(transferredBytes - logWindowStartedBytes, 0);
|
|
54132
|
-
logFileTransferMetrics({
|
|
54133
|
-
transport,
|
|
54134
|
-
status: 'progress',
|
|
54135
|
-
path: options.path,
|
|
54136
|
-
transferredBytes,
|
|
54137
|
-
totalBytes: dataLength,
|
|
54138
|
-
elapsedMs,
|
|
54139
|
-
rateBytesPerSecond: getAverageFileTransferRate(logWindowBytes, logWindowElapsedMs),
|
|
54140
|
-
hostWriteElapsedMs,
|
|
54141
|
-
responseWaitElapsedMs,
|
|
54142
|
-
measuredAttempts,
|
|
54143
|
-
});
|
|
54144
|
-
logWindowStartedAt = now;
|
|
54145
|
-
logWindowStartedBytes = transferredBytes;
|
|
54146
|
-
}
|
|
54147
|
-
if (options.paceMs && options.paceMs > 0) {
|
|
54148
|
-
yield new Promise(resolve => {
|
|
54149
|
-
setTimeout(resolve, options.paceMs);
|
|
54150
|
-
});
|
|
54151
|
-
}
|
|
54152
|
-
}
|
|
54888
|
+
function align(value) {
|
|
54889
|
+
return (value + ARCHIVE_ALIGNMENT - 1) & ~(ARCHIVE_ALIGNMENT - 1);
|
|
54890
|
+
}
|
|
54891
|
+
function buildArchive(entries) {
|
|
54892
|
+
const textEncoder = new TextEncoder();
|
|
54893
|
+
let dataOffset = ARCHIVE_HEADER_SIZE + entries.length * ARCHIVE_ENTRY_SIZE;
|
|
54894
|
+
const encodedEntries = entries.map(entry => {
|
|
54895
|
+
const nameBytes = textEncoder.encode(entry.name);
|
|
54896
|
+
if (!entry.name || nameBytes.byteLength > ARCHIVE_ENTRY_NAME_MAX_LENGTH) {
|
|
54897
|
+
throw new Error('Pro2 host asset package entry names must contain 1 to 255 UTF-8 bytes.');
|
|
54153
54898
|
}
|
|
54154
|
-
|
|
54155
|
-
|
|
54156
|
-
const elapsedMs = Math.max(now - startTime, 0);
|
|
54157
|
-
const logWindowElapsedMs = Math.max(now - logWindowStartedAt, 0);
|
|
54158
|
-
const logWindowBytes = Math.max(written - logWindowStartedBytes, 0);
|
|
54159
|
-
logFileTransferMetrics({
|
|
54160
|
-
transport,
|
|
54161
|
-
status: 'failed',
|
|
54162
|
-
path: options.path,
|
|
54163
|
-
transferredBytes: written,
|
|
54164
|
-
totalBytes: dataLength,
|
|
54165
|
-
elapsedMs,
|
|
54166
|
-
rateBytesPerSecond: getAverageFileTransferRate(logWindowBytes, logWindowElapsedMs),
|
|
54167
|
-
hostWriteElapsedMs,
|
|
54168
|
-
responseWaitElapsedMs,
|
|
54169
|
-
measuredAttempts,
|
|
54170
|
-
});
|
|
54171
|
-
throw error;
|
|
54899
|
+
if (!(entry.data instanceof Uint8Array) || entry.data.byteLength === 0) {
|
|
54900
|
+
throw new Error(`Pro2 host asset package entry [${entry.name}] must not be empty.`);
|
|
54172
54901
|
}
|
|
54173
|
-
const
|
|
54174
|
-
const
|
|
54175
|
-
|
|
54176
|
-
|
|
54177
|
-
transport,
|
|
54178
|
-
status: 'completed',
|
|
54179
|
-
path: options.path,
|
|
54180
|
-
transferredBytes: written,
|
|
54181
|
-
totalBytes: dataLength,
|
|
54182
|
-
elapsedMs,
|
|
54183
|
-
rateBytesPerSecond: getAverageFileTransferRate(logWindowBytes, logWindowElapsedMs),
|
|
54184
|
-
hostWriteElapsedMs,
|
|
54185
|
-
responseWaitElapsedMs,
|
|
54186
|
-
measuredAttempts,
|
|
54187
|
-
});
|
|
54188
|
-
return Object.assign(Object.assign({}, lastMessage), { path: options.path, offset: startOffset, total_size: totalSize, processed_byte: startOffset + written, chunks });
|
|
54902
|
+
const compressed = encodeLz4Blocked(entry.data);
|
|
54903
|
+
const offset = align(dataOffset);
|
|
54904
|
+
dataOffset = offset + compressed.byteLength;
|
|
54905
|
+
return Object.assign(Object.assign({}, entry), { nameBytes, compressed, offset });
|
|
54189
54906
|
});
|
|
54907
|
+
const archive = new Uint8Array(dataOffset);
|
|
54908
|
+
const view = new DataView(archive.buffer);
|
|
54909
|
+
view.setUint32(0, ARCHIVE_MAGIC, true);
|
|
54910
|
+
view.setUint32(4, ARCHIVE_VERSION, true);
|
|
54911
|
+
view.setUint16(8, encodedEntries.length, true);
|
|
54912
|
+
encodedEntries.forEach((entry, index) => {
|
|
54913
|
+
const recordOffset = ARCHIVE_HEADER_SIZE + index * ARCHIVE_ENTRY_SIZE;
|
|
54914
|
+
archive[recordOffset] = entry.nameBytes.byteLength;
|
|
54915
|
+
archive.set(entry.nameBytes, recordOffset + 1);
|
|
54916
|
+
view.setUint32(recordOffset + 0x100, entry.offset, true);
|
|
54917
|
+
view.setUint32(recordOffset + 0x104, entry.data.byteLength, true);
|
|
54918
|
+
view.setUint32(recordOffset + 0x108, entry.compressed.byteLength, true);
|
|
54919
|
+
view.setUint32(recordOffset + 0x10c, crc32(entry.data), true);
|
|
54920
|
+
view.setUint32(recordOffset + 0x110, crc32(entry.compressed), true);
|
|
54921
|
+
archive[recordOffset + 0x114] = ARCHIVE_COMPRESS_LZ4_BLOCKED;
|
|
54922
|
+
archive.set(entry.compressed, entry.offset);
|
|
54923
|
+
});
|
|
54924
|
+
return archive;
|
|
54925
|
+
}
|
|
54926
|
+
function buildPro2HostAssetPackage(entries) {
|
|
54927
|
+
if (entries.length === 0 || new Set(entries.map(entry => entry.name)).size !== entries.length) {
|
|
54928
|
+
throw new Error('Pro2 host asset package entries must have unique, non-empty names.');
|
|
54929
|
+
}
|
|
54930
|
+
const payload = buildArchive(entries);
|
|
54931
|
+
const header = new Uint8Array(CONTAINER_HEADER_SIZE);
|
|
54932
|
+
const view = new DataView(header.buffer);
|
|
54933
|
+
view.setUint32(0, CONTAINER_HEADER_MAGIC, true);
|
|
54934
|
+
view.setUint32(4, CONTAINER_HEADER_VERSION, true);
|
|
54935
|
+
view.setUint32(8, CONTAINER_RESOURCE_TYPE_MAGIC, true);
|
|
54936
|
+
view.setUint32(0x0c, CONTAINER_HEADER_SIZE, true);
|
|
54937
|
+
view.setUint32(0x10, 1, true);
|
|
54938
|
+
view.setUint32(0x14, payload.byteLength, true);
|
|
54939
|
+
header.set(sha3.sha3_512(payload), CONTAINER_HASH_SECTION_OFFSET);
|
|
54940
|
+
header.set(sha3.sha3_512(header.subarray(0, CONTAINER_HEADER_HASH_INPUT_LENGTH)), 0x240);
|
|
54941
|
+
view.setUint32(CONTAINER_SIGNATURE_ALGORITHM_OFFSET, CONTAINER_ED25519_SIGNATURE_ALGORITHM, true);
|
|
54942
|
+
const packageData = concatBytes([header, payload]);
|
|
54943
|
+
if (packageData.byteLength > HOST_ASSET_PACKAGE_MAX_SIZE) {
|
|
54944
|
+
throw new Error('Pro2 host asset package exceeds the firmware 4 MiB limit.');
|
|
54945
|
+
}
|
|
54946
|
+
return packageData;
|
|
54190
54947
|
}
|
|
54191
54948
|
|
|
54192
54949
|
const WALLPAPER_DIRECTORY = 'vol1:/wallpapers';
|
|
54950
|
+
const WALLPAPER_PACKAGE_PATH = `${WALLPAPER_DIRECTORY}/wallpaper.okpkg`;
|
|
54951
|
+
const WALLPAPER_PACKAGE_ENTRY = 'wallpaper.bin';
|
|
54193
54952
|
const SAFE_FILE_NAME = /^[A-Za-z0-9_-]+(?:\.bin)?$/;
|
|
54194
54953
|
const DEVICE_SETTINGS_SET_MESSAGE_TYPE = 60412;
|
|
54195
54954
|
const FILESYSTEM_FILE_WRITE_MESSAGE_TYPE$2 = 60805;
|
|
@@ -54265,18 +55024,15 @@ class DeviceUploadWallpaper extends BaseMethod {
|
|
|
54265
55024
|
this.directoryReady = true;
|
|
54266
55025
|
});
|
|
54267
55026
|
}
|
|
54268
|
-
upload() {
|
|
55027
|
+
upload(path, data) {
|
|
54269
55028
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54270
55029
|
if (this.uploaded)
|
|
54271
55030
|
return;
|
|
54272
|
-
const { encoded } = this;
|
|
54273
|
-
if (!encoded)
|
|
54274
|
-
throw invalidParameter$1('Wallpaper data has not been initialized.');
|
|
54275
55031
|
yield writeProtocolV2File({
|
|
54276
55032
|
commands: this.device.commands,
|
|
54277
|
-
path
|
|
54278
|
-
data
|
|
54279
|
-
totalSize:
|
|
55033
|
+
path,
|
|
55034
|
+
data,
|
|
55035
|
+
totalSize: data.byteLength,
|
|
54280
55036
|
chunkSize: this.params.chunkSize,
|
|
54281
55037
|
maxChunkRetries: 3,
|
|
54282
55038
|
overwrite: true,
|
|
@@ -54292,14 +55048,20 @@ class DeviceUploadWallpaper extends BaseMethod {
|
|
|
54292
55048
|
});
|
|
54293
55049
|
}
|
|
54294
55050
|
run() {
|
|
54295
|
-
var _a;
|
|
55051
|
+
var _a, _b, _c;
|
|
54296
55052
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54297
55053
|
const { encoded } = this;
|
|
54298
55054
|
if (!encoded)
|
|
54299
55055
|
throw invalidParameter$1('Wallpaper data has not been initialized.');
|
|
54300
55056
|
yield this.assertCapabilities();
|
|
54301
55057
|
yield this.ensureDirectory();
|
|
54302
|
-
|
|
55058
|
+
const useHostAssetPackage = supportsPro2HostAssetPackage((_b = (_a = this.device.state) === null || _a === void 0 ? void 0 : _a.versions.firmware) !== null && _b !== void 0 ? _b : undefined);
|
|
55059
|
+
const data = useHostAssetPackage
|
|
55060
|
+
? buildPro2HostAssetPackage([{ name: WALLPAPER_PACKAGE_ENTRY, data: encoded.data }])
|
|
55061
|
+
: encoded.data;
|
|
55062
|
+
if (useHostAssetPackage)
|
|
55063
|
+
this.path = WALLPAPER_PACKAGE_PATH;
|
|
55064
|
+
yield this.upload(this.path, data);
|
|
54303
55065
|
const response = yield this.device.commands.typedCall('DeviceSettingsSet', 'Success', {
|
|
54304
55066
|
settings: { wallpaper_path: this.path },
|
|
54305
55067
|
});
|
|
@@ -54313,9 +55075,9 @@ class DeviceUploadWallpaper extends BaseMethod {
|
|
|
54313
55075
|
}
|
|
54314
55076
|
return {
|
|
54315
55077
|
path: this.path,
|
|
54316
|
-
size:
|
|
55078
|
+
size: data.byteLength,
|
|
54317
55079
|
colorFormat: encoded.colorFormat,
|
|
54318
|
-
message: (
|
|
55080
|
+
message: (_c = response.message) === null || _c === void 0 ? void 0 : _c.message,
|
|
54319
55081
|
};
|
|
54320
55082
|
});
|
|
54321
55083
|
}
|
|
@@ -54392,14 +55154,14 @@ class DeviceUploadNft extends BaseMethod {
|
|
|
54392
55154
|
this.skipForceUpdateCheck = true;
|
|
54393
55155
|
this.useDevicePassphraseState = false;
|
|
54394
55156
|
}
|
|
54395
|
-
assertCapabilities() {
|
|
55157
|
+
assertCapabilities(useHostAssetPackage) {
|
|
54396
55158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54397
55159
|
const protocolInfo = yield this.device.ensureProtocolV2RuntimeContext();
|
|
54398
55160
|
const hasFileWrite = supportsProtocolV2Message(protocolInfo, FILESYSTEM_FILE_WRITE_MESSAGE_TYPE$1);
|
|
54399
55161
|
const hasPathInfo = supportsProtocolV2Message(protocolInfo, FILESYSTEM_PATH_INFO_QUERY_MESSAGE_TYPE);
|
|
54400
55162
|
const hasDirList = supportsProtocolV2Message(protocolInfo, FILESYSTEM_DIR_LIST_MESSAGE_TYPE);
|
|
54401
55163
|
const hasNftUpdate = supportsProtocolV2Message(protocolInfo, NFT_UPDATE_MESSAGE_TYPE);
|
|
54402
|
-
if (!hasFileWrite || !
|
|
55164
|
+
if (!hasFileWrite || !hasNftUpdate || (!useHostAssetPackage && (!hasPathInfo || !hasDirList))) {
|
|
54403
55165
|
throw hdShared.createDeviceNotSupportMethodError(this.name, this.device.getCurrentFirmwareType());
|
|
54404
55166
|
}
|
|
54405
55167
|
});
|
|
@@ -54425,20 +55187,33 @@ class DeviceUploadNft extends BaseMethod {
|
|
|
54425
55187
|
});
|
|
54426
55188
|
}
|
|
54427
55189
|
run() {
|
|
54428
|
-
var _a;
|
|
55190
|
+
var _a, _b, _c;
|
|
54429
55191
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54430
55192
|
const { bundle } = this;
|
|
54431
55193
|
if (!bundle)
|
|
54432
55194
|
throw invalidParameter$1('NFT data has not been initialized.');
|
|
54433
|
-
|
|
55195
|
+
const useHostAssetPackage = supportsPro2HostAssetPackage((_b = (_a = this.device.state) === null || _a === void 0 ? void 0 : _a.versions.firmware) !== null && _b !== void 0 ? _b : undefined);
|
|
55196
|
+
yield this.assertCapabilities(useHostAssetPackage);
|
|
54434
55197
|
this.throwIfAborted();
|
|
54435
|
-
|
|
55198
|
+
if (!useHostAssetPackage)
|
|
55199
|
+
yield this.assertStorageCapacity(bundle.basename);
|
|
54436
55200
|
this.throwIfAborted();
|
|
54437
|
-
const
|
|
55201
|
+
const extractedFiles = [
|
|
54438
55202
|
{ path: `${PRO2_NFT_DIRECTORY}/${bundle.basename}.bin`, data: bundle.image },
|
|
54439
55203
|
{ path: `${PRO2_NFT_DIRECTORY}/${bundle.basename}_m.bin`, data: bundle.thumbnail },
|
|
54440
55204
|
{ path: `${PRO2_NFT_DIRECTORY}/${bundle.basename}.json`, data: bundle.metadata },
|
|
54441
55205
|
];
|
|
55206
|
+
const files = useHostAssetPackage
|
|
55207
|
+
? [
|
|
55208
|
+
{
|
|
55209
|
+
path: `${PRO2_NFT_DIRECTORY}/${bundle.basename}.okpkg`,
|
|
55210
|
+
data: buildPro2HostAssetPackage(extractedFiles.map(file => ({
|
|
55211
|
+
name: file.path.slice(`${PRO2_NFT_DIRECTORY}/`.length),
|
|
55212
|
+
data: file.data,
|
|
55213
|
+
}))),
|
|
55214
|
+
},
|
|
55215
|
+
]
|
|
55216
|
+
: extractedFiles;
|
|
54442
55217
|
const totalSize = files.reduce((sum, file) => sum + file.data.byteLength, 0);
|
|
54443
55218
|
let transferredBeforeFile = 0;
|
|
54444
55219
|
for (const file of files) {
|
|
@@ -54467,12 +55242,12 @@ class DeviceUploadNft extends BaseMethod {
|
|
|
54467
55242
|
const response = yield this.updateNft(bundle.basename);
|
|
54468
55243
|
return {
|
|
54469
55244
|
basename: bundle.basename,
|
|
54470
|
-
imagePath:
|
|
54471
|
-
thumbnailPath:
|
|
54472
|
-
metadataPath:
|
|
55245
|
+
imagePath: extractedFiles[0].path,
|
|
55246
|
+
thumbnailPath: extractedFiles[1].path,
|
|
55247
|
+
metadataPath: extractedFiles[2].path,
|
|
54473
55248
|
totalSize,
|
|
54474
55249
|
nftUpdated: true,
|
|
54475
|
-
message: (
|
|
55250
|
+
message: (_c = response.message) === null || _c === void 0 ? void 0 : _c.message,
|
|
54476
55251
|
};
|
|
54477
55252
|
});
|
|
54478
55253
|
}
|
|
@@ -54748,6 +55523,8 @@ class ProtocolV2UiInteractionCoordinator {
|
|
|
54748
55523
|
const Log$3 = getLogger(exports.LoggerNames.Core);
|
|
54749
55524
|
const createProtocolV2UnlockContext = () => ({
|
|
54750
55525
|
preflightCompleted: false,
|
|
55526
|
+
preflightStatusRefreshed: false,
|
|
55527
|
+
preflightMainPinSelected: false,
|
|
54751
55528
|
});
|
|
54752
55529
|
const resolvePreUnlockPinType = (method) => {
|
|
54753
55530
|
var _a, _b;
|
|
@@ -54780,10 +55557,11 @@ function runMethodWithUnlockPolicy(method, device, options = {}) {
|
|
|
54780
55557
|
}
|
|
54781
55558
|
yield (afterStatusBeforeUnlock === null || afterStatusBeforeUnlock === void 0 ? void 0 : afterStatusBeforeUnlock());
|
|
54782
55559
|
if (!status.unlocked) {
|
|
55560
|
+
const preUnlockPinType = resolvePreUnlockPinType(method);
|
|
54783
55561
|
const unlockInteraction = shouldCoordinateUi
|
|
54784
55562
|
? uiCoordinator.enterUnlockInteraction(method.name)
|
|
54785
55563
|
: undefined;
|
|
54786
|
-
const unlockedStatus = yield device.unlockDevice(
|
|
55564
|
+
const unlockedStatus = yield device.unlockDevice(preUnlockPinType, shouldCoordinateUi
|
|
54787
55565
|
? { emitUiEvent: false, interaction: unlockInteraction }
|
|
54788
55566
|
: {
|
|
54789
55567
|
source: 'unlock-coordinator',
|
|
@@ -54794,8 +55572,10 @@ function runMethodWithUnlockPolicy(method, device, options = {}) {
|
|
|
54794
55572
|
if ((unlockedStatus === null || unlockedStatus === void 0 ? void 0 : unlockedStatus.unlocked) !== true) {
|
|
54795
55573
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'Protocol V2 device remained locked after the unlock flow.');
|
|
54796
55574
|
}
|
|
55575
|
+
context.preflightMainPinSelected = preUnlockPinType === hdTransport.DeviceSessionPinType.Main;
|
|
54797
55576
|
Log$3.debug('Protocol V2 pre-unlock completed', { method: method.name });
|
|
54798
55577
|
}
|
|
55578
|
+
context.preflightStatusRefreshed = true;
|
|
54799
55579
|
context.preflightCompleted = true;
|
|
54800
55580
|
}
|
|
54801
55581
|
yield (prepare === null || prepare === void 0 ? void 0 : prepare());
|
|
@@ -55084,6 +55864,7 @@ class AllNetworkGetAddressBase extends BaseMethod {
|
|
|
55084
55864
|
const response = yield runMethodWithUnlockPolicy(method, this.device, {
|
|
55085
55865
|
context: this.protocolV2UnlockContext,
|
|
55086
55866
|
prepare: () => __awaiter(this, void 0, void 0, function* () {
|
|
55867
|
+
var _d;
|
|
55087
55868
|
if (this.temporarySafetyCheckPrompted) {
|
|
55088
55869
|
method.temporarySafetyCheckPrompted = true;
|
|
55089
55870
|
}
|
|
@@ -55094,10 +55875,10 @@ class AllNetworkGetAddressBase extends BaseMethod {
|
|
|
55094
55875
|
}
|
|
55095
55876
|
}
|
|
55096
55877
|
const useEmptyPassphrase = this.payload.useEmptyPassphrase === true;
|
|
55097
|
-
const deriveCardano = method.name.startsWith('cardano');
|
|
55878
|
+
const deriveCardano = method.name.startsWith('cardano') ? true : undefined;
|
|
55098
55879
|
const shouldResumeWalletSession = useEmptyPassphrase || !!this.payload.passphraseState;
|
|
55099
55880
|
if (this.device.isProtocolV2() && shouldResumeWalletSession) {
|
|
55100
|
-
const passphraseStateSafety = yield this.device.checkPassphraseStateSafety(this.payload.passphraseState, useEmptyPassphrase, this.payload.skipPassphraseCheck, deriveCardano);
|
|
55881
|
+
const passphraseStateSafety = yield this.device.checkPassphraseStateSafety(this.payload.passphraseState, useEmptyPassphrase, this.payload.skipPassphraseCheck, deriveCardano, (_d = this.protocolV2UnlockContext) === null || _d === void 0 ? void 0 : _d.preflightMainPinSelected);
|
|
55101
55882
|
if (!passphraseStateSafety) {
|
|
55102
55883
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceCheckPassphraseStateError);
|
|
55103
55884
|
}
|
|
@@ -57758,6 +58539,7 @@ class EVMSignTypedData extends BaseMethod {
|
|
|
57758
58539
|
const currentDeviceType = this.device.getCurrentDeviceType();
|
|
57759
58540
|
const supportBiggerDataVersion = '4.4.0';
|
|
57760
58541
|
const supportBiggerData = DeviceModelToTypes.model_classic1s.includes(currentDeviceType) ||
|
|
58542
|
+
DeviceModelToTypes.model_pro2.includes(currentDeviceType) ||
|
|
57761
58543
|
(DeviceModelToTypes.model_touch.includes(currentDeviceType) &&
|
|
57762
58544
|
semver__default["default"].gte(currentVersion, supportBiggerDataVersion));
|
|
57763
58545
|
if (supportBiggerData) {
|
|
@@ -64538,7 +65320,7 @@ class DeviceConnector {
|
|
|
64538
65320
|
stop() {
|
|
64539
65321
|
this.listening = false;
|
|
64540
65322
|
}
|
|
64541
|
-
acquire(path, session, forceCleanRunPromise, expectedProtocol, protocolHint, forceProtocolDetection) {
|
|
65323
|
+
acquire(path, session, forceCleanRunPromise, expectedProtocol, protocolHint, forceProtocolDetection, skipProtocolProbe) {
|
|
64542
65324
|
return __awaiter(this, void 0, void 0, function* () {
|
|
64543
65325
|
Log$2.debug('acquire', path, session, expectedProtocol, protocolHint);
|
|
64544
65326
|
const env = DataManager.getSettings('env');
|
|
@@ -64546,13 +65328,15 @@ class DeviceConnector {
|
|
|
64546
65328
|
const transport = this.getActiveTransport();
|
|
64547
65329
|
let res;
|
|
64548
65330
|
if (DataManager.isBleConnect(env)) {
|
|
64549
|
-
|
|
65331
|
+
const acquireInput = {
|
|
64550
65332
|
uuid: path,
|
|
64551
65333
|
forceCleanRunPromise,
|
|
64552
65334
|
expectedProtocol,
|
|
64553
65335
|
protocolHint,
|
|
64554
65336
|
forceProtocolDetection,
|
|
64555
|
-
|
|
65337
|
+
skipProtocolProbe,
|
|
65338
|
+
};
|
|
65339
|
+
res = yield transport.acquire(acquireInput);
|
|
64556
65340
|
}
|
|
64557
65341
|
else {
|
|
64558
65342
|
res = yield transport.acquire({
|
|
@@ -64561,6 +65345,7 @@ class DeviceConnector {
|
|
|
64561
65345
|
expectedProtocol,
|
|
64562
65346
|
protocolHint,
|
|
64563
65347
|
forceProtocolDetection,
|
|
65348
|
+
skipProtocolProbe,
|
|
64564
65349
|
});
|
|
64565
65350
|
}
|
|
64566
65351
|
if (expectedProtocol) {
|
|
@@ -64838,7 +65623,7 @@ const PRE_INITIALIZE_TTL_MS = 60 * 1000;
|
|
|
64838
65623
|
const PRE_PENDING_CALL_TIMEOUT_MS = 15 * 1000;
|
|
64839
65624
|
const preWarmInflight = new Map();
|
|
64840
65625
|
const preWarmDoneAt = new Map();
|
|
64841
|
-
function
|
|
65626
|
+
function resolveDeriveCardano(method) {
|
|
64842
65627
|
var _a;
|
|
64843
65628
|
if (method.name.startsWith('allNetworkGetAddress') &&
|
|
64844
65629
|
method.payload &&
|
|
@@ -64846,13 +65631,19 @@ function hasDeriveCardano(method) {
|
|
|
64846
65631
|
method.payload.bundle.some(net => net && net.network === 'ada')) {
|
|
64847
65632
|
return true;
|
|
64848
65633
|
}
|
|
64849
|
-
|
|
65634
|
+
if (method.name.startsWith('cardano')) {
|
|
65635
|
+
return true;
|
|
65636
|
+
}
|
|
65637
|
+
if (typeof ((_a = method.payload) === null || _a === void 0 ? void 0 : _a.deriveCardano) === 'boolean') {
|
|
65638
|
+
return method.payload.deriveCardano;
|
|
65639
|
+
}
|
|
65640
|
+
return undefined;
|
|
64850
65641
|
}
|
|
64851
65642
|
const parseInitOptions = (method) => ({
|
|
64852
65643
|
initSession: method === null || method === void 0 ? void 0 : method.payload.initSession,
|
|
64853
65644
|
passphraseState: (method === null || method === void 0 ? void 0 : method.payload.useEmptyPassphrase) ? undefined : method === null || method === void 0 ? void 0 : method.payload.passphraseState,
|
|
64854
65645
|
deviceId: method === null || method === void 0 ? void 0 : method.payload.deviceId,
|
|
64855
|
-
deriveCardano: method
|
|
65646
|
+
deriveCardano: method ? resolveDeriveCardano(method) : undefined,
|
|
64856
65647
|
connectProtocol: method === null || method === void 0 ? void 0 : method.payload.connectProtocol,
|
|
64857
65648
|
forceProtocolDetection: method === null || method === void 0 ? void 0 : method.payload.forceProtocolDetection,
|
|
64858
65649
|
protocolV2DeviceInfoTimeoutMs: method === null || method === void 0 ? void 0 : method.payload.protocolV2DeviceInfoTimeoutMs,
|
|
@@ -65068,6 +65859,8 @@ const onCallDevice = (context, message, method) => __awaiter(void 0, void 0, voi
|
|
|
65068
65859
|
if ((_g = method.payload) === null || _g === void 0 ? void 0 : _g.onlyConnectBleDevice) {
|
|
65069
65860
|
preWarmCallbackTask === null || preWarmCallbackTask === void 0 ? void 0 : preWarmCallbackTask.resolve();
|
|
65070
65861
|
Log.debug('Call API - only connect ble device: ', device === null || device === void 0 ? void 0 : device.mainId);
|
|
65862
|
+
completeMethodRequestContext(method);
|
|
65863
|
+
requestQueue.releaseTask(method.responseID);
|
|
65071
65864
|
return createResponseMessage(method.responseID, true, null);
|
|
65072
65865
|
}
|
|
65073
65866
|
Log.debug('Call API - setDevice: ', device.mainId);
|
|
@@ -65189,7 +65982,7 @@ const onCallDevice = (context, message, method) => __awaiter(void 0, void 0, voi
|
|
|
65189
65982
|
}
|
|
65190
65983
|
},
|
|
65191
65984
|
prepare: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
65192
|
-
var _o, _p, _q, _r, _s;
|
|
65985
|
+
var _o, _p, _q, _r, _s, _t;
|
|
65193
65986
|
if (method.deviceId && method.checkDeviceId && !deviceIdCheckedDuringUnlockPreflight) {
|
|
65194
65987
|
const isSameDeviceID = yield checkLiveDeviceId(device, method.deviceId);
|
|
65195
65988
|
if (!isSameDeviceID) {
|
|
@@ -65209,7 +66002,7 @@ const onCallDevice = (context, message, method) => __awaiter(void 0, void 0, voi
|
|
|
65209
66002
|
require: support.require,
|
|
65210
66003
|
});
|
|
65211
66004
|
}
|
|
65212
|
-
const passphraseStateSafety = yield device.checkPassphraseStateSafety((_o = method.payload) === null || _o === void 0 ? void 0 : _o.passphraseState, (_p = method.payload) === null || _p === void 0 ? void 0 : _p.useEmptyPassphrase, (_q = method.payload) === null || _q === void 0 ? void 0 : _q.skipPassphraseCheck,
|
|
66005
|
+
const passphraseStateSafety = yield device.checkPassphraseStateSafety((_o = method.payload) === null || _o === void 0 ? void 0 : _o.passphraseState, (_p = method.payload) === null || _p === void 0 ? void 0 : _p.useEmptyPassphrase, (_q = method.payload) === null || _q === void 0 ? void 0 : _q.skipPassphraseCheck, resolveDeriveCardano(method), (_r = method.protocolV2UnlockContext) === null || _r === void 0 ? void 0 : _r.preflightMainPinSelected);
|
|
65213
66006
|
checkPassphraseEnableState(method, device.features);
|
|
65214
66007
|
if (!passphraseStateSafety) {
|
|
65215
66008
|
DevicePool.clearDeviceCache(method.payload.connectId);
|
|
@@ -65227,7 +66020,7 @@ const onCallDevice = (context, message, method) => __awaiter(void 0, void 0, voi
|
|
|
65227
66020
|
? e
|
|
65228
66021
|
: hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'open safety check failed.');
|
|
65229
66022
|
}
|
|
65230
|
-
(
|
|
66023
|
+
(_t = (_s = method.device) === null || _s === void 0 ? void 0 : _s.commands) === null || _t === void 0 ? void 0 : _t.checkDisposed();
|
|
65231
66024
|
}),
|
|
65232
66025
|
});
|
|
65233
66026
|
messageResponse = createResponseMessage(method.responseID, true, response);
|
|
@@ -65443,7 +66236,36 @@ function isMissingDetectedProtocolV2Error(method, error) {
|
|
|
65443
66236
|
typeof typedError.message === 'string' &&
|
|
65444
66237
|
typedError.message.includes('Device protocol has not been detected'));
|
|
65445
66238
|
}
|
|
65446
|
-
function
|
|
66239
|
+
function isProtocolV2PeerRemovedPairingError(method, error) {
|
|
66240
|
+
return (method.payload.connectProtocol === 'V2' &&
|
|
66241
|
+
(error === null || error === void 0 ? void 0 : error.errorCode) ===
|
|
66242
|
+
hdShared.HardwareErrorCode.BlePeerRemovedPairingInformation);
|
|
66243
|
+
}
|
|
66244
|
+
const BLE_ACQUIRE_DEADLINE_MS = 60 * 1000;
|
|
66245
|
+
function raceBleAcquire(acquirePromise, abortSignal) {
|
|
66246
|
+
return new Promise((resolve, reject) => {
|
|
66247
|
+
let settled = false;
|
|
66248
|
+
const settle = (fn) => {
|
|
66249
|
+
if (settled)
|
|
66250
|
+
return;
|
|
66251
|
+
settled = true;
|
|
66252
|
+
clearTimeout(deadline);
|
|
66253
|
+
abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener('abort', onAbort);
|
|
66254
|
+
fn();
|
|
66255
|
+
};
|
|
66256
|
+
const onAbort = () => settle(() => reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallQueueActionCancelled)));
|
|
66257
|
+
const deadline = setTimeout(() => settle(() => reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.BleTimeoutError, `BLE acquire exceeded ${BLE_ACQUIRE_DEADLINE_MS}ms deadline`))), BLE_ACQUIRE_DEADLINE_MS);
|
|
66258
|
+
acquirePromise.then(value => settle(() => resolve(value)), error => settle(() => reject(error)));
|
|
66259
|
+
if (abortSignal) {
|
|
66260
|
+
if (abortSignal.aborted) {
|
|
66261
|
+
onAbort();
|
|
66262
|
+
return;
|
|
66263
|
+
}
|
|
66264
|
+
abortSignal.addEventListener('abort', onAbort);
|
|
66265
|
+
}
|
|
66266
|
+
});
|
|
66267
|
+
}
|
|
66268
|
+
function connectDeviceForBle(method, device, abortSignal, retryCount = 0) {
|
|
65447
66269
|
var _a;
|
|
65448
66270
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65449
66271
|
try {
|
|
@@ -65458,9 +66280,31 @@ function connectDeviceForBle(method, device, retryCount = 0) {
|
|
|
65458
66280
|
!device.commands ||
|
|
65459
66281
|
device.commands.disposed;
|
|
65460
66282
|
if (shouldAcquire) {
|
|
65461
|
-
|
|
65462
|
-
|
|
65463
|
-
|
|
66283
|
+
const useAcquireGuards = DataManager.getSettings('env') === 'desktop-web-ble';
|
|
66284
|
+
if (useAcquireGuards && (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted)) {
|
|
66285
|
+
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.CallQueueActionCancelled);
|
|
66286
|
+
}
|
|
66287
|
+
if (!useAcquireGuards) {
|
|
66288
|
+
yield device.acquire(method.payload.connectProtocol, {
|
|
66289
|
+
forceProtocolDetection: method.payload.forceProtocolDetection,
|
|
66290
|
+
});
|
|
66291
|
+
}
|
|
66292
|
+
else {
|
|
66293
|
+
try {
|
|
66294
|
+
yield raceBleAcquire(device.acquire(method.payload.connectProtocol, {
|
|
66295
|
+
forceProtocolDetection: method.payload.forceProtocolDetection,
|
|
66296
|
+
}), abortSignal);
|
|
66297
|
+
}
|
|
66298
|
+
catch (err) {
|
|
66299
|
+
if (err.errorCode === hdShared.HardwareErrorCode.BleTimeoutError &&
|
|
66300
|
+
device.mainId &&
|
|
66301
|
+
device.deviceConnector) {
|
|
66302
|
+
yield device.deviceConnector.disconnect(device.mainId).catch(() => undefined);
|
|
66303
|
+
device.markTransportDisconnected();
|
|
66304
|
+
}
|
|
66305
|
+
throw err;
|
|
66306
|
+
}
|
|
66307
|
+
}
|
|
65464
66308
|
}
|
|
65465
66309
|
if ((_a = method.payload) === null || _a === void 0 ? void 0 : _a.onlyConnectBleDevice) {
|
|
65466
66310
|
if (shouldAcquire) {
|
|
@@ -65491,7 +66335,7 @@ function connectDeviceForBle(method, device, retryCount = 0) {
|
|
|
65491
66335
|
const nextRetry = retryCount + 1;
|
|
65492
66336
|
Log.debug(`Bluetooth connection will retry, retry count: ${nextRetry}`);
|
|
65493
66337
|
yield wait(3000);
|
|
65494
|
-
yield connectDeviceForBle(method, device, nextRetry);
|
|
66338
|
+
yield connectDeviceForBle(method, device, abortSignal, nextRetry);
|
|
65495
66339
|
}
|
|
65496
66340
|
else {
|
|
65497
66341
|
throw err;
|
|
@@ -65508,7 +66352,7 @@ const ensureConnected = (_context, method, connectId, pollingId, abortSignal) =>
|
|
|
65508
66352
|
Log.debug(`EnsureConnected function start, MAX_RETRY_COUNT=${MAX_RETRY_COUNT}, POLL_INTERVAL_TIME=${POLL_INTERVAL_TIME} `);
|
|
65509
66353
|
const poll = (time = POLL_INTERVAL_TIME) => __awaiter(void 0, void 0, void 0, function* () {
|
|
65510
66354
|
return new Promise((resolve, reject) => __awaiter(void 0, void 0, void 0, function* () {
|
|
65511
|
-
var
|
|
66355
|
+
var _u;
|
|
65512
66356
|
const abort = () => {
|
|
65513
66357
|
if (abortSignal && abortSignal.aborted) {
|
|
65514
66358
|
if (timer) {
|
|
@@ -65576,7 +66420,7 @@ const ensureConnected = (_context, method, connectId, pollingId, abortSignal) =>
|
|
|
65576
66420
|
if (tryCount === 1) {
|
|
65577
66421
|
device.beginConnectionAttempt();
|
|
65578
66422
|
}
|
|
65579
|
-
yield connectDeviceForBle(method, device);
|
|
66423
|
+
yield connectDeviceForBle(method, device, abortSignal);
|
|
65580
66424
|
}
|
|
65581
66425
|
resolve(device);
|
|
65582
66426
|
return;
|
|
@@ -65618,7 +66462,8 @@ const ensureConnected = (_context, method, connectId, pollingId, abortSignal) =>
|
|
|
65618
66462
|
hdShared.HardwareErrorCode.BridgeNeedsPermission,
|
|
65619
66463
|
hdShared.HardwareErrorCode.DeviceInterruptedFromUser,
|
|
65620
66464
|
hdShared.HardwareErrorCode.CallQueueActionCancelled,
|
|
65621
|
-
].includes(error.errorCode)
|
|
66465
|
+
].includes(error.errorCode) ||
|
|
66466
|
+
isProtocolV2PeerRemovedPairingError(method, error)) {
|
|
65622
66467
|
reject(error);
|
|
65623
66468
|
return;
|
|
65624
66469
|
}
|
|
@@ -65628,7 +66473,7 @@ const ensureConnected = (_context, method, connectId, pollingId, abortSignal) =>
|
|
|
65628
66473
|
clearTimeout(timer);
|
|
65629
66474
|
}
|
|
65630
66475
|
Log.debug('EnsureConnected get to max try count, will return: ', tryCount);
|
|
65631
|
-
if (DataManager.isBrowserWebUsb(env) && !((
|
|
66476
|
+
if (DataManager.isBrowserWebUsb(env) && !((_u = method.payload) === null || _u === void 0 ? void 0 : _u.skipWebDevicePrompt)) {
|
|
65632
66477
|
postMessage(createUiMessage(UI_REQUEST.WEB_DEVICE_PROMPT_ACCESS_PERMISSION));
|
|
65633
66478
|
reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.WebDeviceNotFoundOrNeedsPermission));
|
|
65634
66479
|
}
|
|
@@ -65653,6 +66498,7 @@ const cancel = (context, connectId) => {
|
|
|
65653
66498
|
requestQueue.cancelCallbackTasks(connectId);
|
|
65654
66499
|
const requestIds = requestQueue.getRequestTasksId();
|
|
65655
66500
|
Log.debug(`Cancel Api connect requestQueues: length:${requestIds.length} requestIds:${requestIds.join(',')}`);
|
|
66501
|
+
requestQueue.abortRequestsByConnectId(connectId);
|
|
65656
66502
|
const canceledDevices = [];
|
|
65657
66503
|
const interruptDevice = (device, deviceConnectId) => {
|
|
65658
66504
|
if (!device || canceledDevices.includes(device)) {
|
|
@@ -65671,7 +66517,6 @@ const cancel = (context, connectId) => {
|
|
|
65671
66517
|
}
|
|
65672
66518
|
}
|
|
65673
66519
|
interruptDevice(deviceCacheMap.get(connectId), connectId);
|
|
65674
|
-
requestQueue.abortRequestsByConnectId(connectId);
|
|
65675
66520
|
pollingManager.stop(connectId);
|
|
65676
66521
|
}
|
|
65677
66522
|
catch (e) {
|
|
@@ -65682,6 +66527,7 @@ const cancel = (context, connectId) => {
|
|
|
65682
66527
|
const env = DataManager.getSettings('env');
|
|
65683
66528
|
if (DataManager.isBleConnect(env)) {
|
|
65684
66529
|
Log.debug('Cancel Api all _deviceList: ');
|
|
66530
|
+
requestQueue.abortAllRequests();
|
|
65685
66531
|
const canceledDevices = [];
|
|
65686
66532
|
const interruptDevice = (device) => {
|
|
65687
66533
|
if (!device || canceledDevices.includes(device)) {
|
|
@@ -65703,7 +66549,6 @@ const cancel = (context, connectId) => {
|
|
|
65703
66549
|
}
|
|
65704
66550
|
}
|
|
65705
66551
|
deviceCacheMap.forEach(interruptDevice);
|
|
65706
|
-
requestQueue.abortAllRequests();
|
|
65707
66552
|
pollingManager.stopAll();
|
|
65708
66553
|
}
|
|
65709
66554
|
else {
|
|
@@ -65741,8 +66586,12 @@ const checkPassphraseEnableState = (method, features) => {
|
|
|
65741
66586
|
}
|
|
65742
66587
|
};
|
|
65743
66588
|
const shouldCheckPassphraseState = (method, device) => {
|
|
66589
|
+
var _a;
|
|
65744
66590
|
if (!method.useDevicePassphraseState)
|
|
65745
66591
|
return false;
|
|
66592
|
+
if (device.isProtocolV2() && ((_a = method.payload) === null || _a === void 0 ? void 0 : _a.useEmptyPassphrase) === true) {
|
|
66593
|
+
return true;
|
|
66594
|
+
}
|
|
65746
66595
|
return device.hasUsePassphrase();
|
|
65747
66596
|
};
|
|
65748
66597
|
const cleanup = () => {
|