@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
|
@@ -1,14 +1,84 @@
|
|
|
1
1
|
import type { EFirmwareType } from '@onekeyfe/hd-shared';
|
|
2
2
|
import type { PROTO } from '../../constants';
|
|
3
3
|
import type { Params, Response } from '../params';
|
|
4
|
+
import type { FirmwareUpdatePreparedPlan } from './firmwareUpdatePreparedPlan';
|
|
4
5
|
|
|
5
6
|
type IUpdateType = 'firmware' | 'ble';
|
|
6
7
|
|
|
8
|
+
export interface FirmwareArtifactReference {
|
|
9
|
+
artifactRef: string;
|
|
10
|
+
size: number;
|
|
11
|
+
sha256: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface FirmwareArtifactReader {
|
|
15
|
+
open(input: { artifactRef: string }): Promise<{
|
|
16
|
+
readerId: string;
|
|
17
|
+
size: number;
|
|
18
|
+
}>;
|
|
19
|
+
read(input: { readerId: string; offset: number; length: number }): Promise<{
|
|
20
|
+
data: ArrayBuffer;
|
|
21
|
+
bytesRead: number;
|
|
22
|
+
eof: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
close(input: { readerId: string }): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type FirmwareCheckpointStage =
|
|
28
|
+
| 'EPOCH_STARTED'
|
|
29
|
+
| 'EPOCH_COMPLETED'
|
|
30
|
+
| 'BEFORE_DEVICE_MODE_CHANGE'
|
|
31
|
+
| 'FILE_TRANSFER_STARTED'
|
|
32
|
+
| 'FILE_TRANSFER_COMPLETED'
|
|
33
|
+
| 'INSTALL_REQUESTED'
|
|
34
|
+
| 'INSTALL_ACCEPTED'
|
|
35
|
+
| 'FINAL_VERIFIED';
|
|
36
|
+
|
|
37
|
+
export interface FirmwareCheckpoint {
|
|
38
|
+
schemaVersion: 1;
|
|
39
|
+
sequence: number;
|
|
40
|
+
stage: FirmwareCheckpointStage;
|
|
41
|
+
destructiveActionStarted: boolean;
|
|
42
|
+
target?: string;
|
|
43
|
+
epoch?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface FirmwareCheckpointSink {
|
|
47
|
+
commit(checkpoint: FirmwareCheckpoint): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface FirmwareUpdateHostBinding {
|
|
51
|
+
artifactReader: FirmwareArtifactReader;
|
|
52
|
+
checkpointSink: FirmwareCheckpointSink;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface FirmwareCheckpointParams {
|
|
56
|
+
hostBindingGeneration?: number;
|
|
57
|
+
checkpointSink?: FirmwareCheckpointSink;
|
|
58
|
+
checkpointSequenceStart?: number;
|
|
59
|
+
resumeCheckpoint?: FirmwareCheckpoint;
|
|
60
|
+
}
|
|
61
|
+
|
|
7
62
|
export interface FirmwareUpdateBinaryParams {
|
|
8
63
|
binary: ArrayBuffer;
|
|
9
64
|
updateType: IUpdateType;
|
|
10
65
|
}
|
|
11
66
|
|
|
67
|
+
export interface FirmwareUpdateArtifactParams extends FirmwareCheckpointParams {
|
|
68
|
+
preparedPlan: FirmwareUpdatePreparedPlan;
|
|
69
|
+
hostBindingGeneration: number;
|
|
70
|
+
artifact: FirmwareArtifactReference;
|
|
71
|
+
resourceArtifact?: FirmwareArtifactReference;
|
|
72
|
+
resourceEntries?: Array<{
|
|
73
|
+
entryName: string;
|
|
74
|
+
artifact: FirmwareArtifactReference;
|
|
75
|
+
}>;
|
|
76
|
+
updateType: IUpdateType;
|
|
77
|
+
forcedUpdateRes?: boolean;
|
|
78
|
+
isUpdateBootloader?: boolean;
|
|
79
|
+
firmwareType?: EFirmwareType;
|
|
80
|
+
}
|
|
81
|
+
|
|
12
82
|
export interface FirmwareUpdateParams {
|
|
13
83
|
version?: number[];
|
|
14
84
|
updateType: IUpdateType;
|
|
@@ -37,10 +107,16 @@ export declare function firmwareUpdateV2(
|
|
|
37
107
|
connectId: string | undefined,
|
|
38
108
|
params: Params<FirmwareUpdateBinaryParams & Platform>
|
|
39
109
|
): Response<PROTO.Success>;
|
|
110
|
+
export declare function firmwareUpdateV2(
|
|
111
|
+
connectId: string | undefined,
|
|
112
|
+
params: Params<FirmwareUpdateArtifactParams & Platform>
|
|
113
|
+
): Response<PROTO.Success>;
|
|
40
114
|
|
|
41
|
-
export interface FirmwareUpdateV3Params {
|
|
115
|
+
export interface FirmwareUpdateV3Params extends FirmwareCheckpointParams {
|
|
116
|
+
preparedPlan?: FirmwareUpdatePreparedPlan;
|
|
42
117
|
bleVersion?: number[];
|
|
43
118
|
bleBinary?: ArrayBuffer;
|
|
119
|
+
chunkSize?: number;
|
|
44
120
|
|
|
45
121
|
firmwareVersion?: number[];
|
|
46
122
|
firmwareBinary?: ArrayBuffer;
|
|
@@ -54,8 +130,85 @@ export interface FirmwareUpdateV3Params {
|
|
|
54
130
|
firmwareType?: EFirmwareType;
|
|
55
131
|
|
|
56
132
|
platform: IPlatform;
|
|
133
|
+
|
|
134
|
+
artifactReader?: FirmwareArtifactReader;
|
|
135
|
+
artifacts?: {
|
|
136
|
+
ble?: FirmwareArtifactReference;
|
|
137
|
+
firmware?: FirmwareArtifactReference;
|
|
138
|
+
bootloader?: FirmwareArtifactReference;
|
|
139
|
+
resourceEntries?: Array<{
|
|
140
|
+
entryName: string;
|
|
141
|
+
artifact: FirmwareArtifactReference;
|
|
142
|
+
}>;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* firmwareUpdateV4 target binaries grouped by DeviceFirmwareTargetType.
|
|
148
|
+
* Except for romloader, each field maps to a target accepted by bootloader.
|
|
149
|
+
*/
|
|
150
|
+
export type FirmwareUpdateV4Target =
|
|
151
|
+
| 'boot'
|
|
152
|
+
| 'app_v1'
|
|
153
|
+
| 'app_v2'
|
|
154
|
+
| 'coprocessor'
|
|
155
|
+
| 'resource'
|
|
156
|
+
| 'se01'
|
|
157
|
+
| 'se02'
|
|
158
|
+
| 'se03'
|
|
159
|
+
| 'se04';
|
|
160
|
+
|
|
161
|
+
export interface FirmwareUpdateV4Params extends FirmwareCheckpointParams {
|
|
162
|
+
preparedPlan?: FirmwareUpdatePreparedPlan;
|
|
163
|
+
platform: IPlatform;
|
|
164
|
+
expectedDeviceId?: string;
|
|
165
|
+
chunkSize?: number;
|
|
166
|
+
firmwareType?: EFirmwareType;
|
|
167
|
+
targetsToUpdate?: FirmwareUpdateV4Target[];
|
|
168
|
+
expectedTargetVersions?: Partial<Record<FirmwareUpdateV4Target, string>>;
|
|
169
|
+
|
|
170
|
+
/** FW_MGMT_TARGET_ROMLOADER = 2; Pro2 cannot install it through firmwareUpdateV4. */
|
|
171
|
+
romloaderBinary?: ArrayBuffer;
|
|
172
|
+
/** FW_MGMT_TARGET_BOOTLOADER = 3 */
|
|
173
|
+
bootloaderBinary?: ArrayBuffer;
|
|
174
|
+
/** FW_MGMT_TARGET_APPLICATION_P1 = 4 */
|
|
175
|
+
applicationP1Binary?: ArrayBuffer;
|
|
176
|
+
/** FW_MGMT_TARGET_APPLICATION_P2 = 5 */
|
|
177
|
+
applicationP2Binary?: ArrayBuffer;
|
|
178
|
+
/** FW_MGMT_TARGET_COPROCESSOR = 6 */
|
|
179
|
+
coprocessorBinary?: ArrayBuffer;
|
|
180
|
+
/** FW_MGMT_TARGET_SE01-04 = 7-10 */
|
|
181
|
+
se01Binary?: ArrayBuffer;
|
|
182
|
+
se02Binary?: ArrayBuffer;
|
|
183
|
+
se03Binary?: ArrayBuffer;
|
|
184
|
+
se04Binary?: ArrayBuffer;
|
|
185
|
+
forcedUpdateRes?: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* RESC bundle okpkg files written directly to devicePath through FilesystemFileWrite.
|
|
188
|
+
* Manual mode installs them without version comparison.
|
|
189
|
+
*/
|
|
190
|
+
resourceBundleFiles?: Array<{
|
|
191
|
+
binary: ArrayBuffer;
|
|
192
|
+
devicePath: string;
|
|
193
|
+
}>;
|
|
194
|
+
artifactReader?: FirmwareArtifactReader;
|
|
195
|
+
componentArtifacts?: Partial<
|
|
196
|
+
Record<Exclude<FirmwareUpdateV4Target, 'resource'>, FirmwareArtifactReference>
|
|
197
|
+
>;
|
|
198
|
+
resourceBundleArtifacts?: Array<{
|
|
199
|
+
name: string;
|
|
200
|
+
artifact: FirmwareArtifactReference;
|
|
201
|
+
}>;
|
|
57
202
|
}
|
|
58
203
|
|
|
204
|
+
export declare function registerFirmwareUpdateHostBinding(
|
|
205
|
+
binding: FirmwareUpdateHostBinding
|
|
206
|
+
): number;
|
|
207
|
+
|
|
208
|
+
export declare function unregisterFirmwareUpdateHostBinding(generation?: number): boolean;
|
|
209
|
+
|
|
210
|
+
export declare function getFirmwareUpdateHostBindingGeneration(): number;
|
|
211
|
+
|
|
59
212
|
export declare function firmwareUpdateV3(
|
|
60
213
|
connectId: string | undefined,
|
|
61
214
|
params: Params<FirmwareUpdateV3Params>
|
|
@@ -64,3 +217,12 @@ export declare function firmwareUpdateV3(
|
|
|
64
217
|
firmwareVersion: string;
|
|
65
218
|
bootloaderVersion: string;
|
|
66
219
|
}>;
|
|
220
|
+
|
|
221
|
+
export declare function firmwareUpdateV4(
|
|
222
|
+
connectId: string | undefined,
|
|
223
|
+
params: Params<FirmwareUpdateV4Params>
|
|
224
|
+
): Response<{
|
|
225
|
+
bleVersion: string;
|
|
226
|
+
firmwareVersion: string;
|
|
227
|
+
bootloaderVersion: string;
|
|
228
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface FirmwareUpdateCapabilities {
|
|
2
|
+
planSchemaVersion: 1;
|
|
3
|
+
preparedPlanSchemaVersion: 1;
|
|
4
|
+
hostBindingProtocolVersion: 1;
|
|
5
|
+
checkpointSchemaVersion: 1;
|
|
6
|
+
manifestModes: Array<'external-only' | 'sdk-managed'>;
|
|
7
|
+
supportsArtifactReader: true;
|
|
8
|
+
supportsAwaitableCheckpoint: true;
|
|
9
|
+
supportsResume: true;
|
|
10
|
+
supportsReconciliation: true;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export declare function getFirmwareUpdateCapabilities(): FirmwareUpdateCapabilities;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { FirmwareUpdateV4Target } from './firmwareUpdate';
|
|
2
|
+
import type { EFirmwareType } from '@onekeyfe/hd-shared';
|
|
3
|
+
|
|
4
|
+
export type FirmwareUpdatePlanArtifactRole =
|
|
5
|
+
| 'firmware'
|
|
6
|
+
| 'ble'
|
|
7
|
+
| 'bootloader'
|
|
8
|
+
| 'resource'
|
|
9
|
+
| 'component'
|
|
10
|
+
| 'resourceBundle';
|
|
11
|
+
|
|
12
|
+
export type FirmwareUpdatePlanTarget = 'firmware' | 'ble' | 'bootloader' | FirmwareUpdateV4Target;
|
|
13
|
+
|
|
14
|
+
export interface FirmwareUpdatePlanArtifact {
|
|
15
|
+
artifactId: string;
|
|
16
|
+
role: FirmwareUpdatePlanArtifactRole;
|
|
17
|
+
target: FirmwareUpdatePlanTarget;
|
|
18
|
+
url: string;
|
|
19
|
+
container: 'raw' | 'zip';
|
|
20
|
+
logicalName?: string;
|
|
21
|
+
expectedSize?: number;
|
|
22
|
+
expectedSha256?: string;
|
|
23
|
+
targetVersion?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type FirmwareUpdatePlanEpochKind =
|
|
27
|
+
| 'legacy-update'
|
|
28
|
+
| 'resource-sync'
|
|
29
|
+
| 'bootloader-install'
|
|
30
|
+
| 'bootloader-verify'
|
|
31
|
+
| 'component-install'
|
|
32
|
+
| 'final-verify';
|
|
33
|
+
|
|
34
|
+
export interface FirmwareUpdatePlanEpoch {
|
|
35
|
+
epoch: number;
|
|
36
|
+
kind: FirmwareUpdatePlanEpochKind;
|
|
37
|
+
artifactIds: string[];
|
|
38
|
+
targets: FirmwareUpdatePlanTarget[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface FirmwareUpdatePlan {
|
|
42
|
+
schemaVersion: 1;
|
|
43
|
+
planDigest: string;
|
|
44
|
+
executor: 'v2' | 'v3' | 'v4';
|
|
45
|
+
deviceIdentity: string;
|
|
46
|
+
deviceModel: string;
|
|
47
|
+
firmwareType: EFirmwareType;
|
|
48
|
+
platform: 'native' | 'desktop' | 'ext' | 'web' | 'web-embed';
|
|
49
|
+
artifacts: FirmwareUpdatePlanArtifact[];
|
|
50
|
+
epochs: FirmwareUpdatePlanEpoch[];
|
|
51
|
+
targetsToUpdate: FirmwareUpdatePlanTarget[];
|
|
52
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { FirmwareArtifactReference } from './firmwareUpdate';
|
|
2
|
+
import type {
|
|
3
|
+
FirmwareUpdatePlan,
|
|
4
|
+
FirmwareUpdatePlanArtifactRole,
|
|
5
|
+
FirmwareUpdatePlanEpoch,
|
|
6
|
+
FirmwareUpdatePlanTarget,
|
|
7
|
+
} from './firmwareUpdatePlan';
|
|
8
|
+
|
|
9
|
+
export interface FirmwareUpdatePreparedEntry {
|
|
10
|
+
entryName: string;
|
|
11
|
+
artifact: FirmwareArtifactReference;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface FirmwareUpdatePreparedArtifactInput {
|
|
15
|
+
artifactId: string;
|
|
16
|
+
artifact: FirmwareArtifactReference;
|
|
17
|
+
materializedEntries?: FirmwareUpdatePreparedEntry[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface FirmwareUpdatePreparedArtifact {
|
|
21
|
+
artifactId: string;
|
|
22
|
+
role: FirmwareUpdatePlanArtifactRole;
|
|
23
|
+
target: FirmwareUpdatePlanTarget;
|
|
24
|
+
container: 'raw' | 'zip';
|
|
25
|
+
logicalName?: string;
|
|
26
|
+
targetVersion?: string;
|
|
27
|
+
artifact: FirmwareArtifactReference;
|
|
28
|
+
materializedEntries?: FirmwareUpdatePreparedEntry[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface FirmwareUpdatePreparedPlan {
|
|
32
|
+
schemaVersion: 1;
|
|
33
|
+
preparedPlanDigest: string;
|
|
34
|
+
planDigest: string;
|
|
35
|
+
networkPolicy: 'forbid';
|
|
36
|
+
executor: FirmwareUpdatePlan['executor'];
|
|
37
|
+
deviceIdentity: string;
|
|
38
|
+
deviceModel: string;
|
|
39
|
+
firmwareType: FirmwareUpdatePlan['firmwareType'];
|
|
40
|
+
platform: FirmwareUpdatePlan['platform'];
|
|
41
|
+
leaseRef: string;
|
|
42
|
+
artifacts: FirmwareUpdatePreparedArtifact[];
|
|
43
|
+
epochs: FirmwareUpdatePlanEpoch[];
|
|
44
|
+
targetsToUpdate: FirmwareUpdatePlanTarget[];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export declare function prepareFirmwareUpdatePlan(input: {
|
|
48
|
+
plan: FirmwareUpdatePlan;
|
|
49
|
+
leaseRef: string;
|
|
50
|
+
artifacts: FirmwareUpdatePreparedArtifactInput[];
|
|
51
|
+
}): FirmwareUpdatePreparedPlan;
|
|
52
|
+
|
|
53
|
+
export declare function validateFirmwareUpdatePreparedPlan(
|
|
54
|
+
value: unknown
|
|
55
|
+
): FirmwareUpdatePreparedPlan;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DeviceState, DeviceStateSection } from '../device';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
|
+
|
|
4
|
+
export type DeviceStateScope = 'runtime' | 'settings' | 'firmware';
|
|
5
|
+
|
|
6
|
+
export type GetDeviceStateParams = CommonParams & {
|
|
7
|
+
scope?: DeviceStateScope;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/** Internal state-read options, not part of the public CoreApi. */
|
|
11
|
+
export type DeviceStateReadOptions = {
|
|
12
|
+
refreshSections?: DeviceStateSection[];
|
|
13
|
+
includeRaw?: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export declare function getDeviceState(
|
|
17
|
+
connectId?: string,
|
|
18
|
+
params?: GetDeviceStateParams
|
|
19
|
+
): Response<DeviceState>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { CommonParams, Response } from '../params';
|
|
2
2
|
import type { Features } from '../device';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `getDeviceState` for both Protocol V1 and Protocol V2 devices.
|
|
6
|
+
*/
|
|
4
7
|
export declare function getFeatures(connectId?: string, params?: CommonParams): Response<Features>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { CommonParams, Response } from '../params';
|
|
2
2
|
import type { OnekeyFeatures } from '../device';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `getDeviceState(connectId, { scope: 'firmware' })`.
|
|
6
|
+
*/
|
|
4
7
|
export declare function getOnekeyFeatures(
|
|
5
8
|
connectId?: string,
|
|
6
9
|
params?: CommonParams
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { CommonParams, Response } from '../params';
|
|
2
2
|
|
|
3
|
+
export type GetPassphraseStateParams = CommonParams;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Legacy Protocol V1 wallet API.
|
|
7
|
+
*
|
|
8
|
+
* This remains supported for Protocol V1 integrations. New cross-protocol integrations
|
|
9
|
+
* and all Protocol V2 callers should use `openWalletSession`.
|
|
10
|
+
*/
|
|
3
11
|
export declare function getPassphraseState(
|
|
4
12
|
connectId?: string,
|
|
5
|
-
params?:
|
|
6
|
-
): Response<string>;
|
|
13
|
+
params?: GetPassphraseStateParams
|
|
14
|
+
): Response<string | undefined>;
|
package/src/types/api/index.ts
CHANGED
|
@@ -1,9 +1,37 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
deviceFactoryInfoGet,
|
|
3
|
+
deviceFactoryInfoSet,
|
|
4
|
+
deviceFirmwareUpdate,
|
|
5
|
+
deviceGetFirmwareUpdateStatus,
|
|
6
|
+
deviceGetOnboardingStatus,
|
|
7
|
+
deviceInfoGet,
|
|
8
|
+
deviceReboot,
|
|
9
|
+
deviceSessionOpen,
|
|
10
|
+
deviceSettingsGet,
|
|
11
|
+
deviceSettingsPageShow,
|
|
12
|
+
deviceSettingsSet,
|
|
13
|
+
deviceStatusGet,
|
|
14
|
+
deviceUploadWallpaper,
|
|
15
|
+
dirList,
|
|
16
|
+
dirMake,
|
|
17
|
+
dirRemove,
|
|
18
|
+
fileDelete,
|
|
19
|
+
fileRead,
|
|
20
|
+
fileWrite,
|
|
21
|
+
filesystemFormat,
|
|
22
|
+
filesystemPermissionFix,
|
|
23
|
+
pathInfo,
|
|
24
|
+
ping,
|
|
25
|
+
protocolInfoRequest,
|
|
26
|
+
uploadPortfolio,
|
|
27
|
+
} from './protocolV2';
|
|
1
28
|
import type { off, on, removeAllListeners } from './event';
|
|
2
29
|
import type { uiResponse } from './uiResponse';
|
|
3
30
|
import type { init, updateSettings } from './init';
|
|
4
31
|
import type { testInitializeDeviceDuration } from './testInitializeDeviceDuration';
|
|
5
32
|
import type { preInitialize } from './preInitialize';
|
|
6
33
|
import type { getLogs } from './getLogs';
|
|
34
|
+
import type { clearSessionCache } from './sessionCache';
|
|
7
35
|
import type { checkBridgeStatus } from './checkBridgeStatus';
|
|
8
36
|
import type { checkBridgeRelease } from './checkBridgeRelease';
|
|
9
37
|
import type { checkBootloaderRelease } from './checkBootloaderRelease';
|
|
@@ -11,11 +39,26 @@ import type { checkAllFirmwareRelease } from './checkAllFirmwareRelease';
|
|
|
11
39
|
import type { checkFirmwareTypeAvailable } from './checkFirmwareTypeAvailable';
|
|
12
40
|
import type { searchDevices } from './searchDevices';
|
|
13
41
|
import type { getFeatures } from './getFeatures';
|
|
42
|
+
import type { getDeviceState } from './getDeviceState';
|
|
14
43
|
import type { getOnekeyFeatures } from './getOnekeyFeatures';
|
|
15
44
|
import type { getPassphraseState } from './getPassphraseState';
|
|
45
|
+
import type { openWalletSession } from './openWalletSession';
|
|
16
46
|
import type { checkFirmwareRelease } from './checkFirmwareRelease';
|
|
17
47
|
import type { checkBLEFirmwareRelease } from './checkBLEFirmwareRelease';
|
|
18
|
-
import type {
|
|
48
|
+
import type {
|
|
49
|
+
firmwareUpdate,
|
|
50
|
+
firmwareUpdateV2,
|
|
51
|
+
firmwareUpdateV3,
|
|
52
|
+
firmwareUpdateV4,
|
|
53
|
+
getFirmwareUpdateHostBindingGeneration,
|
|
54
|
+
registerFirmwareUpdateHostBinding,
|
|
55
|
+
unregisterFirmwareUpdateHostBinding,
|
|
56
|
+
} from './firmwareUpdate';
|
|
57
|
+
import type { getFirmwareUpdateCapabilities } from './firmwareUpdateCapabilities';
|
|
58
|
+
import type {
|
|
59
|
+
prepareFirmwareUpdatePlan,
|
|
60
|
+
validateFirmwareUpdatePreparedPlan,
|
|
61
|
+
} from './firmwareUpdatePreparedPlan';
|
|
19
62
|
import type { promptWebDeviceAccess } from './promptWebDeviceAccess';
|
|
20
63
|
import type { deviceReset } from './deviceReset';
|
|
21
64
|
import type { deviceRecovery } from './deviceRecovery';
|
|
@@ -131,6 +174,10 @@ import type { neoSignTransaction } from './neoSignTransaction';
|
|
|
131
174
|
import type { ConnectSettings } from '../settings';
|
|
132
175
|
|
|
133
176
|
export * from './export';
|
|
177
|
+
export type { DeviceStateScope, GetDeviceStateParams } from './getDeviceState';
|
|
178
|
+
export type { GetPassphraseStateParams } from './getPassphraseState';
|
|
179
|
+
export type { OpenWalletSessionParams, OpenWalletSessionPayload } from './openWalletSession';
|
|
180
|
+
export type { ClearSessionCacheParams, ClearSessionCachePayload } from './sessionCache';
|
|
134
181
|
|
|
135
182
|
export type CoreApi = {
|
|
136
183
|
/**
|
|
@@ -141,13 +188,15 @@ export type CoreApi = {
|
|
|
141
188
|
off: typeof off;
|
|
142
189
|
emit: (event: string, ...args: any[]) => void;
|
|
143
190
|
removeAllListeners: typeof removeAllListeners;
|
|
144
|
-
dispose: () => void
|
|
191
|
+
dispose: () => void | Promise<void>;
|
|
145
192
|
call: (params: any) => Promise<any>;
|
|
146
193
|
uiResponse: typeof uiResponse;
|
|
147
194
|
cancel: (connectId?: string) => void;
|
|
195
|
+
cancelOperation: (operationId: string) => void;
|
|
148
196
|
updateSettings: typeof updateSettings;
|
|
149
197
|
switchTransport: (env: ConnectSettings['env']) => Promise<{ success: boolean }>;
|
|
150
198
|
getLogs: typeof getLogs;
|
|
199
|
+
clearSessionCache: typeof clearSessionCache;
|
|
151
200
|
|
|
152
201
|
/**
|
|
153
202
|
* Test function
|
|
@@ -170,8 +219,10 @@ export type CoreApi = {
|
|
|
170
219
|
searchDevices: typeof searchDevices;
|
|
171
220
|
promptWebDeviceAccess: typeof promptWebDeviceAccess;
|
|
172
221
|
getFeatures: typeof getFeatures;
|
|
222
|
+
getDeviceState: typeof getDeviceState;
|
|
173
223
|
getOnekeyFeatures: typeof getOnekeyFeatures;
|
|
174
224
|
getPassphraseState: typeof getPassphraseState;
|
|
225
|
+
openWalletSession: typeof openWalletSession;
|
|
175
226
|
deviceBackup: typeof deviceBackup;
|
|
176
227
|
deviceChangePin: typeof deviceChangePin;
|
|
177
228
|
deviceFlags: typeof deviceFlags;
|
|
@@ -197,8 +248,44 @@ export type CoreApi = {
|
|
|
197
248
|
firmwareUpdate: typeof firmwareUpdate;
|
|
198
249
|
firmwareUpdateV2: typeof firmwareUpdateV2;
|
|
199
250
|
firmwareUpdateV3: typeof firmwareUpdateV3;
|
|
251
|
+
firmwareUpdateV4: typeof firmwareUpdateV4;
|
|
252
|
+
registerFirmwareUpdateHostBinding: typeof registerFirmwareUpdateHostBinding;
|
|
253
|
+
unregisterFirmwareUpdateHostBinding: typeof unregisterFirmwareUpdateHostBinding;
|
|
254
|
+
getFirmwareUpdateHostBindingGeneration: typeof getFirmwareUpdateHostBindingGeneration;
|
|
255
|
+
getFirmwareUpdateCapabilities: typeof getFirmwareUpdateCapabilities;
|
|
256
|
+
prepareFirmwareUpdatePlan: typeof prepareFirmwareUpdatePlan;
|
|
257
|
+
validateFirmwareUpdatePreparedPlan: typeof validateFirmwareUpdatePreparedPlan;
|
|
200
258
|
cipherKeyValue: typeof cipherKeyValue;
|
|
201
259
|
|
|
260
|
+
/**
|
|
261
|
+
* Pro2 business API
|
|
262
|
+
*/
|
|
263
|
+
deviceReboot: typeof deviceReboot;
|
|
264
|
+
deviceGetOnboardingStatus: typeof deviceGetOnboardingStatus;
|
|
265
|
+
deviceUploadWallpaper: typeof deviceUploadWallpaper;
|
|
266
|
+
deviceInfoGet: typeof deviceInfoGet;
|
|
267
|
+
deviceStatusGet: typeof deviceStatusGet;
|
|
268
|
+
deviceSettingsGet: typeof deviceSettingsGet;
|
|
269
|
+
protocolInfoRequest: typeof protocolInfoRequest;
|
|
270
|
+
ping: typeof ping;
|
|
271
|
+
deviceSessionOpen: typeof deviceSessionOpen;
|
|
272
|
+
deviceFirmwareUpdate: typeof deviceFirmwareUpdate;
|
|
273
|
+
deviceGetFirmwareUpdateStatus: typeof deviceGetFirmwareUpdateStatus;
|
|
274
|
+
deviceFactoryInfoSet: typeof deviceFactoryInfoSet;
|
|
275
|
+
deviceFactoryInfoGet: typeof deviceFactoryInfoGet;
|
|
276
|
+
deviceSettingsSet: typeof deviceSettingsSet;
|
|
277
|
+
deviceSettingsPageShow: typeof deviceSettingsPageShow;
|
|
278
|
+
filesystemPermissionFix: typeof filesystemPermissionFix;
|
|
279
|
+
filesystemFormat: typeof filesystemFormat;
|
|
280
|
+
uploadPortfolio: typeof uploadPortfolio;
|
|
281
|
+
fileRead: typeof fileRead;
|
|
282
|
+
fileWrite: typeof fileWrite;
|
|
283
|
+
fileDelete: typeof fileDelete;
|
|
284
|
+
dirList: typeof dirList;
|
|
285
|
+
dirMake: typeof dirMake;
|
|
286
|
+
dirRemove: typeof dirRemove;
|
|
287
|
+
pathInfo: typeof pathInfo;
|
|
288
|
+
|
|
202
289
|
/**
|
|
203
290
|
* All network function
|
|
204
291
|
*/
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { CommonParams, Response } from '../params';
|
|
2
|
+
|
|
3
|
+
export type OpenWalletSessionParams =
|
|
4
|
+
| {
|
|
5
|
+
mode: 'standard';
|
|
6
|
+
deviceId?: never;
|
|
7
|
+
passphraseState?: never;
|
|
8
|
+
useEmptyPassphrase?: never;
|
|
9
|
+
initSession?: never;
|
|
10
|
+
}
|
|
11
|
+
| {
|
|
12
|
+
mode: 'select-hidden';
|
|
13
|
+
deviceId?: never;
|
|
14
|
+
passphraseState?: never;
|
|
15
|
+
useEmptyPassphrase?: never;
|
|
16
|
+
initSession?: never;
|
|
17
|
+
}
|
|
18
|
+
| {
|
|
19
|
+
mode: 'resume-hidden';
|
|
20
|
+
deviceId: string;
|
|
21
|
+
passphraseState: string;
|
|
22
|
+
useEmptyPassphrase?: never;
|
|
23
|
+
initSession?: never;
|
|
24
|
+
}
|
|
25
|
+
| {
|
|
26
|
+
/**
|
|
27
|
+
* Compatibility form. `useEmptyPassphrase: true` opens the standard wallet;
|
|
28
|
+
* otherwise `initSession: true` starts a fresh hidden-wallet selection, a
|
|
29
|
+
* complete wallet binding resumes a hidden wallet, and no binding starts the
|
|
30
|
+
* hidden-wallet selection flow.
|
|
31
|
+
*/
|
|
32
|
+
mode?: undefined;
|
|
33
|
+
useEmptyPassphrase?: boolean;
|
|
34
|
+
initSession?: boolean;
|
|
35
|
+
deviceId?: string;
|
|
36
|
+
passphraseState?: string;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type OpenWalletSessionPayload = {
|
|
40
|
+
protocol: 'V1' | 'V2';
|
|
41
|
+
walletType: 'standard' | 'hidden';
|
|
42
|
+
deviceId: string;
|
|
43
|
+
passphraseState: string | null;
|
|
44
|
+
resumed: boolean;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Opens the standard, hidden, or Attach-to-PIN wallet flow through a unified
|
|
49
|
+
* Protocol V1/V2 API.
|
|
50
|
+
*/
|
|
51
|
+
export declare function openWalletSession(
|
|
52
|
+
connectId: string,
|
|
53
|
+
params: CommonParams & OpenWalletSessionParams
|
|
54
|
+
): Response<OpenWalletSessionPayload>;
|