@onekeyfe/hd-core 1.2.0-alpha.57 → 1.2.0-alpha.59
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 +84 -2
- package/__tests__/DeviceCommands.test.ts +14 -13
- package/__tests__/core-initialization.test.ts +23 -0
- package/__tests__/device-connector-protocol.test.ts +81 -0
- package/__tests__/device-pool-state.test.ts +22 -0
- package/__tests__/device-settings.test.ts +39 -18
- package/__tests__/device-state-mapper.test.ts +12 -0
- package/__tests__/device-utils.test.ts +48 -1
- package/__tests__/deviceSettings.test.ts +10 -0
- package/__tests__/deviceUploadNft.test.ts +4 -28
- package/__tests__/kaspa-use-tweak-pro2.test.ts +2 -2
- package/__tests__/protocol-v2-resources.test.ts +48 -9
- package/__tests__/protocol-v2-unlock-policy.test.ts +34 -0
- package/__tests__/protocol-v2.test.ts +208 -263
- package/__tests__/protocolV2FileWrite.test.ts +113 -0
- package/__tests__/public-pro2-api-boundary.test.ts +2 -98
- package/__tests__/tron-sign-message-init.test.ts +2 -2
- package/dist/api/CheckAllFirmwareRelease.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV4.d.ts +4 -4
- 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/device/DeviceSettings.d.ts.map +1 -1
- package/dist/api/device/DeviceVerify.d.ts.map +1 -1
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +4 -2
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
- package/dist/api/helpers/protocolV2FileWrite.d.ts +7 -0
- package/dist/api/helpers/protocolV2FileWrite.d.ts.map +1 -1
- package/dist/api/index.d.ts +0 -3
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/kaspa/KaspaGetAddress.d.ts +1 -1
- package/dist/api/kaspa/KaspaSignTransaction.d.ts +1 -1
- package/dist/api/polkadot/PolkadotGetAddress.d.ts +1 -1
- package/dist/api/polkadot/networks.d.ts +1 -1
- package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceUploadNft.d.ts.map +1 -1
- package/dist/api/protocol-v2/helpers.d.ts +5 -15
- package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
- package/dist/api/solana/SolSignMessage.d.ts +1 -1
- package/dist/api/solana/SolSignOffchainMessage.d.ts +1 -1
- package/dist/api/solana/SolSignTransaction.d.ts +2 -2
- package/dist/api/stellar/StellarSignTransaction.d.ts +1 -1
- package/dist/api/sui/SuiGetAddress.d.ts +1 -1
- package/dist/api/sui/SuiGetPublicKey.d.ts +1 -1
- package/dist/api/sui/SuiSignMessage.d.ts +1 -1
- package/dist/api/sui/SuiSignTransaction.d.ts +1 -1
- package/dist/api/ton/TonGetAddress.d.ts +1 -1
- package/dist/api/ton/TonSignMessage.d.ts +1 -1
- package/dist/api/ton/TonSignProof.d.ts +1 -1
- package/dist/api/tron/TronSignMessage.d.ts +2 -2
- package/dist/api/tron/TronSignTransaction.d.ts +1 -1
- package/dist/api/utils.d.ts +1 -6
- package/dist/api/utils.d.ts.map +1 -1
- package/dist/core/index.d.ts +4 -10
- package/dist/core/index.d.ts.map +1 -1
- package/dist/data-manager/DataManager.d.ts +8 -5
- package/dist/data-manager/DataManager.d.ts.map +1 -1
- package/dist/data-manager/TransportManager.d.ts.map +1 -1
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DeviceCommands.d.ts.map +1 -1
- package/dist/device/DeviceConnector.d.ts +2 -1
- package/dist/device/DeviceConnector.d.ts.map +1 -1
- package/dist/device/DevicePool.d.ts.map +1 -1
- package/dist/deviceProfile/protocolV2DeviceIdentity.d.ts.map +1 -1
- package/dist/index.d.ts +87 -756
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +723 -3114
- package/dist/inject.d.ts +2 -6
- package/dist/inject.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/resources.d.ts +2 -2
- package/dist/protocols/protocol-v2/resources.d.ts.map +1 -1
- package/dist/types/api/checkAllFirmwareRelease.d.ts +1 -1
- package/dist/types/api/checkAllFirmwareRelease.d.ts.map +1 -1
- package/dist/types/api/firmwareUpdate.d.ts +3 -2
- package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +3 -176
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/protocolV2.d.ts +2 -8
- package/dist/types/api/protocolV2.d.ts.map +1 -1
- package/dist/types/device.d.ts +2 -2
- package/dist/types/device.d.ts.map +1 -1
- package/dist/types/settings.d.ts +22 -14
- package/dist/types/settings.d.ts.map +1 -1
- package/dist/utils/deviceFeaturesCompat.d.ts.map +1 -1
- package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
- package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
- package/dist/utils/deviceSettings.d.ts.map +1 -1
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/patch.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/CheckAllFirmwareRelease.ts +7 -5
- package/src/api/FirmwareUpdateV4.ts +154 -171
- package/src/api/OpenWalletSession.ts +1 -0
- package/src/api/allnetwork/AllNetworkGetAddressBase.ts +3 -1
- package/src/api/device/DeviceSettings.ts +5 -4
- package/src/api/device/DeviceVerify.ts +0 -2
- package/src/api/firmware/FirmwareUpdateBaseMethod.ts +12 -1
- package/src/api/helpers/protocolV2FileWrite.ts +192 -73
- package/src/api/index.ts +0 -3
- package/src/api/kaspa/KaspaGetAddress.ts +1 -1
- package/src/api/kaspa/KaspaSignTransaction.ts +1 -1
- package/src/api/polkadot/networks.ts +3 -3
- package/src/api/protocol-v2/DeviceFactoryInfoGet.ts +0 -3
- package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +7 -6
- package/src/api/protocol-v2/DeviceUploadNft.ts +7 -12
- package/src/api/protocol-v2/helpers.ts +5 -153
- package/src/api/solana/SolSignMessage.ts +1 -1
- package/src/api/solana/SolSignOffchainMessage.ts +1 -1
- package/src/api/solana/SolSignTransaction.ts +2 -2
- package/src/api/sui/SuiGetAddress.ts +1 -1
- package/src/api/sui/SuiGetPublicKey.ts +1 -1
- package/src/api/sui/SuiSignMessage.ts +1 -1
- package/src/api/sui/SuiSignTransaction.ts +1 -1
- package/src/api/ton/TonGetAddress.ts +1 -1
- package/src/api/ton/TonSignMessage.ts +1 -1
- package/src/api/ton/TonSignProof.ts +1 -1
- package/src/api/tron/TronSignMessage.ts +2 -2
- package/src/api/tron/TronSignTransaction.ts +1 -1
- package/src/api/utils.ts +1 -46
- package/src/core/index.ts +16 -28
- package/src/data-manager/DataManager.ts +51 -11
- package/src/data-manager/TransportManager.ts +6 -0
- package/src/device/Device.ts +15 -6
- package/src/device/DeviceCommands.ts +24 -3
- package/src/device/DeviceConnector.ts +33 -13
- package/src/device/DevicePool.ts +17 -8
- package/src/deviceProfile/buildDeviceFeatures.ts +2 -2
- package/src/deviceProfile/protocolV2DeviceIdentity.ts +3 -0
- package/src/index.ts +0 -5
- package/src/inject.ts +7 -209
- package/src/protocols/protocol-v2/resources.ts +44 -13
- package/src/types/api/checkAllFirmwareRelease.ts +1 -1
- package/src/types/api/firmwareUpdate.ts +5 -5
- package/src/types/api/index.ts +2 -288
- package/src/types/api/protocolV2.ts +2 -43
- package/src/types/device.ts +12 -3
- package/src/types/settings.ts +30 -21
- package/src/utils/deviceFeaturesCompat.ts +5 -0
- package/src/utils/deviceFeaturesUtils.ts +6 -3
- package/src/utils/deviceInfoUtils.ts +2 -0
- package/src/utils/deviceSettings.ts +3 -0
- package/__tests__/public-test-api-boundary.test.ts +0 -167
- package/dist/api/BixinBackupDevice.d.ts +0 -7
- package/dist/api/BixinBackupDevice.d.ts.map +0 -1
- package/dist/api/BixinLoadDevice.d.ts +0 -7
- package/dist/api/BixinLoadDevice.d.ts.map +0 -1
- package/dist/api/BixinMessageSE.d.ts +0 -8
- package/dist/api/BixinMessageSE.d.ts.map +0 -1
- package/dist/api/BixinVerifyDeviceRequest.d.ts +0 -8
- package/dist/api/BixinVerifyDeviceRequest.d.ts.map +0 -1
- package/dist/api/WebAuthnAddResidentCredential.d.ts +0 -8
- package/dist/api/WebAuthnAddResidentCredential.d.ts.map +0 -1
- package/dist/api/WebAuthnListResidentCredentials.d.ts +0 -8
- package/dist/api/WebAuthnListResidentCredentials.d.ts.map +0 -1
- package/dist/api/WebAuthnRemoveResidentCredential.d.ts +0 -8
- package/dist/api/WebAuthnRemoveResidentCredential.d.ts.map +0 -1
- package/dist/api/binance/BinanceGetAddress.d.ts +0 -8
- package/dist/api/binance/BinanceGetAddress.d.ts.map +0 -1
- package/dist/api/binance/BinanceGetPublicKey.d.ts +0 -8
- package/dist/api/binance/BinanceGetPublicKey.d.ts.map +0 -1
- package/dist/api/binance/BinanceSignTx.d.ts +0 -7
- package/dist/api/binance/BinanceSignTx.d.ts.map +0 -1
- package/dist/api/btc/BTCAuthorizeCoinJoin.d.ts +0 -7
- package/dist/api/btc/BTCAuthorizeCoinJoin.d.ts.map +0 -1
- package/dist/api/btc/BTCGetOwnershipId.d.ts +0 -7
- package/dist/api/btc/BTCGetOwnershipId.d.ts.map +0 -1
- package/dist/api/btc/BTCGetOwnershipProof.d.ts +0 -7
- package/dist/api/btc/BTCGetOwnershipProof.d.ts.map +0 -1
- package/dist/api/crypto/CryptoBatchGetPublickeys.d.ts +0 -8
- package/dist/api/crypto/CryptoBatchGetPublickeys.d.ts.map +0 -1
- package/dist/api/crypto/CryptoCipherKeyValue.d.ts +0 -8
- package/dist/api/crypto/CryptoCipherKeyValue.d.ts.map +0 -1
- package/dist/api/crypto/CryptoCosiCommit.d.ts +0 -8
- package/dist/api/crypto/CryptoCosiCommit.d.ts.map +0 -1
- package/dist/api/crypto/CryptoCosiSign.d.ts +0 -8
- package/dist/api/crypto/CryptoCosiSign.d.ts.map +0 -1
- package/dist/api/crypto/CryptoGetECDHSessionKey.d.ts +0 -8
- package/dist/api/crypto/CryptoGetECDHSessionKey.d.ts.map +0 -1
- package/dist/api/crypto/CryptoSignIdentity.d.ts +0 -8
- package/dist/api/crypto/CryptoSignIdentity.d.ts.map +0 -1
- package/dist/api/debug/DebugLinkDecision.d.ts +0 -7
- package/dist/api/debug/DebugLinkDecision.d.ts.map +0 -1
- package/dist/api/debug/DebugLinkEraseSdCard.d.ts +0 -7
- package/dist/api/debug/DebugLinkEraseSdCard.d.ts.map +0 -1
- package/dist/api/debug/DebugLinkFlashErase.d.ts +0 -7
- package/dist/api/debug/DebugLinkFlashErase.d.ts.map +0 -1
- package/dist/api/debug/DebugLinkGetState.d.ts +0 -7
- package/dist/api/debug/DebugLinkGetState.d.ts.map +0 -1
- package/dist/api/debug/DebugLinkMemoryRead.d.ts +0 -7
- package/dist/api/debug/DebugLinkMemoryRead.d.ts.map +0 -1
- package/dist/api/debug/DebugLinkMemoryWrite.d.ts +0 -7
- package/dist/api/debug/DebugLinkMemoryWrite.d.ts.map +0 -1
- package/dist/api/debug/DebugLinkRecordScreen.d.ts +0 -7
- package/dist/api/debug/DebugLinkRecordScreen.d.ts.map +0 -1
- package/dist/api/debug/DebugLinkReseedRandom.d.ts +0 -7
- package/dist/api/debug/DebugLinkReseedRandom.d.ts.map +0 -1
- package/dist/api/debug/DebugLinkStop.d.ts +0 -7
- package/dist/api/debug/DebugLinkStop.d.ts.map +0 -1
- package/dist/api/debug/DebugLinkWatchLayout.d.ts +0 -7
- package/dist/api/debug/DebugLinkWatchLayout.d.ts.map +0 -1
- package/dist/api/emmc/EmmcDirList.d.ts +0 -7
- package/dist/api/emmc/EmmcDirList.d.ts.map +0 -1
- package/dist/api/emmc/EmmcDirMake.d.ts +0 -7
- package/dist/api/emmc/EmmcDirMake.d.ts.map +0 -1
- package/dist/api/emmc/EmmcDirRemove.d.ts +0 -7
- package/dist/api/emmc/EmmcDirRemove.d.ts.map +0 -1
- package/dist/api/emmc/EmmcFileDelete.d.ts +0 -7
- package/dist/api/emmc/EmmcFileDelete.d.ts.map +0 -1
- package/dist/api/emmc/EmmcFileRead.d.ts +0 -7
- package/dist/api/emmc/EmmcFileRead.d.ts.map +0 -1
- package/dist/api/emmc/EmmcFileWrite.d.ts +0 -7
- package/dist/api/emmc/EmmcFileWrite.d.ts.map +0 -1
- package/dist/api/emmc/EmmcFixPermission.d.ts +0 -7
- package/dist/api/emmc/EmmcFixPermission.d.ts.map +0 -1
- package/dist/api/emmc/EmmcPathInfo.d.ts +0 -7
- package/dist/api/emmc/EmmcPathInfo.d.ts.map +0 -1
- package/dist/api/eos/EosGetPublicKey.d.ts +0 -8
- package/dist/api/eos/EosGetPublicKey.d.ts.map +0 -1
- package/dist/api/eos/EosSignTx.d.ts +0 -12
- package/dist/api/eos/EosSignTx.d.ts.map +0 -1
- package/dist/api/evmTrezor/EVMGetAddress.d.ts +0 -10
- package/dist/api/evmTrezor/EVMGetAddress.d.ts.map +0 -1
- package/dist/api/evmTrezor/EVMGetPublicKey.d.ts +0 -16
- package/dist/api/evmTrezor/EVMGetPublicKey.d.ts.map +0 -1
- package/dist/api/evmTrezor/EVMSignMessage.d.ts +0 -7
- package/dist/api/evmTrezor/EVMSignMessage.d.ts.map +0 -1
- package/dist/api/evmTrezor/EVMSignTransaction.d.ts +0 -15
- package/dist/api/evmTrezor/EVMSignTransaction.d.ts.map +0 -1
- package/dist/api/evmTrezor/EVMSignTypedData.d.ts +0 -43
- package/dist/api/evmTrezor/EVMSignTypedData.d.ts.map +0 -1
- package/dist/api/evmTrezor/EVMVerifyMessage.d.ts +0 -7
- package/dist/api/evmTrezor/EVMVerifyMessage.d.ts.map +0 -1
- package/dist/api/evmTrezor/legacyV1/getAddress.d.ts +0 -6
- package/dist/api/evmTrezor/legacyV1/getAddress.d.ts.map +0 -1
- package/dist/api/evmTrezor/legacyV1/getPublicKey.d.ts +0 -6
- package/dist/api/evmTrezor/legacyV1/getPublicKey.d.ts.map +0 -1
- package/dist/api/evmTrezor/legacyV1/signMessage.d.ts +0 -6
- package/dist/api/evmTrezor/legacyV1/signMessage.d.ts.map +0 -1
- package/dist/api/evmTrezor/legacyV1/signTransaction.d.ts +0 -9
- package/dist/api/evmTrezor/legacyV1/signTransaction.d.ts.map +0 -1
- package/dist/api/evmTrezor/legacyV1/signTypedData.d.ts +0 -10
- package/dist/api/evmTrezor/legacyV1/signTypedData.d.ts.map +0 -1
- package/dist/api/evmTrezor/legacyV1/signTypedHash.d.ts +0 -11
- package/dist/api/evmTrezor/legacyV1/signTypedHash.d.ts.map +0 -1
- package/dist/api/evmTrezor/legacyV1/verifyMessage.d.ts +0 -6
- package/dist/api/evmTrezor/legacyV1/verifyMessage.d.ts.map +0 -1
- package/dist/api/extensionMethodNames.d.ts +0 -3
- package/dist/api/extensionMethodNames.d.ts.map +0 -1
- package/dist/api/factoryMethods.d.ts +0 -3
- package/dist/api/factoryMethods.d.ts.map +0 -1
- package/dist/api/firmware/FirmwareErase.d.ts +0 -12
- package/dist/api/firmware/FirmwareErase.d.ts.map +0 -1
- package/dist/api/firmware/FirmwareEraseEx.d.ts +0 -12
- package/dist/api/firmware/FirmwareEraseEx.d.ts.map +0 -1
- package/dist/api/firmware/FirmwareUpdateEmmcTest.d.ts +0 -7
- package/dist/api/firmware/FirmwareUpdateEmmcTest.d.ts.map +0 -1
- package/dist/api/firmware/FirmwareUploadTest.d.ts +0 -7
- package/dist/api/firmware/FirmwareUploadTest.d.ts.map +0 -1
- package/dist/api/firmware/Reboot.d.ts +0 -7
- package/dist/api/firmware/Reboot.d.ts.map +0 -1
- package/dist/api/firmware/SelfTest.d.ts +0 -7
- package/dist/api/firmware/SelfTest.d.ts.map +0 -1
- package/dist/api/manager/DeviceCancelAuthorization.d.ts +0 -7
- package/dist/api/manager/DeviceCancelAuthorization.d.ts.map +0 -1
- package/dist/api/manager/DeviceChangeWipeCode.d.ts +0 -7
- package/dist/api/manager/DeviceChangeWipeCode.d.ts.map +0 -1
- package/dist/api/manager/DeviceDoPreauthorized.d.ts +0 -7
- package/dist/api/manager/DeviceDoPreauthorized.d.ts.map +0 -1
- package/dist/api/manager/DeviceEndSession.d.ts +0 -7
- package/dist/api/manager/DeviceEndSession.d.ts.map +0 -1
- package/dist/api/manager/DeviceGetEntropy.d.ts +0 -7
- package/dist/api/manager/DeviceGetEntropy.d.ts.map +0 -1
- package/dist/api/manager/DeviceGetFirmwareHash.d.ts +0 -7
- package/dist/api/manager/DeviceGetFirmwareHash.d.ts.map +0 -1
- package/dist/api/manager/DeviceInfoSettings.d.ts +0 -7
- package/dist/api/manager/DeviceInfoSettings.d.ts.map +0 -1
- package/dist/api/manager/DeviceLoad.d.ts +0 -7
- package/dist/api/manager/DeviceLoad.d.ts.map +0 -1
- package/dist/api/manager/DevicePing.d.ts +0 -7
- package/dist/api/manager/DevicePing.d.ts.map +0 -1
- package/dist/api/manager/DeviceReadSEPublicCert.d.ts +0 -7
- package/dist/api/manager/DeviceReadSEPublicCert.d.ts.map +0 -1
- package/dist/api/manager/DeviceSESignMessage.d.ts +0 -7
- package/dist/api/manager/DeviceSESignMessage.d.ts.map +0 -1
- package/dist/api/manager/DeviceSdProtect.d.ts +0 -7
- package/dist/api/manager/DeviceSdProtect.d.ts.map +0 -1
- package/dist/api/manager/DeviceSpiFlashRead.d.ts +0 -7
- package/dist/api/manager/DeviceSpiFlashRead.d.ts.map +0 -1
- package/dist/api/manager/DeviceSpiFlashWrite.d.ts +0 -7
- package/dist/api/manager/DeviceSpiFlashWrite.d.ts.map +0 -1
- package/dist/api/manager/DeviceUnlockPath.d.ts +0 -7
- package/dist/api/manager/DeviceUnlockPath.d.ts.map +0 -1
- package/dist/api/manager/DeviceWriteSEPrivateKey.d.ts +0 -7
- package/dist/api/manager/DeviceWriteSEPrivateKey.d.ts.map +0 -1
- package/dist/api/manager/DeviceWriteSEPublicCert.d.ts +0 -7
- package/dist/api/manager/DeviceWriteSEPublicCert.d.ts.map +0 -1
- package/dist/api/manager/GetDeviceInfoSettings.d.ts +0 -7
- package/dist/api/manager/GetDeviceInfoSettings.d.ts.map +0 -1
- package/dist/api/manager/GetPublicKeyMultiple.d.ts +0 -7
- package/dist/api/manager/GetPublicKeyMultiple.d.ts.map +0 -1
- package/dist/api/manager/ListResDir.d.ts +0 -7
- package/dist/api/manager/ListResDir.d.ts.map +0 -1
- package/dist/api/manager/NFTWriteData.d.ts +0 -7
- package/dist/api/manager/NFTWriteData.d.ts.map +0 -1
- package/dist/api/manager/NFTWriteInfo.d.ts +0 -7
- package/dist/api/manager/NFTWriteInfo.d.ts.map +0 -1
- package/dist/api/manager/ReadSEPublicKey.d.ts +0 -7
- package/dist/api/manager/ReadSEPublicKey.d.ts.map +0 -1
- package/dist/api/manager/ResourceUpdate.d.ts +0 -6
- package/dist/api/manager/ResourceUpdate.d.ts.map +0 -1
- package/dist/api/methodExtension.d.ts +0 -13
- package/dist/api/methodExtension.d.ts.map +0 -1
- package/dist/api/monero/MoneroGetAddress.d.ts +0 -9
- package/dist/api/monero/MoneroGetAddress.d.ts.map +0 -1
- package/dist/api/monero/MoneroGetWatchKey.d.ts +0 -8
- package/dist/api/monero/MoneroGetWatchKey.d.ts.map +0 -1
- package/dist/api/nem/NEMDecryptMessage.d.ts +0 -8
- package/dist/api/nem/NEMDecryptMessage.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceFactoryCertificateRead.d.ts +0 -7
- package/dist/api/protocol-v2/DeviceFactoryCertificateRead.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceFactoryCertificateWrite.d.ts +0 -8
- package/dist/api/protocol-v2/DeviceFactoryCertificateWrite.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceFactoryChallengeSign.d.ts +0 -8
- package/dist/api/protocol-v2/DeviceFactoryChallengeSign.d.ts.map +0 -1
- package/dist/api/testMethods.d.ts +0 -82
- package/dist/api/testMethods.d.ts.map +0 -1
- package/dist/api/tezos/TezosGetAddress.d.ts +0 -9
- package/dist/api/tezos/TezosGetAddress.d.ts.map +0 -1
- package/dist/api/tezos/TezosGetPublicKey.d.ts +0 -8
- package/dist/api/tezos/TezosGetPublicKey.d.ts.map +0 -1
- package/dist/api/tezos/TezosSignTx.d.ts +0 -12
- package/dist/api/tezos/TezosSignTx.d.ts.map +0 -1
- package/dist/types/api/binanceGetAddress.d.ts +0 -11
- package/dist/types/api/binanceGetAddress.d.ts.map +0 -1
- package/dist/types/api/binanceGetPublicKey.d.ts +0 -11
- package/dist/types/api/binanceGetPublicKey.d.ts.map +0 -1
- package/dist/types/api/binanceSignTx.d.ts +0 -7
- package/dist/types/api/binanceSignTx.d.ts.map +0 -1
- package/dist/types/api/bixinBackupDevice.d.ts +0 -4
- package/dist/types/api/bixinBackupDevice.d.ts.map +0 -1
- package/dist/types/api/bixinLoadDevice.d.ts +0 -4
- package/dist/types/api/bixinLoadDevice.d.ts.map +0 -1
- package/dist/types/api/bixinMessageSE.d.ts +0 -4
- package/dist/types/api/bixinMessageSE.d.ts.map +0 -1
- package/dist/types/api/bixinVerifyDeviceRequest.d.ts +0 -4
- package/dist/types/api/bixinVerifyDeviceRequest.d.ts.map +0 -1
- package/dist/types/api/btcAuthorizeCoinJoin.d.ts +0 -13
- package/dist/types/api/btcAuthorizeCoinJoin.d.ts.map +0 -1
- package/dist/types/api/btcGetOwnershipId.d.ts +0 -10
- package/dist/types/api/btcGetOwnershipId.d.ts.map +0 -1
- package/dist/types/api/btcGetOwnershipProof.d.ts +0 -13
- package/dist/types/api/btcGetOwnershipProof.d.ts.map +0 -1
- package/dist/types/api/cryptoBatchGetPublickeys.d.ts +0 -12
- package/dist/types/api/cryptoBatchGetPublickeys.d.ts.map +0 -1
- package/dist/types/api/cryptoCipherKeyValue.d.ts +0 -13
- package/dist/types/api/cryptoCipherKeyValue.d.ts.map +0 -1
- package/dist/types/api/cryptoCosiCommit.d.ts +0 -8
- package/dist/types/api/cryptoCosiCommit.d.ts.map +0 -1
- package/dist/types/api/cryptoCosiSign.d.ts +0 -10
- package/dist/types/api/cryptoCosiSign.d.ts.map +0 -1
- package/dist/types/api/cryptoGetECDHSessionKey.d.ts +0 -4
- package/dist/types/api/cryptoGetECDHSessionKey.d.ts.map +0 -1
- package/dist/types/api/cryptoSignIdentity.d.ts +0 -4
- package/dist/types/api/cryptoSignIdentity.d.ts.map +0 -1
- package/dist/types/api/debugLinkDecision.d.ts +0 -4
- package/dist/types/api/debugLinkDecision.d.ts.map +0 -1
- package/dist/types/api/debugLinkEraseSdCard.d.ts +0 -4
- package/dist/types/api/debugLinkEraseSdCard.d.ts.map +0 -1
- package/dist/types/api/debugLinkFlashErase.d.ts +0 -4
- package/dist/types/api/debugLinkFlashErase.d.ts.map +0 -1
- package/dist/types/api/debugLinkGetState.d.ts +0 -4
- package/dist/types/api/debugLinkGetState.d.ts.map +0 -1
- package/dist/types/api/debugLinkMemoryRead.d.ts +0 -4
- package/dist/types/api/debugLinkMemoryRead.d.ts.map +0 -1
- package/dist/types/api/debugLinkMemoryWrite.d.ts +0 -4
- package/dist/types/api/debugLinkMemoryWrite.d.ts.map +0 -1
- package/dist/types/api/debugLinkRecordScreen.d.ts +0 -4
- package/dist/types/api/debugLinkRecordScreen.d.ts.map +0 -1
- package/dist/types/api/debugLinkReseedRandom.d.ts +0 -4
- package/dist/types/api/debugLinkReseedRandom.d.ts.map +0 -1
- package/dist/types/api/debugLinkStop.d.ts +0 -4
- package/dist/types/api/debugLinkStop.d.ts.map +0 -1
- package/dist/types/api/debugLinkWatchLayout.d.ts +0 -4
- package/dist/types/api/debugLinkWatchLayout.d.ts.map +0 -1
- package/dist/types/api/deviceCancelAuthorization.d.ts +0 -4
- package/dist/types/api/deviceCancelAuthorization.d.ts.map +0 -1
- package/dist/types/api/deviceChangeWipeCode.d.ts +0 -4
- package/dist/types/api/deviceChangeWipeCode.d.ts.map +0 -1
- package/dist/types/api/deviceDoPreauthorized.d.ts +0 -4
- package/dist/types/api/deviceDoPreauthorized.d.ts.map +0 -1
- package/dist/types/api/deviceEndSession.d.ts +0 -4
- package/dist/types/api/deviceEndSession.d.ts.map +0 -1
- package/dist/types/api/deviceGetEntropy.d.ts +0 -4
- package/dist/types/api/deviceGetEntropy.d.ts.map +0 -1
- package/dist/types/api/deviceGetFirmwareHash.d.ts +0 -4
- package/dist/types/api/deviceGetFirmwareHash.d.ts.map +0 -1
- package/dist/types/api/deviceGetInfo.d.ts +0 -4
- package/dist/types/api/deviceGetInfo.d.ts.map +0 -1
- package/dist/types/api/deviceInfoSettings.d.ts +0 -4
- package/dist/types/api/deviceInfoSettings.d.ts.map +0 -1
- package/dist/types/api/deviceLoad.d.ts +0 -16
- package/dist/types/api/deviceLoad.d.ts.map +0 -1
- package/dist/types/api/devicePing.d.ts +0 -4
- package/dist/types/api/devicePing.d.ts.map +0 -1
- package/dist/types/api/deviceReadSEPublicCert.d.ts +0 -4
- package/dist/types/api/deviceReadSEPublicCert.d.ts.map +0 -1
- package/dist/types/api/deviceSESignMessage.d.ts +0 -4
- package/dist/types/api/deviceSESignMessage.d.ts.map +0 -1
- package/dist/types/api/deviceSdProtect.d.ts +0 -4
- package/dist/types/api/deviceSdProtect.d.ts.map +0 -1
- package/dist/types/api/deviceSpiFlashRead.d.ts +0 -4
- package/dist/types/api/deviceSpiFlashRead.d.ts.map +0 -1
- package/dist/types/api/deviceSpiFlashWrite.d.ts +0 -4
- package/dist/types/api/deviceSpiFlashWrite.d.ts.map +0 -1
- package/dist/types/api/deviceUnlockPath.d.ts +0 -11
- package/dist/types/api/deviceUnlockPath.d.ts.map +0 -1
- package/dist/types/api/deviceWriteSEPrivateKey.d.ts +0 -4
- package/dist/types/api/deviceWriteSEPrivateKey.d.ts.map +0 -1
- package/dist/types/api/deviceWriteSEPublicCert.d.ts +0 -4
- package/dist/types/api/deviceWriteSEPublicCert.d.ts.map +0 -1
- package/dist/types/api/emmcDirList.d.ts +0 -4
- package/dist/types/api/emmcDirList.d.ts.map +0 -1
- package/dist/types/api/emmcDirMake.d.ts +0 -4
- package/dist/types/api/emmcDirMake.d.ts.map +0 -1
- package/dist/types/api/emmcDirRemove.d.ts +0 -4
- package/dist/types/api/emmcDirRemove.d.ts.map +0 -1
- package/dist/types/api/emmcFileDelete.d.ts +0 -4
- package/dist/types/api/emmcFileDelete.d.ts.map +0 -1
- package/dist/types/api/emmcFileRead.d.ts +0 -4
- package/dist/types/api/emmcFileRead.d.ts.map +0 -1
- package/dist/types/api/emmcFileWrite.d.ts +0 -4
- package/dist/types/api/emmcFileWrite.d.ts.map +0 -1
- package/dist/types/api/emmcFixPermission.d.ts +0 -4
- package/dist/types/api/emmcFixPermission.d.ts.map +0 -1
- package/dist/types/api/emmcPathInfo.d.ts +0 -4
- package/dist/types/api/emmcPathInfo.d.ts.map +0 -1
- package/dist/types/api/eosGetPublicKey.d.ts +0 -8
- package/dist/types/api/eosGetPublicKey.d.ts.map +0 -1
- package/dist/types/api/eosSignTx.d.ts +0 -7
- package/dist/types/api/eosSignTx.d.ts.map +0 -1
- package/dist/types/api/evmGetAddressTrezor.d.ts +0 -15
- package/dist/types/api/evmGetAddressTrezor.d.ts.map +0 -1
- package/dist/types/api/evmGetPublicKeyTrezor.d.ts +0 -20
- package/dist/types/api/evmGetPublicKeyTrezor.d.ts.map +0 -1
- package/dist/types/api/evmSignMessageTrezor.d.ts +0 -9
- package/dist/types/api/evmSignMessageTrezor.d.ts.map +0 -1
- package/dist/types/api/evmSignTransactionTrezor.d.ts +0 -40
- package/dist/types/api/evmSignTransactionTrezor.d.ts.map +0 -1
- package/dist/types/api/evmSignTypedDataTrezor.d.ts +0 -34
- package/dist/types/api/evmSignTypedDataTrezor.d.ts.map +0 -1
- package/dist/types/api/evmVerifyMessageTrezor.d.ts +0 -10
- package/dist/types/api/evmVerifyMessageTrezor.d.ts.map +0 -1
- package/dist/types/api/firmwareErase.d.ts +0 -4
- package/dist/types/api/firmwareErase.d.ts.map +0 -1
- package/dist/types/api/firmwareEraseEx.d.ts +0 -4
- package/dist/types/api/firmwareEraseEx.d.ts.map +0 -1
- package/dist/types/api/firmwareUpdateEmmcTest.d.ts +0 -4
- package/dist/types/api/firmwareUpdateEmmcTest.d.ts.map +0 -1
- package/dist/types/api/firmwareUploadTest.d.ts +0 -4
- package/dist/types/api/firmwareUploadTest.d.ts.map +0 -1
- package/dist/types/api/getPublicKeyMultiple.d.ts +0 -4
- package/dist/types/api/getPublicKeyMultiple.d.ts.map +0 -1
- package/dist/types/api/listResDir.d.ts +0 -4
- package/dist/types/api/listResDir.d.ts.map +0 -1
- package/dist/types/api/moneroGetAddress.d.ts +0 -14
- package/dist/types/api/moneroGetAddress.d.ts.map +0 -1
- package/dist/types/api/moneroGetWatchKey.d.ts +0 -14
- package/dist/types/api/moneroGetWatchKey.d.ts.map +0 -1
- package/dist/types/api/nemDecryptMessage.d.ts +0 -10
- package/dist/types/api/nemDecryptMessage.d.ts.map +0 -1
- package/dist/types/api/nftWriteData.d.ts +0 -4
- package/dist/types/api/nftWriteData.d.ts.map +0 -1
- package/dist/types/api/nftWriteInfo.d.ts +0 -4
- package/dist/types/api/nftWriteInfo.d.ts.map +0 -1
- package/dist/types/api/readSEPublicKey.d.ts +0 -4
- package/dist/types/api/readSEPublicKey.d.ts.map +0 -1
- package/dist/types/api/reboot.d.ts +0 -4
- package/dist/types/api/reboot.d.ts.map +0 -1
- package/dist/types/api/resourceUpdate.d.ts +0 -7
- package/dist/types/api/resourceUpdate.d.ts.map +0 -1
- package/dist/types/api/selfTest.d.ts +0 -4
- package/dist/types/api/selfTest.d.ts.map +0 -1
- package/dist/types/api/tezosGetAddress.d.ts +0 -14
- package/dist/types/api/tezosGetAddress.d.ts.map +0 -1
- package/dist/types/api/tezosGetPublicKey.d.ts +0 -14
- package/dist/types/api/tezosGetPublicKey.d.ts.map +0 -1
- package/dist/types/api/tezosSignTx.d.ts +0 -7
- package/dist/types/api/tezosSignTx.d.ts.map +0 -1
- package/dist/types/api/webAuthnAddResidentCredential.d.ts +0 -4
- package/dist/types/api/webAuthnAddResidentCredential.d.ts.map +0 -1
- package/dist/types/api/webAuthnListResidentCredentials.d.ts +0 -4
- package/dist/types/api/webAuthnListResidentCredentials.d.ts.map +0 -1
- package/dist/types/api/webAuthnRemoveResidentCredential.d.ts +0 -4
- package/dist/types/api/webAuthnRemoveResidentCredential.d.ts.map +0 -1
- package/src/api/BixinBackupDevice.ts +0 -15
- package/src/api/BixinLoadDevice.ts +0 -22
- package/src/api/BixinMessageSE.ts +0 -22
- package/src/api/BixinVerifyDeviceRequest.ts +0 -22
- package/src/api/WebAuthnAddResidentCredential.ts +0 -22
- package/src/api/WebAuthnListResidentCredentials.ts +0 -24
- package/src/api/WebAuthnRemoveResidentCredential.ts +0 -22
- package/src/api/binance/BinanceGetAddress.ts +0 -26
- package/src/api/binance/BinanceGetPublicKey.ts +0 -26
- package/src/api/binance/BinanceSignTx.ts +0 -35
- package/src/api/btc/BTCAuthorizeCoinJoin.ts +0 -37
- package/src/api/btc/BTCGetOwnershipId.ts +0 -34
- package/src/api/btc/BTCGetOwnershipProof.ts +0 -37
- package/src/api/crypto/CryptoBatchGetPublickeys.ts +0 -30
- package/src/api/crypto/CryptoCipherKeyValue.ts +0 -29
- package/src/api/crypto/CryptoCosiCommit.ts +0 -24
- package/src/api/crypto/CryptoCosiSign.ts +0 -26
- package/src/api/crypto/CryptoGetECDHSessionKey.ts +0 -24
- package/src/api/crypto/CryptoSignIdentity.ts +0 -25
- package/src/api/debug/DebugLinkDecision.ts +0 -25
- package/src/api/debug/DebugLinkEraseSdCard.ts +0 -23
- package/src/api/debug/DebugLinkFlashErase.ts +0 -23
- package/src/api/debug/DebugLinkGetState.ts +0 -21
- package/src/api/debug/DebugLinkMemoryRead.ts +0 -24
- package/src/api/debug/DebugLinkMemoryWrite.ts +0 -25
- package/src/api/debug/DebugLinkRecordScreen.ts +0 -23
- package/src/api/debug/DebugLinkReseedRandom.ts +0 -23
- package/src/api/debug/DebugLinkStop.ts +0 -25
- package/src/api/debug/DebugLinkWatchLayout.ts +0 -23
- package/src/api/emmc/EmmcDirList.ts +0 -20
- package/src/api/emmc/EmmcDirMake.ts +0 -20
- package/src/api/emmc/EmmcDirRemove.ts +0 -20
- package/src/api/emmc/EmmcFileDelete.ts +0 -20
- package/src/api/emmc/EmmcFileRead.ts +0 -21
- package/src/api/emmc/EmmcFileWrite.ts +0 -23
- package/src/api/emmc/EmmcFixPermission.ts +0 -17
- package/src/api/emmc/EmmcPathInfo.ts +0 -20
- package/src/api/eos/EosGetPublicKey.ts +0 -26
- package/src/api/eos/EosSignTx.ts +0 -40
- package/src/api/evmTrezor/EVMGetAddress.ts +0 -75
- package/src/api/evmTrezor/EVMGetPublicKey.ts +0 -106
- package/src/api/evmTrezor/EVMSignMessage.ts +0 -40
- package/src/api/evmTrezor/EVMSignTransaction.ts +0 -83
- package/src/api/evmTrezor/EVMSignTypedData.ts +0 -366
- package/src/api/evmTrezor/EVMVerifyMessage.ts +0 -37
- package/src/api/evmTrezor/legacyV1/getAddress.ts +0 -16
- package/src/api/evmTrezor/legacyV1/getPublicKey.ts +0 -20
- package/src/api/evmTrezor/legacyV1/signMessage.ts +0 -22
- package/src/api/evmTrezor/legacyV1/signTransaction.ts +0 -24
- package/src/api/evmTrezor/legacyV1/signTypedData.ts +0 -36
- package/src/api/evmTrezor/legacyV1/signTypedHash.ts +0 -48
- package/src/api/evmTrezor/legacyV1/verifyMessage.ts +0 -19
- package/src/api/extensionMethodNames.ts +0 -88
- package/src/api/factoryMethods.ts +0 -2
- package/src/api/firmware/FirmwareErase.ts +0 -18
- package/src/api/firmware/FirmwareEraseEx.ts +0 -18
- package/src/api/firmware/FirmwareUpdateEmmcTest.ts +0 -18
- package/src/api/firmware/FirmwareUploadTest.ts +0 -17
- package/src/api/firmware/Reboot.ts +0 -17
- package/src/api/firmware/SelfTest.ts +0 -17
- package/src/api/manager/DeviceCancelAuthorization.ts +0 -15
- package/src/api/manager/DeviceChangeWipeCode.ts +0 -19
- package/src/api/manager/DeviceDoPreauthorized.ts +0 -15
- package/src/api/manager/DeviceEndSession.ts +0 -19
- package/src/api/manager/DeviceGetEntropy.ts +0 -19
- package/src/api/manager/DeviceGetFirmwareHash.ts +0 -23
- package/src/api/manager/DeviceInfoSettings.ts +0 -23
- package/src/api/manager/DeviceLoad.ts +0 -27
- package/src/api/manager/DevicePing.ts +0 -19
- package/src/api/manager/DeviceReadSEPublicCert.ts +0 -18
- package/src/api/manager/DeviceSESignMessage.ts +0 -23
- package/src/api/manager/DeviceSdProtect.ts +0 -18
- package/src/api/manager/DeviceSpiFlashRead.ts +0 -22
- package/src/api/manager/DeviceSpiFlashWrite.ts +0 -22
- package/src/api/manager/DeviceUnlockPath.ts +0 -26
- package/src/api/manager/DeviceWriteSEPrivateKey.ts +0 -23
- package/src/api/manager/DeviceWriteSEPublicCert.ts +0 -23
- package/src/api/manager/GetDeviceInfoSettings.ts +0 -20
- package/src/api/manager/GetPublicKeyMultiple.ts +0 -24
- package/src/api/manager/ListResDir.ts +0 -19
- package/src/api/manager/NFTWriteData.ts +0 -21
- package/src/api/manager/NFTWriteInfo.ts +0 -23
- package/src/api/manager/ReadSEPublicKey.ts +0 -20
- package/src/api/manager/ResourceUpdate.ts +0 -22
- package/src/api/methodExtension.ts +0 -27
- package/src/api/monero/MoneroGetAddress.ts +0 -64
- package/src/api/monero/MoneroGetWatchKey.ts +0 -59
- package/src/api/nem/NEMDecryptMessage.ts +0 -29
- package/src/api/protocol-v2/DeviceFactoryCertificateRead.ts +0 -25
- package/src/api/protocol-v2/DeviceFactoryCertificateWrite.ts +0 -30
- package/src/api/protocol-v2/DeviceFactoryChallengeSign.ts +0 -28
- package/src/api/testMethods.ts +0 -95
- package/src/api/tezos/TezosGetAddress.ts +0 -64
- package/src/api/tezos/TezosGetPublicKey.ts +0 -63
- package/src/api/tezos/TezosSignTx.ts +0 -44
- package/src/types/api/binanceGetAddress.ts +0 -17
- package/src/types/api/binanceGetPublicKey.ts +0 -17
- package/src/types/api/binanceSignTx.ts +0 -15
- package/src/types/api/bixinBackupDevice.ts +0 -8
- package/src/types/api/bixinLoadDevice.ts +0 -8
- package/src/types/api/bixinMessageSE.ts +0 -8
- package/src/types/api/bixinVerifyDeviceRequest.ts +0 -8
- package/src/types/api/btcAuthorizeCoinJoin.ts +0 -18
- package/src/types/api/btcGetOwnershipId.ts +0 -19
- package/src/types/api/btcGetOwnershipProof.ts +0 -22
- package/src/types/api/cryptoBatchGetPublickeys.ts +0 -18
- package/src/types/api/cryptoCipherKeyValue.ts +0 -18
- package/src/types/api/cryptoCosiCommit.ts +0 -13
- package/src/types/api/cryptoCosiSign.ts +0 -15
- package/src/types/api/cryptoGetECDHSessionKey.ts +0 -8
- package/src/types/api/cryptoSignIdentity.ts +0 -8
- package/src/types/api/debugLinkDecision.ts +0 -7
- package/src/types/api/debugLinkEraseSdCard.ts +0 -7
- package/src/types/api/debugLinkFlashErase.ts +0 -7
- package/src/types/api/debugLinkGetState.ts +0 -7
- package/src/types/api/debugLinkMemoryRead.ts +0 -7
- package/src/types/api/debugLinkMemoryWrite.ts +0 -7
- package/src/types/api/debugLinkRecordScreen.ts +0 -7
- package/src/types/api/debugLinkReseedRandom.ts +0 -7
- package/src/types/api/debugLinkStop.ts +0 -7
- package/src/types/api/debugLinkWatchLayout.ts +0 -7
- package/src/types/api/deviceCancelAuthorization.ts +0 -7
- package/src/types/api/deviceChangeWipeCode.ts +0 -7
- package/src/types/api/deviceDoPreauthorized.ts +0 -7
- package/src/types/api/deviceEndSession.ts +0 -7
- package/src/types/api/deviceGetEntropy.ts +0 -7
- package/src/types/api/deviceGetFirmwareHash.ts +0 -7
- package/src/types/api/deviceGetInfo.ts +0 -7
- package/src/types/api/deviceInfoSettings.ts +0 -7
- package/src/types/api/deviceLoad.ts +0 -19
- package/src/types/api/devicePing.ts +0 -7
- package/src/types/api/deviceReadSEPublicCert.ts +0 -7
- package/src/types/api/deviceSESignMessage.ts +0 -7
- package/src/types/api/deviceSdProtect.ts +0 -7
- package/src/types/api/deviceSpiFlashRead.ts +0 -7
- package/src/types/api/deviceSpiFlashWrite.ts +0 -7
- package/src/types/api/deviceUnlockPath.ts +0 -16
- package/src/types/api/deviceWriteSEPrivateKey.ts +0 -7
- package/src/types/api/deviceWriteSEPublicCert.ts +0 -7
- package/src/types/api/emmcDirList.ts +0 -7
- package/src/types/api/emmcDirMake.ts +0 -7
- package/src/types/api/emmcDirRemove.ts +0 -7
- package/src/types/api/emmcFileDelete.ts +0 -7
- package/src/types/api/emmcFileRead.ts +0 -7
- package/src/types/api/emmcFileWrite.ts +0 -7
- package/src/types/api/emmcFixPermission.ts +0 -7
- package/src/types/api/emmcPathInfo.ts +0 -7
- package/src/types/api/eosGetPublicKey.ts +0 -13
- package/src/types/api/eosSignTx.ts +0 -12
- package/src/types/api/evmGetAddressTrezor.ts +0 -24
- package/src/types/api/evmGetPublicKeyTrezor.ts +0 -31
- package/src/types/api/evmSignMessageTrezor.ts +0 -14
- package/src/types/api/evmSignTransactionTrezor.ts +0 -49
- package/src/types/api/evmSignTypedDataTrezor.ts +0 -42
- package/src/types/api/evmVerifyMessageTrezor.ts +0 -15
- package/src/types/api/firmwareErase.ts +0 -4
- package/src/types/api/firmwareEraseEx.ts +0 -7
- package/src/types/api/firmwareUpdateEmmcTest.ts +0 -7
- package/src/types/api/firmwareUploadTest.ts +0 -7
- package/src/types/api/getPublicKeyMultiple.ts +0 -11
- package/src/types/api/listResDir.ts +0 -8
- package/src/types/api/moneroGetAddress.ts +0 -23
- package/src/types/api/moneroGetWatchKey.ts +0 -26
- package/src/types/api/nemDecryptMessage.ts +0 -15
- package/src/types/api/nftWriteData.ts +0 -8
- package/src/types/api/nftWriteInfo.ts +0 -8
- package/src/types/api/readSEPublicKey.ts +0 -8
- package/src/types/api/reboot.ts +0 -4
- package/src/types/api/resourceUpdate.ts +0 -11
- package/src/types/api/selfTest.ts +0 -7
- package/src/types/api/tezosGetAddress.ts +0 -23
- package/src/types/api/tezosGetPublicKey.ts +0 -23
- package/src/types/api/tezosSignTx.ts +0 -12
- package/src/types/api/webAuthnAddResidentCredential.ts +0 -8
- package/src/types/api/webAuthnListResidentCredentials.ts +0 -8
- package/src/types/api/webAuthnRemoveResidentCredential.ts +0 -8
|
@@ -14,9 +14,6 @@ import DirList from '../src/api/DirList';
|
|
|
14
14
|
import FileRead from '../src/api/FileRead';
|
|
15
15
|
import FileWrite from '../src/api/FileWrite';
|
|
16
16
|
import UploadPortfolio from '../src/api/UploadPortfolio';
|
|
17
|
-
import DeviceFactoryCertificateRead from '../src/api/protocol-v2/DeviceFactoryCertificateRead';
|
|
18
|
-
import DeviceFactoryCertificateWrite from '../src/api/protocol-v2/DeviceFactoryCertificateWrite';
|
|
19
|
-
import DeviceFactoryChallengeSign from '../src/api/protocol-v2/DeviceFactoryChallengeSign';
|
|
20
17
|
import DeviceFactoryInfoGet from '../src/api/protocol-v2/DeviceFactoryInfoGet';
|
|
21
18
|
import DeviceFactoryInfoSet from '../src/api/protocol-v2/DeviceFactoryInfoSet';
|
|
22
19
|
import DeviceFirmwareUpdate from '../src/api/protocol-v2/DeviceFirmwareUpdate';
|
|
@@ -592,7 +589,7 @@ describe('Protocol V2 feature adapter', () => {
|
|
|
592
589
|
} as any);
|
|
593
590
|
const protocolV2 = buildProtocolV2FeaturesPayload({
|
|
594
591
|
deviceInfo: {
|
|
595
|
-
hw: { serial_no: 'P2-001' },
|
|
592
|
+
hw: { Device_type: DeviceType.PRO2, serial_no: 'P2-001' },
|
|
596
593
|
coprocessor: { bt_adv_name: 'Pro 2 BLE' },
|
|
597
594
|
},
|
|
598
595
|
deviceStatus: {
|
|
@@ -2699,8 +2696,10 @@ describe('Protocol V2 feature adapter', () => {
|
|
|
2699
2696
|
).rejects.toThrow('DeviceInfo not supported');
|
|
2700
2697
|
});
|
|
2701
2698
|
|
|
2702
|
-
test('does not inherit Pro or
|
|
2703
|
-
const features = normalizeProtocolV2Features({ ...descriptor, protocolType: 'V2' } as any
|
|
2699
|
+
test('does not inherit Pro or model_touch ranges for Protocol V2 devices', () => {
|
|
2700
|
+
const features = normalizeProtocolV2Features({ ...descriptor, protocolType: 'V2' } as any, {
|
|
2701
|
+
hw: { Device_type: DeviceType.PRO2 },
|
|
2702
|
+
});
|
|
2704
2703
|
const checkedTypes: string[] = [];
|
|
2705
2704
|
|
|
2706
2705
|
const versionRange = getMethodVersionRange(features, type => {
|
|
@@ -2712,11 +2711,13 @@ describe('Protocol V2 feature adapter', () => {
|
|
|
2712
2711
|
});
|
|
2713
2712
|
|
|
2714
2713
|
expect(versionRange).toBeUndefined();
|
|
2715
|
-
expect(checkedTypes).toEqual(['pro2']);
|
|
2714
|
+
expect(checkedTypes).toEqual(['pro2', 'model_pro2']);
|
|
2716
2715
|
});
|
|
2717
2716
|
|
|
2718
2717
|
test('uses firmware-v1 as the Pro2 remote firmware config field', () => {
|
|
2719
|
-
const features = normalizeProtocolV2Features({ ...descriptor, protocolType: 'V2' } as any
|
|
2718
|
+
const features = normalizeProtocolV2Features({ ...descriptor, protocolType: 'V2' } as any, {
|
|
2719
|
+
hw: { Device_type: DeviceType.PRO2 },
|
|
2720
|
+
});
|
|
2720
2721
|
|
|
2721
2722
|
expect(
|
|
2722
2723
|
getFirmwareUpdateField({
|
|
@@ -3626,71 +3627,77 @@ describe('API compatibility handling', () => {
|
|
|
3626
3627
|
});
|
|
3627
3628
|
});
|
|
3628
3629
|
|
|
3629
|
-
test('
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3630
|
+
test.each(['pro2', 'neo'] as const)(
|
|
3631
|
+
'allows %s Solana signing methods through Protocol V2 version checks',
|
|
3632
|
+
deviceType => {
|
|
3633
|
+
const features = {
|
|
3634
|
+
deviceType,
|
|
3635
|
+
} as Features;
|
|
3633
3636
|
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3637
|
+
const solSignMessageMethod = new SolSignMessage({
|
|
3638
|
+
id: 1,
|
|
3639
|
+
payload: {
|
|
3640
|
+
method: 'solSignMessage',
|
|
3641
|
+
path: "m/44'/501'/0'/0'",
|
|
3642
|
+
messageHex: '48656c6c6f',
|
|
3643
|
+
},
|
|
3644
|
+
});
|
|
3645
|
+
const solSignOffchainMessageMethod = new SolSignOffchainMessage({
|
|
3646
|
+
id: 2,
|
|
3647
|
+
payload: {
|
|
3648
|
+
method: 'solSignOffchainMessage',
|
|
3649
|
+
path: "m/44'/501'/0'/0'",
|
|
3650
|
+
messageHex: '48656c6c6f',
|
|
3651
|
+
},
|
|
3652
|
+
});
|
|
3653
|
+
const solSignTransactionMethod = new SolSignTransaction({
|
|
3654
|
+
id: 3,
|
|
3655
|
+
payload: {
|
|
3656
|
+
method: 'solSignTransaction',
|
|
3657
|
+
path: "m/44'/501'/0'/0'",
|
|
3658
|
+
rawTx: '00',
|
|
3659
|
+
},
|
|
3660
|
+
});
|
|
3661
|
+
const solSignVersionedTransactionMethod = new SolSignTransaction({
|
|
3662
|
+
id: 4,
|
|
3663
|
+
payload: {
|
|
3664
|
+
method: 'solSignTransaction',
|
|
3665
|
+
path: "m/44'/501'/0'/0'",
|
|
3666
|
+
rawTx: '80',
|
|
3667
|
+
},
|
|
3668
|
+
});
|
|
3666
3669
|
|
|
3667
|
-
|
|
3668
|
-
|
|
3670
|
+
solSignTransactionMethod.init();
|
|
3671
|
+
solSignVersionedTransactionMethod.init();
|
|
3669
3672
|
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3673
|
+
expect(
|
|
3674
|
+
getMethodVersionRange(features, type => solSignMessageMethod.getVersionRange()[type])
|
|
3675
|
+
).toEqual({
|
|
3676
|
+
min: '0.0.0',
|
|
3677
|
+
});
|
|
3678
|
+
expect(
|
|
3679
|
+
getMethodVersionRange(
|
|
3680
|
+
features,
|
|
3681
|
+
type => solSignOffchainMessageMethod.getVersionRange()[type]
|
|
3682
|
+
)
|
|
3683
|
+
).toEqual({
|
|
3684
|
+
min: '0.0.0',
|
|
3685
|
+
});
|
|
3686
|
+
expect(
|
|
3687
|
+
getMethodVersionRange(features, type => solSignTransactionMethod.getVersionRange()[type])
|
|
3688
|
+
).toEqual({
|
|
3689
|
+
min: '0.0.0',
|
|
3690
|
+
});
|
|
3691
|
+
expect(
|
|
3692
|
+
getMethodVersionRange(
|
|
3693
|
+
features,
|
|
3694
|
+
type => solSignVersionedTransactionMethod.getVersionRange()[type]
|
|
3695
|
+
)
|
|
3696
|
+
).toEqual({
|
|
3697
|
+
min: '0.0.0',
|
|
3698
|
+
});
|
|
3699
|
+
}
|
|
3700
|
+
);
|
|
3694
3701
|
|
|
3695
3702
|
test('uses chunk transfer for large Sui transactions on Protocol V2', async () => {
|
|
3696
3703
|
const rawTx = '0x'.concat('ab'.repeat(5000));
|
|
@@ -3786,7 +3793,7 @@ describe('API compatibility handling', () => {
|
|
|
3786
3793
|
|
|
3787
3794
|
describe('Protocol V2 firmware update targets', () => {
|
|
3788
3795
|
const OKPP_HEADER_SIZE = 0x52a0;
|
|
3789
|
-
let forceReloadDataSpy: jest.SpyInstance
|
|
3796
|
+
let forceReloadDataSpy: jest.SpyInstance;
|
|
3790
3797
|
|
|
3791
3798
|
beforeEach(() => {
|
|
3792
3799
|
forceReloadDataSpy = jest.spyOn(DataManager, 'forceReloadData').mockResolvedValue(undefined);
|
|
@@ -4057,6 +4064,10 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4057
4064
|
originalDescriptor: { id: 'usb-id', path: 'usb-path', protocolType: 'V2' },
|
|
4058
4065
|
features: { bootloader_mode: false, capabilities: [] },
|
|
4059
4066
|
isBootloader: () => false,
|
|
4067
|
+
probeProtocolV2RuntimeState: jest.fn().mockResolvedValue({
|
|
4068
|
+
mode: 'bootloader',
|
|
4069
|
+
bootloaderMode: true,
|
|
4070
|
+
}),
|
|
4060
4071
|
});
|
|
4061
4072
|
(method as any).protocolV2Reboot = jest.fn().mockResolvedValue({
|
|
4062
4073
|
message: 'Device rebooted successfully',
|
|
@@ -4084,6 +4095,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4084
4095
|
(method as any).reconnectProtocolV2Device = reconnectProtocolV2Device;
|
|
4085
4096
|
(method as any).device.getCommands = () => ({ typedCall });
|
|
4086
4097
|
(method as any).protocolV2ExpectedSerialNumber = 'PR9999999999';
|
|
4098
|
+
(method as any).protocolV2ExpectedPath = 'usb-path';
|
|
4087
4099
|
method.postTipMessage = jest.fn();
|
|
4088
4100
|
|
|
4089
4101
|
await (method as any).enterProtocolV2BootloaderMode();
|
|
@@ -4095,6 +4107,38 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4095
4107
|
expect(reconnectProtocolV2Device).toHaveBeenCalledTimes(1);
|
|
4096
4108
|
});
|
|
4097
4109
|
|
|
4110
|
+
test('announces bootloader success only after Protocol V2 bootloader mode is confirmed', async () => {
|
|
4111
|
+
const method = new FirmwareUpdateV4({
|
|
4112
|
+
id: 1,
|
|
4113
|
+
payload: {
|
|
4114
|
+
method: 'firmwareUpdateV4',
|
|
4115
|
+
},
|
|
4116
|
+
});
|
|
4117
|
+
(method as any).device = stubDevice({
|
|
4118
|
+
features: { bootloader_mode: false, capabilities: [] },
|
|
4119
|
+
isBootloader: () => false,
|
|
4120
|
+
isRomloader: () => false,
|
|
4121
|
+
});
|
|
4122
|
+
(method as any).protocolV2Reboot = jest.fn().mockResolvedValue({
|
|
4123
|
+
message: 'Device rebooted successfully',
|
|
4124
|
+
});
|
|
4125
|
+
|
|
4126
|
+
const tipMessages: string[] = [];
|
|
4127
|
+
method.postTipMessage = jest.fn((message: string) => {
|
|
4128
|
+
tipMessages.push(message);
|
|
4129
|
+
});
|
|
4130
|
+
let successWasAnnouncedBeforeConfirmation = false;
|
|
4131
|
+
(method as any).waitForProtocolV2BootloaderMode = jest.fn().mockImplementation(() => {
|
|
4132
|
+
successWasAnnouncedBeforeConfirmation = tipMessages.includes('GoToBootloaderSuccess');
|
|
4133
|
+
return Promise.resolve({ mode: 'bootloader' });
|
|
4134
|
+
});
|
|
4135
|
+
|
|
4136
|
+
await (method as any).enterProtocolV2BootloaderMode();
|
|
4137
|
+
|
|
4138
|
+
expect(successWasAnnouncedBeforeConfirmation).toBe(false);
|
|
4139
|
+
expect(tipMessages).toEqual(['AutoRebootToBootloader', 'GoToBootloaderSuccess']);
|
|
4140
|
+
});
|
|
4141
|
+
|
|
4098
4142
|
test('keeps Protocol V2 bootloader active before firmware transfer', async () => {
|
|
4099
4143
|
const method = new FirmwareUpdateV4({
|
|
4100
4144
|
id: 1,
|
|
@@ -4120,6 +4164,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4120
4164
|
|
|
4121
4165
|
expect((method as any).protocolV2Reboot).not.toHaveBeenCalled();
|
|
4122
4166
|
expect(method.postTipMessage).not.toHaveBeenCalledWith('AutoRebootToBootloader');
|
|
4167
|
+
expect(method.postTipMessage).toHaveBeenCalledWith('GoToBootloaderSuccess');
|
|
4123
4168
|
});
|
|
4124
4169
|
|
|
4125
4170
|
test('keeps Protocol V2 romloader active before firmware transfer', async () => {
|
|
@@ -4209,6 +4254,10 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4209
4254
|
originalDescriptor: { id: 'usb-id', path: 'app-path', protocolType: 'V2' },
|
|
4210
4255
|
features: { bootloader_mode: false, capabilities: [] },
|
|
4211
4256
|
isBootloader: () => false,
|
|
4257
|
+
probeProtocolV2RuntimeState: jest.fn().mockResolvedValue({
|
|
4258
|
+
mode: 'bootloader',
|
|
4259
|
+
bootloaderMode: true,
|
|
4260
|
+
}),
|
|
4212
4261
|
});
|
|
4213
4262
|
const typedCall = jest.fn().mockImplementation((requestType: string) => {
|
|
4214
4263
|
if (requestType === 'DeviceInfoGet') {
|
|
@@ -4236,15 +4285,13 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4236
4285
|
(method as any).reconnectProtocolV2Device = reconnectProtocolV2Device;
|
|
4237
4286
|
(method as any).device.getCommands = () => ({ typedCall });
|
|
4238
4287
|
(method as any).protocolV2ExpectedSerialNumber = 'PR9999999999';
|
|
4288
|
+
(method as any).protocolV2ExpectedPath = 'app-path';
|
|
4239
4289
|
|
|
4240
4290
|
await (method as any).waitForProtocolV2BootloaderMode(60 * 1000, 0);
|
|
4241
4291
|
|
|
4242
4292
|
expect(reconnectProtocolV2Device).toHaveBeenCalledTimes(3);
|
|
4243
|
-
expect(typedCall).toHaveBeenCalledTimes(
|
|
4244
|
-
expect(typedCall.mock.calls.map(call => call[0])).toEqual([
|
|
4245
|
-
'DeviceInfoGet',
|
|
4246
|
-
'ProtocolInfoRequest',
|
|
4247
|
-
]);
|
|
4293
|
+
expect(typedCall).toHaveBeenCalledTimes(1);
|
|
4294
|
+
expect(typedCall.mock.calls.map(call => call[0])).toEqual(['DeviceInfoGet']);
|
|
4248
4295
|
});
|
|
4249
4296
|
|
|
4250
4297
|
test('does not run generic initialize during Protocol V2 USB firmware reconnect', async () => {
|
|
@@ -4281,6 +4328,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4281
4328
|
deviceList: [cachedDevice],
|
|
4282
4329
|
} as any);
|
|
4283
4330
|
(method as any).device = device;
|
|
4331
|
+
(method as any).protocolV2ExpectedPath = 'usb-path';
|
|
4284
4332
|
|
|
4285
4333
|
try {
|
|
4286
4334
|
await (method as any).reconnectProtocolV2Device();
|
|
@@ -4331,6 +4379,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4331
4379
|
deviceList: [otherDevice, expectedDevice],
|
|
4332
4380
|
} as any);
|
|
4333
4381
|
(method as any).device = device;
|
|
4382
|
+
(method as any).protocolV2ExpectedPath = 'usb-path';
|
|
4334
4383
|
(method as any).protocolV2ExpectedSerialNumber = 'PRO2-PHYSICAL-B';
|
|
4335
4384
|
|
|
4336
4385
|
try {
|
|
@@ -4387,7 +4436,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4387
4436
|
expect(updateFromCache).not.toHaveBeenCalled();
|
|
4388
4437
|
});
|
|
4389
4438
|
|
|
4390
|
-
test('allows a
|
|
4439
|
+
test('allows a Protocol V2 USB reconnect candidate without a serial only when its path matches', async () => {
|
|
4391
4440
|
const method = new FirmwareUpdateV4({
|
|
4392
4441
|
id: 1,
|
|
4393
4442
|
payload: {
|
|
@@ -4397,7 +4446,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4397
4446
|
const commands = { disposed: true, mainId: '' };
|
|
4398
4447
|
const updateFromCache = jest.fn();
|
|
4399
4448
|
const device = stubDevice({
|
|
4400
|
-
originalDescriptor: { id: '
|
|
4449
|
+
originalDescriptor: { id: 'usb-a', path: 'usb-a', protocolType: 'V2' },
|
|
4401
4450
|
deviceConnector: {
|
|
4402
4451
|
enumerate: jest.fn().mockResolvedValue({
|
|
4403
4452
|
descriptors: [{ id: 'usb-a', path: 'usb-a', protocolType: 'V2' }],
|
|
@@ -4420,6 +4469,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4420
4469
|
} as any);
|
|
4421
4470
|
(method as any).device = device;
|
|
4422
4471
|
(method as any).protocolV2ExpectedSerialNumber = 'PRO2-PHYSICAL-A';
|
|
4472
|
+
(method as any).protocolV2ExpectedPath = 'usb-a';
|
|
4423
4473
|
|
|
4424
4474
|
try {
|
|
4425
4475
|
await (method as any).reconnectProtocolV2Device();
|
|
@@ -4509,6 +4559,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4509
4559
|
deviceList: [{ getConnectId: () => 'usb-path' }],
|
|
4510
4560
|
} as any);
|
|
4511
4561
|
(method as any).device = device;
|
|
4562
|
+
(method as any).protocolV2ExpectedPath = 'usb-path';
|
|
4512
4563
|
|
|
4513
4564
|
try {
|
|
4514
4565
|
await (method as any).reconnectProtocolV2Device();
|
|
@@ -4539,6 +4590,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4539
4590
|
(method as any).protocolV2ExpectedSerialNumber = 'expected-serial';
|
|
4540
4591
|
(method as any).reconnectProtocolV2Device = reconnectProtocolV2Device;
|
|
4541
4592
|
(method as any).device = stubDevice({
|
|
4593
|
+
originalDescriptor: { id: 'usb-id', path: 'usb-path', protocolType: 'V2' },
|
|
4542
4594
|
getCommands: () => ({ typedCall }),
|
|
4543
4595
|
probeProtocolV2RuntimeState: jest.fn().mockResolvedValue({
|
|
4544
4596
|
deviceId: 'changed-device',
|
|
@@ -5783,14 +5835,14 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
5783
5835
|
});
|
|
5784
5836
|
});
|
|
5785
5837
|
|
|
5786
|
-
test('treats manual resource
|
|
5838
|
+
test('treats manual resource files as explicit payload without remote firmware auto-fill', async () => {
|
|
5787
5839
|
const resourceBundle = new Uint8Array([1, 2, 3]).buffer;
|
|
5788
5840
|
const method = new FirmwareUpdateV4({
|
|
5789
5841
|
id: 1,
|
|
5790
5842
|
payload: {
|
|
5791
5843
|
method: 'firmwareUpdateV4',
|
|
5792
5844
|
platform: 'web',
|
|
5793
|
-
|
|
5845
|
+
resourceFiles: [
|
|
5794
5846
|
{
|
|
5795
5847
|
binary: resourceBundle,
|
|
5796
5848
|
devicePath: ' VOL0:/resource/images/images.okpkg ',
|
|
@@ -5838,7 +5890,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
5838
5890
|
payload: {
|
|
5839
5891
|
method: 'firmwareUpdateV4',
|
|
5840
5892
|
platform: 'web',
|
|
5841
|
-
|
|
5893
|
+
resourceFiles: [
|
|
5842
5894
|
{
|
|
5843
5895
|
binary: new Uint8Array([1, 2, 3]).buffer,
|
|
5844
5896
|
devicePath: 'vol2:/resource/images/images.okpkg',
|
|
@@ -5857,7 +5909,7 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
5857
5909
|
(method as any).enterProtocolV2BootloaderMode = jest.fn();
|
|
5858
5910
|
method.postTipMessage = jest.fn();
|
|
5859
5911
|
|
|
5860
|
-
await expect(method.run()).rejects.toThrow('
|
|
5912
|
+
await expect(method.run()).rejects.toThrow('resourceFiles[0].devicePath');
|
|
5861
5913
|
expect((method as any).prepareRemoteProtocolV2Binaries).not.toHaveBeenCalled();
|
|
5862
5914
|
expect((method as any).enterProtocolV2BootloaderMode).not.toHaveBeenCalled();
|
|
5863
5915
|
});
|
|
@@ -5916,8 +5968,10 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
5916
5968
|
|
|
5917
5969
|
(method as any).device = stubDevice({
|
|
5918
5970
|
getCommands: () => ({ typedCall }),
|
|
5971
|
+
getCurrentDeviceType: () => 'pro2',
|
|
5972
|
+
toMessageObject: () => ({ connectId: 'firmware-device' }),
|
|
5919
5973
|
});
|
|
5920
|
-
method.
|
|
5974
|
+
method.postMessage = jest.fn();
|
|
5921
5975
|
|
|
5922
5976
|
await (method as any).protocolV2CommonUpdateProcess({
|
|
5923
5977
|
payload: new Uint8Array(4097).buffer,
|
|
@@ -5932,6 +5986,17 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
5932
5986
|
expect(writePayloads.map(payload => payload.overwrite)).toEqual([true, false]);
|
|
5933
5987
|
expect(writePayloads.every(payload => payload.append === false)).toBe(true);
|
|
5934
5988
|
expect(writePayloads.map(payload => payload.ui_percentage)).toEqual([0, 100]);
|
|
5989
|
+
expect(method.postMessage).toHaveBeenLastCalledWith({
|
|
5990
|
+
event: 'UI_EVENT',
|
|
5991
|
+
type: UI_REQUEST.FIRMWARE_PROGRESS,
|
|
5992
|
+
payload: expect.objectContaining({
|
|
5993
|
+
progress: 99,
|
|
5994
|
+
progressType: 'transferData',
|
|
5995
|
+
transferredBytes: 4097,
|
|
5996
|
+
totalBytes: 4097,
|
|
5997
|
+
elapsedMs: expect.any(Number),
|
|
5998
|
+
}),
|
|
5999
|
+
});
|
|
5935
6000
|
});
|
|
5936
6001
|
|
|
5937
6002
|
test('restarts the whole file from offset zero after an ambiguous chunk write failure', async () => {
|
|
@@ -6245,7 +6310,7 @@ describe('Protocol V2 firmware update method', () => {
|
|
|
6245
6310
|
expect(typedCall).not.toHaveBeenCalled();
|
|
6246
6311
|
});
|
|
6247
6312
|
|
|
6248
|
-
test.each([0, 2])(
|
|
6313
|
+
test.each([0, 1, 2])(
|
|
6249
6314
|
'rejects firmware target %s because the Pro2 bootloader cannot install it',
|
|
6250
6315
|
async targetId => {
|
|
6251
6316
|
const typedCall = jest.fn();
|
|
@@ -6278,8 +6343,8 @@ describe('Protocol V2 firmware update method', () => {
|
|
|
6278
6343
|
targets: [
|
|
6279
6344
|
{
|
|
6280
6345
|
target_id: undefined,
|
|
6281
|
-
targetId:
|
|
6282
|
-
path: 'vol0:
|
|
6346
|
+
targetId: 3,
|
|
6347
|
+
path: 'vol0:bootloader.okpkg',
|
|
6283
6348
|
},
|
|
6284
6349
|
],
|
|
6285
6350
|
} as any,
|
|
@@ -6291,7 +6356,7 @@ describe('Protocol V2 firmware update method', () => {
|
|
|
6291
6356
|
|
|
6292
6357
|
await method.run();
|
|
6293
6358
|
expect(typedCall.mock.calls[0][2]).toEqual({
|
|
6294
|
-
targets: [{ target_id:
|
|
6359
|
+
targets: [{ target_id: 3, path: 'vol0:bootloader.okpkg' }],
|
|
6295
6360
|
});
|
|
6296
6361
|
});
|
|
6297
6362
|
|
|
@@ -6423,10 +6488,16 @@ describe('Protocol V2 firmware reconnect identity', () => {
|
|
|
6423
6488
|
).not.toThrow();
|
|
6424
6489
|
});
|
|
6425
6490
|
|
|
6426
|
-
test('
|
|
6427
|
-
expect(() =>
|
|
6428
|
-
|
|
6429
|
-
|
|
6491
|
+
test('requires the same descriptor path when either physical serial is unavailable', () => {
|
|
6492
|
+
expect(() =>
|
|
6493
|
+
assertProtocolV2ReconnectIdentity('expected-serial', undefined, 'usb-path', 'usb-path')
|
|
6494
|
+
).not.toThrow();
|
|
6495
|
+
expect(() =>
|
|
6496
|
+
assertProtocolV2ReconnectIdentity(undefined, 'actual-serial', 'usb-path', 'other-path')
|
|
6497
|
+
).toThrow('identity unavailable');
|
|
6498
|
+
expect(() => assertProtocolV2ReconnectIdentity(undefined, undefined)).toThrow(
|
|
6499
|
+
'identity unavailable'
|
|
6500
|
+
);
|
|
6430
6501
|
});
|
|
6431
6502
|
|
|
6432
6503
|
test('captures physical identity from active DeviceInfo instead of wallet deviceId', async () => {
|
|
@@ -6444,6 +6515,7 @@ describe('Protocol V2 firmware reconnect identity', () => {
|
|
|
6444
6515
|
},
|
|
6445
6516
|
});
|
|
6446
6517
|
(method as any).device = stubDevice({
|
|
6518
|
+
originalDescriptor: { id: 'usb-id', path: 'usb-path', protocolType: 'V2' },
|
|
6447
6519
|
features: { deviceId: 'wallet-derived-id' },
|
|
6448
6520
|
getCommands: () => ({ typedCall }),
|
|
6449
6521
|
});
|
|
@@ -6469,11 +6541,13 @@ describe('Protocol V2 firmware reconnect identity', () => {
|
|
|
6469
6541
|
message: { protocol_version: 1, hw: {} },
|
|
6470
6542
|
});
|
|
6471
6543
|
(method as any).device = stubDevice({
|
|
6544
|
+
originalDescriptor: { id: 'usb-id', path: 'usb-path', protocolType: 'V2' },
|
|
6472
6545
|
getCommands: () => ({ typedCall }),
|
|
6473
6546
|
});
|
|
6474
6547
|
|
|
6475
6548
|
await expect((method as any).captureProtocolV2PhysicalIdentity()).resolves.toBeUndefined();
|
|
6476
6549
|
expect((method as any).protocolV2ExpectedSerialNumber).toBeUndefined();
|
|
6550
|
+
expect((method as any).protocolV2ExpectedPath).toBeDefined();
|
|
6477
6551
|
});
|
|
6478
6552
|
|
|
6479
6553
|
test('uses filesystem reads instead of ResourceInventoryGet for resource comparison', async () => {
|
|
@@ -6498,6 +6572,7 @@ describe('Protocol V2 firmware reconnect identity', () => {
|
|
|
6498
6572
|
const typedCall = createResourceFilesystemTypedCall(stable);
|
|
6499
6573
|
(method as any).device = stubDevice({
|
|
6500
6574
|
getCommands: () => ({ typedCall }),
|
|
6575
|
+
getCurrentDeviceType: () => 'pro2',
|
|
6501
6576
|
});
|
|
6502
6577
|
const resourcesSpy = jest
|
|
6503
6578
|
.spyOn(DataManager, 'getProtocolV2Resources')
|
|
@@ -6527,7 +6602,10 @@ describe('Protocol V2 firmware reconnect identity', () => {
|
|
|
6527
6602
|
})
|
|
6528
6603
|
);
|
|
6529
6604
|
const typedCall = createResourceFilesystemTypedCall(stable, ['images']);
|
|
6530
|
-
(method as any).device = stubDevice({
|
|
6605
|
+
(method as any).device = stubDevice({
|
|
6606
|
+
getCommands: () => ({ typedCall }),
|
|
6607
|
+
getCurrentDeviceType: () => 'pro2',
|
|
6608
|
+
});
|
|
6531
6609
|
const resourcesSpy = jest
|
|
6532
6610
|
.spyOn(DataManager, 'getProtocolV2Resources')
|
|
6533
6611
|
.mockReturnValue(stable as any);
|
|
@@ -6562,7 +6640,10 @@ describe('Protocol V2 firmware reconnect identity', () => {
|
|
|
6562
6640
|
})
|
|
6563
6641
|
);
|
|
6564
6642
|
const typedCall = createResourceFilesystemTypedCall(stable, ['images']);
|
|
6565
|
-
(method as any).device = stubDevice({
|
|
6643
|
+
(method as any).device = stubDevice({
|
|
6644
|
+
getCommands: () => ({ typedCall }),
|
|
6645
|
+
getCurrentDeviceType: () => 'pro2',
|
|
6646
|
+
});
|
|
6566
6647
|
const resourcesSpy = jest
|
|
6567
6648
|
.spyOn(DataManager, 'getProtocolV2Resources')
|
|
6568
6649
|
.mockReturnValue(stable as any);
|
|
@@ -6583,34 +6664,6 @@ describe('Protocol V2 firmware reconnect identity', () => {
|
|
|
6583
6664
|
resourcesSpy.mockRestore();
|
|
6584
6665
|
});
|
|
6585
6666
|
|
|
6586
|
-
const buildBootResourcesHeader = ({
|
|
6587
|
-
type = 'CRAT',
|
|
6588
|
-
payloadHash = 'ab'.repeat(64),
|
|
6589
|
-
headerHash = 'cd'.repeat(64),
|
|
6590
|
-
}: {
|
|
6591
|
-
type?: string;
|
|
6592
|
-
payloadHash?: string;
|
|
6593
|
-
headerHash?: string;
|
|
6594
|
-
} = {}) => {
|
|
6595
|
-
const header = new Uint8Array(0x52a0);
|
|
6596
|
-
const view = new DataView(header.buffer);
|
|
6597
|
-
'OKPP'.split('').forEach((char, index) => {
|
|
6598
|
-
header[index] = char.charCodeAt(0);
|
|
6599
|
-
});
|
|
6600
|
-
type.split('').forEach((char, index) => {
|
|
6601
|
-
header[0x08 + index] = char.charCodeAt(0);
|
|
6602
|
-
});
|
|
6603
|
-
view.setUint32(0x0c, header.byteLength, true);
|
|
6604
|
-
const writeHex = (offset: number, hex: string) => {
|
|
6605
|
-
for (let index = 0; index < hex.length / 2; index++) {
|
|
6606
|
-
header[offset + index] = Number.parseInt(hex.slice(index * 2, index * 2 + 2), 16);
|
|
6607
|
-
}
|
|
6608
|
-
};
|
|
6609
|
-
writeHex(0x200, payloadHash);
|
|
6610
|
-
writeHex(0x240, headerHash);
|
|
6611
|
-
return header;
|
|
6612
|
-
};
|
|
6613
|
-
|
|
6614
6667
|
test('does not resolve boot resources unless the optional target is selected', async () => {
|
|
6615
6668
|
const method = new FirmwareUpdateV4({
|
|
6616
6669
|
id: 1,
|
|
@@ -6626,20 +6679,22 @@ describe('Protocol V2 firmware reconnect identity', () => {
|
|
|
6626
6679
|
expect(downloadSpy).not.toHaveBeenCalled();
|
|
6627
6680
|
});
|
|
6628
6681
|
|
|
6629
|
-
test('downloads and maps
|
|
6630
|
-
const
|
|
6631
|
-
const headerHash = 'cd'.repeat(64);
|
|
6632
|
-
const bytes = buildBootResourcesHeader({ payloadHash, headerHash });
|
|
6682
|
+
test('downloads and maps selected boot resources as direct RES files', async () => {
|
|
6683
|
+
const bytes = new Uint8Array([1, 2, 3, 4]);
|
|
6633
6684
|
const binary = bytes.buffer as ArrayBuffer;
|
|
6634
6685
|
const fileHash = Array.from(sha256(bytes), byte => byte.toString(16).padStart(2, '0')).join('');
|
|
6635
6686
|
const resource = {
|
|
6636
6687
|
required: false as const,
|
|
6637
|
-
target: '
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6688
|
+
target: 'RES' as const,
|
|
6689
|
+
files: [
|
|
6690
|
+
{
|
|
6691
|
+
name: 'bootloader_crest.bin',
|
|
6692
|
+
url: 'https://example.com/bootloader_crest.bin',
|
|
6693
|
+
devicePath: 'vol0:/assets/loaders/boot.staging/graphics/bootloader_crest.bin',
|
|
6694
|
+
size: bytes.byteLength,
|
|
6695
|
+
fileHash,
|
|
6696
|
+
},
|
|
6697
|
+
],
|
|
6643
6698
|
};
|
|
6644
6699
|
const method = new FirmwareUpdateV4({
|
|
6645
6700
|
id: 1,
|
|
@@ -6650,30 +6705,39 @@ describe('Protocol V2 firmware reconnect identity', () => {
|
|
|
6650
6705
|
},
|
|
6651
6706
|
});
|
|
6652
6707
|
method.init();
|
|
6708
|
+
(method as any).device = stubDevice({ getCurrentDeviceType: () => 'pro2' });
|
|
6653
6709
|
jest.spyOn(DataManager, 'getProtocolV2BootResources').mockReturnValue(resource);
|
|
6654
6710
|
jest.spyOn(firmwareBinaryApi, 'getSysResourceBinary').mockResolvedValue({ binary });
|
|
6655
6711
|
|
|
6656
|
-
await expect((method as any).prepareProtocolV2BootResources()).resolves.toEqual(
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6712
|
+
await expect((method as any).prepareProtocolV2BootResources()).resolves.toEqual([
|
|
6713
|
+
{
|
|
6714
|
+
name: 'bootloader_crest.bin',
|
|
6715
|
+
binary,
|
|
6716
|
+
devicePath: 'vol0:/assets/loaders/boot.staging/graphics/bootloader_crest.bin',
|
|
6717
|
+
},
|
|
6718
|
+
]);
|
|
6662
6719
|
});
|
|
6663
6720
|
|
|
6664
|
-
test('rejects a
|
|
6721
|
+
test('rejects a manually supplied resource file when its manifest hash does not match', () => {
|
|
6665
6722
|
const method = new FirmwareUpdateV4({
|
|
6666
6723
|
id: 1,
|
|
6667
6724
|
payload: {
|
|
6668
6725
|
method: 'firmwareUpdateV4',
|
|
6669
6726
|
platform: 'web',
|
|
6670
|
-
|
|
6727
|
+
resourceFiles: [
|
|
6728
|
+
{
|
|
6729
|
+
binary: new Uint8Array([1, 2, 3]).buffer,
|
|
6730
|
+
devicePath: 'vol0:/assets/loaders/boot.staging/graphics/bootloader_crest.bin',
|
|
6731
|
+
size: 3,
|
|
6732
|
+
fileHash: '00'.repeat(32),
|
|
6733
|
+
},
|
|
6734
|
+
],
|
|
6671
6735
|
},
|
|
6672
6736
|
});
|
|
6673
6737
|
method.init();
|
|
6674
6738
|
|
|
6675
|
-
|
|
6676
|
-
'
|
|
6739
|
+
expect(() => (method as any).prepareExplicitProtocolV2ResourceFiles()).toThrow(
|
|
6740
|
+
'SHA-256 mismatch'
|
|
6677
6741
|
);
|
|
6678
6742
|
});
|
|
6679
6743
|
});
|
|
@@ -7228,39 +7292,26 @@ describe('Protocol V2 current low-level methods', () => {
|
|
|
7228
7292
|
|
|
7229
7293
|
test('sends DeviceFactoryInfoSet and DeviceFactoryInfoGet', async () => {
|
|
7230
7294
|
const typedCall = jest.fn().mockResolvedValue({ message: {} });
|
|
7231
|
-
const manufactureTime = {
|
|
7232
|
-
year: 2026,
|
|
7233
|
-
month: 8,
|
|
7234
|
-
day: 1,
|
|
7235
|
-
hour: 10,
|
|
7236
|
-
minute: 20,
|
|
7237
|
-
second: 30,
|
|
7238
|
-
};
|
|
7239
7295
|
const setMethod = new DeviceFactoryInfoSet({
|
|
7240
7296
|
id: 1,
|
|
7241
7297
|
payload: {
|
|
7242
7298
|
method: 'deviceFactoryInfoSet',
|
|
7243
|
-
version: 1,
|
|
7244
7299
|
serial_number: 'PR2SERIAL',
|
|
7245
7300
|
burn_in_completed: true,
|
|
7246
|
-
factory_test_completed: true,
|
|
7247
|
-
manufacture_time: manufactureTime,
|
|
7248
7301
|
},
|
|
7249
7302
|
});
|
|
7250
7303
|
setMethod.init();
|
|
7251
|
-
expect(setMethod.getSupportedProtocols()).toEqual(['V2']);
|
|
7252
|
-
expect(setMethod.requireDeviceMode).toEqual([UI_REQUEST.BOOTLOADER]);
|
|
7253
7304
|
(setMethod as any).device = stubDevice({ commands: { typedCall } });
|
|
7254
7305
|
|
|
7255
7306
|
await setMethod.run();
|
|
7256
7307
|
|
|
7257
7308
|
expect(typedCall).toHaveBeenCalledWith('DeviceFactoryInfoSet', 'Success', {
|
|
7258
7309
|
info: {
|
|
7259
|
-
version:
|
|
7310
|
+
version: undefined,
|
|
7260
7311
|
serial_number: 'PR2SERIAL',
|
|
7261
7312
|
burn_in_completed: true,
|
|
7262
|
-
factory_test_completed:
|
|
7263
|
-
manufacture_time:
|
|
7313
|
+
factory_test_completed: undefined,
|
|
7314
|
+
manufacture_time: undefined,
|
|
7264
7315
|
},
|
|
7265
7316
|
});
|
|
7266
7317
|
|
|
@@ -7270,7 +7321,6 @@ describe('Protocol V2 current low-level methods', () => {
|
|
|
7270
7321
|
payload: { method: 'deviceFactoryInfoGet' },
|
|
7271
7322
|
});
|
|
7272
7323
|
getMethod.init();
|
|
7273
|
-
expect(getMethod.getSupportedProtocols()).toEqual(['V2']);
|
|
7274
7324
|
(getMethod as any).device = stubDevice({ commands: { typedCall } });
|
|
7275
7325
|
|
|
7276
7326
|
await getMethod.run();
|
|
@@ -7278,111 +7328,6 @@ describe('Protocol V2 current low-level methods', () => {
|
|
|
7278
7328
|
expect(typedCall).toHaveBeenLastCalledWith('DeviceFactoryInfoGet', 'DeviceFactoryInfo', {});
|
|
7279
7329
|
});
|
|
7280
7330
|
|
|
7281
|
-
test('validates the write-once DeviceFactoryInfoSet payload before sending', () => {
|
|
7282
|
-
expect(() =>
|
|
7283
|
-
new DeviceFactoryInfoSet({
|
|
7284
|
-
id: 1,
|
|
7285
|
-
payload: {
|
|
7286
|
-
method: 'deviceProvisionFactoryInfo',
|
|
7287
|
-
serial_number: 'PR2SERIAL',
|
|
7288
|
-
},
|
|
7289
|
-
}).init()
|
|
7290
|
-
).toThrow('Parameter [manufacture_time] is required.');
|
|
7291
|
-
|
|
7292
|
-
expect(() =>
|
|
7293
|
-
new DeviceFactoryInfoSet({
|
|
7294
|
-
id: 1,
|
|
7295
|
-
payload: {
|
|
7296
|
-
method: 'deviceProvisionFactoryInfo',
|
|
7297
|
-
version: 1,
|
|
7298
|
-
serial_number: 'P'.repeat(25),
|
|
7299
|
-
burn_in_completed: true,
|
|
7300
|
-
factory_test_completed: true,
|
|
7301
|
-
manufacture_time: {
|
|
7302
|
-
year: 2026,
|
|
7303
|
-
month: 8,
|
|
7304
|
-
day: 1,
|
|
7305
|
-
hour: 0,
|
|
7306
|
-
minute: 0,
|
|
7307
|
-
second: 0,
|
|
7308
|
-
},
|
|
7309
|
-
},
|
|
7310
|
-
}).init()
|
|
7311
|
-
).toThrow('must not exceed 24 UTF-8 bytes');
|
|
7312
|
-
});
|
|
7313
|
-
|
|
7314
|
-
test('writes, reads and signs with the Protocol V2 factory certificate API', async () => {
|
|
7315
|
-
const typedCall = jest.fn().mockResolvedValue({ message: {} });
|
|
7316
|
-
const write = new DeviceFactoryCertificateWrite({
|
|
7317
|
-
id: 1,
|
|
7318
|
-
payload: {
|
|
7319
|
-
method: 'deviceWriteFactoryCertificate',
|
|
7320
|
-
certificate: 'aabbcc',
|
|
7321
|
-
},
|
|
7322
|
-
});
|
|
7323
|
-
write.init();
|
|
7324
|
-
expect(write.getSupportedProtocols()).toEqual(['V2']);
|
|
7325
|
-
expect(write.requireDeviceMode).toEqual([UI_REQUEST.BOOTLOADER]);
|
|
7326
|
-
(write as any).device = stubDevice({ commands: { typedCall } });
|
|
7327
|
-
await write.run();
|
|
7328
|
-
|
|
7329
|
-
expect(typedCall).toHaveBeenLastCalledWith('DeviceCertificateWrite', 'Success', {
|
|
7330
|
-
cert: {
|
|
7331
|
-
cert_and_pubkey: 'aabbcc',
|
|
7332
|
-
private_key: undefined,
|
|
7333
|
-
},
|
|
7334
|
-
});
|
|
7335
|
-
|
|
7336
|
-
const read = new DeviceFactoryCertificateRead({
|
|
7337
|
-
id: 2,
|
|
7338
|
-
payload: { method: 'deviceReadFactoryCertificate' },
|
|
7339
|
-
});
|
|
7340
|
-
read.init();
|
|
7341
|
-
expect(read.getSupportedProtocols()).toEqual(['V2']);
|
|
7342
|
-
(read as any).device = stubDevice({ commands: { typedCall } });
|
|
7343
|
-
await read.run();
|
|
7344
|
-
expect(typedCall).toHaveBeenLastCalledWith('DeviceCertificateRead', 'DeviceCertificate', {});
|
|
7345
|
-
|
|
7346
|
-
const sign = new DeviceFactoryChallengeSign({
|
|
7347
|
-
id: 3,
|
|
7348
|
-
payload: {
|
|
7349
|
-
method: 'deviceSignFactoryChallenge',
|
|
7350
|
-
digest: '22'.repeat(32),
|
|
7351
|
-
},
|
|
7352
|
-
});
|
|
7353
|
-
sign.init();
|
|
7354
|
-
expect(sign.getSupportedProtocols()).toEqual(['V2']);
|
|
7355
|
-
(sign as any).device = stubDevice({ commands: { typedCall } });
|
|
7356
|
-
await sign.run();
|
|
7357
|
-
expect(typedCall).toHaveBeenLastCalledWith(
|
|
7358
|
-
'DeviceCertificateSign',
|
|
7359
|
-
'DeviceCertificateSignature',
|
|
7360
|
-
{ data: '22'.repeat(32) }
|
|
7361
|
-
);
|
|
7362
|
-
});
|
|
7363
|
-
|
|
7364
|
-
test('rejects malformed Protocol V2 factory certificate fields', () => {
|
|
7365
|
-
expect(() =>
|
|
7366
|
-
new DeviceFactoryCertificateWrite({
|
|
7367
|
-
id: 1,
|
|
7368
|
-
payload: {
|
|
7369
|
-
method: 'deviceWriteFactoryCertificate',
|
|
7370
|
-
certificate: 'xyz',
|
|
7371
|
-
},
|
|
7372
|
-
}).init()
|
|
7373
|
-
).toThrow('even-length hexadecimal string');
|
|
7374
|
-
|
|
7375
|
-
expect(() =>
|
|
7376
|
-
new DeviceFactoryChallengeSign({
|
|
7377
|
-
id: 2,
|
|
7378
|
-
payload: {
|
|
7379
|
-
method: 'deviceSignFactoryChallenge',
|
|
7380
|
-
digest: '11',
|
|
7381
|
-
},
|
|
7382
|
-
}).init()
|
|
7383
|
-
).toThrow('exactly 32 bytes');
|
|
7384
|
-
});
|
|
7385
|
-
|
|
7386
7331
|
test('marks explicit Protocol V2 unlock as an on-device PIN interaction', () => {
|
|
7387
7332
|
const method = new DeviceUnlock({
|
|
7388
7333
|
id: 1,
|