@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
|
@@ -91,11 +91,93 @@ describe('AllNetworkGetAddressBase tracing', () => {
|
|
|
91
91
|
0
|
|
92
92
|
);
|
|
93
93
|
|
|
94
|
-
expect(checkPassphraseStateSafety).toHaveBeenCalledWith(
|
|
94
|
+
expect(checkPassphraseStateSafety).toHaveBeenCalledWith(
|
|
95
|
+
'hidden-state',
|
|
96
|
+
false,
|
|
97
|
+
undefined,
|
|
98
|
+
false
|
|
99
|
+
);
|
|
95
100
|
expect(calls).toEqual(['resume-hidden-session', 'run-chain-method']);
|
|
96
101
|
expect(typedCall).not.toHaveBeenCalled();
|
|
97
102
|
});
|
|
98
103
|
|
|
104
|
+
test('resumes a Protocol V2 Cardano hidden wallet with the Cardano seed domain', async () => {
|
|
105
|
+
const calls: string[] = [];
|
|
106
|
+
const checkPassphraseStateSafety = jest.fn().mockImplementation(() => {
|
|
107
|
+
calls.push('resume-cardano-session');
|
|
108
|
+
return Promise.resolve(true);
|
|
109
|
+
});
|
|
110
|
+
const innerMethod = {
|
|
111
|
+
checkSafetyLevelOnTestNet: jest.fn().mockResolvedValue(false),
|
|
112
|
+
connectId: 'connect-id',
|
|
113
|
+
deviceId: 'device-id',
|
|
114
|
+
getVersionRange: jest.fn().mockReturnValue({}),
|
|
115
|
+
assertProtocolSupported: jest.fn(),
|
|
116
|
+
init: jest.fn(),
|
|
117
|
+
name: 'cardanoGetAddress',
|
|
118
|
+
responseID: 45,
|
|
119
|
+
unlockPolicy: 'unlock-before-run',
|
|
120
|
+
run: jest.fn().mockImplementation(() => {
|
|
121
|
+
calls.push('run-cardano-method');
|
|
122
|
+
return Promise.resolve([{ address: 'addr1hidden' }]);
|
|
123
|
+
}),
|
|
124
|
+
setDevice: jest.fn(),
|
|
125
|
+
strictCheckDeviceSupport: false,
|
|
126
|
+
};
|
|
127
|
+
(findMethod as jest.Mock).mockReturnValue(innerMethod);
|
|
128
|
+
const method = new TestAllNetworkMethod({
|
|
129
|
+
id: 5,
|
|
130
|
+
payload: {
|
|
131
|
+
method: 'allNetworkGetAddress',
|
|
132
|
+
connectId: 'connect-id',
|
|
133
|
+
deviceId: 'device-id',
|
|
134
|
+
passphraseState: 'hidden-state',
|
|
135
|
+
bundle: [],
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
method.protocolV2UnlockContext = { preflightCompleted: true };
|
|
139
|
+
const typedCall = jest.fn();
|
|
140
|
+
method.device = {
|
|
141
|
+
checkPassphraseStateSafety,
|
|
142
|
+
commands: {
|
|
143
|
+
typedCall,
|
|
144
|
+
},
|
|
145
|
+
getCurrentFirmwareType: jest.fn(),
|
|
146
|
+
getProtocol: jest.fn().mockReturnValue('V2'),
|
|
147
|
+
getCurrentFirmwareVersionString: jest.fn().mockReturnValue('1.0.0'),
|
|
148
|
+
getCurrentMethodVersionRange: jest
|
|
149
|
+
.fn()
|
|
150
|
+
.mockImplementation((getRange: (type: string) => unknown) => getRange('pro2')),
|
|
151
|
+
instanceId: 'device-instance',
|
|
152
|
+
isProtocolV2: jest.fn().mockReturnValue(true),
|
|
153
|
+
isBootloader: jest.fn().mockReturnValue(false),
|
|
154
|
+
isRomloader: jest.fn().mockReturnValue(false),
|
|
155
|
+
off: jest.fn(),
|
|
156
|
+
on: jest.fn(),
|
|
157
|
+
state: { status: { unlocked: true } },
|
|
158
|
+
updateProtocolV2Status: jest.fn(),
|
|
159
|
+
} as any;
|
|
160
|
+
|
|
161
|
+
await method.callMethod(
|
|
162
|
+
'cardanoGetAddress',
|
|
163
|
+
{
|
|
164
|
+
bundle: [
|
|
165
|
+
{
|
|
166
|
+
_originRequestParams: {
|
|
167
|
+
network: 'ada',
|
|
168
|
+
path: "m/1852'/1815'/0'/0/0",
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
0
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
expect(checkPassphraseStateSafety).toHaveBeenCalledWith('hidden-state', false, undefined, true);
|
|
177
|
+
expect(calls).toEqual(['resume-cardano-session', 'run-cardano-method']);
|
|
178
|
+
expect(typedCall).not.toHaveBeenCalled();
|
|
179
|
+
});
|
|
180
|
+
|
|
99
181
|
test('resumes a Protocol V2 standard wallet before running a nested chain method', async () => {
|
|
100
182
|
const calls: string[] = [];
|
|
101
183
|
const checkPassphraseStateSafety = jest.fn().mockImplementation(() => {
|
|
@@ -168,7 +250,7 @@ describe('AllNetworkGetAddressBase tracing', () => {
|
|
|
168
250
|
0
|
|
169
251
|
);
|
|
170
252
|
|
|
171
|
-
expect(checkPassphraseStateSafety).toHaveBeenCalledWith(undefined, true, undefined);
|
|
253
|
+
expect(checkPassphraseStateSafety).toHaveBeenCalledWith(undefined, true, undefined, false);
|
|
172
254
|
expect(calls).toEqual(['resume-standard-session', 'run-chain-method']);
|
|
173
255
|
expect(typedCall).not.toHaveBeenCalled();
|
|
174
256
|
});
|
|
@@ -363,9 +363,9 @@ describe('DeviceCommands failure mapping', () => {
|
|
|
363
363
|
}
|
|
364
364
|
);
|
|
365
365
|
|
|
366
|
-
it.each(['
|
|
367
|
-
'
|
|
368
|
-
async
|
|
366
|
+
it.each(['SignTx', 'EthereumSignTypedDataOneKey', 'SolanaSignTx', 'GetAddress'] as const)(
|
|
367
|
+
'does not treat domain-ambiguous Protocol V2 subcode 1 for %s as cancellation',
|
|
368
|
+
async callType => {
|
|
369
369
|
const commands = createCommands();
|
|
370
370
|
|
|
371
371
|
await expect(
|
|
@@ -375,18 +375,13 @@ describe('DeviceCommands failure mapping', () => {
|
|
|
375
375
|
message: {
|
|
376
376
|
code: 'Failure_ProcessError',
|
|
377
377
|
subcode: 1,
|
|
378
|
-
message,
|
|
378
|
+
message: 'Domain-specific failure',
|
|
379
379
|
},
|
|
380
380
|
} as any,
|
|
381
|
-
|
|
381
|
+
callType
|
|
382
382
|
)
|
|
383
383
|
).rejects.toMatchObject({
|
|
384
|
-
errorCode: HardwareErrorCode.
|
|
385
|
-
params: {
|
|
386
|
-
failureCode: 'Failure_ProcessError',
|
|
387
|
-
subcode: 1,
|
|
388
|
-
firmwareMessage: message,
|
|
389
|
-
},
|
|
384
|
+
errorCode: HardwareErrorCode.RuntimeError,
|
|
390
385
|
});
|
|
391
386
|
}
|
|
392
387
|
);
|
|
@@ -401,6 +396,7 @@ describe('DeviceCommands failure mapping', () => {
|
|
|
401
396
|
type: 'Failure',
|
|
402
397
|
message: {
|
|
403
398
|
code: 'Failure_ProcessError',
|
|
399
|
+
subcode: 1,
|
|
404
400
|
message: 'Cancelled on device',
|
|
405
401
|
},
|
|
406
402
|
} as any,
|
|
@@ -411,7 +407,7 @@ describe('DeviceCommands failure mapping', () => {
|
|
|
411
407
|
});
|
|
412
408
|
});
|
|
413
409
|
|
|
414
|
-
it('
|
|
410
|
+
it('maps the DeviceError subcode 1 exception to DeviceBusy', async () => {
|
|
415
411
|
const commands = createCommands();
|
|
416
412
|
|
|
417
413
|
await expect(
|
|
@@ -427,7 +423,12 @@ describe('DeviceCommands failure mapping', () => {
|
|
|
427
423
|
'DeviceSettingsPageShow'
|
|
428
424
|
)
|
|
429
425
|
).rejects.toMatchObject({
|
|
430
|
-
errorCode: HardwareErrorCode.
|
|
426
|
+
errorCode: HardwareErrorCode.DeviceBusy,
|
|
427
|
+
params: {
|
|
428
|
+
failureCode: 'Failure_ProcessError',
|
|
429
|
+
subcode: 1,
|
|
430
|
+
firmwareMessage: 'Another process error',
|
|
431
|
+
},
|
|
431
432
|
});
|
|
432
433
|
});
|
|
433
434
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DataManager } from '../src/data-manager';
|
|
2
|
+
import { init } from '../src/core';
|
|
3
|
+
|
|
4
|
+
import type { ConnectSettings } from '../src/types';
|
|
5
|
+
|
|
6
|
+
jest.mock('../src/data/config', () => ({
|
|
7
|
+
getSDKVersion: jest.fn(() => '1.0.0-test'),
|
|
8
|
+
DEFAULT_DOMAIN: 'https://jssdk.onekey.so/1.0.0-test/',
|
|
9
|
+
}));
|
|
10
|
+
|
|
11
|
+
describe('Core initialization', () => {
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
jest.restoreAllMocks();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('does not create a partially initialized core when settings loading fails', async () => {
|
|
17
|
+
jest.spyOn(DataManager, 'load').mockRejectedValue(new Error('settings load failed'));
|
|
18
|
+
|
|
19
|
+
await expect(init({} as ConnectSettings, class TestTransport {})).rejects.toThrow(
|
|
20
|
+
'settings load failed'
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
2
|
+
|
|
3
|
+
import DeviceConnector from '../src/device/DeviceConnector';
|
|
4
|
+
|
|
5
|
+
jest.mock('../src/data-manager/TransportManager', () => ({
|
|
6
|
+
__esModule: true,
|
|
7
|
+
default: {
|
|
8
|
+
load: jest.fn(),
|
|
9
|
+
getTransport: jest.fn(),
|
|
10
|
+
},
|
|
11
|
+
}));
|
|
12
|
+
|
|
13
|
+
jest.mock('../src/data-manager', () => ({
|
|
14
|
+
DataManager: {
|
|
15
|
+
getSettings: jest.fn(() => 'desktop-web-ble'),
|
|
16
|
+
isBleConnect: jest.fn(() => true),
|
|
17
|
+
},
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
jest.mock('../src/device/DevicePool', () => ({
|
|
21
|
+
DevicePool: {
|
|
22
|
+
setConnector: jest.fn(),
|
|
23
|
+
},
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
const transportManagerMock: {
|
|
27
|
+
default: {
|
|
28
|
+
getTransport: jest.Mock;
|
|
29
|
+
};
|
|
30
|
+
} = jest.requireMock('../src/data-manager/TransportManager');
|
|
31
|
+
|
|
32
|
+
describe('DeviceConnector protocol validation', () => {
|
|
33
|
+
beforeEach(() => {
|
|
34
|
+
jest.clearAllMocks();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('reports an explicit transport error when connector initialization ran too early', async () => {
|
|
38
|
+
transportManagerMock.default.getTransport.mockReturnValue(undefined);
|
|
39
|
+
const connector = new DeviceConnector();
|
|
40
|
+
|
|
41
|
+
await expect(connector.enumerate()).rejects.toMatchObject({
|
|
42
|
+
errorCode: HardwareErrorCode.TransportNotConfigured,
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('uses the actively probed protocol returned by acquire when the cache was cleared', async () => {
|
|
47
|
+
const acquire = jest.fn().mockResolvedValue({
|
|
48
|
+
id: 'pro2-id',
|
|
49
|
+
path: 'pro2-id',
|
|
50
|
+
protocolType: 'V2',
|
|
51
|
+
});
|
|
52
|
+
transportManagerMock.default.getTransport.mockReturnValue({
|
|
53
|
+
acquire,
|
|
54
|
+
getProtocolType: jest.fn(() => undefined),
|
|
55
|
+
});
|
|
56
|
+
const connector = new DeviceConnector();
|
|
57
|
+
|
|
58
|
+
await expect(connector.acquire('pro2-id', undefined, undefined, 'V2')).resolves.toEqual(
|
|
59
|
+
expect.objectContaining({ protocolType: 'V2' })
|
|
60
|
+
);
|
|
61
|
+
expect(acquire).toHaveBeenCalledWith(
|
|
62
|
+
expect.objectContaining({ uuid: 'pro2-id', expectedProtocol: 'V2' })
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('still rejects a real mismatch reported by the active protocol probe', async () => {
|
|
67
|
+
transportManagerMock.default.getTransport.mockReturnValue({
|
|
68
|
+
acquire: jest.fn().mockResolvedValue({
|
|
69
|
+
id: 'classic-id',
|
|
70
|
+
path: 'classic-id',
|
|
71
|
+
protocolType: 'V1',
|
|
72
|
+
}),
|
|
73
|
+
getProtocolType: jest.fn(() => 'V1'),
|
|
74
|
+
});
|
|
75
|
+
const connector = new DeviceConnector();
|
|
76
|
+
|
|
77
|
+
await expect(connector.acquire('classic-id', undefined, undefined, 'V2')).rejects.toThrow(
|
|
78
|
+
'Device protocol mismatch: expected V2, detected V1'
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -38,6 +38,28 @@ describe('DevicePool state lifecycle', () => {
|
|
|
38
38
|
expect(getDeviceState).toHaveBeenNthCalledWith(2, { refreshSections: ['settings'] });
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
+
test('actively re-detects a cached device when protocol detection is forced', async () => {
|
|
42
|
+
const descriptor = { path: 'cached-path', protocolType: 'V1' } as any;
|
|
43
|
+
const device = Device.fromDescriptor(descriptor);
|
|
44
|
+
const acquire = jest.spyOn(device, 'acquire').mockImplementation(() => {
|
|
45
|
+
device.originalDescriptor.protocolType = 'V2';
|
|
46
|
+
return Promise.resolve(true);
|
|
47
|
+
});
|
|
48
|
+
const initialize = jest.spyOn(device, 'initialize').mockResolvedValue(undefined);
|
|
49
|
+
const release = jest.spyOn(device, 'release').mockResolvedValue(undefined);
|
|
50
|
+
DevicePool.devicesCache = { 'cached-id': device };
|
|
51
|
+
|
|
52
|
+
const result = await DevicePool.getDevices([descriptor], 'cached-id', {
|
|
53
|
+
forceProtocolDetection: true,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
expect(acquire).toHaveBeenCalledWith(undefined, { forceProtocolDetection: true });
|
|
57
|
+
expect(initialize).toHaveBeenCalledWith({ forceProtocolDetection: true });
|
|
58
|
+
expect(release).toHaveBeenCalledTimes(1);
|
|
59
|
+
expect(device.originalDescriptor.protocolType).toBe('V2');
|
|
60
|
+
expect(result.deviceList).toEqual([device]);
|
|
61
|
+
});
|
|
62
|
+
|
|
41
63
|
test('keeps a discovered device when its Protocol V2 label cannot be read', async () => {
|
|
42
64
|
const labelError = new Error('settings unavailable');
|
|
43
65
|
const getDeviceState = jest
|
|
@@ -115,8 +115,8 @@ describe('DeviceSettings protocol routing', () => {
|
|
|
115
115
|
);
|
|
116
116
|
});
|
|
117
117
|
|
|
118
|
-
it('uses DeviceSettingsSet and
|
|
119
|
-
const { device, typedCall, updateState } = createDevice({ protocol: 'V2' });
|
|
118
|
+
it('uses DeviceSettingsSet and reloads Protocol V2 status and settings from the device', async () => {
|
|
119
|
+
const { device, typedCall, updateState, getDeviceState } = createDevice({ protocol: 'V2' });
|
|
120
120
|
const method = new DeviceSettings({
|
|
121
121
|
id: 2,
|
|
122
122
|
payload: {
|
|
@@ -141,21 +141,10 @@ describe('DeviceSettings protocol routing', () => {
|
|
|
141
141
|
haptic_feedback: true,
|
|
142
142
|
},
|
|
143
143
|
});
|
|
144
|
-
expect(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
language: 'ja',
|
|
149
|
-
bleEnabled: true,
|
|
150
|
-
autoLockDelayMs: 60_000,
|
|
151
|
-
hapticFeedback: true,
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
'settings-write'
|
|
155
|
-
);
|
|
156
|
-
expect(typedCall.mock.calls.map(call => call[0])).not.toEqual(
|
|
157
|
-
expect.arrayContaining(['DeviceInfoGet', 'DeviceStatusGet', 'DeviceSettingsGet'])
|
|
158
|
-
);
|
|
144
|
+
expect(getDeviceState).toHaveBeenCalledWith({
|
|
145
|
+
refreshSections: ['status', 'settings'],
|
|
146
|
+
});
|
|
147
|
+
expect(updateState).not.toHaveBeenCalled();
|
|
159
148
|
});
|
|
160
149
|
|
|
161
150
|
it('uses the Pro2 passphrase page as a device-side toggle and verifies the target state', async () => {
|
|
@@ -183,7 +172,39 @@ describe('DeviceSettings protocol routing', () => {
|
|
|
183
172
|
});
|
|
184
173
|
expect(typedCall).not.toHaveBeenCalledWith('DeviceSettingsSet', 'Success', expect.anything());
|
|
185
174
|
expect(getDeviceState).toHaveBeenNthCalledWith(1, { refreshSections: ['status'] });
|
|
186
|
-
expect(getDeviceState).toHaveBeenNthCalledWith(2, {
|
|
175
|
+
expect(getDeviceState).toHaveBeenNthCalledWith(2, {
|
|
176
|
+
refreshSections: ['status', 'settings'],
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it('reloads Protocol V2 status and settings after changing air-gap mode', async () => {
|
|
181
|
+
const { device, typedCall, getDeviceState } = createDevice({ protocol: 'V2' });
|
|
182
|
+
getDeviceState
|
|
183
|
+
.mockResolvedValueOnce({
|
|
184
|
+
settings: { airgapMode: false },
|
|
185
|
+
})
|
|
186
|
+
.mockResolvedValueOnce({
|
|
187
|
+
status: { unlocked: true },
|
|
188
|
+
settings: { airgapMode: true },
|
|
189
|
+
});
|
|
190
|
+
const method = new DeviceSettings({
|
|
191
|
+
id: 4,
|
|
192
|
+
payload: {
|
|
193
|
+
method: 'deviceSettings',
|
|
194
|
+
airgapMode: true,
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
method.init();
|
|
198
|
+
(method as any).device = device;
|
|
199
|
+
|
|
200
|
+
await expect(method.run()).resolves.toEqual({ message: 'Success' });
|
|
201
|
+
expect(typedCall).toHaveBeenCalledWith('DeviceSettingsPageShow', 'Success', {
|
|
202
|
+
page: DeviceSettingsPage.DeviceAirgap,
|
|
203
|
+
});
|
|
204
|
+
expect(getDeviceState).toHaveBeenNthCalledWith(1, { refreshSections: ['settings'] });
|
|
205
|
+
expect(getDeviceState).toHaveBeenNthCalledWith(2, {
|
|
206
|
+
refreshSections: ['status', 'settings'],
|
|
207
|
+
});
|
|
187
208
|
});
|
|
188
209
|
|
|
189
210
|
it('does not open a Pro2 settings page when the hardware already matches the target', async () => {
|
|
@@ -145,6 +145,18 @@ describe('DeviceStateMapper', () => {
|
|
|
145
145
|
expect(patch.status?.unlocked).toBeUndefined();
|
|
146
146
|
});
|
|
147
147
|
|
|
148
|
+
test('maps the Protocol V2 Neo device type without treating it as Pro2', () => {
|
|
149
|
+
const patch = mapProtocolV2DeviceInfoToState({
|
|
150
|
+
hw: { Device_type: DeviceType.NEO, serial_no: 'NEO-SERIAL-1' },
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
expect(patch.identity).toMatchObject({
|
|
154
|
+
deviceType: EDeviceType.Neo,
|
|
155
|
+
model: 'neo',
|
|
156
|
+
serialNo: 'NEO-SERIAL-1',
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
|
|
148
160
|
test('maps the hardware model independently from Protocol V2', () => {
|
|
149
161
|
const pro = mapProtocolV2DeviceInfoToState({
|
|
150
162
|
protocol_version: 2,
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { EDeviceType, EFirmwareType } from '@onekeyfe/hd-shared';
|
|
2
|
+
import { DeviceType } from '@onekeyfe/hd-transport';
|
|
2
3
|
|
|
3
4
|
import {
|
|
4
5
|
getDeviceSerialNo,
|
|
5
6
|
getDeviceType,
|
|
7
|
+
getDeviceTypeByBleName,
|
|
6
8
|
getDeviceUUID,
|
|
7
9
|
getFirmwareType,
|
|
10
|
+
getMethodVersionRange,
|
|
8
11
|
} from '../src/utils/deviceInfoUtils';
|
|
9
12
|
import {
|
|
10
13
|
getDeviceBLEFirmwareVersion,
|
|
@@ -85,7 +88,7 @@ describe('device feature selectors', () => {
|
|
|
85
88
|
test('reads normalized Protocol V2 features through the same public selectors', () => {
|
|
86
89
|
const features = buildProtocolV2FeaturesPayload({
|
|
87
90
|
deviceInfo: {
|
|
88
|
-
hw: { serial_no: 'P2-001' },
|
|
91
|
+
hw: { Device_type: DeviceType.PRO2, serial_no: 'P2-001' },
|
|
89
92
|
fw: {
|
|
90
93
|
application: { version: '5.0.0' },
|
|
91
94
|
bootloader: { version: '2.0.0' },
|
|
@@ -104,4 +107,48 @@ describe('device feature selectors', () => {
|
|
|
104
107
|
expect(getDeviceBoardloaderVersion(features)).toEqual([1, 0, 0]);
|
|
105
108
|
expect(getDeviceBLEFirmwareVersion(features)).toEqual([3, 0, 0]);
|
|
106
109
|
});
|
|
110
|
+
|
|
111
|
+
test('preserves the real Neo type in Protocol V2 compatibility features', () => {
|
|
112
|
+
const features = buildProtocolV2FeaturesPayload({
|
|
113
|
+
deviceInfo: {
|
|
114
|
+
hw: { Device_type: DeviceType.NEO, serial_no: 'NEO-001' },
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
expect(features.deviceType).toBe(EDeviceType.Neo);
|
|
119
|
+
expect(features.onekey_device_type).toBe('NEO');
|
|
120
|
+
expect(getDeviceType(features)).toBe(EDeviceType.Neo);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
test('recognizes Neo discovery names before initialization', () => {
|
|
124
|
+
expect(getDeviceTypeByBleName('OneKey Neo 1234')).toBe(EDeviceType.Neo);
|
|
125
|
+
expect(getDeviceTypeByBleName('Neo 1234')).toBe(EDeviceType.Neo);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test.each([EDeviceType.Pro2, EDeviceType.Neo])(
|
|
129
|
+
'uses the Pro2 product model as the chain capability fallback for %s',
|
|
130
|
+
deviceType => {
|
|
131
|
+
const checkedTypes: string[] = [];
|
|
132
|
+
const versionRange = getMethodVersionRange({ deviceType } as PROTO.Features, type => {
|
|
133
|
+
checkedTypes.push(type);
|
|
134
|
+
return type === 'model_pro2' ? { min: '1.0.0' } : undefined;
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
expect(versionRange).toEqual({ min: '1.0.0' });
|
|
138
|
+
expect(checkedTypes).toEqual([deviceType, 'model_pro2']);
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
test('prefers a Neo-specific chain range over the shared Pro2 product model', () => {
|
|
143
|
+
const versionRange = getMethodVersionRange(
|
|
144
|
+
{ deviceType: EDeviceType.Neo } as PROTO.Features,
|
|
145
|
+
type => {
|
|
146
|
+
if (type === EDeviceType.Neo) return { min: '2.0.0' };
|
|
147
|
+
if (type === 'model_pro2') return { min: '1.0.0' };
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
expect(versionRange).toEqual({ min: '2.0.0' });
|
|
153
|
+
});
|
|
107
154
|
});
|
|
@@ -72,6 +72,16 @@ describe('Pro 2 device settings options', () => {
|
|
|
72
72
|
]);
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
+
test('uses the shared Protocol V2 settings model for Neo', () => {
|
|
76
|
+
expect(getLanguageConfig(EDeviceType.Neo)).toEqual(getLanguageConfig(EDeviceType.Pro2));
|
|
77
|
+
expect(getAutoLockOptions(EDeviceType.Neo, 'V2')).toEqual(
|
|
78
|
+
getAutoLockOptions(EDeviceType.Pro2, 'V2')
|
|
79
|
+
);
|
|
80
|
+
expect(getAutoShutDownOptions(EDeviceType.Neo, 'V2')).toEqual(
|
|
81
|
+
getAutoShutDownOptions(EDeviceType.Pro2, 'V2')
|
|
82
|
+
);
|
|
83
|
+
});
|
|
84
|
+
|
|
75
85
|
test('keeps the legacy and Protocol V2 never values protocol-specific', () => {
|
|
76
86
|
expect(getAutoLockOptions(EDeviceType.Pro, 'V1').slice(-1)[0]).toEqual({
|
|
77
87
|
label: 'Never',
|
|
@@ -160,30 +160,24 @@ describe('DeviceUploadNft', () => {
|
|
|
160
160
|
});
|
|
161
161
|
});
|
|
162
162
|
|
|
163
|
-
test('
|
|
163
|
+
test('does not retry a timed-out NftUpdate', async () => {
|
|
164
164
|
const timeout = Object.assign(new Error('Protocol V2 response timeout'), {
|
|
165
165
|
code: 'response-timeout',
|
|
166
166
|
});
|
|
167
|
-
let updateCalls = 0;
|
|
168
167
|
const typedCall = jest.fn((request: string, _response: string, params: any) => {
|
|
169
168
|
if (request === 'FilesystemDirList') {
|
|
170
169
|
return { message: { path: 'vol1:/nft', child_files: '' } };
|
|
171
170
|
}
|
|
172
171
|
if (request === 'FilesystemFileWrite') return fileWriteSuccess(params);
|
|
173
|
-
if (request === 'NftUpdate')
|
|
174
|
-
updateCalls += 1;
|
|
175
|
-
if (updateCalls === 1) throw timeout;
|
|
176
|
-
return { message: { message: 'NFT updated' } };
|
|
177
|
-
}
|
|
172
|
+
if (request === 'NftUpdate') throw timeout;
|
|
178
173
|
throw new Error(`Unexpected request: ${request}`);
|
|
179
174
|
});
|
|
180
175
|
const method = createMethod({ typedCall });
|
|
181
176
|
|
|
182
|
-
await expect(method.run()).
|
|
177
|
+
await expect(method.run()).rejects.toBe(timeout);
|
|
183
178
|
|
|
184
179
|
const updateRequests = typedCall.mock.calls.filter(call => call[0] === 'NftUpdate');
|
|
185
|
-
expect(updateRequests).toHaveLength(
|
|
186
|
-
expect(updateRequests[1]).toEqual(updateRequests[0]);
|
|
180
|
+
expect(updateRequests).toHaveLength(1);
|
|
187
181
|
});
|
|
188
182
|
|
|
189
183
|
test('does not retry a non-timeout NftUpdate failure', async () => {
|
|
@@ -201,24 +195,6 @@ describe('DeviceUploadNft', () => {
|
|
|
201
195
|
expect(typedCall.mock.calls.filter(call => call[0] === 'NftUpdate')).toHaveLength(1);
|
|
202
196
|
});
|
|
203
197
|
|
|
204
|
-
test('propagates a second NftUpdate timeout after one retry', async () => {
|
|
205
|
-
const timeout = Object.assign(new Error('Protocol V2 response timeout'), {
|
|
206
|
-
code: 'response-timeout',
|
|
207
|
-
});
|
|
208
|
-
const typedCall = jest.fn((request: string, _response: string, params: any) => {
|
|
209
|
-
if (request === 'FilesystemDirList') {
|
|
210
|
-
return { message: { path: 'vol1:/nft', child_files: '' } };
|
|
211
|
-
}
|
|
212
|
-
if (request === 'FilesystemFileWrite') return fileWriteSuccess(params);
|
|
213
|
-
if (request === 'NftUpdate') throw timeout;
|
|
214
|
-
throw new Error(`Unexpected request: ${request}`);
|
|
215
|
-
});
|
|
216
|
-
const method = createMethod({ typedCall });
|
|
217
|
-
|
|
218
|
-
await expect(method.run()).rejects.toBe(timeout);
|
|
219
|
-
expect(typedCall.mock.calls.filter(call => call[0] === 'NftUpdate')).toHaveLength(2);
|
|
220
|
-
});
|
|
221
|
-
|
|
222
198
|
test('does not publish when a file write fails', async () => {
|
|
223
199
|
const typedCall = jest.fn((request: string) => {
|
|
224
200
|
if (request === 'FilesystemDirList') {
|
|
@@ -6,7 +6,7 @@ jest.mock('../src/data/config', () => ({
|
|
|
6
6
|
DEFAULT_DOMAIN: 'https://jssdk.onekey.so/1.0.0/',
|
|
7
7
|
}));
|
|
8
8
|
|
|
9
|
-
describe('Kaspa Pro2 useTweak capability', () => {
|
|
9
|
+
describe('Kaspa Pro2 product-family useTweak capability', () => {
|
|
10
10
|
test.each([
|
|
11
11
|
['get address', KaspaGetAddress],
|
|
12
12
|
['sign transaction', KaspaSignTransaction],
|
|
@@ -14,7 +14,7 @@ describe('Kaspa Pro2 useTweak capability', () => {
|
|
|
14
14
|
const method = new Method({ id: 1, payload: {} } as never);
|
|
15
15
|
|
|
16
16
|
expect(method.getUseTweakVersionRange()).toMatchObject({
|
|
17
|
-
|
|
17
|
+
model_pro2: { min: '0.0.0' },
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
20
|
});
|
|
@@ -56,12 +56,17 @@ const resources: IProtocolV2Resource[] = PROTOCOL_V2_RESOURCE_TYPES.map((type, i
|
|
|
56
56
|
|
|
57
57
|
const bootResources: IProtocolV2BootResources = {
|
|
58
58
|
required: false,
|
|
59
|
-
target: '
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
target: 'RES',
|
|
60
|
+
manifestUrl: 'https://example.com/manifest.json',
|
|
61
|
+
files: [
|
|
62
|
+
{
|
|
63
|
+
name: 'bootloader_crest.bin',
|
|
64
|
+
url: 'https://example.com/assets/bootloader_crest.bin',
|
|
65
|
+
devicePath: 'vol0:/assets/loaders/boot.staging/graphics/bootloader_crest.bin',
|
|
66
|
+
size: 1234,
|
|
67
|
+
fileHash: 'ab'.repeat(32),
|
|
68
|
+
},
|
|
69
|
+
],
|
|
65
70
|
};
|
|
66
71
|
|
|
67
72
|
const createSettings = (configFetcher: ConnectSettings['configFetcher']): ConnectSettings =>
|
|
@@ -119,7 +124,7 @@ describe('Pro2 resource configuration', () => {
|
|
|
119
124
|
).toThrow('headerHash');
|
|
120
125
|
});
|
|
121
126
|
|
|
122
|
-
test('requires boot resources to remain optional and use
|
|
127
|
+
test('requires boot resources to remain optional and use RES file entries', () => {
|
|
123
128
|
expect(() =>
|
|
124
129
|
parseProtocolV2Resources({
|
|
125
130
|
stable: resources,
|
|
@@ -129,9 +134,18 @@ describe('Pro2 resource configuration', () => {
|
|
|
129
134
|
expect(() =>
|
|
130
135
|
parseProtocolV2Resources({
|
|
131
136
|
stable: resources,
|
|
132
|
-
boot: { ...bootResources, target: '
|
|
137
|
+
boot: { ...bootResources, target: 'INVALID' },
|
|
133
138
|
})
|
|
134
|
-
).toThrow('expected
|
|
139
|
+
).toThrow('expected RES');
|
|
140
|
+
expect(() =>
|
|
141
|
+
parseProtocolV2Resources({
|
|
142
|
+
stable: resources,
|
|
143
|
+
boot: {
|
|
144
|
+
...bootResources,
|
|
145
|
+
files: [{ ...bootResources.files[0], devicePath: '../outside.bin' }],
|
|
146
|
+
},
|
|
147
|
+
})
|
|
148
|
+
).toThrow('devicePath');
|
|
135
149
|
});
|
|
136
150
|
|
|
137
151
|
test('downloads nothing when all resource identities match', () => {
|
|
@@ -269,6 +283,31 @@ describe('Pro2 resource configuration', () => {
|
|
|
269
283
|
expect(DataManager.getProtocolV2BootResources()).toEqual(bootResources);
|
|
270
284
|
});
|
|
271
285
|
|
|
286
|
+
test('keeps base SDK initialization available when remote Pro2 resources are invalid', async () => {
|
|
287
|
+
const remoteConfig = createRemoteConfig();
|
|
288
|
+
(remoteConfig.pro2 as { resources?: unknown }).resources = { stable: [] };
|
|
289
|
+
const configFetcher = jest.fn().mockResolvedValue(remoteConfig);
|
|
290
|
+
|
|
291
|
+
await expect(DataManager.load(createSettings(configFetcher))).resolves.toBe(true);
|
|
292
|
+
|
|
293
|
+
expect(DataManager.getProtocolV2Resources()).toBeUndefined();
|
|
294
|
+
expect(DataManager.getProtocolV2BootResources()).toBeUndefined();
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
test('only blocks resource mutation when the refreshed Pro2 resources are invalid', async () => {
|
|
298
|
+
const remoteConfig = createRemoteConfig();
|
|
299
|
+
(remoteConfig.pro2 as { resources?: unknown }).resources = { stable: [] };
|
|
300
|
+
const settings = createSettings(jest.fn().mockResolvedValue(remoteConfig));
|
|
301
|
+
DataManager.settings = settings;
|
|
302
|
+
|
|
303
|
+
await expect(DataManager.forceReloadData()).resolves.toBeUndefined();
|
|
304
|
+
await expect(DataManager.forceReloadData({ requireResources: true })).rejects.toMatchObject({
|
|
305
|
+
errorCode: HardwareErrorCode.FirmwareUpdateDownloadFailed,
|
|
306
|
+
message: expect.stringContaining('Invalid Pro2 resources config'),
|
|
307
|
+
});
|
|
308
|
+
expect(DataManager.lastCheckTimestamp).toBeGreaterThan(0);
|
|
309
|
+
});
|
|
310
|
+
|
|
272
311
|
test('does not advance the cache timestamp when refresh fails', async () => {
|
|
273
312
|
jest.spyOn(axios, 'get').mockRejectedValue(new Error('offline'));
|
|
274
313
|
const settings = createSettings(jest.fn().mockResolvedValue(null));
|