@onekeyfe/hd-core 1.2.0-alpha.55 → 1.2.0-alpha.57
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__/device-state-contract.test.ts +1 -0
- package/__tests__/device-state-mapper.test.ts +1 -1
- package/__tests__/deviceSettings.test.ts +1 -1
- package/__tests__/protocol-v2.test.ts +129 -3
- package/__tests__/protocolV2FileWrite.test.ts +39 -0
- package/__tests__/public-pro2-api-boundary.test.ts +98 -2
- package/__tests__/public-test-api-boundary.test.ts +167 -0
- package/dist/api/BixinBackupDevice.d.ts +7 -0
- package/dist/api/BixinBackupDevice.d.ts.map +1 -0
- package/dist/api/BixinLoadDevice.d.ts +7 -0
- package/dist/api/BixinLoadDevice.d.ts.map +1 -0
- package/dist/api/BixinMessageSE.d.ts +8 -0
- package/dist/api/BixinMessageSE.d.ts.map +1 -0
- package/dist/api/BixinVerifyDeviceRequest.d.ts +8 -0
- package/dist/api/BixinVerifyDeviceRequest.d.ts.map +1 -0
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/WebAuthnAddResidentCredential.d.ts +8 -0
- package/dist/api/WebAuthnAddResidentCredential.d.ts.map +1 -0
- package/dist/api/WebAuthnListResidentCredentials.d.ts +8 -0
- package/dist/api/WebAuthnListResidentCredentials.d.ts.map +1 -0
- package/dist/api/WebAuthnRemoveResidentCredential.d.ts +8 -0
- package/dist/api/WebAuthnRemoveResidentCredential.d.ts.map +1 -0
- package/dist/api/binance/BinanceGetAddress.d.ts +8 -0
- package/dist/api/binance/BinanceGetAddress.d.ts.map +1 -0
- package/dist/api/binance/BinanceGetPublicKey.d.ts +8 -0
- package/dist/api/binance/BinanceGetPublicKey.d.ts.map +1 -0
- package/dist/api/binance/BinanceSignTx.d.ts +7 -0
- package/dist/api/binance/BinanceSignTx.d.ts.map +1 -0
- package/dist/api/btc/BTCAuthorizeCoinJoin.d.ts +7 -0
- package/dist/api/btc/BTCAuthorizeCoinJoin.d.ts.map +1 -0
- package/dist/api/btc/BTCGetOwnershipId.d.ts +7 -0
- package/dist/api/btc/BTCGetOwnershipId.d.ts.map +1 -0
- package/dist/api/btc/BTCGetOwnershipProof.d.ts +7 -0
- package/dist/api/btc/BTCGetOwnershipProof.d.ts.map +1 -0
- package/dist/api/crypto/CryptoBatchGetPublickeys.d.ts +8 -0
- package/dist/api/crypto/CryptoBatchGetPublickeys.d.ts.map +1 -0
- package/dist/api/crypto/CryptoCipherKeyValue.d.ts +8 -0
- package/dist/api/crypto/CryptoCipherKeyValue.d.ts.map +1 -0
- package/dist/api/crypto/CryptoCosiCommit.d.ts +8 -0
- package/dist/api/crypto/CryptoCosiCommit.d.ts.map +1 -0
- package/dist/api/crypto/CryptoCosiSign.d.ts +8 -0
- package/dist/api/crypto/CryptoCosiSign.d.ts.map +1 -0
- package/dist/api/crypto/CryptoGetECDHSessionKey.d.ts +8 -0
- package/dist/api/crypto/CryptoGetECDHSessionKey.d.ts.map +1 -0
- package/dist/api/crypto/CryptoSignIdentity.d.ts +8 -0
- package/dist/api/crypto/CryptoSignIdentity.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkDecision.d.ts +7 -0
- package/dist/api/debug/DebugLinkDecision.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkEraseSdCard.d.ts +7 -0
- package/dist/api/debug/DebugLinkEraseSdCard.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkFlashErase.d.ts +7 -0
- package/dist/api/debug/DebugLinkFlashErase.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkGetState.d.ts +7 -0
- package/dist/api/debug/DebugLinkGetState.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkMemoryRead.d.ts +7 -0
- package/dist/api/debug/DebugLinkMemoryRead.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkMemoryWrite.d.ts +7 -0
- package/dist/api/debug/DebugLinkMemoryWrite.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkRecordScreen.d.ts +7 -0
- package/dist/api/debug/DebugLinkRecordScreen.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkReseedRandom.d.ts +7 -0
- package/dist/api/debug/DebugLinkReseedRandom.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkStop.d.ts +7 -0
- package/dist/api/debug/DebugLinkStop.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkWatchLayout.d.ts +7 -0
- package/dist/api/debug/DebugLinkWatchLayout.d.ts.map +1 -0
- package/dist/api/device/DeviceVerify.d.ts.map +1 -1
- package/dist/api/emmc/EmmcDirList.d.ts +7 -0
- package/dist/api/emmc/EmmcDirList.d.ts.map +1 -0
- package/dist/api/emmc/EmmcDirMake.d.ts +7 -0
- package/dist/api/emmc/EmmcDirMake.d.ts.map +1 -0
- package/dist/api/emmc/EmmcDirRemove.d.ts +7 -0
- package/dist/api/emmc/EmmcDirRemove.d.ts.map +1 -0
- package/dist/api/emmc/EmmcFileDelete.d.ts +7 -0
- package/dist/api/emmc/EmmcFileDelete.d.ts.map +1 -0
- package/dist/api/emmc/EmmcFileRead.d.ts +7 -0
- package/dist/api/emmc/EmmcFileRead.d.ts.map +1 -0
- package/dist/api/emmc/EmmcFileWrite.d.ts +7 -0
- package/dist/api/emmc/EmmcFileWrite.d.ts.map +1 -0
- package/dist/api/emmc/EmmcFixPermission.d.ts +7 -0
- package/dist/api/emmc/EmmcFixPermission.d.ts.map +1 -0
- package/dist/api/emmc/EmmcPathInfo.d.ts +7 -0
- package/dist/api/emmc/EmmcPathInfo.d.ts.map +1 -0
- package/dist/api/eos/EosGetPublicKey.d.ts +8 -0
- package/dist/api/eos/EosGetPublicKey.d.ts.map +1 -0
- package/dist/api/eos/EosSignTx.d.ts +12 -0
- package/dist/api/eos/EosSignTx.d.ts.map +1 -0
- package/dist/api/evmTrezor/EVMGetAddress.d.ts +10 -0
- package/dist/api/evmTrezor/EVMGetAddress.d.ts.map +1 -0
- package/dist/api/evmTrezor/EVMGetPublicKey.d.ts +16 -0
- package/dist/api/evmTrezor/EVMGetPublicKey.d.ts.map +1 -0
- package/dist/api/evmTrezor/EVMSignMessage.d.ts +7 -0
- package/dist/api/evmTrezor/EVMSignMessage.d.ts.map +1 -0
- package/dist/api/evmTrezor/EVMSignTransaction.d.ts +15 -0
- package/dist/api/evmTrezor/EVMSignTransaction.d.ts.map +1 -0
- package/dist/api/evmTrezor/EVMSignTypedData.d.ts +43 -0
- package/dist/api/evmTrezor/EVMSignTypedData.d.ts.map +1 -0
- package/dist/api/evmTrezor/EVMVerifyMessage.d.ts +7 -0
- package/dist/api/evmTrezor/EVMVerifyMessage.d.ts.map +1 -0
- package/dist/api/evmTrezor/legacyV1/getAddress.d.ts +6 -0
- package/dist/api/evmTrezor/legacyV1/getAddress.d.ts.map +1 -0
- package/dist/api/evmTrezor/legacyV1/getPublicKey.d.ts +6 -0
- package/dist/api/evmTrezor/legacyV1/getPublicKey.d.ts.map +1 -0
- package/dist/api/evmTrezor/legacyV1/signMessage.d.ts +6 -0
- package/dist/api/evmTrezor/legacyV1/signMessage.d.ts.map +1 -0
- package/dist/api/evmTrezor/legacyV1/signTransaction.d.ts +9 -0
- package/dist/api/evmTrezor/legacyV1/signTransaction.d.ts.map +1 -0
- package/dist/api/evmTrezor/legacyV1/signTypedData.d.ts +10 -0
- package/dist/api/evmTrezor/legacyV1/signTypedData.d.ts.map +1 -0
- package/dist/api/evmTrezor/legacyV1/signTypedHash.d.ts +11 -0
- package/dist/api/evmTrezor/legacyV1/signTypedHash.d.ts.map +1 -0
- package/dist/api/evmTrezor/legacyV1/verifyMessage.d.ts +6 -0
- package/dist/api/evmTrezor/legacyV1/verifyMessage.d.ts.map +1 -0
- package/dist/api/extensionMethodNames.d.ts +3 -0
- package/dist/api/extensionMethodNames.d.ts.map +1 -0
- package/dist/api/factoryMethods.d.ts +3 -0
- package/dist/api/factoryMethods.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareErase.d.ts +12 -0
- package/dist/api/firmware/FirmwareErase.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareEraseEx.d.ts +12 -0
- package/dist/api/firmware/FirmwareEraseEx.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareUpdateEmmcTest.d.ts +7 -0
- package/dist/api/firmware/FirmwareUpdateEmmcTest.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareUploadTest.d.ts +7 -0
- package/dist/api/firmware/FirmwareUploadTest.d.ts.map +1 -0
- package/dist/api/firmware/Reboot.d.ts +7 -0
- package/dist/api/firmware/Reboot.d.ts.map +1 -0
- package/dist/api/firmware/SelfTest.d.ts +7 -0
- package/dist/api/firmware/SelfTest.d.ts.map +1 -0
- package/dist/api/helpers/protocolV2FileWrite.d.ts.map +1 -1
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/manager/DeviceCancelAuthorization.d.ts +7 -0
- package/dist/api/manager/DeviceCancelAuthorization.d.ts.map +1 -0
- package/dist/api/manager/DeviceChangeWipeCode.d.ts +7 -0
- package/dist/api/manager/DeviceChangeWipeCode.d.ts.map +1 -0
- package/dist/api/manager/DeviceDoPreauthorized.d.ts +7 -0
- package/dist/api/manager/DeviceDoPreauthorized.d.ts.map +1 -0
- package/dist/api/manager/DeviceEndSession.d.ts +7 -0
- package/dist/api/manager/DeviceEndSession.d.ts.map +1 -0
- package/dist/api/manager/DeviceGetEntropy.d.ts +7 -0
- package/dist/api/manager/DeviceGetEntropy.d.ts.map +1 -0
- package/dist/api/manager/DeviceGetFirmwareHash.d.ts +7 -0
- package/dist/api/manager/DeviceGetFirmwareHash.d.ts.map +1 -0
- package/dist/api/manager/DeviceInfoSettings.d.ts +7 -0
- package/dist/api/manager/DeviceInfoSettings.d.ts.map +1 -0
- package/dist/api/manager/DeviceLoad.d.ts +7 -0
- package/dist/api/manager/DeviceLoad.d.ts.map +1 -0
- package/dist/api/manager/DevicePing.d.ts +7 -0
- package/dist/api/manager/DevicePing.d.ts.map +1 -0
- package/dist/api/manager/DeviceReadSEPublicCert.d.ts +7 -0
- package/dist/api/manager/DeviceReadSEPublicCert.d.ts.map +1 -0
- package/dist/api/manager/DeviceSESignMessage.d.ts +7 -0
- package/dist/api/manager/DeviceSESignMessage.d.ts.map +1 -0
- package/dist/api/manager/DeviceSdProtect.d.ts +7 -0
- package/dist/api/manager/DeviceSdProtect.d.ts.map +1 -0
- package/dist/api/manager/DeviceSpiFlashRead.d.ts +7 -0
- package/dist/api/manager/DeviceSpiFlashRead.d.ts.map +1 -0
- package/dist/api/manager/DeviceSpiFlashWrite.d.ts +7 -0
- package/dist/api/manager/DeviceSpiFlashWrite.d.ts.map +1 -0
- package/dist/api/manager/DeviceUnlockPath.d.ts +7 -0
- package/dist/api/manager/DeviceUnlockPath.d.ts.map +1 -0
- package/dist/api/manager/DeviceWriteSEPrivateKey.d.ts +7 -0
- package/dist/api/manager/DeviceWriteSEPrivateKey.d.ts.map +1 -0
- package/dist/api/manager/DeviceWriteSEPublicCert.d.ts +7 -0
- package/dist/api/manager/DeviceWriteSEPublicCert.d.ts.map +1 -0
- package/dist/api/manager/GetDeviceInfoSettings.d.ts +7 -0
- package/dist/api/manager/GetDeviceInfoSettings.d.ts.map +1 -0
- package/dist/api/manager/GetPublicKeyMultiple.d.ts +7 -0
- package/dist/api/manager/GetPublicKeyMultiple.d.ts.map +1 -0
- package/dist/api/manager/ListResDir.d.ts +7 -0
- package/dist/api/manager/ListResDir.d.ts.map +1 -0
- package/dist/api/manager/NFTWriteData.d.ts +7 -0
- package/dist/api/manager/NFTWriteData.d.ts.map +1 -0
- package/dist/api/manager/NFTWriteInfo.d.ts +7 -0
- package/dist/api/manager/NFTWriteInfo.d.ts.map +1 -0
- package/dist/api/manager/ReadSEPublicKey.d.ts +7 -0
- package/dist/api/manager/ReadSEPublicKey.d.ts.map +1 -0
- package/dist/api/manager/ResourceUpdate.d.ts +6 -0
- package/dist/api/manager/ResourceUpdate.d.ts.map +1 -0
- package/dist/api/methodExtension.d.ts +13 -0
- package/dist/api/methodExtension.d.ts.map +1 -0
- package/dist/api/monero/MoneroGetAddress.d.ts +9 -0
- package/dist/api/monero/MoneroGetAddress.d.ts.map +1 -0
- package/dist/api/monero/MoneroGetWatchKey.d.ts +8 -0
- package/dist/api/monero/MoneroGetWatchKey.d.ts.map +1 -0
- package/dist/api/nem/NEMDecryptMessage.d.ts +8 -0
- package/dist/api/nem/NEMDecryptMessage.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceFactoryCertificateRead.d.ts +7 -0
- package/dist/api/protocol-v2/DeviceFactoryCertificateRead.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceFactoryCertificateWrite.d.ts +8 -0
- package/dist/api/protocol-v2/DeviceFactoryCertificateWrite.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceFactoryChallengeSign.d.ts +8 -0
- package/dist/api/protocol-v2/DeviceFactoryChallengeSign.d.ts.map +1 -0
- 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/helpers.d.ts +15 -5
- package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
- package/dist/api/stellar/StellarSignTransaction.d.ts +1 -1
- package/dist/api/testMethods.d.ts +82 -0
- package/dist/api/testMethods.d.ts.map +1 -0
- package/dist/api/tezos/TezosGetAddress.d.ts +9 -0
- package/dist/api/tezos/TezosGetAddress.d.ts.map +1 -0
- package/dist/api/tezos/TezosGetPublicKey.d.ts +8 -0
- package/dist/api/tezos/TezosGetPublicKey.d.ts.map +1 -0
- package/dist/api/tezos/TezosSignTx.d.ts +12 -0
- package/dist/api/tezos/TezosSignTx.d.ts.map +1 -0
- package/dist/api/utils.d.ts +6 -1
- package/dist/api/utils.d.ts.map +1 -1
- package/dist/core/index.d.ts +10 -4
- package/dist/core/index.d.ts.map +1 -1
- package/dist/index.d.ts +722 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2635 -54
- package/dist/inject.d.ts +6 -2
- package/dist/inject.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/firmware.d.ts.map +1 -1
- package/dist/types/api/binanceGetAddress.d.ts +11 -0
- package/dist/types/api/binanceGetAddress.d.ts.map +1 -0
- package/dist/types/api/binanceGetPublicKey.d.ts +11 -0
- package/dist/types/api/binanceGetPublicKey.d.ts.map +1 -0
- package/dist/types/api/binanceSignTx.d.ts +7 -0
- package/dist/types/api/binanceSignTx.d.ts.map +1 -0
- package/dist/types/api/bixinBackupDevice.d.ts +4 -0
- package/dist/types/api/bixinBackupDevice.d.ts.map +1 -0
- package/dist/types/api/bixinLoadDevice.d.ts +4 -0
- package/dist/types/api/bixinLoadDevice.d.ts.map +1 -0
- package/dist/types/api/bixinMessageSE.d.ts +4 -0
- package/dist/types/api/bixinMessageSE.d.ts.map +1 -0
- package/dist/types/api/bixinVerifyDeviceRequest.d.ts +4 -0
- package/dist/types/api/bixinVerifyDeviceRequest.d.ts.map +1 -0
- package/dist/types/api/btcAuthorizeCoinJoin.d.ts +13 -0
- package/dist/types/api/btcAuthorizeCoinJoin.d.ts.map +1 -0
- package/dist/types/api/btcGetOwnershipId.d.ts +10 -0
- package/dist/types/api/btcGetOwnershipId.d.ts.map +1 -0
- package/dist/types/api/btcGetOwnershipProof.d.ts +13 -0
- package/dist/types/api/btcGetOwnershipProof.d.ts.map +1 -0
- package/dist/types/api/cryptoBatchGetPublickeys.d.ts +12 -0
- package/dist/types/api/cryptoBatchGetPublickeys.d.ts.map +1 -0
- package/dist/types/api/cryptoCipherKeyValue.d.ts +13 -0
- package/dist/types/api/cryptoCipherKeyValue.d.ts.map +1 -0
- package/dist/types/api/cryptoCosiCommit.d.ts +8 -0
- package/dist/types/api/cryptoCosiCommit.d.ts.map +1 -0
- package/dist/types/api/cryptoCosiSign.d.ts +10 -0
- package/dist/types/api/cryptoCosiSign.d.ts.map +1 -0
- package/dist/types/api/cryptoGetECDHSessionKey.d.ts +4 -0
- package/dist/types/api/cryptoGetECDHSessionKey.d.ts.map +1 -0
- package/dist/types/api/cryptoSignIdentity.d.ts +4 -0
- package/dist/types/api/cryptoSignIdentity.d.ts.map +1 -0
- package/dist/types/api/debugLinkDecision.d.ts +4 -0
- package/dist/types/api/debugLinkDecision.d.ts.map +1 -0
- package/dist/types/api/debugLinkEraseSdCard.d.ts +4 -0
- package/dist/types/api/debugLinkEraseSdCard.d.ts.map +1 -0
- package/dist/types/api/debugLinkFlashErase.d.ts +4 -0
- package/dist/types/api/debugLinkFlashErase.d.ts.map +1 -0
- package/dist/types/api/debugLinkGetState.d.ts +4 -0
- package/dist/types/api/debugLinkGetState.d.ts.map +1 -0
- package/dist/types/api/debugLinkMemoryRead.d.ts +4 -0
- package/dist/types/api/debugLinkMemoryRead.d.ts.map +1 -0
- package/dist/types/api/debugLinkMemoryWrite.d.ts +4 -0
- package/dist/types/api/debugLinkMemoryWrite.d.ts.map +1 -0
- package/dist/types/api/debugLinkRecordScreen.d.ts +4 -0
- package/dist/types/api/debugLinkRecordScreen.d.ts.map +1 -0
- package/dist/types/api/debugLinkReseedRandom.d.ts +4 -0
- package/dist/types/api/debugLinkReseedRandom.d.ts.map +1 -0
- package/dist/types/api/debugLinkStop.d.ts +4 -0
- package/dist/types/api/debugLinkStop.d.ts.map +1 -0
- package/dist/types/api/debugLinkWatchLayout.d.ts +4 -0
- package/dist/types/api/debugLinkWatchLayout.d.ts.map +1 -0
- package/dist/types/api/detectDeviceConnectProtocol.d.ts.map +1 -1
- package/dist/types/api/deviceCancelAuthorization.d.ts +4 -0
- package/dist/types/api/deviceCancelAuthorization.d.ts.map +1 -0
- package/dist/types/api/deviceChangeWipeCode.d.ts +4 -0
- package/dist/types/api/deviceChangeWipeCode.d.ts.map +1 -0
- package/dist/types/api/deviceDoPreauthorized.d.ts +4 -0
- package/dist/types/api/deviceDoPreauthorized.d.ts.map +1 -0
- package/dist/types/api/deviceEndSession.d.ts +4 -0
- package/dist/types/api/deviceEndSession.d.ts.map +1 -0
- package/dist/types/api/deviceGetEntropy.d.ts +4 -0
- package/dist/types/api/deviceGetEntropy.d.ts.map +1 -0
- package/dist/types/api/deviceGetFirmwareHash.d.ts +4 -0
- package/dist/types/api/deviceGetFirmwareHash.d.ts.map +1 -0
- package/dist/types/api/deviceGetInfo.d.ts +4 -0
- package/dist/types/api/deviceGetInfo.d.ts.map +1 -0
- package/dist/types/api/deviceInfoSettings.d.ts +4 -0
- package/dist/types/api/deviceInfoSettings.d.ts.map +1 -0
- package/dist/types/api/deviceLoad.d.ts +16 -0
- package/dist/types/api/deviceLoad.d.ts.map +1 -0
- package/dist/types/api/devicePing.d.ts +4 -0
- package/dist/types/api/devicePing.d.ts.map +1 -0
- package/dist/types/api/deviceReadSEPublicCert.d.ts +4 -0
- package/dist/types/api/deviceReadSEPublicCert.d.ts.map +1 -0
- package/dist/types/api/deviceSESignMessage.d.ts +4 -0
- package/dist/types/api/deviceSESignMessage.d.ts.map +1 -0
- package/dist/types/api/deviceSdProtect.d.ts +4 -0
- package/dist/types/api/deviceSdProtect.d.ts.map +1 -0
- package/dist/types/api/deviceSpiFlashRead.d.ts +4 -0
- package/dist/types/api/deviceSpiFlashRead.d.ts.map +1 -0
- package/dist/types/api/deviceSpiFlashWrite.d.ts +4 -0
- package/dist/types/api/deviceSpiFlashWrite.d.ts.map +1 -0
- package/dist/types/api/deviceUnlockPath.d.ts +11 -0
- package/dist/types/api/deviceUnlockPath.d.ts.map +1 -0
- package/dist/types/api/deviceWriteSEPrivateKey.d.ts +4 -0
- package/dist/types/api/deviceWriteSEPrivateKey.d.ts.map +1 -0
- package/dist/types/api/deviceWriteSEPublicCert.d.ts +4 -0
- package/dist/types/api/deviceWriteSEPublicCert.d.ts.map +1 -0
- package/dist/types/api/emmcDirList.d.ts +4 -0
- package/dist/types/api/emmcDirList.d.ts.map +1 -0
- package/dist/types/api/emmcDirMake.d.ts +4 -0
- package/dist/types/api/emmcDirMake.d.ts.map +1 -0
- package/dist/types/api/emmcDirRemove.d.ts +4 -0
- package/dist/types/api/emmcDirRemove.d.ts.map +1 -0
- package/dist/types/api/emmcFileDelete.d.ts +4 -0
- package/dist/types/api/emmcFileDelete.d.ts.map +1 -0
- package/dist/types/api/emmcFileRead.d.ts +4 -0
- package/dist/types/api/emmcFileRead.d.ts.map +1 -0
- package/dist/types/api/emmcFileWrite.d.ts +4 -0
- package/dist/types/api/emmcFileWrite.d.ts.map +1 -0
- package/dist/types/api/emmcFixPermission.d.ts +4 -0
- package/dist/types/api/emmcFixPermission.d.ts.map +1 -0
- package/dist/types/api/emmcPathInfo.d.ts +4 -0
- package/dist/types/api/emmcPathInfo.d.ts.map +1 -0
- package/dist/types/api/eosGetPublicKey.d.ts +8 -0
- package/dist/types/api/eosGetPublicKey.d.ts.map +1 -0
- package/dist/types/api/eosSignTx.d.ts +7 -0
- package/dist/types/api/eosSignTx.d.ts.map +1 -0
- package/dist/types/api/evmGetAddressTrezor.d.ts +15 -0
- package/dist/types/api/evmGetAddressTrezor.d.ts.map +1 -0
- package/dist/types/api/evmGetPublicKeyTrezor.d.ts +20 -0
- package/dist/types/api/evmGetPublicKeyTrezor.d.ts.map +1 -0
- package/dist/types/api/evmSignMessageTrezor.d.ts +9 -0
- package/dist/types/api/evmSignMessageTrezor.d.ts.map +1 -0
- package/dist/types/api/evmSignTransactionTrezor.d.ts +40 -0
- package/dist/types/api/evmSignTransactionTrezor.d.ts.map +1 -0
- package/dist/types/api/evmSignTypedDataTrezor.d.ts +34 -0
- package/dist/types/api/evmSignTypedDataTrezor.d.ts.map +1 -0
- package/dist/types/api/evmVerifyMessageTrezor.d.ts +10 -0
- package/dist/types/api/evmVerifyMessageTrezor.d.ts.map +1 -0
- package/dist/types/api/firmwareErase.d.ts +4 -0
- package/dist/types/api/firmwareErase.d.ts.map +1 -0
- package/dist/types/api/firmwareEraseEx.d.ts +4 -0
- package/dist/types/api/firmwareEraseEx.d.ts.map +1 -0
- package/dist/types/api/firmwareUpdateEmmcTest.d.ts +4 -0
- package/dist/types/api/firmwareUpdateEmmcTest.d.ts.map +1 -0
- package/dist/types/api/firmwareUploadTest.d.ts +4 -0
- package/dist/types/api/firmwareUploadTest.d.ts.map +1 -0
- package/dist/types/api/getPublicKeyMultiple.d.ts +4 -0
- package/dist/types/api/getPublicKeyMultiple.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +176 -3
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/listResDir.d.ts +4 -0
- package/dist/types/api/listResDir.d.ts.map +1 -0
- package/dist/types/api/moneroGetAddress.d.ts +14 -0
- package/dist/types/api/moneroGetAddress.d.ts.map +1 -0
- package/dist/types/api/moneroGetWatchKey.d.ts +14 -0
- package/dist/types/api/moneroGetWatchKey.d.ts.map +1 -0
- package/dist/types/api/nemDecryptMessage.d.ts +10 -0
- package/dist/types/api/nemDecryptMessage.d.ts.map +1 -0
- package/dist/types/api/nftWriteData.d.ts +4 -0
- package/dist/types/api/nftWriteData.d.ts.map +1 -0
- package/dist/types/api/nftWriteInfo.d.ts +4 -0
- package/dist/types/api/nftWriteInfo.d.ts.map +1 -0
- package/dist/types/api/protocolV2.d.ts +8 -2
- package/dist/types/api/protocolV2.d.ts.map +1 -1
- package/dist/types/api/readSEPublicKey.d.ts +4 -0
- package/dist/types/api/readSEPublicKey.d.ts.map +1 -0
- package/dist/types/api/reboot.d.ts +4 -0
- package/dist/types/api/reboot.d.ts.map +1 -0
- package/dist/types/api/resourceUpdate.d.ts +7 -0
- package/dist/types/api/resourceUpdate.d.ts.map +1 -0
- package/dist/types/api/selfTest.d.ts +4 -0
- package/dist/types/api/selfTest.d.ts.map +1 -0
- package/dist/types/api/tezosGetAddress.d.ts +14 -0
- package/dist/types/api/tezosGetAddress.d.ts.map +1 -0
- package/dist/types/api/tezosGetPublicKey.d.ts +14 -0
- package/dist/types/api/tezosGetPublicKey.d.ts.map +1 -0
- package/dist/types/api/tezosSignTx.d.ts +7 -0
- package/dist/types/api/tezosSignTx.d.ts.map +1 -0
- package/dist/types/api/webAuthnAddResidentCredential.d.ts +4 -0
- package/dist/types/api/webAuthnAddResidentCredential.d.ts.map +1 -0
- package/dist/types/api/webAuthnListResidentCredentials.d.ts +4 -0
- package/dist/types/api/webAuthnListResidentCredentials.d.ts.map +1 -0
- package/dist/types/api/webAuthnRemoveResidentCredential.d.ts +4 -0
- package/dist/types/api/webAuthnRemoveResidentCredential.d.ts.map +1 -0
- 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/BixinBackupDevice.ts +15 -0
- package/src/api/BixinLoadDevice.ts +22 -0
- package/src/api/BixinMessageSE.ts +22 -0
- package/src/api/BixinVerifyDeviceRequest.ts +22 -0
- package/src/api/FirmwareUpdateV4.ts +15 -10
- package/src/api/WebAuthnAddResidentCredential.ts +22 -0
- package/src/api/WebAuthnListResidentCredentials.ts +24 -0
- package/src/api/WebAuthnRemoveResidentCredential.ts +22 -0
- package/src/api/binance/BinanceGetAddress.ts +26 -0
- package/src/api/binance/BinanceGetPublicKey.ts +26 -0
- package/src/api/binance/BinanceSignTx.ts +35 -0
- package/src/api/btc/BTCAuthorizeCoinJoin.ts +37 -0
- package/src/api/btc/BTCGetOwnershipId.ts +34 -0
- package/src/api/btc/BTCGetOwnershipProof.ts +37 -0
- package/src/api/crypto/CryptoBatchGetPublickeys.ts +30 -0
- package/src/api/crypto/CryptoCipherKeyValue.ts +29 -0
- package/src/api/crypto/CryptoCosiCommit.ts +24 -0
- package/src/api/crypto/CryptoCosiSign.ts +26 -0
- package/src/api/crypto/CryptoGetECDHSessionKey.ts +24 -0
- package/src/api/crypto/CryptoSignIdentity.ts +25 -0
- package/src/api/debug/DebugLinkDecision.ts +25 -0
- package/src/api/debug/DebugLinkEraseSdCard.ts +23 -0
- package/src/api/debug/DebugLinkFlashErase.ts +23 -0
- package/src/api/debug/DebugLinkGetState.ts +21 -0
- package/src/api/debug/DebugLinkMemoryRead.ts +24 -0
- package/src/api/debug/DebugLinkMemoryWrite.ts +25 -0
- package/src/api/debug/DebugLinkRecordScreen.ts +23 -0
- package/src/api/debug/DebugLinkReseedRandom.ts +23 -0
- package/src/api/debug/DebugLinkStop.ts +25 -0
- package/src/api/debug/DebugLinkWatchLayout.ts +23 -0
- package/src/api/device/DeviceVerify.ts +2 -0
- package/src/api/emmc/EmmcDirList.ts +20 -0
- package/src/api/emmc/EmmcDirMake.ts +20 -0
- package/src/api/emmc/EmmcDirRemove.ts +20 -0
- package/src/api/emmc/EmmcFileDelete.ts +20 -0
- package/src/api/emmc/EmmcFileRead.ts +21 -0
- package/src/api/emmc/EmmcFileWrite.ts +23 -0
- package/src/api/emmc/EmmcFixPermission.ts +17 -0
- package/src/api/emmc/EmmcPathInfo.ts +20 -0
- package/src/api/eos/EosGetPublicKey.ts +26 -0
- package/src/api/eos/EosSignTx.ts +40 -0
- package/src/api/evmTrezor/EVMGetAddress.ts +75 -0
- package/src/api/evmTrezor/EVMGetPublicKey.ts +106 -0
- package/src/api/evmTrezor/EVMSignMessage.ts +40 -0
- package/src/api/evmTrezor/EVMSignTransaction.ts +83 -0
- package/src/api/evmTrezor/EVMSignTypedData.ts +366 -0
- package/src/api/evmTrezor/EVMVerifyMessage.ts +37 -0
- package/src/api/evmTrezor/legacyV1/getAddress.ts +16 -0
- package/src/api/evmTrezor/legacyV1/getPublicKey.ts +20 -0
- package/src/api/evmTrezor/legacyV1/signMessage.ts +22 -0
- package/src/api/evmTrezor/legacyV1/signTransaction.ts +24 -0
- package/src/api/evmTrezor/legacyV1/signTypedData.ts +36 -0
- package/src/api/evmTrezor/legacyV1/signTypedHash.ts +48 -0
- package/src/api/evmTrezor/legacyV1/verifyMessage.ts +19 -0
- package/src/api/extensionMethodNames.ts +88 -0
- package/src/api/factoryMethods.ts +2 -0
- package/src/api/firmware/FirmwareErase.ts +18 -0
- package/src/api/firmware/FirmwareEraseEx.ts +18 -0
- package/src/api/firmware/FirmwareUpdateEmmcTest.ts +18 -0
- package/src/api/firmware/FirmwareUploadTest.ts +17 -0
- package/src/api/firmware/Reboot.ts +17 -0
- package/src/api/firmware/SelfTest.ts +17 -0
- package/src/api/helpers/protocolV2FileWrite.ts +16 -3
- package/src/api/index.ts +3 -0
- package/src/api/manager/DeviceCancelAuthorization.ts +15 -0
- package/src/api/manager/DeviceChangeWipeCode.ts +19 -0
- package/src/api/manager/DeviceDoPreauthorized.ts +15 -0
- package/src/api/manager/DeviceEndSession.ts +19 -0
- package/src/api/manager/DeviceGetEntropy.ts +19 -0
- package/src/api/manager/DeviceGetFirmwareHash.ts +23 -0
- package/src/api/manager/DeviceInfoSettings.ts +23 -0
- package/src/api/manager/DeviceLoad.ts +27 -0
- package/src/api/manager/DevicePing.ts +19 -0
- package/src/api/manager/DeviceReadSEPublicCert.ts +18 -0
- package/src/api/manager/DeviceSESignMessage.ts +23 -0
- package/src/api/manager/DeviceSdProtect.ts +18 -0
- package/src/api/manager/DeviceSpiFlashRead.ts +22 -0
- package/src/api/manager/DeviceSpiFlashWrite.ts +22 -0
- package/src/api/manager/DeviceUnlockPath.ts +26 -0
- package/src/api/manager/DeviceWriteSEPrivateKey.ts +23 -0
- package/src/api/manager/DeviceWriteSEPublicCert.ts +23 -0
- package/src/api/manager/GetDeviceInfoSettings.ts +20 -0
- package/src/api/manager/GetPublicKeyMultiple.ts +24 -0
- package/src/api/manager/ListResDir.ts +19 -0
- package/src/api/manager/NFTWriteData.ts +21 -0
- package/src/api/manager/NFTWriteInfo.ts +23 -0
- package/src/api/manager/ReadSEPublicKey.ts +20 -0
- package/src/api/manager/ResourceUpdate.ts +22 -0
- package/src/api/methodExtension.ts +27 -0
- package/src/api/monero/MoneroGetAddress.ts +64 -0
- package/src/api/monero/MoneroGetWatchKey.ts +59 -0
- package/src/api/nem/NEMDecryptMessage.ts +29 -0
- package/src/api/protocol-v2/DeviceFactoryCertificateRead.ts +25 -0
- package/src/api/protocol-v2/DeviceFactoryCertificateWrite.ts +30 -0
- package/src/api/protocol-v2/DeviceFactoryChallengeSign.ts +28 -0
- package/src/api/protocol-v2/DeviceFactoryInfoGet.ts +3 -0
- package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +6 -7
- package/src/api/protocol-v2/helpers.ts +152 -5
- package/src/api/testMethods.ts +95 -0
- package/src/api/tezos/TezosGetAddress.ts +64 -0
- package/src/api/tezos/TezosGetPublicKey.ts +63 -0
- package/src/api/tezos/TezosSignTx.ts +44 -0
- package/src/api/utils.ts +46 -1
- package/src/core/index.ts +22 -7
- package/src/index.ts +5 -0
- package/src/inject.ts +209 -7
- package/src/protocols/protocol-v2/firmware.ts +2 -0
- package/src/types/api/binanceGetAddress.ts +17 -0
- package/src/types/api/binanceGetPublicKey.ts +17 -0
- package/src/types/api/binanceSignTx.ts +15 -0
- package/src/types/api/bixinBackupDevice.ts +8 -0
- package/src/types/api/bixinLoadDevice.ts +8 -0
- package/src/types/api/bixinMessageSE.ts +8 -0
- package/src/types/api/bixinVerifyDeviceRequest.ts +8 -0
- package/src/types/api/btcAuthorizeCoinJoin.ts +18 -0
- package/src/types/api/btcGetOwnershipId.ts +19 -0
- package/src/types/api/btcGetOwnershipProof.ts +22 -0
- package/src/types/api/cryptoBatchGetPublickeys.ts +18 -0
- package/src/types/api/cryptoCipherKeyValue.ts +18 -0
- package/src/types/api/cryptoCosiCommit.ts +13 -0
- package/src/types/api/cryptoCosiSign.ts +15 -0
- package/src/types/api/cryptoGetECDHSessionKey.ts +8 -0
- package/src/types/api/cryptoSignIdentity.ts +8 -0
- package/src/types/api/debugLinkDecision.ts +7 -0
- package/src/types/api/debugLinkEraseSdCard.ts +7 -0
- package/src/types/api/debugLinkFlashErase.ts +7 -0
- package/src/types/api/debugLinkGetState.ts +7 -0
- package/src/types/api/debugLinkMemoryRead.ts +7 -0
- package/src/types/api/debugLinkMemoryWrite.ts +7 -0
- package/src/types/api/debugLinkRecordScreen.ts +7 -0
- package/src/types/api/debugLinkReseedRandom.ts +7 -0
- package/src/types/api/debugLinkStop.ts +7 -0
- package/src/types/api/debugLinkWatchLayout.ts +7 -0
- package/src/types/api/detectDeviceConnectProtocol.ts +0 -1
- package/src/types/api/deviceCancelAuthorization.ts +7 -0
- package/src/types/api/deviceChangeWipeCode.ts +7 -0
- package/src/types/api/deviceDoPreauthorized.ts +7 -0
- package/src/types/api/deviceEndSession.ts +7 -0
- package/src/types/api/deviceGetEntropy.ts +7 -0
- package/src/types/api/deviceGetFirmwareHash.ts +7 -0
- package/src/types/api/deviceGetInfo.ts +7 -0
- package/src/types/api/deviceInfoSettings.ts +7 -0
- package/src/types/api/deviceLoad.ts +19 -0
- package/src/types/api/devicePing.ts +7 -0
- package/src/types/api/deviceReadSEPublicCert.ts +7 -0
- package/src/types/api/deviceSESignMessage.ts +7 -0
- package/src/types/api/deviceSdProtect.ts +7 -0
- package/src/types/api/deviceSpiFlashRead.ts +7 -0
- package/src/types/api/deviceSpiFlashWrite.ts +7 -0
- package/src/types/api/deviceUnlockPath.ts +16 -0
- package/src/types/api/deviceWriteSEPrivateKey.ts +7 -0
- package/src/types/api/deviceWriteSEPublicCert.ts +7 -0
- package/src/types/api/emmcDirList.ts +7 -0
- package/src/types/api/emmcDirMake.ts +7 -0
- package/src/types/api/emmcDirRemove.ts +7 -0
- package/src/types/api/emmcFileDelete.ts +7 -0
- package/src/types/api/emmcFileRead.ts +7 -0
- package/src/types/api/emmcFileWrite.ts +7 -0
- package/src/types/api/emmcFixPermission.ts +7 -0
- package/src/types/api/emmcPathInfo.ts +7 -0
- package/src/types/api/eosGetPublicKey.ts +13 -0
- package/src/types/api/eosSignTx.ts +12 -0
- package/src/types/api/evmGetAddressTrezor.ts +24 -0
- package/src/types/api/evmGetPublicKeyTrezor.ts +31 -0
- package/src/types/api/evmSignMessageTrezor.ts +14 -0
- package/src/types/api/evmSignTransactionTrezor.ts +49 -0
- package/src/types/api/evmSignTypedDataTrezor.ts +42 -0
- package/src/types/api/evmVerifyMessageTrezor.ts +15 -0
- package/src/types/api/firmwareErase.ts +4 -0
- package/src/types/api/firmwareEraseEx.ts +7 -0
- package/src/types/api/firmwareUpdateEmmcTest.ts +7 -0
- package/src/types/api/firmwareUploadTest.ts +7 -0
- package/src/types/api/getPublicKeyMultiple.ts +11 -0
- package/src/types/api/index.ts +288 -2
- package/src/types/api/listResDir.ts +8 -0
- package/src/types/api/moneroGetAddress.ts +23 -0
- package/src/types/api/moneroGetWatchKey.ts +26 -0
- package/src/types/api/nemDecryptMessage.ts +15 -0
- package/src/types/api/nftWriteData.ts +8 -0
- package/src/types/api/nftWriteInfo.ts +8 -0
- package/src/types/api/protocolV2.ts +43 -2
- package/src/types/api/readSEPublicKey.ts +8 -0
- package/src/types/api/reboot.ts +4 -0
- package/src/types/api/resourceUpdate.ts +11 -0
- package/src/types/api/selfTest.ts +7 -0
- package/src/types/api/tezosGetAddress.ts +23 -0
- package/src/types/api/tezosGetPublicKey.ts +23 -0
- package/src/types/api/tezosSignTx.ts +12 -0
- package/src/types/api/webAuthnAddResidentCredential.ts +8 -0
- package/src/types/api/webAuthnListResidentCredentials.ts +8 -0
- package/src/types/api/webAuthnRemoveResidentCredential.ts +8 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { EDeviceType } from '@onekeyfe/hd-shared';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
PROTOCOL_V2_NEVER_TIMEOUT_MS,
|
|
4
5
|
getAutoLockOptions,
|
|
5
6
|
getAutoShutDownOptions,
|
|
6
7
|
getDeviceSettingsCapabilities,
|
|
7
8
|
getLanguageConfig,
|
|
8
9
|
mapLanguageFromProtocolV2,
|
|
9
10
|
mapLanguageToProtocolV2,
|
|
10
|
-
PROTOCOL_V2_NEVER_TIMEOUT_MS,
|
|
11
11
|
} from '../src/utils/deviceSettings';
|
|
12
12
|
|
|
13
13
|
describe('Pro 2 device settings options', () => {
|
|
@@ -14,6 +14,9 @@ import DirList from '../src/api/DirList';
|
|
|
14
14
|
import FileRead from '../src/api/FileRead';
|
|
15
15
|
import FileWrite from '../src/api/FileWrite';
|
|
16
16
|
import UploadPortfolio from '../src/api/UploadPortfolio';
|
|
17
|
+
import DeviceFactoryCertificateRead from '../src/api/protocol-v2/DeviceFactoryCertificateRead';
|
|
18
|
+
import DeviceFactoryCertificateWrite from '../src/api/protocol-v2/DeviceFactoryCertificateWrite';
|
|
19
|
+
import DeviceFactoryChallengeSign from '../src/api/protocol-v2/DeviceFactoryChallengeSign';
|
|
17
20
|
import DeviceFactoryInfoGet from '../src/api/protocol-v2/DeviceFactoryInfoGet';
|
|
18
21
|
import DeviceFactoryInfoSet from '../src/api/protocol-v2/DeviceFactoryInfoSet';
|
|
19
22
|
import DeviceFirmwareUpdate from '../src/api/protocol-v2/DeviceFirmwareUpdate';
|
|
@@ -6071,6 +6074,10 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
6071
6074
|
expect(writePayloads.map(payload => payload.file.offset)).toEqual([0, 1800]);
|
|
6072
6075
|
expect(writePayloads.map(payload => payload.file.data.byteLength)).toEqual([1800, 1]);
|
|
6073
6076
|
expect(writePayloads.map(payload => payload.ui_percentage)).toEqual([0, 100]);
|
|
6077
|
+
expect(typedCall.mock.calls.map(call => call[3])).toEqual([
|
|
6078
|
+
{ writeWithResponse: true },
|
|
6079
|
+
{ writeWithResponse: true },
|
|
6080
|
+
]);
|
|
6074
6081
|
});
|
|
6075
6082
|
|
|
6076
6083
|
test('ends device confirmation and starts install progress only after Protocol V2 ACK', async () => {
|
|
@@ -7221,26 +7228,39 @@ describe('Protocol V2 current low-level methods', () => {
|
|
|
7221
7228
|
|
|
7222
7229
|
test('sends DeviceFactoryInfoSet and DeviceFactoryInfoGet', async () => {
|
|
7223
7230
|
const typedCall = jest.fn().mockResolvedValue({ message: {} });
|
|
7231
|
+
const manufactureTime = {
|
|
7232
|
+
year: 2026,
|
|
7233
|
+
month: 8,
|
|
7234
|
+
day: 1,
|
|
7235
|
+
hour: 10,
|
|
7236
|
+
minute: 20,
|
|
7237
|
+
second: 30,
|
|
7238
|
+
};
|
|
7224
7239
|
const setMethod = new DeviceFactoryInfoSet({
|
|
7225
7240
|
id: 1,
|
|
7226
7241
|
payload: {
|
|
7227
7242
|
method: 'deviceFactoryInfoSet',
|
|
7243
|
+
version: 1,
|
|
7228
7244
|
serial_number: 'PR2SERIAL',
|
|
7229
7245
|
burn_in_completed: true,
|
|
7246
|
+
factory_test_completed: true,
|
|
7247
|
+
manufacture_time: manufactureTime,
|
|
7230
7248
|
},
|
|
7231
7249
|
});
|
|
7232
7250
|
setMethod.init();
|
|
7251
|
+
expect(setMethod.getSupportedProtocols()).toEqual(['V2']);
|
|
7252
|
+
expect(setMethod.requireDeviceMode).toEqual([UI_REQUEST.BOOTLOADER]);
|
|
7233
7253
|
(setMethod as any).device = stubDevice({ commands: { typedCall } });
|
|
7234
7254
|
|
|
7235
7255
|
await setMethod.run();
|
|
7236
7256
|
|
|
7237
7257
|
expect(typedCall).toHaveBeenCalledWith('DeviceFactoryInfoSet', 'Success', {
|
|
7238
7258
|
info: {
|
|
7239
|
-
version:
|
|
7259
|
+
version: 1,
|
|
7240
7260
|
serial_number: 'PR2SERIAL',
|
|
7241
7261
|
burn_in_completed: true,
|
|
7242
|
-
factory_test_completed:
|
|
7243
|
-
manufacture_time:
|
|
7262
|
+
factory_test_completed: true,
|
|
7263
|
+
manufacture_time: manufactureTime,
|
|
7244
7264
|
},
|
|
7245
7265
|
});
|
|
7246
7266
|
|
|
@@ -7250,6 +7270,7 @@ describe('Protocol V2 current low-level methods', () => {
|
|
|
7250
7270
|
payload: { method: 'deviceFactoryInfoGet' },
|
|
7251
7271
|
});
|
|
7252
7272
|
getMethod.init();
|
|
7273
|
+
expect(getMethod.getSupportedProtocols()).toEqual(['V2']);
|
|
7253
7274
|
(getMethod as any).device = stubDevice({ commands: { typedCall } });
|
|
7254
7275
|
|
|
7255
7276
|
await getMethod.run();
|
|
@@ -7257,6 +7278,111 @@ describe('Protocol V2 current low-level methods', () => {
|
|
|
7257
7278
|
expect(typedCall).toHaveBeenLastCalledWith('DeviceFactoryInfoGet', 'DeviceFactoryInfo', {});
|
|
7258
7279
|
});
|
|
7259
7280
|
|
|
7281
|
+
test('validates the write-once DeviceFactoryInfoSet payload before sending', () => {
|
|
7282
|
+
expect(() =>
|
|
7283
|
+
new DeviceFactoryInfoSet({
|
|
7284
|
+
id: 1,
|
|
7285
|
+
payload: {
|
|
7286
|
+
method: 'deviceProvisionFactoryInfo',
|
|
7287
|
+
serial_number: 'PR2SERIAL',
|
|
7288
|
+
},
|
|
7289
|
+
}).init()
|
|
7290
|
+
).toThrow('Parameter [manufacture_time] is required.');
|
|
7291
|
+
|
|
7292
|
+
expect(() =>
|
|
7293
|
+
new DeviceFactoryInfoSet({
|
|
7294
|
+
id: 1,
|
|
7295
|
+
payload: {
|
|
7296
|
+
method: 'deviceProvisionFactoryInfo',
|
|
7297
|
+
version: 1,
|
|
7298
|
+
serial_number: 'P'.repeat(25),
|
|
7299
|
+
burn_in_completed: true,
|
|
7300
|
+
factory_test_completed: true,
|
|
7301
|
+
manufacture_time: {
|
|
7302
|
+
year: 2026,
|
|
7303
|
+
month: 8,
|
|
7304
|
+
day: 1,
|
|
7305
|
+
hour: 0,
|
|
7306
|
+
minute: 0,
|
|
7307
|
+
second: 0,
|
|
7308
|
+
},
|
|
7309
|
+
},
|
|
7310
|
+
}).init()
|
|
7311
|
+
).toThrow('must not exceed 24 UTF-8 bytes');
|
|
7312
|
+
});
|
|
7313
|
+
|
|
7314
|
+
test('writes, reads and signs with the Protocol V2 factory certificate API', async () => {
|
|
7315
|
+
const typedCall = jest.fn().mockResolvedValue({ message: {} });
|
|
7316
|
+
const write = new DeviceFactoryCertificateWrite({
|
|
7317
|
+
id: 1,
|
|
7318
|
+
payload: {
|
|
7319
|
+
method: 'deviceWriteFactoryCertificate',
|
|
7320
|
+
certificate: 'aabbcc',
|
|
7321
|
+
},
|
|
7322
|
+
});
|
|
7323
|
+
write.init();
|
|
7324
|
+
expect(write.getSupportedProtocols()).toEqual(['V2']);
|
|
7325
|
+
expect(write.requireDeviceMode).toEqual([UI_REQUEST.BOOTLOADER]);
|
|
7326
|
+
(write as any).device = stubDevice({ commands: { typedCall } });
|
|
7327
|
+
await write.run();
|
|
7328
|
+
|
|
7329
|
+
expect(typedCall).toHaveBeenLastCalledWith('DeviceCertificateWrite', 'Success', {
|
|
7330
|
+
cert: {
|
|
7331
|
+
cert_and_pubkey: 'aabbcc',
|
|
7332
|
+
private_key: undefined,
|
|
7333
|
+
},
|
|
7334
|
+
});
|
|
7335
|
+
|
|
7336
|
+
const read = new DeviceFactoryCertificateRead({
|
|
7337
|
+
id: 2,
|
|
7338
|
+
payload: { method: 'deviceReadFactoryCertificate' },
|
|
7339
|
+
});
|
|
7340
|
+
read.init();
|
|
7341
|
+
expect(read.getSupportedProtocols()).toEqual(['V2']);
|
|
7342
|
+
(read as any).device = stubDevice({ commands: { typedCall } });
|
|
7343
|
+
await read.run();
|
|
7344
|
+
expect(typedCall).toHaveBeenLastCalledWith('DeviceCertificateRead', 'DeviceCertificate', {});
|
|
7345
|
+
|
|
7346
|
+
const sign = new DeviceFactoryChallengeSign({
|
|
7347
|
+
id: 3,
|
|
7348
|
+
payload: {
|
|
7349
|
+
method: 'deviceSignFactoryChallenge',
|
|
7350
|
+
digest: '22'.repeat(32),
|
|
7351
|
+
},
|
|
7352
|
+
});
|
|
7353
|
+
sign.init();
|
|
7354
|
+
expect(sign.getSupportedProtocols()).toEqual(['V2']);
|
|
7355
|
+
(sign as any).device = stubDevice({ commands: { typedCall } });
|
|
7356
|
+
await sign.run();
|
|
7357
|
+
expect(typedCall).toHaveBeenLastCalledWith(
|
|
7358
|
+
'DeviceCertificateSign',
|
|
7359
|
+
'DeviceCertificateSignature',
|
|
7360
|
+
{ data: '22'.repeat(32) }
|
|
7361
|
+
);
|
|
7362
|
+
});
|
|
7363
|
+
|
|
7364
|
+
test('rejects malformed Protocol V2 factory certificate fields', () => {
|
|
7365
|
+
expect(() =>
|
|
7366
|
+
new DeviceFactoryCertificateWrite({
|
|
7367
|
+
id: 1,
|
|
7368
|
+
payload: {
|
|
7369
|
+
method: 'deviceWriteFactoryCertificate',
|
|
7370
|
+
certificate: 'xyz',
|
|
7371
|
+
},
|
|
7372
|
+
}).init()
|
|
7373
|
+
).toThrow('even-length hexadecimal string');
|
|
7374
|
+
|
|
7375
|
+
expect(() =>
|
|
7376
|
+
new DeviceFactoryChallengeSign({
|
|
7377
|
+
id: 2,
|
|
7378
|
+
payload: {
|
|
7379
|
+
method: 'deviceSignFactoryChallenge',
|
|
7380
|
+
digest: '11',
|
|
7381
|
+
},
|
|
7382
|
+
}).init()
|
|
7383
|
+
).toThrow('exactly 32 bytes');
|
|
7384
|
+
});
|
|
7385
|
+
|
|
7260
7386
|
test('marks explicit Protocol V2 unlock as an on-device PIN interaction', () => {
|
|
7261
7387
|
const method = new DeviceUnlock({
|
|
7262
7388
|
id: 1,
|
|
@@ -89,4 +89,43 @@ describe('writeProtocolV2File', () => {
|
|
|
89
89
|
expect(typedCall.mock.calls[1][2]).toEqual(typedCall.mock.calls[0][2]);
|
|
90
90
|
expect(onProgress).toHaveBeenCalledTimes(1);
|
|
91
91
|
});
|
|
92
|
+
|
|
93
|
+
test('按确认分片的时间窗口记录实时传输速率', async () => {
|
|
94
|
+
const data = new Uint8Array(4097);
|
|
95
|
+
const typedCall = jest.fn().mockResolvedValue({ message: {} });
|
|
96
|
+
const onProgress = jest.fn();
|
|
97
|
+
const dateNowSpy = jest
|
|
98
|
+
.spyOn(Date, 'now')
|
|
99
|
+
.mockReturnValueOnce(1_000)
|
|
100
|
+
.mockReturnValueOnce(2_000)
|
|
101
|
+
.mockReturnValueOnce(3_000);
|
|
102
|
+
|
|
103
|
+
try {
|
|
104
|
+
await writeProtocolV2File({
|
|
105
|
+
commands: { typedCall } as any,
|
|
106
|
+
path: 'vol1:/wallpapers/test.bin',
|
|
107
|
+
data,
|
|
108
|
+
onProgress,
|
|
109
|
+
});
|
|
110
|
+
} finally {
|
|
111
|
+
dateNowSpy.mockRestore();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
expect(onProgress).toHaveBeenNthCalledWith(
|
|
115
|
+
1,
|
|
116
|
+
expect.objectContaining({
|
|
117
|
+
transferredBytes: 4000,
|
|
118
|
+
rateBytesPerSecond: 4000,
|
|
119
|
+
elapsedMs: 1000,
|
|
120
|
+
})
|
|
121
|
+
);
|
|
122
|
+
expect(onProgress).toHaveBeenNthCalledWith(
|
|
123
|
+
2,
|
|
124
|
+
expect.objectContaining({
|
|
125
|
+
transferredBytes: 4097,
|
|
126
|
+
rateBytesPerSecond: 97,
|
|
127
|
+
elapsedMs: 2000,
|
|
128
|
+
})
|
|
129
|
+
);
|
|
130
|
+
});
|
|
92
131
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as publicMethods from '../src/api';
|
|
2
|
+
import { FACTORY_API_METHOD_NAMES } from '../src/api/extensionMethodNames';
|
|
3
|
+
import { factoryApiMethodExtension } from '../src/api/methodExtension';
|
|
2
4
|
import { findMethod } from '../src/api/utils';
|
|
3
|
-
import { createCoreApi } from '../src/inject';
|
|
5
|
+
import { createCoreApi, createFactoryApi } from '../src/inject';
|
|
4
6
|
|
|
5
|
-
import type { CoreApi } from '../src/types/api';
|
|
7
|
+
import type { CoreApi, TestApi } from '../src/types/api';
|
|
6
8
|
|
|
7
9
|
jest.mock('../src/data/config', () => ({
|
|
8
10
|
DEFAULT_DOMAIN: 'https://example.com/',
|
|
@@ -49,9 +51,16 @@ describe('public Pro2 API boundary', () => {
|
|
|
49
51
|
|
|
50
52
|
expect(api.deviceGetOnboardingStatus).toBeInstanceOf(Function);
|
|
51
53
|
expect(api.deviceUploadNft).toBeInstanceOf(Function);
|
|
54
|
+
expect(api.deviceReadFactoryInfo).toBeInstanceOf(Function);
|
|
55
|
+
expect(api.deviceReadFactoryCertificate).toBeInstanceOf(Function);
|
|
56
|
+
expect(api.deviceSignFactoryChallenge).toBeInstanceOf(Function);
|
|
52
57
|
expect(api.uploadPortfolio).toBeInstanceOf(Function);
|
|
53
58
|
expect(api.testProtocolV2Ping).toBeInstanceOf(Function);
|
|
54
59
|
expect(publicMethods.testProtocolV2Ping).toBeInstanceOf(Function);
|
|
60
|
+
expect(api).not.toHaveProperty('deviceProvisionFactoryInfo');
|
|
61
|
+
expect(api).not.toHaveProperty('deviceWriteFactoryCertificate');
|
|
62
|
+
expect(publicMethods).not.toHaveProperty('deviceProvisionFactoryInfo');
|
|
63
|
+
expect(publicMethods).not.toHaveProperty('deviceWriteFactoryCertificate');
|
|
55
64
|
|
|
56
65
|
expect(api).not.toHaveProperty('deviceSessionOpen');
|
|
57
66
|
expect(publicMethods).not.toHaveProperty('deviceSessionOpen');
|
|
@@ -65,6 +74,93 @@ describe('public Pro2 API boundary', () => {
|
|
|
65
74
|
});
|
|
66
75
|
});
|
|
67
76
|
|
|
77
|
+
test('routes semantic Pro2 factory APIs without publishing raw message names', async () => {
|
|
78
|
+
const call = jest.fn().mockResolvedValue({ success: true, payload: {} });
|
|
79
|
+
const api = {
|
|
80
|
+
...createCoreApi(call as CoreApi['call']),
|
|
81
|
+
...createFactoryApi(call as CoreApi['call']),
|
|
82
|
+
} as TestApi;
|
|
83
|
+
const manufactureTime = {
|
|
84
|
+
year: 2026,
|
|
85
|
+
month: 8,
|
|
86
|
+
day: 1,
|
|
87
|
+
hour: 10,
|
|
88
|
+
minute: 20,
|
|
89
|
+
second: 30,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
await api.deviceProvisionFactoryInfo('pro2', {
|
|
93
|
+
version: 1,
|
|
94
|
+
serial_number: 'P2A00000001',
|
|
95
|
+
burn_in_completed: true,
|
|
96
|
+
factory_test_completed: true,
|
|
97
|
+
manufacture_time: manufactureTime,
|
|
98
|
+
connectProtocol: 'V2',
|
|
99
|
+
});
|
|
100
|
+
await api.deviceReadFactoryInfo('pro2', { connectProtocol: 'V2' });
|
|
101
|
+
await api.deviceWriteFactoryCertificate('pro2', {
|
|
102
|
+
certificate: 'aabb',
|
|
103
|
+
connectProtocol: 'V2',
|
|
104
|
+
});
|
|
105
|
+
await api.deviceReadFactoryCertificate('pro2', { connectProtocol: 'V2' });
|
|
106
|
+
await api.deviceSignFactoryChallenge('pro2', {
|
|
107
|
+
digest: '22'.repeat(32),
|
|
108
|
+
connectProtocol: 'V2',
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
expect(call).toHaveBeenNthCalledWith(1, {
|
|
112
|
+
method: 'deviceProvisionFactoryInfo',
|
|
113
|
+
connectId: 'pro2',
|
|
114
|
+
version: 1,
|
|
115
|
+
serial_number: 'P2A00000001',
|
|
116
|
+
burn_in_completed: true,
|
|
117
|
+
factory_test_completed: true,
|
|
118
|
+
manufacture_time: manufactureTime,
|
|
119
|
+
connectProtocol: 'V2',
|
|
120
|
+
});
|
|
121
|
+
expect(call).toHaveBeenNthCalledWith(2, {
|
|
122
|
+
method: 'deviceReadFactoryInfo',
|
|
123
|
+
connectId: 'pro2',
|
|
124
|
+
connectProtocol: 'V2',
|
|
125
|
+
});
|
|
126
|
+
expect(call).toHaveBeenNthCalledWith(3, {
|
|
127
|
+
method: 'deviceWriteFactoryCertificate',
|
|
128
|
+
connectId: 'pro2',
|
|
129
|
+
certificate: 'aabb',
|
|
130
|
+
connectProtocol: 'V2',
|
|
131
|
+
});
|
|
132
|
+
expect(call).toHaveBeenNthCalledWith(4, {
|
|
133
|
+
method: 'deviceReadFactoryCertificate',
|
|
134
|
+
connectId: 'pro2',
|
|
135
|
+
connectProtocol: 'V2',
|
|
136
|
+
});
|
|
137
|
+
expect(call).toHaveBeenNthCalledWith(5, {
|
|
138
|
+
method: 'deviceSignFactoryChallenge',
|
|
139
|
+
connectId: 'pro2',
|
|
140
|
+
digest: '22'.repeat(32),
|
|
141
|
+
connectProtocol: 'V2',
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test('requires explicit destructive authorization for Pro2 factory writes', () => {
|
|
146
|
+
expect(Object.keys(factoryApiMethodExtension.methods)).toEqual(FACTORY_API_METHOD_NAMES);
|
|
147
|
+
const message = {
|
|
148
|
+
id: 1,
|
|
149
|
+
payload: { method: 'deviceProvisionFactoryInfo' },
|
|
150
|
+
} as any;
|
|
151
|
+
|
|
152
|
+
expect(() => findMethod(message)).toThrow('Method deviceProvisionFactoryInfo is not set');
|
|
153
|
+
expect(() => findMethod(message, { extensions: [factoryApiMethodExtension] })).toThrow(
|
|
154
|
+
'requires allowDestructiveOperations'
|
|
155
|
+
);
|
|
156
|
+
expect(
|
|
157
|
+
findMethod(message, {
|
|
158
|
+
extensions: [factoryApiMethodExtension],
|
|
159
|
+
allowDestructiveOperations: true,
|
|
160
|
+
}).name
|
|
161
|
+
).toBe('deviceProvisionFactoryInfo');
|
|
162
|
+
});
|
|
163
|
+
|
|
68
164
|
test('routes the diagnostic Protocol V2 Ping without publishing the raw ping command', async () => {
|
|
69
165
|
const call = jest.fn().mockResolvedValue({ success: true, payload: { message: 'benchmark' } });
|
|
70
166
|
const api = createCoreApi(call as CoreApi['call']) as CoreApi;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import * as publicMethods from '../src/api';
|
|
2
|
+
import * as methods from '../src/api/testMethods';
|
|
3
|
+
import DeviceWipe from '../src/api/device/DeviceWipe';
|
|
4
|
+
import { TEST_API_METHOD_NAMES } from '../src/api/extensionMethodNames';
|
|
5
|
+
import { testApiMethodExtension } from '../src/api/methodExtension';
|
|
6
|
+
import { findMethod } from '../src/api/utils';
|
|
7
|
+
import { createCoreApi, createTestApi } from '../src/inject';
|
|
8
|
+
|
|
9
|
+
import type { BaseMethod } from '../src/api/BaseMethod';
|
|
10
|
+
import type { CoreApi } from '../src/types/api';
|
|
11
|
+
|
|
12
|
+
jest.mock('../src/data/config', () => ({
|
|
13
|
+
getSDKVersion: jest.fn(() => '1.0.0'),
|
|
14
|
+
DEFAULT_DOMAIN: 'https://jssdk.onekey.so/1.0.0/',
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
const testApiNames = [
|
|
18
|
+
'btcGetOwnershipId',
|
|
19
|
+
'btcGetOwnershipProof',
|
|
20
|
+
'btcAuthorizeCoinJoin',
|
|
21
|
+
'cryptoBatchGetPublickeys',
|
|
22
|
+
'cryptoCipherKeyValue',
|
|
23
|
+
'cryptoCosiCommit',
|
|
24
|
+
'cryptoCosiSign',
|
|
25
|
+
'cryptoGetECDHSessionKey',
|
|
26
|
+
'cryptoSignIdentity',
|
|
27
|
+
'evmGetAddressTrezor',
|
|
28
|
+
'evmGetPublicKeyTrezor',
|
|
29
|
+
'evmSignMessageTrezor',
|
|
30
|
+
'evmSignTransactionTrezor',
|
|
31
|
+
'evmSignTypedDataTrezor',
|
|
32
|
+
'evmVerifyMessageTrezor',
|
|
33
|
+
'nemDecryptMessage',
|
|
34
|
+
'deviceSpiFlashWrite',
|
|
35
|
+
'deviceSpiFlashRead',
|
|
36
|
+
'deviceInfoSettings',
|
|
37
|
+
'deviceGetInfo',
|
|
38
|
+
'deviceReadSEPublicCert',
|
|
39
|
+
'deviceWriteSEPrivateKey',
|
|
40
|
+
'deviceWriteSEPublicCert',
|
|
41
|
+
'deviceSESignMessage',
|
|
42
|
+
'devicePing',
|
|
43
|
+
'deviceGetEntropy',
|
|
44
|
+
'deviceGetFirmwareHash',
|
|
45
|
+
'deviceUnlockPath',
|
|
46
|
+
'deviceSdProtect',
|
|
47
|
+
'deviceChangeWipeCode',
|
|
48
|
+
'deviceEndSession',
|
|
49
|
+
'deviceLoad',
|
|
50
|
+
'deviceDoPreauthorized',
|
|
51
|
+
'deviceCancelAuthorization',
|
|
52
|
+
'emmcDirList',
|
|
53
|
+
'emmcDirMake',
|
|
54
|
+
'emmcDirRemove',
|
|
55
|
+
'emmcFileDelete',
|
|
56
|
+
'emmcFileRead',
|
|
57
|
+
'emmcFileWrite',
|
|
58
|
+
'emmcFixPermission',
|
|
59
|
+
'emmcPathInfo',
|
|
60
|
+
'debugLinkDecision',
|
|
61
|
+
'debugLinkEraseSdCard',
|
|
62
|
+
'debugLinkFlashErase',
|
|
63
|
+
'debugLinkGetState',
|
|
64
|
+
'debugLinkMemoryRead',
|
|
65
|
+
'debugLinkMemoryWrite',
|
|
66
|
+
'debugLinkRecordScreen',
|
|
67
|
+
'debugLinkReseedRandom',
|
|
68
|
+
'debugLinkStop',
|
|
69
|
+
'debugLinkWatchLayout',
|
|
70
|
+
'firmwareErase',
|
|
71
|
+
'firmwareEraseEx',
|
|
72
|
+
'firmwareUpdateEmmcTest',
|
|
73
|
+
'firmwareUploadTest',
|
|
74
|
+
'reboot',
|
|
75
|
+
'selfTest',
|
|
76
|
+
'tezosGetAddress',
|
|
77
|
+
'tezosGetPublicKey',
|
|
78
|
+
'tezosSignTx',
|
|
79
|
+
'moneroGetAddress',
|
|
80
|
+
'moneroGetWatchKey',
|
|
81
|
+
'eosGetPublicKey',
|
|
82
|
+
'eosSignTx',
|
|
83
|
+
'binanceGetAddress',
|
|
84
|
+
'binanceGetPublicKey',
|
|
85
|
+
'binanceSignTx',
|
|
86
|
+
'webAuthnAddResidentCredential',
|
|
87
|
+
'webAuthnListResidentCredentials',
|
|
88
|
+
'webAuthnRemoveResidentCredential',
|
|
89
|
+
'getPublicKeyMultiple',
|
|
90
|
+
'listResDir',
|
|
91
|
+
'nftWriteData',
|
|
92
|
+
'nftWriteInfo',
|
|
93
|
+
'readSEPublicKey',
|
|
94
|
+
'resourceUpdate',
|
|
95
|
+
'bixinBackupDevice',
|
|
96
|
+
'bixinLoadDevice',
|
|
97
|
+
'bixinMessageSE',
|
|
98
|
+
'bixinVerifyDeviceRequest',
|
|
99
|
+
] as const;
|
|
100
|
+
|
|
101
|
+
describe('public test API boundary', () => {
|
|
102
|
+
test('keeps every test API behind the explicit extension', () => {
|
|
103
|
+
expect(testApiNames).toEqual(TEST_API_METHOD_NAMES);
|
|
104
|
+
expect(Object.keys(testApiMethodExtension.methods).sort()).toEqual(
|
|
105
|
+
[...TEST_API_METHOD_NAMES].sort()
|
|
106
|
+
);
|
|
107
|
+
const call = jest.fn() as CoreApi['call'];
|
|
108
|
+
const publicApi = createCoreApi(call) as Record<string, unknown>;
|
|
109
|
+
const api = createTestApi(call) as Record<string, unknown>;
|
|
110
|
+
|
|
111
|
+
testApiNames.forEach(name => {
|
|
112
|
+
expect(typeof methods[name]).toBe('function');
|
|
113
|
+
expect(typeof api[name]).toBe('function');
|
|
114
|
+
expect(publicMethods).not.toHaveProperty(name);
|
|
115
|
+
expect(publicApi).not.toHaveProperty(name);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
test('keeps imported test methods on Protocol V1', () => {
|
|
120
|
+
testApiNames.forEach(name => {
|
|
121
|
+
const Method = methods[name] as new (message: {
|
|
122
|
+
id?: number;
|
|
123
|
+
payload: unknown;
|
|
124
|
+
}) => BaseMethod;
|
|
125
|
+
const instance = new Method({ id: 1, payload: { method: name } });
|
|
126
|
+
|
|
127
|
+
expect(instance.getSupportedProtocols()).toEqual(['V1']);
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
test('preserves the current shared wipe behavior for Protocol V1 and V2', () => {
|
|
132
|
+
const wipe = new DeviceWipe({ id: 1, payload: { method: 'deviceWipe' } });
|
|
133
|
+
|
|
134
|
+
expect(wipe.getSupportedProtocols()).toEqual(['V1', 'V2']);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
test('routes representative calls through the current public call boundary', async () => {
|
|
138
|
+
const call = jest.fn().mockResolvedValue({ success: true });
|
|
139
|
+
const api = createTestApi(call as CoreApi['call']);
|
|
140
|
+
|
|
141
|
+
await api.devicePing('usb:1', { message: 'ping' });
|
|
142
|
+
await api.evmGetAddressTrezor('usb:1', 'device:1', {
|
|
143
|
+
path: "m/44'/60'/0'/0/0",
|
|
144
|
+
showOnOneKey: false,
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
expect(call).toHaveBeenNthCalledWith(1, {
|
|
148
|
+
connectId: 'usb:1',
|
|
149
|
+
message: 'ping',
|
|
150
|
+
method: 'devicePing',
|
|
151
|
+
});
|
|
152
|
+
expect(call).toHaveBeenNthCalledWith(2, {
|
|
153
|
+
connectId: 'usb:1',
|
|
154
|
+
deviceId: 'device:1',
|
|
155
|
+
method: 'evmGetAddressTrezor',
|
|
156
|
+
path: "m/44'/60'/0'/0/0",
|
|
157
|
+
showOnOneKey: false,
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
test('resolves test methods only for the configured Core instance', () => {
|
|
162
|
+
const message = { id: 1, payload: { method: 'devicePing' } } as any;
|
|
163
|
+
|
|
164
|
+
expect(() => findMethod(message)).toThrow('Method devicePing is not set');
|
|
165
|
+
expect(findMethod(message, { extensions: [testApiMethodExtension] }).name).toBe('devicePing');
|
|
166
|
+
});
|
|
167
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseMethod } from './BaseMethod';
|
|
2
|
+
import type { BixinBackupDevice } from '@onekeyfe/hd-transport';
|
|
3
|
+
export default class DeviceBackup extends BaseMethod<BixinBackupDevice> {
|
|
4
|
+
init(): void;
|
|
5
|
+
run(): Promise<import("@onekeyfe/hd-transport").Success>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=BixinBackupDevice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BixinBackupDevice.d.ts","sourceRoot":"","sources":["../../src/api/BixinBackupDevice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,UAAU,CAAC,iBAAiB,CAAC;IACrE,IAAI;IAIE,GAAG;CAKV"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseMethod } from './BaseMethod';
|
|
2
|
+
import type { BixinLoadDevice as HardwareBixinLoadDevice } from '@onekeyfe/hd-transport';
|
|
3
|
+
export default class BixinLoadDevice extends BaseMethod<HardwareBixinLoadDevice> {
|
|
4
|
+
init(): void;
|
|
5
|
+
run(): Promise<import("@onekeyfe/hd-transport").Success>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=BixinLoadDevice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BixinLoadDevice.d.ts","sourceRoot":"","sources":["../../src/api/BixinLoadDevice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEzF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU,CAAC,uBAAuB,CAAC;IAC9E,IAAI;IAWE,GAAG;CAKV"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseMethod } from './BaseMethod';
|
|
2
|
+
import type { BixinMessageSE as HardwareBixinMessageSE } from '@onekeyfe/hd-transport';
|
|
3
|
+
export default class BixinMessageSE extends BaseMethod<HardwareBixinMessageSE> {
|
|
4
|
+
hasBundle: boolean;
|
|
5
|
+
init(): void;
|
|
6
|
+
run(): Promise<import("../device/DeviceCommands").TypedResponseMessage<"BixinOutMessageSE">>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=BixinMessageSE.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BixinMessageSE.d.ts","sourceRoot":"","sources":["../../src/api/BixinMessageSE.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEvF,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,sBAAsB,CAAC;IAC5E,SAAS,UAAS;IAElB,IAAI;IASE,GAAG;CAKV"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseMethod } from './BaseMethod';
|
|
2
|
+
import type { BixinVerifyDeviceRequest as HardwareBixinVerifyDeviceRequest } from '@onekeyfe/hd-transport';
|
|
3
|
+
export default class BixinVerifyDeviceRequest extends BaseMethod<HardwareBixinVerifyDeviceRequest> {
|
|
4
|
+
hasBundle: boolean;
|
|
5
|
+
init(): void;
|
|
6
|
+
run(): Promise<import("../device/DeviceCommands").TypedResponseMessage<"BixinVerifyDeviceAck">>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=BixinVerifyDeviceRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BixinVerifyDeviceRequest.d.ts","sourceRoot":"","sources":["../../src/api/BixinVerifyDeviceRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,wBAAwB,IAAI,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAE3G,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,UAAU,CAAC,gCAAgC,CAAC;IAChG,SAAS,UAAS;IAElB,IAAI;IASE,GAAG;CAKV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirmwareUpdateV4.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV4.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAkB/E,OAAO,KAAK,EAAE,sBAAsB,EAA0B,MAAM,6BAA6B,CAAC;AAmUlG,eAAO,MAAM,oCAAoC,WACvC,WAAW,GAAG,UAAU,eACnB,MAAM,GAAG,SAAS,YAKhC,CAAC;AAEF,eAAO,MAAM,iCAAiC,0BACrB,MAAM,uBACR,MAAM,SAa5B,CAAC;AAUF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,wBAAwB,CAAC,sBAAsB,CAAC;IAC5F,OAAO,CAAC,8BAA8B,CAAC,CAAS;IAEhD,qBAAqB;IAIrB,IAAI;IA6DJ,OAAO,CAAC,8BAA8B;IAiBhC,GAAG;;;;;YAKK,aAAa;YAwGb,2BAA2B;IAWzC,OAAO,CAAC,yBAAyB;IAKjC,OAAO,CAAC,kCAAkC;IAO1C,OAAO,CAAC,8BAA8B;YAMxB,iCAAiC;YAOjC,iCAAiC;YAOjC,iCAAiC;IAM/C,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,4BAA4B;IASpC,OAAO,CAAC,2BAA2B;IAsBnC,OAAO,CAAC,yBAAyB;IAiBjC,OAAO,CAAC,wBAAwB;YAkBlB,iCAAiC;YAmCjC,+BAA+B;IAqD7C,OAAO,CAAC,qCAAqC;YAuB/B,8BAA8B;IAyB5C,OAAO,CAAC,wCAAwC;YAgBlC,gCAAgC;YAqChC,0BAA0B;YAe1B,6BAA6B;IAkC3C,OAAO,CAAC,0BAA0B;IAUlC,OAAO,CAAC,yBAAyB;IAU3B,6BAA6B;YA4BrB,+BAA+B;IAkD7C,OAAO,CAAC,6BAA6B;YAkCvB,uBAAuB;IA4GrC,OAAO,CAAC,mCAAmC;YAI7B,0BAA0B;IAaxC,OAAO,CAAC,4BAA4B;IAgEpC,OAAO,CAAC,6BAA6B;YAcvB,uCAAuC;YAoJvC,gCAAgC;YAchC,yBAAyB;YAQzB,8BAA8B;IAQ5C,OAAO,CAAC,0BAA0B;YAiBpB,qCAAqC;YAgDrC,yBAAyB;YA8DzB,8BAA8B;IAU5C,OAAO,CAAC,kCAAkC;YAI5B,6BAA6B;YAwB7B,wBAAwB;IAoDtC,OAAO,CAAC,sCAAsC;YAchC,cAAc;
|
|
1
|
+
{"version":3,"file":"FirmwareUpdateV4.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV4.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAkB/E,OAAO,KAAK,EAAE,sBAAsB,EAA0B,MAAM,6BAA6B,CAAC;AAmUlG,eAAO,MAAM,oCAAoC,WACvC,WAAW,GAAG,UAAU,eACnB,MAAM,GAAG,SAAS,YAKhC,CAAC;AAEF,eAAO,MAAM,iCAAiC,0BACrB,MAAM,uBACR,MAAM,SAa5B,CAAC;AAUF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,wBAAwB,CAAC,sBAAsB,CAAC;IAC5F,OAAO,CAAC,8BAA8B,CAAC,CAAS;IAEhD,qBAAqB;IAIrB,IAAI;IA6DJ,OAAO,CAAC,8BAA8B;IAiBhC,GAAG;;;;;YAKK,aAAa;YAwGb,2BAA2B;IAWzC,OAAO,CAAC,yBAAyB;IAKjC,OAAO,CAAC,kCAAkC;IAO1C,OAAO,CAAC,8BAA8B;YAMxB,iCAAiC;YAOjC,iCAAiC;YAOjC,iCAAiC;IAM/C,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,4BAA4B;IASpC,OAAO,CAAC,2BAA2B;IAsBnC,OAAO,CAAC,yBAAyB;IAiBjC,OAAO,CAAC,wBAAwB;YAkBlB,iCAAiC;YAmCjC,+BAA+B;IAqD7C,OAAO,CAAC,qCAAqC;YAuB/B,8BAA8B;IAyB5C,OAAO,CAAC,wCAAwC;YAgBlC,gCAAgC;YAqChC,0BAA0B;YAe1B,6BAA6B;IAkC3C,OAAO,CAAC,0BAA0B;IAUlC,OAAO,CAAC,yBAAyB;IAU3B,6BAA6B;YA4BrB,+BAA+B;IAkD7C,OAAO,CAAC,6BAA6B;YAkCvB,uBAAuB;IA4GrC,OAAO,CAAC,mCAAmC;YAI7B,0BAA0B;IAaxC,OAAO,CAAC,4BAA4B;IAgEpC,OAAO,CAAC,6BAA6B;YAcvB,uCAAuC;YAoJvC,gCAAgC;YAchC,yBAAyB;YAQzB,8BAA8B;IAQ5C,OAAO,CAAC,0BAA0B;YAiBpB,qCAAqC;YAgDrC,yBAAyB;YA8DzB,8BAA8B;IAU5C,OAAO,CAAC,kCAAkC;YAI5B,6BAA6B;YAwB7B,wBAAwB;IAoDtC,OAAO,CAAC,sCAAsC;YAchC,cAAc;YAoCd,6BAA6B;YAW7B,0BAA0B;YAS1B,6BAA6B;YAmB7B,gBAAgB;IAiB9B,OAAO,CAAC,qBAAqB;CAM9B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseMethod } from './BaseMethod';
|
|
2
|
+
import type { WebAuthnAddResidentCredential as HardwareWebAuthnAddResidentCredential } from '@onekeyfe/hd-transport';
|
|
3
|
+
export default class WebAuthnAddResidentCredential extends BaseMethod<HardwareWebAuthnAddResidentCredential> {
|
|
4
|
+
hasBundle: boolean;
|
|
5
|
+
init(): void;
|
|
6
|
+
run(): Promise<import("../device/DeviceCommands").TypedResponseMessage<"Success">>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=WebAuthnAddResidentCredential.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebAuthnAddResidentCredential.d.ts","sourceRoot":"","sources":["../../src/api/WebAuthnAddResidentCredential.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,6BAA6B,IAAI,qCAAqC,EAAE,MAAM,wBAAwB,CAAC;AAErH,MAAM,CAAC,OAAO,OAAO,6BAA8B,SAAQ,UAAU,CAAC,qCAAqC,CAAC;IAC1G,SAAS,UAAS;IAElB,IAAI;IASE,GAAG;CAKV"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseMethod } from './BaseMethod';
|
|
2
|
+
import type { WebAuthnListResidentCredentials as HardwareWebAuthnListResidentCredentials } from '@onekeyfe/hd-transport';
|
|
3
|
+
export default class WebAuthnListResidentCredentials extends BaseMethod<HardwareWebAuthnListResidentCredentials> {
|
|
4
|
+
hasBundle: boolean;
|
|
5
|
+
init(): void;
|
|
6
|
+
run(): Promise<import("../device/DeviceCommands").TypedResponseMessage<"WebAuthnCredentials">>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=WebAuthnListResidentCredentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebAuthnListResidentCredentials.d.ts","sourceRoot":"","sources":["../../src/api/WebAuthnListResidentCredentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,+BAA+B,IAAI,uCAAuC,EAAE,MAAM,wBAAwB,CAAC;AAEzH,MAAM,CAAC,OAAO,OAAO,+BAAgC,SAAQ,UAAU,CAAC,uCAAuC,CAAC;IAC9G,SAAS,UAAS;IAElB,IAAI;IAOE,GAAG;CASV"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseMethod } from './BaseMethod';
|
|
2
|
+
import type { WebAuthnRemoveResidentCredential as HardwareWebAuthnRemoveResidentCredential } from '@onekeyfe/hd-transport';
|
|
3
|
+
export default class WebAuthnRemoveResidentCredential extends BaseMethod<HardwareWebAuthnRemoveResidentCredential> {
|
|
4
|
+
hasBundle: boolean;
|
|
5
|
+
init(): void;
|
|
6
|
+
run(): Promise<import("../device/DeviceCommands").TypedResponseMessage<"Success">>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=WebAuthnRemoveResidentCredential.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebAuthnRemoveResidentCredential.d.ts","sourceRoot":"","sources":["../../src/api/WebAuthnRemoveResidentCredential.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,gCAAgC,IAAI,wCAAwC,EAAE,MAAM,wBAAwB,CAAC;AAE3H,MAAM,CAAC,OAAO,OAAO,gCAAiC,SAAQ,UAAU,CAAC,wCAAwC,CAAC;IAChH,SAAS,UAAS;IAElB,IAAI;IASE,GAAG;CAKV"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseMethod } from '../BaseMethod';
|
|
2
|
+
import type { BinanceGetAddress as HardwareBinanceGetAddress } from '@onekeyfe/hd-transport';
|
|
3
|
+
export default class BinanceGetAddress extends BaseMethod<HardwareBinanceGetAddress> {
|
|
4
|
+
hasBundle: boolean;
|
|
5
|
+
init(): void;
|
|
6
|
+
run(): Promise<import("../../device/DeviceCommands").TypedResponseMessage<"BinanceAddress">>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=BinanceGetAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BinanceGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/binance/BinanceGetAddress.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAE7F,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU,CAAC,yBAAyB,CAAC;IAClF,SAAS,UAAS;IAElB,IAAI;IAWE,GAAG;CAKV"}
|