@onekeyfe/hd-core 1.1.34-alpha.2 → 1.1.34-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/AllNetworkGetAddressBase.tracing.test.ts +75 -0
- package/__tests__/DeviceCommands.test.ts +217 -0
- package/__tests__/RequestQueue.test.ts +140 -0
- package/__tests__/UploadPortfolio.test.ts +46 -0
- package/__tests__/connectSettings.test.ts +61 -0
- package/__tests__/device-lifecycle-events.test.ts +117 -0
- package/__tests__/device-pool-state.test.ts +132 -0
- package/__tests__/device-settings.test.ts +286 -0
- package/__tests__/device-state-mapper.test.ts +229 -0
- package/__tests__/device-utils.test.ts +106 -0
- package/__tests__/device-wallet-session-store.test.ts +191 -0
- package/__tests__/evmLedgerLegacySafety.test.ts +15 -4
- package/__tests__/evmSignTransaction.test.ts +1 -1
- package/__tests__/evmSignTypedData.test.ts +1 -1
- package/__tests__/filesystemValidation.test.ts +53 -0
- package/__tests__/firmware-update/firmware-artifact-source.test.ts +119 -0
- package/__tests__/firmware-update/firmware-checkpoint.test.ts +105 -0
- package/__tests__/firmware-update/firmware-host-binding.test.ts +73 -0
- package/__tests__/firmware-update/firmware-update-capabilities.test.ts +17 -0
- package/__tests__/firmware-update/firmware-update-plan.test.ts +358 -0
- package/__tests__/firmware-update/firmware-update-prepared-plan.test.ts +200 -0
- package/__tests__/firmware-update/firmware-update-recovery.test.ts +81 -0
- package/__tests__/firmware-update/firmware-update-v2-download-before-boot.test.ts +48 -31
- package/__tests__/firmware-update/firmware-upload-source.test.ts +70 -0
- package/__tests__/get-device-state.test.ts +403 -0
- package/__tests__/logBlockEvent.test.ts +61 -0
- package/__tests__/logger.test.ts +34 -0
- package/__tests__/open-wallet-session.test.ts +565 -0
- package/__tests__/preInitialize.test.ts +33 -0
- package/__tests__/pro2Wallpaper.test.ts +39 -0
- package/__tests__/protocol-v2-bootloader-mode.test.ts +37 -0
- package/__tests__/protocol-v2-firmware-targets.test.ts +19 -0
- package/__tests__/protocol-v2.test.ts +6008 -0
- package/__tests__/protocolV2FileWrite.test.ts +67 -0
- package/__tests__/public-pro2-api-boundary.test.ts +66 -0
- package/__tests__/search-devices.test.ts +136 -0
- package/dist/api/BaseMethod.d.ts +12 -0
- package/dist/api/BaseMethod.d.ts.map +1 -1
- package/dist/api/CheckAllFirmwareRelease.d.ts.map +1 -1
- package/dist/api/CheckBootloaderRelease.d.ts.map +1 -1
- package/dist/api/CheckFirmwareRelease.d.ts.map +1 -1
- package/dist/api/ClearSessionCache.d.ts +9 -0
- package/dist/api/ClearSessionCache.d.ts.map +1 -0
- package/dist/api/DirList.d.ts +10 -0
- package/dist/api/DirList.d.ts.map +1 -0
- package/dist/api/DirMake.d.ts +9 -0
- package/dist/api/DirMake.d.ts.map +1 -0
- package/dist/api/DirRemove.d.ts +9 -0
- package/dist/api/DirRemove.d.ts.map +1 -0
- package/dist/api/FileDelete.d.ts +9 -0
- package/dist/api/FileDelete.d.ts.map +1 -0
- package/dist/api/FileRead.d.ts +19 -0
- package/dist/api/FileRead.d.ts.map +1 -0
- package/dist/api/FileWrite.d.ts +25 -0
- package/dist/api/FileWrite.d.ts.map +1 -0
- package/dist/api/FirmwareUpdate.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV2.d.ts +14 -3
- package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV3.d.ts +10 -3
- package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV4.d.ts +75 -0
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -0
- package/dist/api/GetDeviceState.d.ts +7 -0
- package/dist/api/GetDeviceState.d.ts.map +1 -0
- package/dist/api/GetFeatures.d.ts +1 -1
- package/dist/api/GetFeatures.d.ts.map +1 -1
- package/dist/api/GetOnekeyFeatures.d.ts.map +1 -1
- package/dist/api/GetPassphraseState.d.ts.map +1 -1
- package/dist/api/OpenWalletSession.d.ts +14 -0
- package/dist/api/OpenWalletSession.d.ts.map +1 -0
- package/dist/api/PathInfo.d.ts +10 -0
- package/dist/api/PathInfo.d.ts.map +1 -0
- package/dist/api/PromptWebDeviceAccess.d.ts.map +1 -1
- package/dist/api/SearchDevices.d.ts +5 -1
- package/dist/api/SearchDevices.d.ts.map +1 -1
- package/dist/api/UploadPortfolio.d.ts +18 -0
- package/dist/api/UploadPortfolio.d.ts.map +1 -0
- package/dist/api/alephium/AlephiumGetAddress.d.ts +2 -6
- package/dist/api/alephium/AlephiumGetAddress.d.ts.map +1 -1
- package/dist/api/alephium/AlephiumSignMessage.d.ts +2 -5
- package/dist/api/alephium/AlephiumSignMessage.d.ts.map +1 -1
- package/dist/api/alephium/AlephiumSignTransaction.d.ts +5 -8
- package/dist/api/alephium/AlephiumSignTransaction.d.ts.map +1 -1
- package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
- package/dist/api/aptos/AptosGetAddress.d.ts.map +1 -1
- package/dist/api/benfen/BenfenGetAddress.d.ts +2 -9
- package/dist/api/benfen/BenfenGetAddress.d.ts.map +1 -1
- package/dist/api/benfen/BenfenGetPublicKey.d.ts +2 -9
- package/dist/api/benfen/BenfenGetPublicKey.d.ts.map +1 -1
- package/dist/api/benfen/BenfenSignMessage.d.ts +2 -8
- package/dist/api/benfen/BenfenSignMessage.d.ts.map +1 -1
- package/dist/api/benfen/BenfenSignTransaction.d.ts +2 -8
- package/dist/api/benfen/BenfenSignTransaction.d.ts.map +1 -1
- package/dist/api/btc/BTCGetAddress.d.ts +1 -11
- package/dist/api/btc/BTCGetAddress.d.ts.map +1 -1
- package/dist/api/btc/BTCGetPublicKey.d.ts +1 -11
- package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
- package/dist/api/btc/BTCSignMessage.d.ts +1 -15
- package/dist/api/btc/BTCSignMessage.d.ts.map +1 -1
- package/dist/api/btc/BTCSignPsbt.d.ts.map +1 -1
- package/dist/api/btc/BTCSignTransaction.d.ts +1 -11
- package/dist/api/btc/BTCSignTransaction.d.ts.map +1 -1
- package/dist/api/btc/BTCVerifyMessage.d.ts +1 -11
- package/dist/api/btc/BTCVerifyMessage.d.ts.map +1 -1
- package/dist/api/btc/helpers/versionLimit.d.ts +2 -11
- package/dist/api/btc/helpers/versionLimit.d.ts.map +1 -1
- package/dist/api/cardano/CardanoSignTransaction.d.ts.map +1 -1
- package/dist/api/conflux/ConfluxSignTransaction.d.ts.map +1 -1
- package/dist/api/device/DeviceCancel.d.ts.map +1 -1
- package/dist/api/device/DeviceChangePin.d.ts.map +1 -1
- package/dist/api/device/DeviceFullyUploadResource.d.ts +1 -2
- package/dist/api/device/DeviceFullyUploadResource.d.ts.map +1 -1
- package/dist/api/device/DeviceLock.d.ts.map +1 -1
- package/dist/api/device/DeviceRebootToBoardloader.d.ts +1 -1
- package/dist/api/device/DeviceRebootToBoardloader.d.ts.map +1 -1
- package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -1
- package/dist/api/device/DeviceSettings.d.ts.map +1 -1
- package/dist/api/device/DeviceSupportFeatures.d.ts.map +1 -1
- package/dist/api/device/DeviceUnlock.d.ts +1 -1
- package/dist/api/device/DeviceUnlock.d.ts.map +1 -1
- package/dist/api/device/DeviceUpdateBootloader.d.ts +7 -1
- package/dist/api/device/DeviceUpdateBootloader.d.ts.map +1 -1
- package/dist/api/device/DeviceUploadResource.d.ts.map +1 -1
- package/dist/api/device/DeviceVerify.d.ts.map +1 -1
- package/dist/api/device/DeviceWipe.d.ts.map +1 -1
- package/dist/api/dynex/DnxGetAddress.d.ts.map +1 -1
- package/dist/api/dynex/DnxSignTransaction.d.ts.map +1 -1
- package/dist/api/evm/EVMGetPublicKey.d.ts.map +1 -1
- package/dist/api/evm/EVMSignMessageEIP712.d.ts +2 -8
- package/dist/api/evm/EVMSignMessageEIP712.d.ts.map +1 -1
- package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
- package/dist/api/evm/latest/signTypedData.d.ts +1 -1
- package/dist/api/evm/latest/signTypedData.d.ts.map +1 -1
- package/dist/api/evm/latest/signTypedHash.d.ts.map +1 -1
- package/dist/api/evm/legacyV1/getAddress.d.ts.map +1 -1
- package/dist/api/evm/legacyV1/getPublicKey.d.ts.map +1 -1
- package/dist/api/evm/legacyV1/signMessage.d.ts.map +1 -1
- package/dist/api/evm/legacyV1/signTypedData.d.ts +1 -1
- package/dist/api/evm/legacyV1/signTypedData.d.ts.map +1 -1
- package/dist/api/evm/legacyV1/signTypedHash.d.ts.map +1 -1
- package/dist/api/evm/legacyV1/verifyMessage.d.ts.map +1 -1
- package/dist/api/firmware/FirmwareArtifactSource.d.ts +26 -0
- package/dist/api/firmware/FirmwareArtifactSource.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareCheckpoint.d.ts +15 -0
- package/dist/api/firmware/FirmwareCheckpoint.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareHostBinding.d.ts +6 -0
- package/dist/api/firmware/FirmwareHostBinding.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +10 -1
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
- package/dist/api/firmware/FirmwareUpdateCapabilities.d.ts +3 -0
- package/dist/api/firmware/FirmwareUpdateCapabilities.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareUpdatePlan.d.ts +29 -0
- package/dist/api/firmware/FirmwareUpdatePlan.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareUpdatePreparedPlan.d.ts +25 -0
- package/dist/api/firmware/FirmwareUpdatePreparedPlan.d.ts.map +1 -0
- package/dist/api/firmware/bootloaderHelper.d.ts.map +1 -1
- package/dist/api/firmware/getBinary.d.ts +11 -0
- package/dist/api/firmware/getBinary.d.ts.map +1 -1
- package/dist/api/firmware/progressThrottle.d.ts +3 -0
- package/dist/api/firmware/progressThrottle.d.ts.map +1 -0
- package/dist/api/firmware/updateBootloader.d.ts +2 -0
- package/dist/api/firmware/updateBootloader.d.ts.map +1 -1
- package/dist/api/firmware/uploadFirmware.d.ts +9 -1
- package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
- package/dist/api/helpers/batchGetPublickeys.d.ts +3 -0
- package/dist/api/helpers/batchGetPublickeys.d.ts.map +1 -1
- package/dist/api/helpers/filesystemValidation.d.ts +10 -0
- package/dist/api/helpers/filesystemValidation.d.ts.map +1 -0
- package/dist/api/helpers/protocolV2FileWrite.d.ts +33 -0
- package/dist/api/helpers/protocolV2FileWrite.d.ts.map +1 -0
- package/dist/api/index.d.ts +29 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/kaspa/KaspaSignTransaction.d.ts.map +1 -1
- package/dist/api/lightning/LnurlAuth.d.ts +4 -0
- package/dist/api/lightning/LnurlAuth.d.ts.map +1 -1
- package/dist/api/neo/NeoGetAddress.d.ts +2 -8
- package/dist/api/neo/NeoGetAddress.d.ts.map +1 -1
- package/dist/api/neo/NeoSignTransaction.d.ts +2 -8
- package/dist/api/neo/NeoSignTransaction.d.ts.map +1 -1
- package/dist/api/nervos/NervosGetAddress.d.ts +2 -9
- package/dist/api/nervos/NervosGetAddress.d.ts.map +1 -1
- package/dist/api/nervos/NervosSignTransaction.d.ts +9 -12
- package/dist/api/nervos/NervosSignTransaction.d.ts.map +1 -1
- package/dist/api/nexa/NexaGetAddress.d.ts +2 -8
- package/dist/api/nexa/NexaGetAddress.d.ts.map +1 -1
- package/dist/api/nexa/NexaSignTransaction.d.ts +2 -9
- package/dist/api/nexa/NexaSignTransaction.d.ts.map +1 -1
- package/dist/api/polkadot/PolkadotGetAddress.d.ts +3 -0
- package/dist/api/polkadot/PolkadotGetAddress.d.ts.map +1 -1
- package/dist/api/polkadot/networks.d.ts +3 -0
- package/dist/api/polkadot/networks.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts +6 -0
- package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts +7 -0
- package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts +7 -0
- package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts +7 -0
- package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts +6 -0
- package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceInfoGet.d.ts +28 -0
- package/dist/api/protocol-v2/DeviceInfoGet.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceReboot.d.ts +7 -0
- package/dist/api/protocol-v2/DeviceReboot.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceSessionOpen.d.ts +28 -0
- package/dist/api/protocol-v2/DeviceSessionOpen.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceSettingsGet.d.ts +6 -0
- package/dist/api/protocol-v2/DeviceSettingsGet.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceSettingsPageShow.d.ts +16 -0
- package/dist/api/protocol-v2/DeviceSettingsPageShow.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceSettingsSet.d.ts +12 -0
- package/dist/api/protocol-v2/DeviceSettingsSet.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceStatusGet.d.ts +6 -0
- package/dist/api/protocol-v2/DeviceStatusGet.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts +26 -0
- package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts.map +1 -0
- package/dist/api/protocol-v2/FilesystemFormat.d.ts +6 -0
- package/dist/api/protocol-v2/FilesystemFormat.d.ts.map +1 -0
- package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts +6 -0
- package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts.map +1 -0
- package/dist/api/protocol-v2/Ping.d.ts +8 -0
- package/dist/api/protocol-v2/Ping.d.ts.map +1 -0
- package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts +6 -0
- package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts.map +1 -0
- package/dist/api/protocol-v2/helpers.d.ts +42 -0
- package/dist/api/protocol-v2/helpers.d.ts.map +1 -0
- package/dist/api/scdo/ScdoGetAddress.d.ts +2 -6
- package/dist/api/scdo/ScdoGetAddress.d.ts.map +1 -1
- package/dist/api/scdo/ScdoSignMessage.d.ts +2 -5
- package/dist/api/scdo/ScdoSignMessage.d.ts.map +1 -1
- package/dist/api/scdo/ScdoSignTransaction.d.ts +2 -5
- package/dist/api/scdo/ScdoSignTransaction.d.ts.map +1 -1
- package/dist/api/solana/SolGetAddress.d.ts +1 -0
- package/dist/api/solana/SolGetAddress.d.ts.map +1 -1
- package/dist/api/solana/SolSignMessage.d.ts +3 -0
- package/dist/api/solana/SolSignMessage.d.ts.map +1 -1
- package/dist/api/solana/SolSignOffchainMessage.d.ts +3 -0
- package/dist/api/solana/SolSignOffchainMessage.d.ts.map +1 -1
- package/dist/api/solana/SolSignTransaction.d.ts +6 -0
- package/dist/api/solana/SolSignTransaction.d.ts.map +1 -1
- package/dist/api/stellar/StellarGetAddress.d.ts +2 -1
- package/dist/api/stellar/StellarGetAddress.d.ts.map +1 -1
- package/dist/api/stellar/StellarSignTransaction.d.ts +3 -2
- package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -1
- package/dist/api/sui/SuiGetAddress.d.ts +3 -0
- package/dist/api/sui/SuiGetAddress.d.ts.map +1 -1
- package/dist/api/sui/SuiGetPublicKey.d.ts +3 -0
- package/dist/api/sui/SuiGetPublicKey.d.ts.map +1 -1
- package/dist/api/sui/SuiSignMessage.d.ts +3 -0
- package/dist/api/sui/SuiSignMessage.d.ts.map +1 -1
- package/dist/api/sui/SuiSignTransaction.d.ts +5 -2
- package/dist/api/sui/SuiSignTransaction.d.ts.map +1 -1
- package/dist/api/ton/TonGetAddress.d.ts +3 -0
- package/dist/api/ton/TonGetAddress.d.ts.map +1 -1
- package/dist/api/ton/TonSignData.d.ts +1 -0
- package/dist/api/ton/TonSignData.d.ts.map +1 -1
- package/dist/api/ton/TonSignMessage.d.ts +3 -0
- package/dist/api/ton/TonSignMessage.d.ts.map +1 -1
- package/dist/api/ton/TonSignProof.d.ts +3 -0
- package/dist/api/ton/TonSignProof.d.ts.map +1 -1
- package/dist/api/tron/TronSignMessage.d.ts +3 -0
- package/dist/api/tron/TronSignMessage.d.ts.map +1 -1
- package/dist/api/tron/TronSignTransaction.d.ts +3 -0
- package/dist/api/tron/TronSignTransaction.d.ts.map +1 -1
- package/dist/api/utils.d.ts +2 -1
- package/dist/api/utils.d.ts.map +1 -1
- package/dist/constants/index.d.ts +2 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/core/RequestQueue.d.ts +19 -1
- package/dist/core/RequestQueue.d.ts.map +1 -1
- package/dist/core/deviceEventRegistration.d.ts +11 -0
- package/dist/core/deviceEventRegistration.d.ts.map +1 -0
- package/dist/core/index.d.ts +4 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/data-manager/DataManager.d.ts +9 -5
- package/dist/data-manager/DataManager.d.ts.map +1 -1
- package/dist/data-manager/MessagesConfig.d.ts +2 -2
- package/dist/data-manager/MessagesConfig.d.ts.map +1 -1
- package/dist/data-manager/TransportManager.d.ts +5 -4
- package/dist/data-manager/TransportManager.d.ts.map +1 -1
- package/dist/data-manager/connectSettings.d.ts.map +1 -1
- package/dist/device/Device.d.ts +60 -16
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DeviceCommands.d.ts +16 -14
- 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/DeviceFeaturesState.d.ts +4 -0
- package/dist/device/DeviceFeaturesState.d.ts.map +1 -0
- package/dist/device/DevicePool.d.ts +4 -2
- package/dist/device/DevicePool.d.ts.map +1 -1
- package/dist/device/DeviceStateMapper.d.ts +13 -0
- package/dist/device/DeviceStateMapper.d.ts.map +1 -0
- package/dist/device/DeviceStateProjector.d.ts +7 -0
- package/dist/device/DeviceStateProjector.d.ts.map +1 -0
- package/dist/device/DeviceStateStore.d.ts +21 -0
- package/dist/device/DeviceStateStore.d.ts.map +1 -0
- package/dist/device/DeviceWalletSessionStore.d.ts +15 -0
- package/dist/device/DeviceWalletSessionStore.d.ts.map +1 -0
- package/dist/device/cloneDeviceState.d.ts +2 -0
- package/dist/device/cloneDeviceState.d.ts.map +1 -0
- package/dist/device/deviceIdentity.d.ts +5 -0
- package/dist/device/deviceIdentity.d.ts.map +1 -0
- package/dist/deviceProfile/buildDeviceFeatures.d.ts +12 -0
- package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -0
- package/dist/deviceProfile/index.d.ts +2 -0
- package/dist/deviceProfile/index.d.ts.map +1 -0
- package/dist/events/call.d.ts +7 -0
- package/dist/events/call.d.ts.map +1 -1
- package/dist/events/core.d.ts +2 -2
- package/dist/events/core.d.ts.map +1 -1
- package/dist/events/device.d.ts +11 -2
- package/dist/events/device.d.ts.map +1 -1
- package/dist/events/iframe.d.ts +1 -0
- package/dist/events/iframe.d.ts.map +1 -1
- package/dist/events/logBlockEvent.d.ts +1 -0
- package/dist/events/logBlockEvent.d.ts.map +1 -1
- package/dist/events/ui-request.d.ts +26 -2
- package/dist/events/ui-request.d.ts.map +1 -1
- package/dist/index.d.ts +1797 -451
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26905 -5611
- package/dist/inject.d.ts +3 -2
- package/dist/inject.d.ts.map +1 -1
- package/dist/lowLevelInject.d.ts +2 -1
- package/dist/lowLevelInject.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/deviceSession.d.ts +7 -0
- package/dist/protocols/protocol-v2/deviceSession.d.ts.map +1 -0
- package/dist/protocols/protocol-v2/features.d.ts +88 -0
- package/dist/protocols/protocol-v2/features.d.ts.map +1 -0
- package/dist/protocols/protocol-v2/firmware.d.ts +15 -0
- package/dist/protocols/protocol-v2/firmware.d.ts.map +1 -0
- package/dist/protocols/protocol-v2/index.d.ts +5 -0
- package/dist/protocols/protocol-v2/index.d.ts.map +1 -0
- package/dist/protocols/protocol-v2/lockedError.d.ts +2 -0
- package/dist/protocols/protocol-v2/lockedError.d.ts.map +1 -0
- package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts +16 -0
- package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts.map +1 -0
- package/dist/protocols/protocol-v2/uiInteraction.d.ts +39 -0
- package/dist/protocols/protocol-v2/uiInteraction.d.ts.map +1 -0
- package/dist/protocols/protocol-v2/unlockRetry.d.ts +11 -0
- package/dist/protocols/protocol-v2/unlockRetry.d.ts.map +1 -0
- package/dist/protocols/protocol-v2/walletSession.d.ts +21 -0
- package/dist/protocols/protocol-v2/walletSession.d.ts.map +1 -0
- package/dist/topLevelInject.d.ts.map +1 -1
- package/dist/types/api/checkAllFirmwareRelease.d.ts +4 -2
- package/dist/types/api/checkAllFirmwareRelease.d.ts.map +1 -1
- package/dist/types/api/deviceSettings.d.ts +9 -0
- package/dist/types/api/deviceSettings.d.ts.map +1 -1
- package/dist/types/api/deviceUnlock.d.ts +1 -1
- package/dist/types/api/deviceUnlock.d.ts.map +1 -1
- package/dist/types/api/deviceUpdateBootloader.d.ts +6 -1
- package/dist/types/api/deviceUpdateBootloader.d.ts.map +1 -1
- package/dist/types/api/export.d.ts +4 -1
- package/dist/types/api/export.d.ts.map +1 -1
- package/dist/types/api/firmwareUpdate.d.ts +114 -1
- package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
- package/dist/types/api/firmwareUpdateCapabilities.d.ts +13 -0
- package/dist/types/api/firmwareUpdateCapabilities.d.ts.map +1 -0
- package/dist/types/api/firmwareUpdatePlan.d.ts +35 -0
- package/dist/types/api/firmwareUpdatePlan.d.ts.map +1 -0
- package/dist/types/api/firmwareUpdatePreparedPlan.d.ts +43 -0
- package/dist/types/api/firmwareUpdatePreparedPlan.d.ts.map +1 -0
- package/dist/types/api/getDeviceState.d.ts +12 -0
- package/dist/types/api/getDeviceState.d.ts.map +1 -0
- package/dist/types/api/getFeatures.d.ts.map +1 -1
- package/dist/types/api/getOnekeyFeatures.d.ts.map +1 -1
- package/dist/types/api/getPassphraseState.d.ts +2 -1
- package/dist/types/api/getPassphraseState.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +48 -2
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/openWalletSession.d.ts +35 -0
- package/dist/types/api/openWalletSession.d.ts.map +1 -0
- package/dist/types/api/protocolV2.d.ts +113 -0
- package/dist/types/api/protocolV2.d.ts.map +1 -0
- package/dist/types/api/searchDevices.d.ts +2 -2
- package/dist/types/api/searchDevices.d.ts.map +1 -1
- package/dist/types/api/sessionCache.d.ts +10 -0
- package/dist/types/api/sessionCache.d.ts.map +1 -0
- package/dist/types/device.d.ts +207 -5
- package/dist/types/device.d.ts.map +1 -1
- package/dist/types/params.d.ts +3 -0
- package/dist/types/params.d.ts.map +1 -1
- package/dist/types/settings.d.ts +33 -0
- package/dist/types/settings.d.ts.map +1 -1
- package/dist/utils/capabilitieUtils.d.ts.map +1 -1
- package/dist/utils/deviceFeaturesCompat.d.ts +13 -0
- package/dist/utils/deviceFeaturesCompat.d.ts.map +1 -0
- package/dist/utils/deviceFeaturesUtils.d.ts +17 -9
- package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
- package/dist/utils/deviceInfoUtils.d.ts +10 -8
- package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
- package/dist/utils/deviceSettings.d.ts +2 -0
- package/dist/utils/deviceSettings.d.ts.map +1 -1
- package/dist/utils/deviceVersionUtils.d.ts +6 -5
- package/dist/utils/deviceVersionUtils.d.ts.map +1 -1
- package/dist/utils/findDefectiveBatchDevice.d.ts +1 -1
- package/dist/utils/homescreen.d.ts.map +1 -1
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/patch.d.ts.map +1 -1
- package/dist/utils/pro2Wallpaper.d.ts +12 -0
- package/dist/utils/pro2Wallpaper.d.ts.map +1 -0
- package/dist/utils/tracing.d.ts.map +1 -1
- package/dist/utils/versionUtils.d.ts +1 -1
- package/package.json +4 -4
- package/src/api/BaseMethod.ts +60 -23
- package/src/api/CheckAllFirmwareRelease.ts +16 -3
- package/src/api/CheckBootloaderRelease.ts +1 -2
- package/src/api/CheckFirmwareRelease.ts +1 -2
- package/src/api/ClearSessionCache.ts +28 -0
- package/src/api/DirList.ts +33 -0
- package/src/api/DirMake.ts +23 -0
- package/src/api/DirRemove.ts +23 -0
- package/src/api/FileDelete.ts +23 -0
- package/src/api/FileRead.ts +183 -0
- package/src/api/FileWrite.ts +71 -0
- package/src/api/FirmwareUpdate.ts +15 -7
- package/src/api/FirmwareUpdateV2.ts +354 -148
- package/src/api/FirmwareUpdateV3.ts +376 -62
- package/src/api/FirmwareUpdateV4.ts +2279 -0
- package/src/api/GetDeviceState.ts +55 -0
- package/src/api/GetFeatures.ts +12 -4
- package/src/api/GetOnekeyFeatures.ts +15 -3
- package/src/api/GetPassphraseState.ts +9 -10
- package/src/api/OpenWalletSession.ts +211 -0
- package/src/api/PathInfo.ts +41 -0
- package/src/api/PromptWebDeviceAccess.ts +10 -1
- package/src/api/SearchDevices.ts +33 -3
- package/src/api/UploadPortfolio.ts +50 -0
- package/src/api/alephium/AlephiumGetAddress.ts +6 -2
- package/src/api/alephium/AlephiumSignMessage.ts +6 -1
- package/src/api/alephium/AlephiumSignTransaction.ts +15 -4
- package/src/api/allnetwork/AllNetworkGetAddressBase.ts +25 -21
- package/src/api/aptos/AptosGetAddress.ts +2 -3
- package/src/api/benfen/BenfenGetAddress.ts +11 -7
- package/src/api/benfen/BenfenGetPublicKey.ts +6 -2
- package/src/api/benfen/BenfenSignMessage.ts +6 -1
- package/src/api/benfen/BenfenSignTransaction.ts +6 -1
- package/src/api/btc/BTCGetPublicKey.ts +3 -2
- package/src/api/btc/BTCSignPsbt.ts +1 -2
- package/src/api/btc/helpers/versionLimit.ts +7 -1
- package/src/api/cardano/CardanoSignTransaction.ts +2 -4
- package/src/api/conflux/ConfluxSignTransaction.ts +5 -2
- package/src/api/device/DeviceCancel.ts +1 -0
- package/src/api/device/DeviceChangePin.ts +24 -0
- package/src/api/device/DeviceFullyUploadResource.ts +6 -7
- package/src/api/device/DeviceLock.ts +2 -3
- package/src/api/device/DeviceRebootToBoardloader.ts +11 -1
- package/src/api/device/DeviceRebootToBootloader.ts +11 -1
- package/src/api/device/DeviceSettings.ts +121 -0
- package/src/api/device/DeviceSupportFeatures.ts +2 -13
- package/src/api/device/DeviceUnlock.ts +9 -0
- package/src/api/device/DeviceUpdateBootloader.ts +175 -11
- package/src/api/device/DeviceUploadResource.ts +4 -5
- package/src/api/device/DeviceVerify.ts +1 -2
- package/src/api/device/DeviceWipe.ts +19 -0
- package/src/api/dynex/DnxGetAddress.ts +6 -0
- package/src/api/dynex/DnxSignTransaction.ts +6 -0
- package/src/api/evm/EVMGetAddress.ts +1 -1
- package/src/api/evm/EVMGetPublicKey.ts +3 -4
- package/src/api/evm/EVMSignMessage.ts +1 -1
- package/src/api/evm/EVMSignMessageEIP712.ts +14 -1
- package/src/api/evm/EVMSignTransaction.ts +1 -1
- package/src/api/evm/EVMSignTypedData.ts +30 -18
- package/src/api/evm/EVMVerifyMessage.ts +1 -1
- package/src/api/evm/latest/signTypedHash.ts +2 -4
- package/src/api/evm/legacyV1/getAddress.ts +5 -3
- package/src/api/evm/legacyV1/getPublicKey.ts +5 -3
- package/src/api/evm/legacyV1/signMessage.ts +5 -3
- package/src/api/evm/legacyV1/signTypedData.ts +9 -8
- package/src/api/evm/legacyV1/signTypedHash.ts +7 -7
- package/src/api/evm/legacyV1/verifyMessage.ts +5 -3
- package/src/api/firmware/FirmwareArtifactSource.ts +278 -0
- package/src/api/firmware/FirmwareCheckpoint.ts +188 -0
- package/src/api/firmware/FirmwareHostBinding.ts +108 -0
- package/src/api/firmware/FirmwareUpdateBaseMethod.ts +83 -15
- package/src/api/firmware/FirmwareUpdateCapabilities.ts +13 -0
- package/src/api/firmware/FirmwareUpdatePlan.ts +729 -0
- package/src/api/firmware/FirmwareUpdatePreparedPlan.ts +403 -0
- package/src/api/firmware/bootloaderHelper.ts +3 -2
- package/src/api/firmware/getBinary.ts +1 -1
- package/src/api/firmware/progressThrottle.ts +44 -0
- package/src/api/firmware/releaseHelper.ts +3 -3
- package/src/api/firmware/updateBootloader.ts +19 -4
- package/src/api/firmware/uploadFirmware.ts +148 -34
- package/src/api/helpers/batchGetPublickeys.ts +51 -6
- package/src/api/helpers/filesystemValidation.ts +112 -0
- package/src/api/helpers/protocolV2FileWrite.ts +193 -0
- package/src/api/index.ts +32 -0
- package/src/api/kaspa/KaspaSignTransaction.ts +2 -3
- package/src/api/lightning/LnurlAuth.ts +4 -0
- package/src/api/neo/NeoGetAddress.ts +6 -1
- package/src/api/neo/NeoSignTransaction.ts +6 -1
- package/src/api/nervos/NervosGetAddress.ts +6 -2
- package/src/api/nervos/NervosSignTransaction.ts +14 -4
- package/src/api/nexa/NexaGetAddress.ts +6 -2
- package/src/api/nexa/NexaSignTransaction.ts +11 -12
- package/src/api/polkadot/networks.ts +9 -0
- package/src/api/protocol-v2/DeviceFactoryInfoGet.ts +20 -0
- package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +32 -0
- package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +61 -0
- package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +55 -0
- package/src/api/protocol-v2/DeviceGetOnboardingStatus.ts +18 -0
- package/src/api/protocol-v2/DeviceInfoGet.ts +145 -0
- package/src/api/protocol-v2/DeviceReboot.ts +26 -0
- package/src/api/protocol-v2/DeviceSessionOpen.ts +102 -0
- package/src/api/protocol-v2/DeviceSettingsGet.ts +18 -0
- package/src/api/protocol-v2/DeviceSettingsPageShow.ts +70 -0
- package/src/api/protocol-v2/DeviceSettingsSet.ts +44 -0
- package/src/api/protocol-v2/DeviceStatusGet.ts +16 -0
- package/src/api/protocol-v2/DeviceUploadWallpaper.ts +131 -0
- package/src/api/protocol-v2/FilesystemFormat.ts +19 -0
- package/src/api/protocol-v2/FilesystemPermissionFix.ts +16 -0
- package/src/api/protocol-v2/Ping.ts +18 -0
- package/src/api/protocol-v2/ProtocolInfoRequest.ts +16 -0
- package/src/api/protocol-v2/helpers.ts +203 -0
- package/src/api/scdo/ScdoGetAddress.ts +6 -2
- package/src/api/scdo/ScdoSignMessage.ts +6 -1
- package/src/api/scdo/ScdoSignTransaction.ts +6 -2
- package/src/api/solana/SolGetAddress.ts +4 -0
- package/src/api/solana/SolSignMessage.ts +3 -0
- package/src/api/solana/SolSignOffchainMessage.ts +3 -0
- package/src/api/solana/SolSignTransaction.ts +6 -0
- package/src/api/stellar/StellarGetAddress.ts +10 -1
- package/src/api/stellar/StellarSignTransaction.ts +14 -1
- package/src/api/sui/SuiGetAddress.ts +5 -3
- package/src/api/sui/SuiGetPublicKey.ts +3 -0
- package/src/api/sui/SuiSignMessage.ts +3 -0
- package/src/api/sui/SuiSignTransaction.ts +14 -12
- package/src/api/ton/TonGetAddress.ts +3 -0
- package/src/api/ton/TonSignData.ts +6 -3
- package/src/api/ton/TonSignMessage.ts +6 -5
- package/src/api/ton/TonSignProof.ts +3 -0
- package/src/api/tron/TronSignMessage.ts +4 -1
- package/src/api/tron/TronSignTransaction.ts +3 -0
- package/src/api/utils.ts +7 -3
- package/src/api/xrp/XrpSignTransaction.ts +1 -1
- package/src/constants/index.ts +7 -1
- package/src/core/RequestQueue.ts +124 -4
- package/src/core/deviceEventRegistration.ts +23 -0
- package/src/core/index.ts +253 -125
- package/src/data/messages/messages-protocol-v2.json +13544 -0
- package/src/data-manager/DataManager.ts +61 -49
- package/src/data-manager/MessagesConfig.ts +14 -14
- package/src/data-manager/TransportManager.ts +38 -12
- package/src/data-manager/connectSettings.ts +15 -0
- package/src/device/Device.ts +759 -164
- package/src/device/DeviceCommands.ts +245 -36
- package/src/device/DeviceConnector.ts +29 -4
- package/src/device/DeviceFeaturesState.ts +34 -0
- package/src/device/DevicePool.ts +69 -21
- package/src/device/DeviceStateMapper.ts +348 -0
- package/src/device/DeviceStateProjector.ts +95 -0
- package/src/device/DeviceStateStore.ts +201 -0
- package/src/device/DeviceWalletSessionStore.ts +78 -0
- package/src/device/cloneDeviceState.ts +39 -0
- package/src/device/deviceIdentity.ts +18 -0
- package/src/deviceProfile/buildDeviceFeatures.ts +391 -0
- package/src/deviceProfile/index.ts +4 -0
- package/src/events/call.ts +6 -0
- package/src/events/core.ts +2 -0
- package/src/events/device.ts +17 -1
- package/src/events/iframe.ts +1 -0
- package/src/events/logBlockEvent.ts +30 -0
- package/src/events/ui-request.ts +32 -2
- package/src/index.ts +9 -0
- package/src/inject.ts +75 -3
- package/src/lowLevelInject.ts +8 -1
- package/src/protocols/protocol-v2/deviceSession.ts +24 -0
- package/src/protocols/protocol-v2/features.ts +163 -0
- package/src/protocols/protocol-v2/firmware.ts +21 -0
- package/src/protocols/protocol-v2/index.ts +18 -0
- package/src/protocols/protocol-v2/lockedError.ts +10 -0
- package/src/protocols/protocol-v2/settingsUnlockPolicy.ts +61 -0
- package/src/protocols/protocol-v2/uiInteraction.ts +210 -0
- package/src/protocols/protocol-v2/unlockRetry.ts +76 -0
- package/src/protocols/protocol-v2/walletSession.ts +202 -0
- package/src/topLevelInject.ts +7 -1
- package/src/types/api/checkAllFirmwareRelease.ts +4 -2
- package/src/types/api/deviceSettings.ts +9 -0
- package/src/types/api/deviceUnlock.ts +1 -1
- package/src/types/api/deviceUpdateBootloader.ts +10 -1
- package/src/types/api/export.ts +25 -0
- package/src/types/api/firmwareUpdate.ts +163 -1
- package/src/types/api/firmwareUpdateCapabilities.ts +13 -0
- package/src/types/api/firmwareUpdatePlan.ts +52 -0
- package/src/types/api/firmwareUpdatePreparedPlan.ts +55 -0
- package/src/types/api/getDeviceState.ts +19 -0
- package/src/types/api/getFeatures.ts +3 -0
- package/src/types/api/getOnekeyFeatures.ts +3 -0
- package/src/types/api/getPassphraseState.ts +10 -2
- package/src/types/api/index.ts +89 -2
- package/src/types/api/openWalletSession.ts +54 -0
- package/src/types/api/protocolV2.ts +244 -0
- package/src/types/api/searchDevices.ts +2 -2
- package/src/types/api/sessionCache.ts +14 -0
- package/src/types/device.ts +266 -5
- package/src/types/params.ts +11 -0
- package/src/types/settings.ts +54 -29
- package/src/utils/capabilitieUtils.ts +1 -2
- package/src/utils/deviceFeaturesCompat.ts +173 -0
- package/src/utils/deviceFeaturesUtils.ts +122 -84
- package/src/utils/deviceInfoUtils.ts +38 -87
- package/src/utils/deviceSettings.ts +48 -0
- package/src/utils/deviceVersionUtils.ts +25 -62
- package/src/utils/findDefectiveBatchDevice.ts +8 -8
- package/src/utils/homescreen.ts +10 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/pro2Wallpaper.ts +109 -0
- package/src/utils/tracing.ts +3 -1
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import type { CommonParams, Response } from '../params';
|
|
2
|
+
import type {
|
|
3
|
+
DevOnboardingStatus,
|
|
4
|
+
DeviceFactoryInfo,
|
|
5
|
+
DeviceFirmwareUpdateStatus,
|
|
6
|
+
DeviceSettings,
|
|
7
|
+
DeviceStatus,
|
|
8
|
+
ProtocolInfo,
|
|
9
|
+
ProtocolV2DeviceInfo,
|
|
10
|
+
Success,
|
|
11
|
+
} from '@onekeyfe/hd-transport';
|
|
12
|
+
import type {
|
|
13
|
+
DeviceFactoryInfoSetParams,
|
|
14
|
+
DeviceFirmwareUpdateParams,
|
|
15
|
+
DeviceFirmwareUpdateStatusGetParams,
|
|
16
|
+
DeviceRebootParams,
|
|
17
|
+
} from '../../api/protocol-v2/helpers';
|
|
18
|
+
import type { DeviceSessionOpenParams } from '../../api/protocol-v2/DeviceSessionOpen';
|
|
19
|
+
import type { DeviceInfoGetParams } from '../../api/protocol-v2/DeviceInfoGet';
|
|
20
|
+
import type { DeviceSettingsSetParams } from '../../api/protocol-v2/DeviceSettingsSet';
|
|
21
|
+
import type { DeviceSettingsPageShowParams } from '../../api/protocol-v2/DeviceSettingsPageShow';
|
|
22
|
+
import type {
|
|
23
|
+
DeviceUploadWallpaperParams,
|
|
24
|
+
DeviceUploadWallpaperResponse,
|
|
25
|
+
} from '../../api/protocol-v2/DeviceUploadWallpaper';
|
|
26
|
+
|
|
27
|
+
// Re-export implementation parameter types as the single source of truth.
|
|
28
|
+
export type {
|
|
29
|
+
DeviceFirmwareTargetInput,
|
|
30
|
+
DeviceFirmwareUpdateParams,
|
|
31
|
+
DeviceFirmwareUpdateStatusGetParams,
|
|
32
|
+
DeviceRebootParams,
|
|
33
|
+
DeviceFactoryInfoSetParams,
|
|
34
|
+
RebootTypeInput,
|
|
35
|
+
} from '../../api/protocol-v2/helpers';
|
|
36
|
+
export type { DeviceSessionOpenParams } from '../../api/protocol-v2/DeviceSessionOpen';
|
|
37
|
+
export type {
|
|
38
|
+
DeviceInfoGetParams,
|
|
39
|
+
DeviceInfoGetTargets,
|
|
40
|
+
DeviceInfoGetTypes,
|
|
41
|
+
} from '../../api/protocol-v2/DeviceInfoGet';
|
|
42
|
+
export type { DeviceSettingsSetParams } from '../../api/protocol-v2/DeviceSettingsSet';
|
|
43
|
+
export type {
|
|
44
|
+
DeviceSettingsPageShowParams,
|
|
45
|
+
SupportedDeviceSettingsPage,
|
|
46
|
+
} from '../../api/protocol-v2/DeviceSettingsPageShow';
|
|
47
|
+
export type {
|
|
48
|
+
DeviceUploadWallpaperParams,
|
|
49
|
+
DeviceUploadWallpaperResponse,
|
|
50
|
+
} from '../../api/protocol-v2/DeviceUploadWallpaper';
|
|
51
|
+
|
|
52
|
+
// ── Shared response shapes (Protocol V2 file system) ────────────────────
|
|
53
|
+
|
|
54
|
+
export type FileOpSuccess = { message?: string };
|
|
55
|
+
|
|
56
|
+
export type FileInfo = {
|
|
57
|
+
path: string;
|
|
58
|
+
offset: number;
|
|
59
|
+
total_size: number;
|
|
60
|
+
data?: Uint8Array;
|
|
61
|
+
data_hash?: number;
|
|
62
|
+
processed_byte?: number;
|
|
63
|
+
chunks?: number;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type DirInfo = {
|
|
67
|
+
path: string;
|
|
68
|
+
child_dirs?: string;
|
|
69
|
+
child_files?: string;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// All FilesystemPathInfo proto fields are required; keep this type aligned.
|
|
73
|
+
export type PathInfoResult = {
|
|
74
|
+
exist: boolean;
|
|
75
|
+
size: number;
|
|
76
|
+
year: number;
|
|
77
|
+
month: number;
|
|
78
|
+
day: number;
|
|
79
|
+
hour: number;
|
|
80
|
+
minute: number;
|
|
81
|
+
second: number;
|
|
82
|
+
readonly: boolean;
|
|
83
|
+
hidden: boolean;
|
|
84
|
+
system: boolean;
|
|
85
|
+
archive: boolean;
|
|
86
|
+
directory: boolean;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export type DeviceSessionOpenResponse = {
|
|
90
|
+
session_id: string;
|
|
91
|
+
btc_test_address: string;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// ── Method signatures ─────────────────────────────────────────────────────
|
|
95
|
+
|
|
96
|
+
/** @deprecated Development-only raw Protocol V2 command. Use `getDeviceState`. */
|
|
97
|
+
export declare function deviceInfoGet(
|
|
98
|
+
connectId: string,
|
|
99
|
+
params?: CommonParams & DeviceInfoGetParams
|
|
100
|
+
): Response<ProtocolV2DeviceInfo>;
|
|
101
|
+
|
|
102
|
+
/** @deprecated Development-only raw Protocol V2 command. Use `getDeviceState`. */
|
|
103
|
+
export declare function deviceStatusGet(
|
|
104
|
+
connectId: string,
|
|
105
|
+
params?: CommonParams
|
|
106
|
+
): Response<DeviceStatus>;
|
|
107
|
+
|
|
108
|
+
/** @deprecated Development-only raw Protocol V2 command. Use `getDeviceState`. */
|
|
109
|
+
export declare function deviceSettingsGet(
|
|
110
|
+
connectId: string,
|
|
111
|
+
params?: CommonParams
|
|
112
|
+
): Response<DeviceSettings>;
|
|
113
|
+
|
|
114
|
+
/** @deprecated Development-only raw Protocol V2 command. */
|
|
115
|
+
export declare function protocolInfoRequest(
|
|
116
|
+
connectId: string,
|
|
117
|
+
params?: CommonParams
|
|
118
|
+
): Response<ProtocolInfo>;
|
|
119
|
+
|
|
120
|
+
export declare function ping(
|
|
121
|
+
connectId: string,
|
|
122
|
+
params?: CommonParams & { message?: string }
|
|
123
|
+
): Response<Success>;
|
|
124
|
+
|
|
125
|
+
export declare function deviceReboot(
|
|
126
|
+
connectId: string,
|
|
127
|
+
params: CommonParams & DeviceRebootParams
|
|
128
|
+
): Response<Success>;
|
|
129
|
+
|
|
130
|
+
export declare function deviceGetOnboardingStatus(
|
|
131
|
+
connectId: string,
|
|
132
|
+
params?: CommonParams
|
|
133
|
+
): Response<DevOnboardingStatus>;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @deprecated Use `openWalletSession` instead of the raw Protocol V2 command.
|
|
137
|
+
*/
|
|
138
|
+
export declare function deviceSessionOpen(
|
|
139
|
+
connectId: string,
|
|
140
|
+
params: CommonParams & DeviceSessionOpenParams
|
|
141
|
+
): Response<DeviceSessionOpenResponse>;
|
|
142
|
+
|
|
143
|
+
export declare function deviceFirmwareUpdate(
|
|
144
|
+
connectId: string,
|
|
145
|
+
params: CommonParams & DeviceFirmwareUpdateParams
|
|
146
|
+
): Response<Success | DeviceFirmwareUpdateStatus>;
|
|
147
|
+
|
|
148
|
+
export declare function deviceGetFirmwareUpdateStatus(
|
|
149
|
+
connectId: string,
|
|
150
|
+
params?: CommonParams & DeviceFirmwareUpdateStatusGetParams
|
|
151
|
+
): Response<DeviceFirmwareUpdateStatus>;
|
|
152
|
+
|
|
153
|
+
export declare function deviceFactoryInfoSet(
|
|
154
|
+
connectId: string,
|
|
155
|
+
params: CommonParams & DeviceFactoryInfoSetParams
|
|
156
|
+
): Response<Success>;
|
|
157
|
+
|
|
158
|
+
export declare function deviceFactoryInfoGet(
|
|
159
|
+
connectId: string,
|
|
160
|
+
params?: CommonParams
|
|
161
|
+
): Response<DeviceFactoryInfo>;
|
|
162
|
+
|
|
163
|
+
export declare function deviceSettingsSet(
|
|
164
|
+
connectId: string,
|
|
165
|
+
params: CommonParams & DeviceSettingsSetParams
|
|
166
|
+
): Response<Success>;
|
|
167
|
+
|
|
168
|
+
export declare function deviceSettingsPageShow(
|
|
169
|
+
connectId: string,
|
|
170
|
+
params: CommonParams & DeviceSettingsPageShowParams
|
|
171
|
+
): Response<Success>;
|
|
172
|
+
|
|
173
|
+
export declare function deviceUploadWallpaper(
|
|
174
|
+
connectId: string,
|
|
175
|
+
params: CommonParams & DeviceUploadWallpaperParams
|
|
176
|
+
): Response<DeviceUploadWallpaperResponse>;
|
|
177
|
+
|
|
178
|
+
export declare function filesystemPermissionFix(
|
|
179
|
+
connectId: string,
|
|
180
|
+
params?: CommonParams
|
|
181
|
+
): Response<Success>;
|
|
182
|
+
|
|
183
|
+
export declare function fileRead(
|
|
184
|
+
connectId: string,
|
|
185
|
+
params: {
|
|
186
|
+
path: string;
|
|
187
|
+
offset?: number;
|
|
188
|
+
totalSize?: number;
|
|
189
|
+
chunkLen?: number;
|
|
190
|
+
uiPercentage?: number;
|
|
191
|
+
}
|
|
192
|
+
): Response<FileInfo>;
|
|
193
|
+
|
|
194
|
+
export declare function fileWrite(
|
|
195
|
+
connectId: string,
|
|
196
|
+
params: {
|
|
197
|
+
path: string;
|
|
198
|
+
offset?: number;
|
|
199
|
+
totalSize?: number;
|
|
200
|
+
chunkSize?: number;
|
|
201
|
+
chunkLen?: number;
|
|
202
|
+
data: ArrayBuffer | Uint8Array | Blob | string;
|
|
203
|
+
overwrite?: boolean;
|
|
204
|
+
append?: boolean;
|
|
205
|
+
uiPercentage?: number;
|
|
206
|
+
timeoutMs?: number | string;
|
|
207
|
+
}
|
|
208
|
+
): Response<FileInfo>;
|
|
209
|
+
|
|
210
|
+
export declare function fileDelete(
|
|
211
|
+
connectId: string,
|
|
212
|
+
params: { path: string }
|
|
213
|
+
): Response<FileOpSuccess>;
|
|
214
|
+
|
|
215
|
+
export declare function dirList(
|
|
216
|
+
connectId: string,
|
|
217
|
+
params: { path: string; depth?: number }
|
|
218
|
+
): Response<DirInfo>;
|
|
219
|
+
|
|
220
|
+
export declare function dirMake(
|
|
221
|
+
connectId: string,
|
|
222
|
+
params: { path: string }
|
|
223
|
+
): Response<FileOpSuccess>;
|
|
224
|
+
|
|
225
|
+
export declare function dirRemove(
|
|
226
|
+
connectId: string,
|
|
227
|
+
params: { path: string }
|
|
228
|
+
): Response<FileOpSuccess>;
|
|
229
|
+
|
|
230
|
+
export declare function pathInfo(
|
|
231
|
+
connectId: string,
|
|
232
|
+
params: { path: string; timeoutMs?: number | string }
|
|
233
|
+
): Response<PathInfoResult>;
|
|
234
|
+
|
|
235
|
+
export declare function uploadPortfolio(
|
|
236
|
+
connectId: string,
|
|
237
|
+
params: {
|
|
238
|
+
operationId?: string;
|
|
239
|
+
packageBytes: ArrayBuffer | Uint8Array | Blob;
|
|
240
|
+
timeoutMs?: number | string;
|
|
241
|
+
}
|
|
242
|
+
): Response<FileInfo & { portfolioUpdated: true }>;
|
|
243
|
+
|
|
244
|
+
export declare function filesystemFormat(connectId: string): Response<Success>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SearchDevice } from '../device';
|
|
2
|
-
import type { Response } from '../params';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
3
|
|
|
4
|
-
export declare function searchDevices(): Response<SearchDevice[]>;
|
|
4
|
+
export declare function searchDevices(params?: CommonParams): Response<SearchDevice[]>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Response } from '../params';
|
|
2
|
+
|
|
3
|
+
export type ClearSessionCacheParams = {
|
|
4
|
+
deviceId?: string;
|
|
5
|
+
passphraseState?: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type ClearSessionCachePayload = {
|
|
9
|
+
cleared: true;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export declare function clearSessionCache(
|
|
13
|
+
params?: ClearSessionCacheParams
|
|
14
|
+
): Response<ClearSessionCachePayload>;
|
package/src/types/device.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { EDeviceType } from '@onekeyfe/hd-shared';
|
|
1
|
+
import { EDeviceType, type EFirmwareType } from '@onekeyfe/hd-shared';
|
|
2
2
|
|
|
3
3
|
import type { IVersionArray } from './settings';
|
|
4
4
|
import type { PROTO } from '../constants';
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
OneKeyDeviceCommType,
|
|
7
|
+
ProtocolV2DeviceInfo,
|
|
8
|
+
DeviceStatus as ProtocolV2DeviceStatus,
|
|
9
|
+
} from '@onekeyfe/hd-transport';
|
|
6
10
|
|
|
7
11
|
export type DeviceStatus = 'available' | 'occupied' | 'used';
|
|
8
12
|
|
|
@@ -23,6 +27,12 @@ export type UnavailableCapabilities = { [key: string]: UnavailableCapability };
|
|
|
23
27
|
|
|
24
28
|
export type KnownDevice = {
|
|
25
29
|
connectId: string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Stable physical-device identity. Current SDK responses always include this
|
|
32
|
+
* value; it remains optional in the type during the uuid compatibility window.
|
|
33
|
+
*/
|
|
34
|
+
serialNo?: string;
|
|
35
|
+
/** @deprecated Use serialNo instead. */
|
|
26
36
|
uuid: string;
|
|
27
37
|
deviceId: string | null;
|
|
28
38
|
deviceType: IDeviceType | null;
|
|
@@ -33,7 +43,9 @@ export type KnownDevice = {
|
|
|
33
43
|
name: string;
|
|
34
44
|
error?: typeof undefined;
|
|
35
45
|
mode: EOneKeyDeviceMode;
|
|
36
|
-
features
|
|
46
|
+
features?: Features;
|
|
47
|
+
/** Unified SDK device-state snapshot; features remains a legacy projection. */
|
|
48
|
+
state?: DeviceState;
|
|
37
49
|
unavailableCapabilities: UnavailableCapabilities;
|
|
38
50
|
bleFirmwareVersion: IVersionArray | null;
|
|
39
51
|
firmwareVersion: IVersionArray | null;
|
|
@@ -46,6 +58,17 @@ export type KnownDevice = {
|
|
|
46
58
|
|
|
47
59
|
export type SearchDevice = {
|
|
48
60
|
connectId: string | null;
|
|
61
|
+
/**
|
|
62
|
+
* Available after device initialization. BLE discovery does not connect to the
|
|
63
|
+
* device, so it returns null until a later initialized device response. Current
|
|
64
|
+
* SDK responses always include the field; it remains optional in the type during
|
|
65
|
+
* the uuid compatibility window.
|
|
66
|
+
*/
|
|
67
|
+
serialNo?: string | null;
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated Ambiguous legacy identifier. Use serialNo for hardware identity
|
|
70
|
+
* and connectId for transport routing.
|
|
71
|
+
*/
|
|
49
72
|
uuid: string;
|
|
50
73
|
deviceId: string | null;
|
|
51
74
|
deviceType: IDeviceType;
|
|
@@ -85,7 +108,242 @@ export type SearchDevice = {
|
|
|
85
108
|
|
|
86
109
|
export type Device = KnownDevice;
|
|
87
110
|
|
|
88
|
-
export type
|
|
111
|
+
export type DeviceFeaturesProtocol = 'V1' | 'V2' | 'unknown';
|
|
112
|
+
|
|
113
|
+
export type DeviceFeaturesMode =
|
|
114
|
+
| 'normal'
|
|
115
|
+
| 'bootloader'
|
|
116
|
+
| 'romloader'
|
|
117
|
+
| 'notInitialized'
|
|
118
|
+
| 'backupMode'
|
|
119
|
+
| 'unknown';
|
|
120
|
+
|
|
121
|
+
export type DeviceFeaturesVerify = {
|
|
122
|
+
firmwareBuildId?: string;
|
|
123
|
+
firmwareHash?: string;
|
|
124
|
+
bootloaderBuildId?: string;
|
|
125
|
+
bootloaderHash?: string;
|
|
126
|
+
boardBuildId?: string;
|
|
127
|
+
boardHash?: string;
|
|
128
|
+
bleBuildId?: string;
|
|
129
|
+
bleHash?: string;
|
|
130
|
+
se01BuildId?: string;
|
|
131
|
+
se01Hash?: string;
|
|
132
|
+
se02BuildId?: string;
|
|
133
|
+
se02Hash?: string;
|
|
134
|
+
se03BuildId?: string;
|
|
135
|
+
se03Hash?: string;
|
|
136
|
+
se04BuildId?: string;
|
|
137
|
+
se04Hash?: string;
|
|
138
|
+
se01BootBuildId?: string;
|
|
139
|
+
se01BootHash?: string;
|
|
140
|
+
se02BootBuildId?: string;
|
|
141
|
+
se02BootHash?: string;
|
|
142
|
+
se03BootBuildId?: string;
|
|
143
|
+
se03BootHash?: string;
|
|
144
|
+
se04BootBuildId?: string;
|
|
145
|
+
se04BootHash?: string;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export type DeviceFeaturesRaw = {
|
|
149
|
+
protocolV1Features?: PROTO.Features;
|
|
150
|
+
protocolV1OneKeyFeatures?: OnekeyFeatures;
|
|
151
|
+
protocolV2DeviceInfo?: ProtocolV2DeviceInfo;
|
|
152
|
+
protocolV2DeviceStatus?: ProtocolV2DeviceStatus;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export type DeviceFeaturesRawPatch = {
|
|
156
|
+
[Key in keyof DeviceFeaturesRaw]?: DeviceFeaturesRaw[Key] | null;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export type DeviceStateProtocol = DeviceFeaturesProtocol;
|
|
160
|
+
export type DeviceStateMode = DeviceFeaturesMode;
|
|
161
|
+
export type DeviceStateSection = 'identity' | 'status' | 'settings' | 'versions' | 'verification';
|
|
162
|
+
|
|
163
|
+
export type DeviceStateUpdateSource =
|
|
164
|
+
| 'initialize'
|
|
165
|
+
| 'device-info'
|
|
166
|
+
| 'device-status'
|
|
167
|
+
| 'apply-settings'
|
|
168
|
+
| 'change-pin'
|
|
169
|
+
| 'lock'
|
|
170
|
+
| 'unlock'
|
|
171
|
+
| 'passphrase'
|
|
172
|
+
| 'session-clear'
|
|
173
|
+
| 'firmware-update'
|
|
174
|
+
| 'transport-reconnect'
|
|
175
|
+
| 'compatibility';
|
|
176
|
+
|
|
177
|
+
export type DeviceStateIdentity = {
|
|
178
|
+
deviceType: IDeviceType;
|
|
179
|
+
firmwareType: EFirmwareType;
|
|
180
|
+
model: string | null;
|
|
181
|
+
vendor: string | null;
|
|
182
|
+
deviceId: string | null;
|
|
183
|
+
serialNo: string;
|
|
184
|
+
label: string | null;
|
|
185
|
+
bleName: string | null;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export type DeviceStateStatus = {
|
|
189
|
+
mode: DeviceStateMode;
|
|
190
|
+
initialized: boolean | null;
|
|
191
|
+
unlocked: boolean | null;
|
|
192
|
+
firmwarePresent: boolean | null;
|
|
193
|
+
backupRequired: boolean | null;
|
|
194
|
+
noBackup: boolean | null;
|
|
195
|
+
unfinishedBackup: boolean | null;
|
|
196
|
+
recoveryMode: boolean | null;
|
|
197
|
+
passphraseProtection: boolean | null;
|
|
198
|
+
pinProtection: boolean | null;
|
|
199
|
+
attachToPinEnabled: boolean | null;
|
|
200
|
+
unlockedAttachPin: boolean | null;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export type DeviceStateSettings = {
|
|
204
|
+
language: string | null;
|
|
205
|
+
bleEnabled: boolean | null;
|
|
206
|
+
sdCardPresent: boolean | null;
|
|
207
|
+
sdProtection: boolean | null;
|
|
208
|
+
wipeCodeProtection: boolean | null;
|
|
209
|
+
passphraseAlwaysOnDevice: boolean | null;
|
|
210
|
+
safetyChecks: string | null;
|
|
211
|
+
autoLockDelayMs: number | null;
|
|
212
|
+
autoShutdownDelayMs: number | null;
|
|
213
|
+
displayRotation: number | null;
|
|
214
|
+
experimentalFeatures: boolean | null;
|
|
215
|
+
wallpaperPath: string | null;
|
|
216
|
+
brightness: number | null;
|
|
217
|
+
animationEnabled: boolean | null;
|
|
218
|
+
tapToWake: boolean | null;
|
|
219
|
+
hapticFeedback: boolean | null;
|
|
220
|
+
deviceNameDisplayEnabled: boolean | null;
|
|
221
|
+
airgapMode: boolean | null;
|
|
222
|
+
fidoEnabled: boolean | null;
|
|
223
|
+
usbLockEnabled: boolean | null;
|
|
224
|
+
randomKeypad: boolean | null;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export type DeviceStateVersions = {
|
|
228
|
+
firmware: string | null;
|
|
229
|
+
bootloader: string | null;
|
|
230
|
+
board: string | null;
|
|
231
|
+
ble: string | null;
|
|
232
|
+
/** @deprecated Kept for legacy consumers; new code should read se01. */
|
|
233
|
+
se?: string | null;
|
|
234
|
+
se01?: string | null;
|
|
235
|
+
se02?: string | null;
|
|
236
|
+
se03?: string | null;
|
|
237
|
+
se04?: string | null;
|
|
238
|
+
se01Boot?: string | null;
|
|
239
|
+
se02Boot?: string | null;
|
|
240
|
+
se03Boot?: string | null;
|
|
241
|
+
se04Boot?: string | null;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export type DeviceState = {
|
|
245
|
+
schemaVersion: 1;
|
|
246
|
+
revision: number;
|
|
247
|
+
updatedAt: number;
|
|
248
|
+
protocol: DeviceStateProtocol;
|
|
249
|
+
/** Device-message protocol version, independent of the SDK V1/V2 protocol family. */
|
|
250
|
+
protocolVersion: number | null;
|
|
251
|
+
identity: DeviceStateIdentity;
|
|
252
|
+
status: DeviceStateStatus;
|
|
253
|
+
settings: DeviceStateSettings;
|
|
254
|
+
versions: DeviceStateVersions;
|
|
255
|
+
capabilities: Array<number | string>;
|
|
256
|
+
verification?: Partial<DeviceFeaturesVerify>;
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export type DeviceStatePatch = {
|
|
260
|
+
protocol?: DeviceStateProtocol;
|
|
261
|
+
protocolVersion?: number | null;
|
|
262
|
+
identity?: Partial<DeviceStateIdentity>;
|
|
263
|
+
status?: Partial<DeviceStateStatus>;
|
|
264
|
+
settings?: Partial<DeviceStateSettings>;
|
|
265
|
+
versions?: Partial<DeviceStateVersions>;
|
|
266
|
+
capabilities?: Array<number | string>;
|
|
267
|
+
verification?: DeviceFeaturesVerify;
|
|
268
|
+
raw?: DeviceFeaturesRawPatch;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
export type DeviceStateEvent = {
|
|
272
|
+
connectId: string | null;
|
|
273
|
+
state: DeviceState;
|
|
274
|
+
revision: number;
|
|
275
|
+
source: DeviceStateUpdateSource;
|
|
276
|
+
changedKeys: string[];
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export type NormalizedFeatures = {
|
|
280
|
+
protocol: DeviceFeaturesProtocol;
|
|
281
|
+
protocolVersion?: number | null;
|
|
282
|
+
deviceType: IDeviceType;
|
|
283
|
+
firmwareType: EFirmwareType;
|
|
284
|
+
model: string | null;
|
|
285
|
+
vendor: string | null;
|
|
286
|
+
deviceId: string | null;
|
|
287
|
+
serialNo: string;
|
|
288
|
+
label: string | null;
|
|
289
|
+
bleName: string | null;
|
|
290
|
+
capabilities: Array<number | string>;
|
|
291
|
+
mode: DeviceFeaturesMode;
|
|
292
|
+
initialized: boolean | null;
|
|
293
|
+
bootloaderMode: boolean | null;
|
|
294
|
+
unlocked: boolean | null;
|
|
295
|
+
firmwarePresent: boolean | null;
|
|
296
|
+
passphraseProtection: boolean | null;
|
|
297
|
+
pinProtection: boolean | null;
|
|
298
|
+
backupRequired: boolean | null;
|
|
299
|
+
noBackup: boolean | null;
|
|
300
|
+
unfinishedBackup: boolean | null;
|
|
301
|
+
recoveryMode: boolean | null;
|
|
302
|
+
language: string | null;
|
|
303
|
+
bleEnabled: boolean | null;
|
|
304
|
+
sdCardPresent: boolean | null;
|
|
305
|
+
sdProtection: boolean | null;
|
|
306
|
+
wipeCodeProtection: boolean | null;
|
|
307
|
+
passphraseAlwaysOnDevice: boolean | null;
|
|
308
|
+
attachToPinEnabled?: boolean | null;
|
|
309
|
+
safetyChecks: string | null;
|
|
310
|
+
autoLockDelayMs: number | null;
|
|
311
|
+
autoShutdownDelayMs: number | null;
|
|
312
|
+
displayRotation: number | null;
|
|
313
|
+
experimentalFeatures: boolean | null;
|
|
314
|
+
wallpaperPath: string | null;
|
|
315
|
+
brightness: number | null;
|
|
316
|
+
animationEnabled: boolean | null;
|
|
317
|
+
tapToWake: boolean | null;
|
|
318
|
+
hapticFeedback: boolean | null;
|
|
319
|
+
deviceNameDisplayEnabled: boolean | null;
|
|
320
|
+
airgapMode: boolean | null;
|
|
321
|
+
fidoEnabled: boolean | null;
|
|
322
|
+
usbLockEnabled: boolean | null;
|
|
323
|
+
randomKeypad: boolean | null;
|
|
324
|
+
firmwareVersion: string | null;
|
|
325
|
+
bootloaderVersion: string | null;
|
|
326
|
+
boardVersion: string | null;
|
|
327
|
+
bleVersion: string | null;
|
|
328
|
+
se01Version?: string | null;
|
|
329
|
+
se02Version?: string | null;
|
|
330
|
+
se03Version?: string | null;
|
|
331
|
+
se04Version?: string | null;
|
|
332
|
+
se01BootVersion?: string | null;
|
|
333
|
+
se02BootVersion?: string | null;
|
|
334
|
+
se03BootVersion?: string | null;
|
|
335
|
+
se04BootVersion?: string | null;
|
|
336
|
+
seVersion?: string | null;
|
|
337
|
+
verify?: DeviceFeaturesVerify;
|
|
338
|
+
sessionId: string | null;
|
|
339
|
+
passphraseState?: string;
|
|
340
|
+
unlockedAttachPin?: boolean;
|
|
341
|
+
raw?: DeviceFeaturesRaw;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
export type Features = NormalizedFeatures &
|
|
345
|
+
Partial<Omit<PROTO.Features, keyof NormalizedFeatures>> &
|
|
346
|
+
Partial<Omit<PROTO.OnekeyFeatures, keyof NormalizedFeatures | keyof PROTO.Features>>;
|
|
89
347
|
|
|
90
348
|
export type OnekeyFeatures = PROTO.OnekeyFeatures;
|
|
91
349
|
|
|
@@ -96,7 +354,8 @@ export type IDeviceType =
|
|
|
96
354
|
| EDeviceType.ClassicPure
|
|
97
355
|
| EDeviceType.Mini
|
|
98
356
|
| EDeviceType.Touch
|
|
99
|
-
| EDeviceType.Pro
|
|
357
|
+
| EDeviceType.Pro
|
|
358
|
+
| EDeviceType.Pro2;
|
|
100
359
|
|
|
101
360
|
/**
|
|
102
361
|
* model_classic: 'classic' | 'classic1s' | 'classicpure'
|
|
@@ -124,6 +383,7 @@ export const DeviceTypeToModels: { [deviceType in IDeviceType]: IDeviceModel[] }
|
|
|
124
383
|
[EDeviceType.Mini]: ['model_mini'],
|
|
125
384
|
[EDeviceType.Touch]: ['model_touch'],
|
|
126
385
|
[EDeviceType.Pro]: ['model_touch'],
|
|
386
|
+
[EDeviceType.Pro2]: [],
|
|
127
387
|
[EDeviceType.Unknown]: [],
|
|
128
388
|
};
|
|
129
389
|
|
|
@@ -136,6 +396,7 @@ export type ITransportStatus = 'valid' | 'outdated';
|
|
|
136
396
|
export type IVersionRange = {
|
|
137
397
|
min: string;
|
|
138
398
|
max?: string;
|
|
399
|
+
unsupported?: boolean;
|
|
139
400
|
};
|
|
140
401
|
|
|
141
402
|
export type DeviceFirmwareRange = {
|
package/src/types/params.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { HardwareConnectProtocol } from '@onekeyfe/hd-shared';
|
|
2
|
+
|
|
1
3
|
export interface CommonParams {
|
|
2
4
|
keepSession?: boolean;
|
|
3
5
|
/**
|
|
@@ -12,6 +14,10 @@ export interface CommonParams {
|
|
|
12
14
|
* Timeout time for single polling
|
|
13
15
|
*/
|
|
14
16
|
timeout?: number;
|
|
17
|
+
/**
|
|
18
|
+
* DeviceInfoGet timeout during Protocol V2 initialization.
|
|
19
|
+
*/
|
|
20
|
+
protocolV2DeviceInfoTimeoutMs?: number;
|
|
15
21
|
/**
|
|
16
22
|
* passphrase state
|
|
17
23
|
*/
|
|
@@ -52,6 +58,11 @@ export interface CommonParams {
|
|
|
52
58
|
* Use pre-initialized device state (BLE only)
|
|
53
59
|
*/
|
|
54
60
|
usePreInitialize?: boolean;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Expected transport protocol. If omitted, SDK probes Protocol V1 then Protocol V2.
|
|
64
|
+
*/
|
|
65
|
+
connectProtocol?: HardwareConnectProtocol;
|
|
55
66
|
}
|
|
56
67
|
|
|
57
68
|
export type Params<T> = CommonParams & T & { bundle?: undefined };
|