@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
|
@@ -47,7 +47,7 @@ export default class SolSignTransaction extends BaseMethod<HardwareSolanaSignTx[
|
|
|
47
47
|
getVersionRange() {
|
|
48
48
|
if (this.existsVersionedTx()) {
|
|
49
49
|
return {
|
|
50
|
-
|
|
50
|
+
model_pro2: {
|
|
51
51
|
min: '0.0.0',
|
|
52
52
|
},
|
|
53
53
|
model_mini: {
|
|
@@ -60,7 +60,7 @@ export default class SolSignTransaction extends BaseMethod<HardwareSolanaSignTx[
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
return {
|
|
63
|
-
|
|
63
|
+
model_pro2: {
|
|
64
64
|
min: '0.0.0',
|
|
65
65
|
},
|
|
66
66
|
classic: {
|
|
@@ -46,7 +46,7 @@ export default class TronSignMessage extends BaseMethod<HardwareTronSignMessage>
|
|
|
46
46
|
|
|
47
47
|
getVersionRange() {
|
|
48
48
|
return {
|
|
49
|
-
|
|
49
|
+
model_pro2: {
|
|
50
50
|
min: '0.0.0',
|
|
51
51
|
},
|
|
52
52
|
model_mini: {
|
|
@@ -57,7 +57,7 @@ export default class TronSignMessage extends BaseMethod<HardwareTronSignMessage>
|
|
|
57
57
|
|
|
58
58
|
getMessageV2VersionRange() {
|
|
59
59
|
return {
|
|
60
|
-
|
|
60
|
+
model_pro2: {
|
|
61
61
|
min: '0.0.0',
|
|
62
62
|
},
|
|
63
63
|
pro: {
|
package/src/api/utils.ts
CHANGED
|
@@ -3,47 +3,13 @@ import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
|
3
3
|
import * as ApiMethods from './index';
|
|
4
4
|
|
|
5
5
|
import type { BaseMethod } from './BaseMethod';
|
|
6
|
-
import type { CoreMethodExtension } from './methodExtension';
|
|
7
6
|
import type { IFrameCallMessage } from '../events';
|
|
8
7
|
|
|
9
8
|
type MethodConstructor = new (message: IFrameCallMessage & { id?: number }) => BaseMethod<any>;
|
|
10
9
|
|
|
11
10
|
const publicMethodRegistry = ApiMethods as unknown as Record<string, MethodConstructor>;
|
|
12
11
|
|
|
13
|
-
export
|
|
14
|
-
extensions?: readonly CoreMethodExtension[];
|
|
15
|
-
allowDestructiveOperations?: boolean;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const findExtensionMethod = (
|
|
19
|
-
method: string,
|
|
20
|
-
extensions: readonly CoreMethodExtension[]
|
|
21
|
-
): { constructor: MethodConstructor; destructive: boolean } | undefined => {
|
|
22
|
-
let match: { constructor: MethodConstructor; destructive: boolean } | undefined;
|
|
23
|
-
|
|
24
|
-
for (const extension of extensions) {
|
|
25
|
-
const constructor = extension.methods[method];
|
|
26
|
-
if (constructor) {
|
|
27
|
-
if (match) {
|
|
28
|
-
throw ERRORS.TypedError(
|
|
29
|
-
HardwareErrorCode.CallMethodInvalidParameter,
|
|
30
|
-
`Method ${method} is registered by multiple extensions`
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
match = {
|
|
34
|
-
constructor,
|
|
35
|
-
destructive: extension.destructiveMethods?.includes(method) === true,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return match;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export function findMethod(
|
|
44
|
-
message: IFrameCallMessage & { id?: number },
|
|
45
|
-
options: FindMethodOptions = {}
|
|
46
|
-
): BaseMethod<any> {
|
|
12
|
+
export function findMethod(message: IFrameCallMessage & { id?: number }): BaseMethod<any> {
|
|
47
13
|
const { method } = message.payload;
|
|
48
14
|
if (typeof method !== 'string') {
|
|
49
15
|
throw ERRORS.TypedError(HardwareErrorCode.CallMethodInvalidParameter, 'Method is not set');
|
|
@@ -54,17 +20,6 @@ export function findMethod(
|
|
|
54
20
|
return new MethodConstructor(message);
|
|
55
21
|
}
|
|
56
22
|
|
|
57
|
-
const extensionMethod = findExtensionMethod(method, options.extensions ?? []);
|
|
58
|
-
if (extensionMethod) {
|
|
59
|
-
if (extensionMethod.destructive && options.allowDestructiveOperations !== true) {
|
|
60
|
-
throw ERRORS.TypedError(
|
|
61
|
-
HardwareErrorCode.CallMethodInvalidParameter,
|
|
62
|
-
`Destructive method ${method} requires allowDestructiveOperations`
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
return new extensionMethod.constructor(message);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
23
|
throw ERRORS.TypedError(
|
|
69
24
|
HardwareErrorCode.CallMethodInvalidParameter,
|
|
70
25
|
`Method ${method} is not set`
|
package/src/core/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import semver from 'semver';
|
|
2
|
-
import
|
|
2
|
+
import EventEmitter from 'events';
|
|
3
3
|
import { DeviceSessionPinType, TRANSPORT_EVENT } from '@onekeyfe/hd-transport';
|
|
4
4
|
import {
|
|
5
5
|
ERRORS,
|
|
@@ -75,7 +75,6 @@ import type {
|
|
|
75
75
|
TransportDeviceDisconnectEvent,
|
|
76
76
|
} from '@onekeyfe/hd-transport';
|
|
77
77
|
import type { BaseMethod } from '../api/BaseMethod';
|
|
78
|
-
import type { CoreMethodExtension } from '../api/methodExtension';
|
|
79
78
|
|
|
80
79
|
const Log = getLogger(LoggerNames.Core);
|
|
81
80
|
const PRE_INITIALIZE_TTL_MS = 60 * 1000;
|
|
@@ -87,11 +86,6 @@ const preWarmDoneAt = new Map<string, number>();
|
|
|
87
86
|
|
|
88
87
|
export type CoreContext = ReturnType<Core['getCoreContext']>;
|
|
89
88
|
|
|
90
|
-
export type CoreOptions = {
|
|
91
|
-
methodExtensions?: readonly CoreMethodExtension[];
|
|
92
|
-
allowDestructiveOperations?: boolean;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
89
|
function hasDeriveCardano(method: BaseMethod): boolean {
|
|
96
90
|
if (
|
|
97
91
|
method.name.startsWith('allNetworkGetAddress') &&
|
|
@@ -162,10 +156,7 @@ export const callAPI = async (context: CoreContext, message: CoreMessage) => {
|
|
|
162
156
|
// find api method
|
|
163
157
|
let method!: BaseMethod;
|
|
164
158
|
try {
|
|
165
|
-
method = findMethod(message as IFrameCallMessage
|
|
166
|
-
extensions: context.methodExtensions,
|
|
167
|
-
allowDestructiveOperations: context.allowDestructiveOperations,
|
|
168
|
-
});
|
|
159
|
+
method = findMethod(message as IFrameCallMessage);
|
|
169
160
|
method.connector = _connector;
|
|
170
161
|
const shouldPostMessage = createUiProgressMessageFilter();
|
|
171
162
|
method.postMessage = event => {
|
|
@@ -661,6 +652,12 @@ const onCallDevice = async (
|
|
|
661
652
|
requestQueue.resolveRequest(method.responseID, messageResponse);
|
|
662
653
|
completeMethodRequestContext(method);
|
|
663
654
|
} catch (error) {
|
|
655
|
+
// Device.run may release the request before transport callbacks finish after a timeout.
|
|
656
|
+
// Ignore the stale callback because the caller already received the connection error.
|
|
657
|
+
if (!requestQueue.getTask(method.responseID)) {
|
|
658
|
+
Log.debug(`Call API - Ignore late inner method result`, error);
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
664
661
|
Log.debug(`Call API - Inner Method Run Error`, error);
|
|
665
662
|
messageResponse = createResponseMessage(method.responseID, false, { error });
|
|
666
663
|
requestQueue.resolveRequest(method.responseID, messageResponse);
|
|
@@ -1486,11 +1483,8 @@ export default class Core extends EventEmitter {
|
|
|
1486
1483
|
|
|
1487
1484
|
private methodSynchronize = getSynchronize();
|
|
1488
1485
|
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
constructor(options: CoreOptions = {}) {
|
|
1486
|
+
constructor() {
|
|
1492
1487
|
super();
|
|
1493
|
-
this.options = options;
|
|
1494
1488
|
this.tracingContext = createSdkTracingContext();
|
|
1495
1489
|
this.sdkInstanceId = this.tracingContext.sdkInstanceId;
|
|
1496
1490
|
Log.debug(`[Core] Created SDK instance: ${this.sdkInstanceId}`);
|
|
@@ -1499,8 +1493,6 @@ export default class Core extends EventEmitter {
|
|
|
1499
1493
|
private getCoreContext() {
|
|
1500
1494
|
return {
|
|
1501
1495
|
sdkInstanceId: this.sdkInstanceId,
|
|
1502
|
-
methodExtensions: this.options.methodExtensions ?? [],
|
|
1503
|
-
allowDestructiveOperations: this.options.allowDestructiveOperations === true,
|
|
1504
1496
|
tracingContext: this.tracingContext,
|
|
1505
1497
|
requestQueue: this.requestQueue,
|
|
1506
1498
|
methodSynchronize: this.methodSynchronize,
|
|
@@ -1631,8 +1623,8 @@ export default class Core extends EventEmitter {
|
|
|
1631
1623
|
}
|
|
1632
1624
|
}
|
|
1633
1625
|
|
|
1634
|
-
export const initCore = (
|
|
1635
|
-
const core = new Core(
|
|
1626
|
+
export const initCore = () => {
|
|
1627
|
+
const core = new Core();
|
|
1636
1628
|
_core = core;
|
|
1637
1629
|
return core;
|
|
1638
1630
|
};
|
|
@@ -1658,26 +1650,22 @@ const initTransport = (Transport: any, plugin?: LowlevelTransportSharedPlugin) =
|
|
|
1658
1650
|
export const init = async (
|
|
1659
1651
|
settings: ConnectSettings,
|
|
1660
1652
|
Transport: any,
|
|
1661
|
-
plugin?: LowlevelTransportSharedPlugin
|
|
1662
|
-
options?: CoreOptions
|
|
1653
|
+
plugin?: LowlevelTransportSharedPlugin
|
|
1663
1654
|
) => {
|
|
1664
1655
|
try {
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
initTransport(Transport, plugin);
|
|
1668
|
-
} catch {
|
|
1669
|
-
Log.error('DataManager.load error');
|
|
1670
|
-
}
|
|
1656
|
+
await DataManager.load(settings);
|
|
1657
|
+
initTransport(Transport, plugin);
|
|
1671
1658
|
enableLog(DataManager.getSettings('debug'));
|
|
1672
1659
|
if (DataManager.getSettings('env') !== 'react-native') {
|
|
1673
1660
|
setLoggerPostMessage(postMessage);
|
|
1674
1661
|
}
|
|
1675
|
-
initCore(
|
|
1662
|
+
initCore();
|
|
1676
1663
|
initConnector();
|
|
1677
1664
|
|
|
1678
1665
|
return _core;
|
|
1679
1666
|
} catch (error) {
|
|
1680
1667
|
Log.error('core init', error);
|
|
1668
|
+
throw error;
|
|
1681
1669
|
}
|
|
1682
1670
|
};
|
|
1683
1671
|
|
|
@@ -26,6 +26,7 @@ import type {
|
|
|
26
26
|
Features,
|
|
27
27
|
IDeviceBLEFirmwareStatus,
|
|
28
28
|
IDeviceFirmwareStatus,
|
|
29
|
+
IProtocolV2Resources,
|
|
29
30
|
ITransportStatus,
|
|
30
31
|
IVersionArray,
|
|
31
32
|
RemoteConfigResponse,
|
|
@@ -68,7 +69,7 @@ function getFirmwareTypeFromField(firmwareField: IFirmwareField): EFirmwareType
|
|
|
68
69
|
|
|
69
70
|
export default class DataManager {
|
|
70
71
|
static deviceMap: DeviceTypeMap & {
|
|
71
|
-
[k: string]: DeviceTypeMap[keyof DeviceTypeMap] | undefined;
|
|
72
|
+
[k: string]: NonNullable<DeviceTypeMap[keyof DeviceTypeMap]> | undefined;
|
|
72
73
|
} = {
|
|
73
74
|
[EDeviceType.Classic]: {
|
|
74
75
|
firmware: [],
|
|
@@ -94,6 +95,10 @@ export default class DataManager {
|
|
|
94
95
|
firmware: [],
|
|
95
96
|
ble: [],
|
|
96
97
|
},
|
|
98
|
+
[EDeviceType.Neo]: {
|
|
99
|
+
firmware: [],
|
|
100
|
+
ble: [],
|
|
101
|
+
},
|
|
97
102
|
[EDeviceType.ClassicPure]: {
|
|
98
103
|
firmware: [],
|
|
99
104
|
ble: [],
|
|
@@ -112,6 +117,8 @@ export default class DataManager {
|
|
|
112
117
|
|
|
113
118
|
static lastCheckTimestamp = 0;
|
|
114
119
|
|
|
120
|
+
static protocolV2ResourcesConfigError: Error | undefined;
|
|
121
|
+
|
|
115
122
|
static getFirmwareStatus = (
|
|
116
123
|
features: Features,
|
|
117
124
|
firmwareType: EFirmwareType
|
|
@@ -356,7 +363,7 @@ export default class DataManager {
|
|
|
356
363
|
|
|
357
364
|
private static enrichFirmwareReleaseInfo(
|
|
358
365
|
deviceData: DeviceTypeMap[keyof DeviceTypeMap] | undefined
|
|
359
|
-
): DeviceTypeMap[keyof DeviceTypeMap] {
|
|
366
|
+
): NonNullable<DeviceTypeMap[keyof DeviceTypeMap]> {
|
|
360
367
|
// Safety check: return default structure if input is undefined/null
|
|
361
368
|
if (!deviceData || typeof deviceData !== 'object') {
|
|
362
369
|
return {
|
|
@@ -400,6 +407,7 @@ export default class DataManager {
|
|
|
400
407
|
|
|
401
408
|
static async load(settings: ConnectSettings): Promise<boolean> {
|
|
402
409
|
this.settings = settings;
|
|
410
|
+
this.protocolV2ResourcesConfigError = undefined;
|
|
403
411
|
if (!settings.fetchConfig) {
|
|
404
412
|
return false;
|
|
405
413
|
}
|
|
@@ -446,9 +454,27 @@ export default class DataManager {
|
|
|
446
454
|
|
|
447
455
|
// 3. Apply config if available
|
|
448
456
|
if (data) {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
457
|
+
let pro2Resources: IProtocolV2Resources | undefined;
|
|
458
|
+
let neoResources: IProtocolV2Resources | undefined;
|
|
459
|
+
this.protocolV2ResourcesConfigError = undefined;
|
|
460
|
+
try {
|
|
461
|
+
pro2Resources = parseProtocolV2Resources(
|
|
462
|
+
(data.pro2 as { resources?: unknown } | undefined)?.resources
|
|
463
|
+
);
|
|
464
|
+
neoResources = parseProtocolV2Resources(
|
|
465
|
+
(data.neo as { resources?: unknown } | undefined)?.resources
|
|
466
|
+
);
|
|
467
|
+
} catch (error) {
|
|
468
|
+
// Firmware resource metadata is not required for base communication. If the
|
|
469
|
+
// remote config is temporarily incomplete, disable this resource update only.
|
|
470
|
+
this.protocolV2ResourcesConfigError =
|
|
471
|
+
error instanceof Error ? error : new Error(String(error));
|
|
472
|
+
Log.warn('[DataConfig] Ignoring invalid Pro2 resources config:', error);
|
|
473
|
+
}
|
|
474
|
+
const enrichedPro2Config = this.enrichFirmwareReleaseInfo(data.pro2);
|
|
475
|
+
const enrichedNeoConfig = this.enrichFirmwareReleaseInfo(data.neo);
|
|
476
|
+
const { resources: _unvalidatedResources, ...pro2Config } = enrichedPro2Config;
|
|
477
|
+
const { resources: _unvalidatedNeoResources, ...neoConfig } = enrichedNeoConfig;
|
|
452
478
|
Log.log(`[DataConfig] Config loaded successfully via [${fetchMethod}]`);
|
|
453
479
|
this.deviceMap = {
|
|
454
480
|
[EDeviceType.Classic]: this.enrichFirmwareReleaseInfo(data.classic),
|
|
@@ -458,9 +484,13 @@ export default class DataManager {
|
|
|
458
484
|
[EDeviceType.Touch]: this.enrichFirmwareReleaseInfo(data.touch),
|
|
459
485
|
[EDeviceType.Pro]: this.enrichFirmwareReleaseInfo(data.pro),
|
|
460
486
|
[EDeviceType.Pro2]: {
|
|
461
|
-
...
|
|
487
|
+
...pro2Config,
|
|
462
488
|
...(pro2Resources ? { resources: pro2Resources } : undefined),
|
|
463
489
|
},
|
|
490
|
+
[EDeviceType.Neo]: {
|
|
491
|
+
...neoConfig,
|
|
492
|
+
...(neoResources ? { resources: neoResources } : undefined),
|
|
493
|
+
},
|
|
464
494
|
};
|
|
465
495
|
this.assets = {
|
|
466
496
|
bridge: data.bridge,
|
|
@@ -494,7 +524,9 @@ export default class DataManager {
|
|
|
494
524
|
}
|
|
495
525
|
|
|
496
526
|
/** Force a fresh remote config before an update is allowed to mutate the device. */
|
|
497
|
-
static async forceReloadData(
|
|
527
|
+
static async forceReloadData({
|
|
528
|
+
requireResources = false,
|
|
529
|
+
}: { requireResources?: boolean } = {}): Promise<void> {
|
|
498
530
|
if (!this.settings) {
|
|
499
531
|
throw new Error('Remote config settings are not initialized');
|
|
500
532
|
}
|
|
@@ -505,15 +537,23 @@ export default class DataManager {
|
|
|
505
537
|
'Unable to refresh the latest remote config'
|
|
506
538
|
);
|
|
507
539
|
}
|
|
540
|
+
if (requireResources && this.protocolV2ResourcesConfigError) {
|
|
541
|
+
throw ERRORS.TypedError(
|
|
542
|
+
HardwareErrorCode.FirmwareUpdateDownloadFailed,
|
|
543
|
+
`Invalid Pro2 resources config: ${this.protocolV2ResourcesConfigError.message}`
|
|
544
|
+
);
|
|
545
|
+
}
|
|
508
546
|
this.lastCheckTimestamp = getTimeStamp();
|
|
509
547
|
}
|
|
510
548
|
|
|
511
|
-
static getProtocolV2Resources() {
|
|
512
|
-
return this.deviceMap[
|
|
549
|
+
static getProtocolV2Resources(deviceType: EDeviceType.Pro2 | EDeviceType.Neo = EDeviceType.Pro2) {
|
|
550
|
+
return this.deviceMap[deviceType]?.resources?.stable;
|
|
513
551
|
}
|
|
514
552
|
|
|
515
|
-
static getProtocolV2BootResources(
|
|
516
|
-
|
|
553
|
+
static getProtocolV2BootResources(
|
|
554
|
+
deviceType: EDeviceType.Pro2 | EDeviceType.Neo = EDeviceType.Pro2
|
|
555
|
+
) {
|
|
556
|
+
return this.deviceMap[deviceType]?.resources?.boot;
|
|
517
557
|
}
|
|
518
558
|
|
|
519
559
|
static getProtobufMessages(schema: ProtobufMessageSchema = 'v1CurrentSchema'): JSON {
|
|
@@ -121,6 +121,12 @@ export default class TransportManager {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
static setTransport(TransportConstructor: any, plugin?: LowlevelTransportSharedPlugin) {
|
|
124
|
+
if (typeof TransportConstructor !== 'function') {
|
|
125
|
+
throw ERRORS.TypedError(
|
|
126
|
+
HardwareErrorCode.TransportNotConfigured,
|
|
127
|
+
'Transport constructor is not available'
|
|
128
|
+
);
|
|
129
|
+
}
|
|
124
130
|
const env = DataManager.getSettings('env');
|
|
125
131
|
if (env === 'react-native') {
|
|
126
132
|
/** Actually initializes the ReactNativeTransport */
|
package/src/device/Device.ts
CHANGED
|
@@ -696,6 +696,7 @@ export class Device extends EventEmitter {
|
|
|
696
696
|
// Most-specific model first; must match getMethodVersionRange in deviceInfoUtils,
|
|
697
697
|
// otherwise e.g. Classic1s resolves the looser model_mini range before model_classic1s.
|
|
698
698
|
const modelFallbacks: IDeviceModel[] = [
|
|
699
|
+
'model_pro2',
|
|
699
700
|
'model_classic1s',
|
|
700
701
|
'model_classic',
|
|
701
702
|
'model_mini',
|
|
@@ -715,7 +716,8 @@ export class Device extends EventEmitter {
|
|
|
715
716
|
if (
|
|
716
717
|
deviceType === EDeviceType.Touch ||
|
|
717
718
|
deviceType === EDeviceType.Pro ||
|
|
718
|
-
deviceType === EDeviceType.Pro2
|
|
719
|
+
deviceType === EDeviceType.Pro2 ||
|
|
720
|
+
deviceType === EDeviceType.Neo
|
|
719
721
|
) {
|
|
720
722
|
return { support: true };
|
|
721
723
|
}
|
|
@@ -732,7 +734,8 @@ export class Device extends EventEmitter {
|
|
|
732
734
|
if (
|
|
733
735
|
deviceType === EDeviceType.Touch ||
|
|
734
736
|
deviceType === EDeviceType.Pro ||
|
|
735
|
-
deviceType === EDeviceType.Pro2
|
|
737
|
+
deviceType === EDeviceType.Pro2 ||
|
|
738
|
+
deviceType === EDeviceType.Neo
|
|
736
739
|
) {
|
|
737
740
|
return { support: false };
|
|
738
741
|
}
|
|
@@ -1167,10 +1170,14 @@ export class Device extends EventEmitter {
|
|
|
1167
1170
|
const protocolV2DeviceType = runtimeDeviceInfo
|
|
1168
1171
|
? resolveProtocolV2DeviceIdentity(runtimeDeviceInfo.hw?.Device_type).deviceType
|
|
1169
1172
|
: this.getCurrentDeviceType();
|
|
1170
|
-
if (
|
|
1173
|
+
if (
|
|
1174
|
+
runtimeMode === 'romloader' &&
|
|
1175
|
+
protocolV2DeviceType !== EDeviceType.Pro2 &&
|
|
1176
|
+
protocolV2DeviceType !== EDeviceType.Neo
|
|
1177
|
+
) {
|
|
1171
1178
|
throw ERRORS.TypedError(
|
|
1172
1179
|
HardwareErrorCode.DeviceInitializeFailed,
|
|
1173
|
-
'Protocol V2 romloader mode is only supported for Pro2.'
|
|
1180
|
+
'Protocol V2 romloader mode is only supported for Pro2 and Neo.'
|
|
1174
1181
|
);
|
|
1175
1182
|
}
|
|
1176
1183
|
const deviceStatusSupported = supportsProtocolV2Message(
|
|
@@ -1569,7 +1576,8 @@ export class Device extends EventEmitter {
|
|
|
1569
1576
|
if (!this.state) return undefined;
|
|
1570
1577
|
return (
|
|
1571
1578
|
this.isProtocolV2() &&
|
|
1572
|
-
this.getCurrentDeviceType() === EDeviceType.Pro2
|
|
1579
|
+
(this.getCurrentDeviceType() === EDeviceType.Pro2 ||
|
|
1580
|
+
this.getCurrentDeviceType() === EDeviceType.Neo) &&
|
|
1573
1581
|
this.state.status.mode === 'romloader'
|
|
1574
1582
|
);
|
|
1575
1583
|
}
|
|
@@ -1615,7 +1623,8 @@ export class Device extends EventEmitter {
|
|
|
1615
1623
|
const isModeT =
|
|
1616
1624
|
deviceType === EDeviceType.Touch ||
|
|
1617
1625
|
deviceType === EDeviceType.Pro ||
|
|
1618
|
-
deviceType === EDeviceType.Pro2
|
|
1626
|
+
deviceType === EDeviceType.Pro2 ||
|
|
1627
|
+
deviceType === EDeviceType.Neo;
|
|
1619
1628
|
const unlocked = this.state?.status.unlocked;
|
|
1620
1629
|
const preCheckTouch = isModeT && unlocked === false;
|
|
1621
1630
|
const passphraseProtection = this.getCurrentPassphraseProtection();
|
|
@@ -54,9 +54,19 @@ const DEVICE_SESSION_CALLS = new Set([
|
|
|
54
54
|
'DeviceSessionAskPin',
|
|
55
55
|
'DeviceSessionAskPassphrase',
|
|
56
56
|
]);
|
|
57
|
+
const DEVICE_CONTROL_CALLS = new Set([
|
|
58
|
+
'DeviceReboot',
|
|
59
|
+
'DeviceSettingsGet',
|
|
60
|
+
'DeviceSettingsSet',
|
|
61
|
+
'DeviceSettingsPageShow',
|
|
62
|
+
'DeviceCertificateWrite',
|
|
63
|
+
'DeviceCertificateRead',
|
|
64
|
+
'DeviceCertificateSign',
|
|
65
|
+
'DeviceMiscUsbMscControl',
|
|
66
|
+
]);
|
|
57
67
|
|
|
58
|
-
// Protocol V2
|
|
59
|
-
//
|
|
68
|
+
// Older Protocol V2 firmware may omit the cancellation subcode, so retain a
|
|
69
|
+
// narrow message fallback for compatibility.
|
|
60
70
|
const isProtocolV2ActionCancelledMessage = (message: string) =>
|
|
61
71
|
/^(?:cancel(?:led|ed)(?: on device)?|confirm dismissed|user cancel(?:led|ed)(?:\s+.*)?)$/i.test(
|
|
62
72
|
message
|
|
@@ -499,6 +509,10 @@ export class DeviceCommands {
|
|
|
499
509
|
const normalizedMessage = message?.trim() ?? '';
|
|
500
510
|
const isProtocolV2ActionCancelledFailure =
|
|
501
511
|
this.device.isProtocolV2() && isProtocolV2ActionCancelledMessage(normalizedMessage);
|
|
512
|
+
const isProtocolV2DeviceBusyFailure =
|
|
513
|
+
this.device.isProtocolV2() &&
|
|
514
|
+
DEVICE_CONTROL_CALLS.has(callType) &&
|
|
515
|
+
subcode === DeviceErrorCode.DeviceError_Busy;
|
|
502
516
|
const isLegacyProtocolV2LockedFailure =
|
|
503
517
|
this.device.isProtocolV2() && /^device (?:is )?locked$/i.test(normalizedMessage);
|
|
504
518
|
if (
|
|
@@ -556,8 +570,15 @@ export class DeviceCommands {
|
|
|
556
570
|
subcode,
|
|
557
571
|
firmwareMessage: message,
|
|
558
572
|
});
|
|
573
|
+
} else if (isProtocolV2DeviceBusyFailure) {
|
|
574
|
+
error = ERRORS.TypedError(HardwareErrorCode.DeviceBusy, message, {
|
|
575
|
+
failureCode: code,
|
|
576
|
+
subcode,
|
|
577
|
+
firmwareMessage: message,
|
|
578
|
+
});
|
|
559
579
|
} else if (
|
|
560
|
-
|
|
580
|
+
(DEVICE_CONTROL_CALLS.has(callType) &&
|
|
581
|
+
subcode === DeviceErrorCode.DeviceError_ActionCancelled) ||
|
|
561
582
|
isProtocolV2ActionCancelledFailure
|
|
562
583
|
) {
|
|
563
584
|
error = ERRORS.TypedError(HardwareErrorCode.ActionCancelled, message, {
|
|
@@ -14,7 +14,7 @@ import type { OneKeyDeviceInfo as DeviceDescriptor, Transport } from '@onekeyfe/
|
|
|
14
14
|
const Log = getLogger(LoggerNames.DeviceConnector);
|
|
15
15
|
|
|
16
16
|
export default class DeviceConnector {
|
|
17
|
-
transport
|
|
17
|
+
transport?: Transport;
|
|
18
18
|
|
|
19
19
|
listenTimestamp = 0;
|
|
20
20
|
|
|
@@ -30,9 +30,21 @@ export default class DeviceConnector {
|
|
|
30
30
|
DevicePool.setConnector(this);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
private getActiveTransport(): Transport {
|
|
34
|
+
const transport = this.transport ?? TransportManager.getTransport();
|
|
35
|
+
if (!transport) {
|
|
36
|
+
throw ERRORS.TypedError(
|
|
37
|
+
HardwareErrorCode.TransportNotConfigured,
|
|
38
|
+
'Device connector was created before transport initialization'
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
this.transport = transport;
|
|
42
|
+
return transport;
|
|
43
|
+
}
|
|
44
|
+
|
|
33
45
|
async enumerate() {
|
|
34
46
|
try {
|
|
35
|
-
const descriptors = await this.
|
|
47
|
+
const descriptors = await this.getActiveTransport().enumerate();
|
|
36
48
|
this.upcoming = descriptors;
|
|
37
49
|
this._reportDevicesChange();
|
|
38
50
|
return { descriptors } as DeviceDescriptorDiff;
|
|
@@ -50,11 +62,10 @@ export default class DeviceConnector {
|
|
|
50
62
|
let descriptors: DeviceDescriptor[];
|
|
51
63
|
|
|
52
64
|
try {
|
|
65
|
+
const transport = this.getActiveTransport();
|
|
53
66
|
Log.debug('Start listening', current);
|
|
54
67
|
this.listenTimestamp = new Date().getTime();
|
|
55
|
-
descriptors = waitForEvent
|
|
56
|
-
? await this.transport.listen(current)
|
|
57
|
-
: await this.transport.enumerate();
|
|
68
|
+
descriptors = waitForEvent ? await transport.listen(current) : await transport.enumerate();
|
|
58
69
|
if (!this.listening) return; // do not continue if stop() was called
|
|
59
70
|
|
|
60
71
|
this.upcoming = descriptors;
|
|
@@ -88,16 +99,17 @@ export default class DeviceConnector {
|
|
|
88
99
|
Log.debug('acquire', path, session, expectedProtocol, protocolHint);
|
|
89
100
|
const env = DataManager.getSettings('env');
|
|
90
101
|
try {
|
|
102
|
+
const transport = this.getActiveTransport();
|
|
91
103
|
let res;
|
|
92
104
|
if (DataManager.isBleConnect(env)) {
|
|
93
|
-
res = await
|
|
105
|
+
res = await transport.acquire({
|
|
94
106
|
uuid: path,
|
|
95
107
|
forceCleanRunPromise,
|
|
96
108
|
expectedProtocol,
|
|
97
109
|
protocolHint,
|
|
98
110
|
});
|
|
99
111
|
} else {
|
|
100
|
-
res = await
|
|
112
|
+
res = await transport.acquire({
|
|
101
113
|
path,
|
|
102
114
|
previous: session ?? null,
|
|
103
115
|
expectedProtocol,
|
|
@@ -105,7 +117,13 @@ export default class DeviceConnector {
|
|
|
105
117
|
});
|
|
106
118
|
}
|
|
107
119
|
if (expectedProtocol) {
|
|
108
|
-
|
|
120
|
+
// The acquire response is the stable snapshot from this active probe. A delayed
|
|
121
|
+
// disconnect from an older generation may clear caches, so do not rely on cache alone.
|
|
122
|
+
const acquiredProtocol =
|
|
123
|
+
typeof res === 'object' && res !== null
|
|
124
|
+
? (res as DeviceDescriptor).protocolType
|
|
125
|
+
: undefined;
|
|
126
|
+
const detectedProtocol = acquiredProtocol ?? transport.getProtocolType(path);
|
|
109
127
|
if (detectedProtocol !== expectedProtocol) {
|
|
110
128
|
throw ERRORS.TypedError(
|
|
111
129
|
HardwareErrorCode.RuntimeError,
|
|
@@ -122,7 +140,7 @@ export default class DeviceConnector {
|
|
|
122
140
|
|
|
123
141
|
async release(session: string, onclose: boolean) {
|
|
124
142
|
try {
|
|
125
|
-
const res = await this.
|
|
143
|
+
const res = await this.getActiveTransport().release(session, onclose);
|
|
126
144
|
return res;
|
|
127
145
|
} catch (error) {
|
|
128
146
|
safeThrowError(error);
|
|
@@ -131,8 +149,9 @@ export default class DeviceConnector {
|
|
|
131
149
|
|
|
132
150
|
async disconnect(session: string | undefined | null) {
|
|
133
151
|
try {
|
|
134
|
-
|
|
135
|
-
|
|
152
|
+
const transport = this.getActiveTransport();
|
|
153
|
+
if (transport.disconnect && !!session) {
|
|
154
|
+
await transport.disconnect(session);
|
|
136
155
|
}
|
|
137
156
|
} catch (error) {
|
|
138
157
|
safeThrowError(error);
|
|
@@ -140,10 +159,11 @@ export default class DeviceConnector {
|
|
|
140
159
|
}
|
|
141
160
|
|
|
142
161
|
promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null> {
|
|
143
|
-
|
|
162
|
+
const transport = this.getActiveTransport();
|
|
163
|
+
if (!transport.promptDeviceAccess) {
|
|
144
164
|
return Promise.resolve(null);
|
|
145
165
|
}
|
|
146
|
-
return
|
|
166
|
+
return transport.promptDeviceAccess();
|
|
147
167
|
}
|
|
148
168
|
|
|
149
169
|
_reportDevicesChange() {
|