@onekeyfe/hd-core 1.1.34-alpha.3 → 1.1.34-alpha.4
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__/DeviceCommands.test.ts +0 -217
- package/__tests__/evmLedgerLegacySafety.test.ts +4 -15
- package/__tests__/evmSignTransaction.test.ts +1 -1
- package/__tests__/evmSignTypedData.test.ts +1 -1
- package/__tests__/firmware-update/firmware-update-v2-download-before-boot.test.ts +31 -48
- package/__tests__/preInitialize.test.ts +0 -33
- package/dist/api/BaseMethod.d.ts +0 -12
- 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/FirmwareUpdate.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV2.d.ts +3 -14
- package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV3.d.ts +3 -10
- package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
- 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/PromptWebDeviceAccess.d.ts.map +1 -1
- package/dist/api/SearchDevices.d.ts +1 -5
- package/dist/api/SearchDevices.d.ts.map +1 -1
- package/dist/api/alephium/AlephiumGetAddress.d.ts +6 -2
- package/dist/api/alephium/AlephiumGetAddress.d.ts.map +1 -1
- package/dist/api/alephium/AlephiumSignMessage.d.ts +5 -2
- package/dist/api/alephium/AlephiumSignMessage.d.ts.map +1 -1
- package/dist/api/alephium/AlephiumSignTransaction.d.ts +8 -5
- 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 +9 -2
- package/dist/api/benfen/BenfenGetAddress.d.ts.map +1 -1
- package/dist/api/benfen/BenfenGetPublicKey.d.ts +9 -2
- package/dist/api/benfen/BenfenGetPublicKey.d.ts.map +1 -1
- package/dist/api/benfen/BenfenSignMessage.d.ts +8 -2
- package/dist/api/benfen/BenfenSignMessage.d.ts.map +1 -1
- package/dist/api/benfen/BenfenSignTransaction.d.ts +8 -2
- package/dist/api/benfen/BenfenSignTransaction.d.ts.map +1 -1
- package/dist/api/btc/BTCGetAddress.d.ts +11 -1
- package/dist/api/btc/BTCGetAddress.d.ts.map +1 -1
- package/dist/api/btc/BTCGetPublicKey.d.ts +11 -1
- package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
- package/dist/api/btc/BTCSignMessage.d.ts +15 -1
- 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 +11 -1
- package/dist/api/btc/BTCSignTransaction.d.ts.map +1 -1
- package/dist/api/btc/BTCVerifyMessage.d.ts +11 -1
- package/dist/api/btc/BTCVerifyMessage.d.ts.map +1 -1
- package/dist/api/btc/helpers/versionLimit.d.ts +11 -2
- 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 +2 -1
- 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 +1 -7
- 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 +8 -2
- 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/FirmwareUpdateBaseMethod.d.ts +1 -10
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
- package/dist/api/firmware/bootloaderHelper.d.ts.map +1 -1
- package/dist/api/firmware/getBinary.d.ts +0 -11
- package/dist/api/firmware/getBinary.d.ts.map +1 -1
- package/dist/api/firmware/updateBootloader.d.ts +0 -2
- package/dist/api/firmware/updateBootloader.d.ts.map +1 -1
- package/dist/api/firmware/uploadFirmware.d.ts +1 -9
- package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
- package/dist/api/helpers/batchGetPublickeys.d.ts +0 -3
- package/dist/api/helpers/batchGetPublickeys.d.ts.map +1 -1
- package/dist/api/index.d.ts +0 -29
- 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 +0 -4
- package/dist/api/lightning/LnurlAuth.d.ts.map +1 -1
- package/dist/api/neo/NeoGetAddress.d.ts +8 -2
- package/dist/api/neo/NeoGetAddress.d.ts.map +1 -1
- package/dist/api/neo/NeoSignTransaction.d.ts +8 -2
- package/dist/api/neo/NeoSignTransaction.d.ts.map +1 -1
- package/dist/api/nervos/NervosGetAddress.d.ts +9 -2
- package/dist/api/nervos/NervosGetAddress.d.ts.map +1 -1
- package/dist/api/nervos/NervosSignTransaction.d.ts +12 -9
- package/dist/api/nervos/NervosSignTransaction.d.ts.map +1 -1
- package/dist/api/nexa/NexaGetAddress.d.ts +8 -2
- package/dist/api/nexa/NexaGetAddress.d.ts.map +1 -1
- package/dist/api/nexa/NexaSignTransaction.d.ts +9 -2
- package/dist/api/nexa/NexaSignTransaction.d.ts.map +1 -1
- package/dist/api/polkadot/PolkadotGetAddress.d.ts +0 -3
- package/dist/api/polkadot/PolkadotGetAddress.d.ts.map +1 -1
- package/dist/api/polkadot/networks.d.ts +0 -3
- package/dist/api/polkadot/networks.d.ts.map +1 -1
- package/dist/api/scdo/ScdoGetAddress.d.ts +6 -2
- package/dist/api/scdo/ScdoGetAddress.d.ts.map +1 -1
- package/dist/api/scdo/ScdoSignMessage.d.ts +5 -2
- package/dist/api/scdo/ScdoSignMessage.d.ts.map +1 -1
- package/dist/api/scdo/ScdoSignTransaction.d.ts +5 -2
- package/dist/api/scdo/ScdoSignTransaction.d.ts.map +1 -1
- package/dist/api/solana/SolGetAddress.d.ts +0 -1
- package/dist/api/solana/SolGetAddress.d.ts.map +1 -1
- package/dist/api/solana/SolSignMessage.d.ts +0 -3
- package/dist/api/solana/SolSignMessage.d.ts.map +1 -1
- package/dist/api/solana/SolSignOffchainMessage.d.ts +0 -3
- package/dist/api/solana/SolSignOffchainMessage.d.ts.map +1 -1
- package/dist/api/solana/SolSignTransaction.d.ts +0 -6
- package/dist/api/solana/SolSignTransaction.d.ts.map +1 -1
- package/dist/api/stellar/StellarGetAddress.d.ts +1 -2
- package/dist/api/stellar/StellarGetAddress.d.ts.map +1 -1
- package/dist/api/stellar/StellarSignTransaction.d.ts +2 -3
- package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -1
- package/dist/api/sui/SuiGetAddress.d.ts +0 -3
- package/dist/api/sui/SuiGetAddress.d.ts.map +1 -1
- package/dist/api/sui/SuiGetPublicKey.d.ts +0 -3
- package/dist/api/sui/SuiGetPublicKey.d.ts.map +1 -1
- package/dist/api/sui/SuiSignMessage.d.ts +0 -3
- package/dist/api/sui/SuiSignMessage.d.ts.map +1 -1
- package/dist/api/sui/SuiSignTransaction.d.ts +2 -5
- package/dist/api/sui/SuiSignTransaction.d.ts.map +1 -1
- package/dist/api/ton/TonGetAddress.d.ts +0 -3
- package/dist/api/ton/TonGetAddress.d.ts.map +1 -1
- package/dist/api/ton/TonSignData.d.ts +0 -1
- package/dist/api/ton/TonSignData.d.ts.map +1 -1
- package/dist/api/ton/TonSignMessage.d.ts +0 -3
- package/dist/api/ton/TonSignMessage.d.ts.map +1 -1
- package/dist/api/ton/TonSignProof.d.ts +0 -3
- package/dist/api/ton/TonSignProof.d.ts.map +1 -1
- package/dist/api/tron/TronSignMessage.d.ts +0 -3
- package/dist/api/tron/TronSignMessage.d.ts.map +1 -1
- package/dist/api/tron/TronSignTransaction.d.ts +0 -3
- package/dist/api/tron/TronSignTransaction.d.ts.map +1 -1
- package/dist/api/utils.d.ts +1 -2
- package/dist/api/utils.d.ts.map +1 -1
- package/dist/constants/index.d.ts +1 -2
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/core/RequestQueue.d.ts +1 -19
- package/dist/core/RequestQueue.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -4
- package/dist/core/index.d.ts.map +1 -1
- package/dist/data-manager/DataManager.d.ts +5 -9
- 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 +4 -5
- 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 +16 -60
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DeviceCommands.d.ts +14 -16
- package/dist/device/DeviceCommands.d.ts.map +1 -1
- package/dist/device/DeviceConnector.d.ts +1 -2
- package/dist/device/DeviceConnector.d.ts.map +1 -1
- package/dist/device/DevicePool.d.ts +2 -4
- package/dist/device/DevicePool.d.ts.map +1 -1
- package/dist/events/call.d.ts +0 -7
- 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 +2 -11
- package/dist/events/device.d.ts.map +1 -1
- package/dist/events/iframe.d.ts +0 -1
- package/dist/events/iframe.d.ts.map +1 -1
- package/dist/events/logBlockEvent.d.ts +0 -1
- package/dist/events/logBlockEvent.d.ts.map +1 -1
- package/dist/events/ui-request.d.ts +2 -26
- package/dist/events/ui-request.d.ts.map +1 -1
- package/dist/index.d.ts +451 -1797
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5556 -26855
- package/dist/inject.d.ts +2 -3
- package/dist/inject.d.ts.map +1 -1
- package/dist/lowLevelInject.d.ts +1 -2
- package/dist/lowLevelInject.d.ts.map +1 -1
- package/dist/topLevelInject.d.ts.map +1 -1
- package/dist/types/api/checkAllFirmwareRelease.d.ts +2 -4
- package/dist/types/api/checkAllFirmwareRelease.d.ts.map +1 -1
- package/dist/types/api/deviceSettings.d.ts +0 -9
- 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 +1 -6
- package/dist/types/api/deviceUpdateBootloader.d.ts.map +1 -1
- package/dist/types/api/export.d.ts +1 -4
- package/dist/types/api/export.d.ts.map +1 -1
- package/dist/types/api/firmwareUpdate.d.ts +1 -114
- package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
- 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 +1 -2
- package/dist/types/api/getPassphraseState.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +2 -48
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/searchDevices.d.ts +2 -2
- package/dist/types/api/searchDevices.d.ts.map +1 -1
- package/dist/types/device.d.ts +5 -207
- package/dist/types/device.d.ts.map +1 -1
- package/dist/types/params.d.ts +0 -3
- package/dist/types/params.d.ts.map +1 -1
- package/dist/types/settings.d.ts +0 -33
- package/dist/types/settings.d.ts.map +1 -1
- package/dist/utils/capabilitieUtils.d.ts.map +1 -1
- package/dist/utils/deviceFeaturesUtils.d.ts +9 -17
- package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
- package/dist/utils/deviceInfoUtils.d.ts +8 -10
- package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
- package/dist/utils/deviceSettings.d.ts +0 -2
- package/dist/utils/deviceSettings.d.ts.map +1 -1
- package/dist/utils/deviceVersionUtils.d.ts +5 -6
- 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 +1 -3
- 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/tracing.d.ts.map +1 -1
- package/dist/utils/versionUtils.d.ts +1 -1
- package/package.json +4 -4
- package/src/api/BaseMethod.ts +23 -60
- package/src/api/CheckAllFirmwareRelease.ts +3 -16
- package/src/api/CheckBootloaderRelease.ts +2 -1
- package/src/api/CheckFirmwareRelease.ts +2 -1
- package/src/api/FirmwareUpdate.ts +7 -15
- package/src/api/FirmwareUpdateV2.ts +148 -354
- package/src/api/FirmwareUpdateV3.ts +62 -376
- package/src/api/GetFeatures.ts +4 -12
- package/src/api/GetOnekeyFeatures.ts +3 -15
- package/src/api/GetPassphraseState.ts +10 -9
- package/src/api/PromptWebDeviceAccess.ts +1 -10
- package/src/api/SearchDevices.ts +3 -33
- package/src/api/alephium/AlephiumGetAddress.ts +2 -6
- package/src/api/alephium/AlephiumSignMessage.ts +1 -6
- package/src/api/alephium/AlephiumSignTransaction.ts +4 -15
- package/src/api/allnetwork/AllNetworkGetAddressBase.ts +21 -25
- package/src/api/aptos/AptosGetAddress.ts +3 -2
- package/src/api/benfen/BenfenGetAddress.ts +7 -11
- package/src/api/benfen/BenfenGetPublicKey.ts +2 -6
- package/src/api/benfen/BenfenSignMessage.ts +1 -6
- package/src/api/benfen/BenfenSignTransaction.ts +1 -6
- package/src/api/btc/BTCGetPublicKey.ts +2 -3
- package/src/api/btc/BTCSignPsbt.ts +2 -1
- package/src/api/btc/helpers/versionLimit.ts +1 -7
- package/src/api/cardano/CardanoSignTransaction.ts +4 -2
- package/src/api/conflux/ConfluxSignTransaction.ts +2 -5
- package/src/api/device/DeviceCancel.ts +0 -1
- package/src/api/device/DeviceChangePin.ts +0 -24
- package/src/api/device/DeviceFullyUploadResource.ts +7 -6
- package/src/api/device/DeviceLock.ts +3 -2
- package/src/api/device/DeviceRebootToBoardloader.ts +1 -11
- package/src/api/device/DeviceRebootToBootloader.ts +1 -11
- package/src/api/device/DeviceSettings.ts +0 -121
- package/src/api/device/DeviceSupportFeatures.ts +13 -2
- package/src/api/device/DeviceUnlock.ts +0 -9
- package/src/api/device/DeviceUpdateBootloader.ts +11 -175
- package/src/api/device/DeviceUploadResource.ts +5 -4
- package/src/api/device/DeviceVerify.ts +2 -1
- package/src/api/device/DeviceWipe.ts +0 -19
- package/src/api/dynex/DnxGetAddress.ts +0 -6
- package/src/api/dynex/DnxSignTransaction.ts +0 -6
- package/src/api/evm/EVMGetAddress.ts +1 -1
- package/src/api/evm/EVMGetPublicKey.ts +4 -3
- package/src/api/evm/EVMSignMessage.ts +1 -1
- package/src/api/evm/EVMSignMessageEIP712.ts +1 -14
- package/src/api/evm/EVMSignTransaction.ts +1 -1
- package/src/api/evm/EVMSignTypedData.ts +18 -30
- package/src/api/evm/EVMVerifyMessage.ts +1 -1
- package/src/api/evm/latest/signTypedHash.ts +4 -2
- package/src/api/evm/legacyV1/getAddress.ts +3 -5
- package/src/api/evm/legacyV1/getPublicKey.ts +3 -5
- package/src/api/evm/legacyV1/signMessage.ts +3 -5
- package/src/api/evm/legacyV1/signTypedData.ts +8 -9
- package/src/api/evm/legacyV1/signTypedHash.ts +7 -7
- package/src/api/evm/legacyV1/verifyMessage.ts +3 -5
- package/src/api/firmware/FirmwareUpdateBaseMethod.ts +15 -83
- package/src/api/firmware/bootloaderHelper.ts +2 -3
- package/src/api/firmware/getBinary.ts +1 -1
- package/src/api/firmware/releaseHelper.ts +3 -3
- package/src/api/firmware/updateBootloader.ts +4 -19
- package/src/api/firmware/uploadFirmware.ts +34 -148
- package/src/api/helpers/batchGetPublickeys.ts +6 -51
- package/src/api/index.ts +0 -32
- package/src/api/kaspa/KaspaSignTransaction.ts +3 -2
- package/src/api/lightning/LnurlAuth.ts +0 -4
- package/src/api/neo/NeoGetAddress.ts +1 -6
- package/src/api/neo/NeoSignTransaction.ts +1 -6
- package/src/api/nervos/NervosGetAddress.ts +2 -6
- package/src/api/nervos/NervosSignTransaction.ts +4 -14
- package/src/api/nexa/NexaGetAddress.ts +2 -6
- package/src/api/nexa/NexaSignTransaction.ts +12 -11
- package/src/api/polkadot/networks.ts +0 -9
- package/src/api/scdo/ScdoGetAddress.ts +2 -6
- package/src/api/scdo/ScdoSignMessage.ts +1 -6
- package/src/api/scdo/ScdoSignTransaction.ts +2 -6
- package/src/api/solana/SolGetAddress.ts +0 -4
- package/src/api/solana/SolSignMessage.ts +0 -3
- package/src/api/solana/SolSignOffchainMessage.ts +0 -3
- package/src/api/solana/SolSignTransaction.ts +0 -6
- package/src/api/stellar/StellarGetAddress.ts +1 -10
- package/src/api/stellar/StellarSignTransaction.ts +1 -14
- package/src/api/sui/SuiGetAddress.ts +3 -5
- package/src/api/sui/SuiGetPublicKey.ts +0 -3
- package/src/api/sui/SuiSignMessage.ts +0 -3
- package/src/api/sui/SuiSignTransaction.ts +12 -14
- package/src/api/ton/TonGetAddress.ts +0 -3
- package/src/api/ton/TonSignData.ts +3 -6
- package/src/api/ton/TonSignMessage.ts +5 -6
- package/src/api/ton/TonSignProof.ts +0 -3
- package/src/api/tron/TronSignMessage.ts +1 -4
- package/src/api/tron/TronSignTransaction.ts +0 -3
- package/src/api/utils.ts +3 -7
- package/src/api/xrp/XrpSignTransaction.ts +1 -1
- package/src/constants/index.ts +1 -7
- package/src/core/RequestQueue.ts +4 -124
- package/src/core/index.ts +116 -255
- package/src/data-manager/DataManager.ts +49 -61
- package/src/data-manager/MessagesConfig.ts +14 -14
- package/src/data-manager/TransportManager.ts +12 -38
- package/src/data-manager/connectSettings.ts +0 -15
- package/src/device/Device.ts +164 -759
- package/src/device/DeviceCommands.ts +36 -245
- package/src/device/DeviceConnector.ts +4 -29
- package/src/device/DevicePool.ts +21 -69
- package/src/events/call.ts +0 -6
- package/src/events/core.ts +0 -2
- package/src/events/device.ts +1 -17
- package/src/events/iframe.ts +0 -1
- package/src/events/logBlockEvent.ts +0 -30
- package/src/events/ui-request.ts +2 -32
- package/src/index.ts +0 -9
- package/src/inject.ts +3 -75
- package/src/lowLevelInject.ts +1 -8
- package/src/topLevelInject.ts +1 -7
- package/src/types/api/checkAllFirmwareRelease.ts +2 -4
- package/src/types/api/deviceSettings.ts +0 -9
- package/src/types/api/deviceUnlock.ts +1 -1
- package/src/types/api/deviceUpdateBootloader.ts +1 -10
- package/src/types/api/export.ts +0 -25
- package/src/types/api/firmwareUpdate.ts +1 -163
- package/src/types/api/getFeatures.ts +0 -3
- package/src/types/api/getOnekeyFeatures.ts +0 -3
- package/src/types/api/getPassphraseState.ts +2 -10
- package/src/types/api/index.ts +2 -89
- package/src/types/api/searchDevices.ts +2 -2
- package/src/types/device.ts +5 -266
- package/src/types/params.ts +0 -11
- package/src/types/settings.ts +29 -54
- package/src/utils/capabilitieUtils.ts +2 -1
- package/src/utils/deviceFeaturesUtils.ts +84 -122
- package/src/utils/deviceInfoUtils.ts +87 -38
- package/src/utils/deviceSettings.ts +0 -48
- package/src/utils/deviceVersionUtils.ts +62 -25
- package/src/utils/findDefectiveBatchDevice.ts +8 -8
- package/src/utils/homescreen.ts +0 -10
- package/src/utils/index.ts +0 -4
- package/src/utils/tracing.ts +1 -3
- package/__tests__/AllNetworkGetAddressBase.tracing.test.ts +0 -75
- package/__tests__/RequestQueue.test.ts +0 -140
- package/__tests__/UploadPortfolio.test.ts +0 -46
- package/__tests__/connectSettings.test.ts +0 -61
- package/__tests__/device-lifecycle-events.test.ts +0 -117
- package/__tests__/device-pool-state.test.ts +0 -132
- package/__tests__/device-settings.test.ts +0 -286
- package/__tests__/device-state-mapper.test.ts +0 -229
- package/__tests__/device-utils.test.ts +0 -106
- package/__tests__/device-wallet-session-store.test.ts +0 -191
- package/__tests__/filesystemValidation.test.ts +0 -53
- package/__tests__/firmware-update/firmware-artifact-source.test.ts +0 -119
- package/__tests__/firmware-update/firmware-checkpoint.test.ts +0 -105
- package/__tests__/firmware-update/firmware-host-binding.test.ts +0 -73
- package/__tests__/firmware-update/firmware-update-capabilities.test.ts +0 -17
- package/__tests__/firmware-update/firmware-update-plan.test.ts +0 -358
- package/__tests__/firmware-update/firmware-update-prepared-plan.test.ts +0 -200
- package/__tests__/firmware-update/firmware-update-recovery.test.ts +0 -81
- package/__tests__/firmware-update/firmware-upload-source.test.ts +0 -70
- package/__tests__/get-device-state.test.ts +0 -403
- package/__tests__/logBlockEvent.test.ts +0 -61
- package/__tests__/logger.test.ts +0 -34
- package/__tests__/open-wallet-session.test.ts +0 -565
- package/__tests__/pro2Wallpaper.test.ts +0 -39
- package/__tests__/protocol-v2-bootloader-mode.test.ts +0 -37
- package/__tests__/protocol-v2-firmware-targets.test.ts +0 -19
- package/__tests__/protocol-v2.test.ts +0 -6008
- package/__tests__/protocolV2FileWrite.test.ts +0 -67
- package/__tests__/public-pro2-api-boundary.test.ts +0 -66
- package/__tests__/search-devices.test.ts +0 -136
- package/dist/api/ClearSessionCache.d.ts +0 -9
- package/dist/api/ClearSessionCache.d.ts.map +0 -1
- package/dist/api/DirList.d.ts +0 -10
- package/dist/api/DirList.d.ts.map +0 -1
- package/dist/api/DirMake.d.ts +0 -9
- package/dist/api/DirMake.d.ts.map +0 -1
- package/dist/api/DirRemove.d.ts +0 -9
- package/dist/api/DirRemove.d.ts.map +0 -1
- package/dist/api/FileDelete.d.ts +0 -9
- package/dist/api/FileDelete.d.ts.map +0 -1
- package/dist/api/FileRead.d.ts +0 -19
- package/dist/api/FileRead.d.ts.map +0 -1
- package/dist/api/FileWrite.d.ts +0 -25
- package/dist/api/FileWrite.d.ts.map +0 -1
- package/dist/api/FirmwareUpdateV4.d.ts +0 -75
- package/dist/api/FirmwareUpdateV4.d.ts.map +0 -1
- package/dist/api/GetDeviceState.d.ts +0 -7
- package/dist/api/GetDeviceState.d.ts.map +0 -1
- package/dist/api/OpenWalletSession.d.ts +0 -14
- package/dist/api/OpenWalletSession.d.ts.map +0 -1
- package/dist/api/PathInfo.d.ts +0 -10
- package/dist/api/PathInfo.d.ts.map +0 -1
- package/dist/api/UploadPortfolio.d.ts +0 -18
- package/dist/api/UploadPortfolio.d.ts.map +0 -1
- package/dist/api/firmware/FirmwareArtifactSource.d.ts +0 -26
- package/dist/api/firmware/FirmwareArtifactSource.d.ts.map +0 -1
- package/dist/api/firmware/FirmwareCheckpoint.d.ts +0 -15
- package/dist/api/firmware/FirmwareCheckpoint.d.ts.map +0 -1
- package/dist/api/firmware/FirmwareHostBinding.d.ts +0 -6
- package/dist/api/firmware/FirmwareHostBinding.d.ts.map +0 -1
- package/dist/api/firmware/FirmwareUpdateCapabilities.d.ts +0 -3
- package/dist/api/firmware/FirmwareUpdateCapabilities.d.ts.map +0 -1
- package/dist/api/firmware/FirmwareUpdatePlan.d.ts +0 -29
- package/dist/api/firmware/FirmwareUpdatePlan.d.ts.map +0 -1
- package/dist/api/firmware/FirmwareUpdatePreparedPlan.d.ts +0 -25
- package/dist/api/firmware/FirmwareUpdatePreparedPlan.d.ts.map +0 -1
- package/dist/api/firmware/progressThrottle.d.ts +0 -3
- package/dist/api/firmware/progressThrottle.d.ts.map +0 -1
- package/dist/api/helpers/filesystemValidation.d.ts +0 -10
- package/dist/api/helpers/filesystemValidation.d.ts.map +0 -1
- package/dist/api/helpers/protocolV2FileWrite.d.ts +0 -33
- package/dist/api/helpers/protocolV2FileWrite.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts +0 -6
- package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts +0 -7
- package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts +0 -7
- package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts +0 -7
- package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts +0 -6
- package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceInfoGet.d.ts +0 -28
- package/dist/api/protocol-v2/DeviceInfoGet.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceReboot.d.ts +0 -7
- package/dist/api/protocol-v2/DeviceReboot.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceSessionOpen.d.ts +0 -28
- package/dist/api/protocol-v2/DeviceSessionOpen.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceSettingsGet.d.ts +0 -6
- package/dist/api/protocol-v2/DeviceSettingsGet.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceSettingsPageShow.d.ts +0 -16
- package/dist/api/protocol-v2/DeviceSettingsPageShow.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceSettingsSet.d.ts +0 -12
- package/dist/api/protocol-v2/DeviceSettingsSet.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceStatusGet.d.ts +0 -6
- package/dist/api/protocol-v2/DeviceStatusGet.d.ts.map +0 -1
- package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts +0 -26
- package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts.map +0 -1
- package/dist/api/protocol-v2/FilesystemFormat.d.ts +0 -6
- package/dist/api/protocol-v2/FilesystemFormat.d.ts.map +0 -1
- package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts +0 -6
- package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts.map +0 -1
- package/dist/api/protocol-v2/Ping.d.ts +0 -8
- package/dist/api/protocol-v2/Ping.d.ts.map +0 -1
- package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts +0 -6
- package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts.map +0 -1
- package/dist/api/protocol-v2/helpers.d.ts +0 -42
- package/dist/api/protocol-v2/helpers.d.ts.map +0 -1
- package/dist/core/deviceEventRegistration.d.ts +0 -11
- package/dist/core/deviceEventRegistration.d.ts.map +0 -1
- package/dist/device/DeviceFeaturesState.d.ts +0 -4
- package/dist/device/DeviceFeaturesState.d.ts.map +0 -1
- package/dist/device/DeviceStateMapper.d.ts +0 -13
- package/dist/device/DeviceStateMapper.d.ts.map +0 -1
- package/dist/device/DeviceStateProjector.d.ts +0 -7
- package/dist/device/DeviceStateProjector.d.ts.map +0 -1
- package/dist/device/DeviceStateStore.d.ts +0 -21
- package/dist/device/DeviceStateStore.d.ts.map +0 -1
- package/dist/device/DeviceWalletSessionStore.d.ts +0 -15
- package/dist/device/DeviceWalletSessionStore.d.ts.map +0 -1
- package/dist/device/cloneDeviceState.d.ts +0 -2
- package/dist/device/cloneDeviceState.d.ts.map +0 -1
- package/dist/device/deviceIdentity.d.ts +0 -5
- package/dist/device/deviceIdentity.d.ts.map +0 -1
- package/dist/deviceProfile/buildDeviceFeatures.d.ts +0 -12
- package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +0 -1
- package/dist/deviceProfile/index.d.ts +0 -2
- package/dist/deviceProfile/index.d.ts.map +0 -1
- package/dist/protocols/protocol-v2/deviceSession.d.ts +0 -7
- package/dist/protocols/protocol-v2/deviceSession.d.ts.map +0 -1
- package/dist/protocols/protocol-v2/features.d.ts +0 -88
- package/dist/protocols/protocol-v2/features.d.ts.map +0 -1
- package/dist/protocols/protocol-v2/firmware.d.ts +0 -15
- package/dist/protocols/protocol-v2/firmware.d.ts.map +0 -1
- package/dist/protocols/protocol-v2/index.d.ts +0 -5
- package/dist/protocols/protocol-v2/index.d.ts.map +0 -1
- package/dist/protocols/protocol-v2/lockedError.d.ts +0 -2
- package/dist/protocols/protocol-v2/lockedError.d.ts.map +0 -1
- package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts +0 -16
- package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts.map +0 -1
- package/dist/protocols/protocol-v2/uiInteraction.d.ts +0 -39
- package/dist/protocols/protocol-v2/uiInteraction.d.ts.map +0 -1
- package/dist/protocols/protocol-v2/unlockRetry.d.ts +0 -11
- package/dist/protocols/protocol-v2/unlockRetry.d.ts.map +0 -1
- package/dist/protocols/protocol-v2/walletSession.d.ts +0 -21
- package/dist/protocols/protocol-v2/walletSession.d.ts.map +0 -1
- package/dist/types/api/firmwareUpdateCapabilities.d.ts +0 -13
- package/dist/types/api/firmwareUpdateCapabilities.d.ts.map +0 -1
- package/dist/types/api/firmwareUpdatePlan.d.ts +0 -35
- package/dist/types/api/firmwareUpdatePlan.d.ts.map +0 -1
- package/dist/types/api/firmwareUpdatePreparedPlan.d.ts +0 -43
- package/dist/types/api/firmwareUpdatePreparedPlan.d.ts.map +0 -1
- package/dist/types/api/getDeviceState.d.ts +0 -12
- package/dist/types/api/getDeviceState.d.ts.map +0 -1
- package/dist/types/api/openWalletSession.d.ts +0 -35
- package/dist/types/api/openWalletSession.d.ts.map +0 -1
- package/dist/types/api/protocolV2.d.ts +0 -113
- package/dist/types/api/protocolV2.d.ts.map +0 -1
- package/dist/types/api/sessionCache.d.ts +0 -10
- package/dist/types/api/sessionCache.d.ts.map +0 -1
- package/dist/utils/deviceFeaturesCompat.d.ts +0 -13
- package/dist/utils/deviceFeaturesCompat.d.ts.map +0 -1
- package/dist/utils/pro2Wallpaper.d.ts +0 -12
- package/dist/utils/pro2Wallpaper.d.ts.map +0 -1
- package/src/api/ClearSessionCache.ts +0 -28
- package/src/api/DirList.ts +0 -33
- package/src/api/DirMake.ts +0 -23
- package/src/api/DirRemove.ts +0 -23
- package/src/api/FileDelete.ts +0 -23
- package/src/api/FileRead.ts +0 -183
- package/src/api/FileWrite.ts +0 -71
- package/src/api/FirmwareUpdateV4.ts +0 -2279
- package/src/api/GetDeviceState.ts +0 -55
- package/src/api/OpenWalletSession.ts +0 -211
- package/src/api/PathInfo.ts +0 -41
- package/src/api/UploadPortfolio.ts +0 -50
- package/src/api/firmware/FirmwareArtifactSource.ts +0 -278
- package/src/api/firmware/FirmwareCheckpoint.ts +0 -188
- package/src/api/firmware/FirmwareHostBinding.ts +0 -108
- package/src/api/firmware/FirmwareUpdateCapabilities.ts +0 -13
- package/src/api/firmware/FirmwareUpdatePlan.ts +0 -729
- package/src/api/firmware/FirmwareUpdatePreparedPlan.ts +0 -403
- package/src/api/firmware/progressThrottle.ts +0 -44
- package/src/api/helpers/filesystemValidation.ts +0 -112
- package/src/api/helpers/protocolV2FileWrite.ts +0 -193
- package/src/api/protocol-v2/DeviceFactoryInfoGet.ts +0 -20
- package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +0 -32
- package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +0 -61
- package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +0 -55
- package/src/api/protocol-v2/DeviceGetOnboardingStatus.ts +0 -18
- package/src/api/protocol-v2/DeviceInfoGet.ts +0 -145
- package/src/api/protocol-v2/DeviceReboot.ts +0 -26
- package/src/api/protocol-v2/DeviceSessionOpen.ts +0 -102
- package/src/api/protocol-v2/DeviceSettingsGet.ts +0 -18
- package/src/api/protocol-v2/DeviceSettingsPageShow.ts +0 -70
- package/src/api/protocol-v2/DeviceSettingsSet.ts +0 -44
- package/src/api/protocol-v2/DeviceStatusGet.ts +0 -16
- package/src/api/protocol-v2/DeviceUploadWallpaper.ts +0 -131
- package/src/api/protocol-v2/FilesystemFormat.ts +0 -19
- package/src/api/protocol-v2/FilesystemPermissionFix.ts +0 -16
- package/src/api/protocol-v2/Ping.ts +0 -18
- package/src/api/protocol-v2/ProtocolInfoRequest.ts +0 -16
- package/src/api/protocol-v2/helpers.ts +0 -203
- package/src/core/deviceEventRegistration.ts +0 -23
- package/src/data/messages/messages-protocol-v2.json +0 -13544
- package/src/device/DeviceFeaturesState.ts +0 -34
- package/src/device/DeviceStateMapper.ts +0 -348
- package/src/device/DeviceStateProjector.ts +0 -95
- package/src/device/DeviceStateStore.ts +0 -201
- package/src/device/DeviceWalletSessionStore.ts +0 -78
- package/src/device/cloneDeviceState.ts +0 -39
- package/src/device/deviceIdentity.ts +0 -18
- package/src/deviceProfile/buildDeviceFeatures.ts +0 -391
- package/src/deviceProfile/index.ts +0 -4
- package/src/protocols/protocol-v2/deviceSession.ts +0 -24
- package/src/protocols/protocol-v2/features.ts +0 -163
- package/src/protocols/protocol-v2/firmware.ts +0 -21
- package/src/protocols/protocol-v2/index.ts +0 -18
- package/src/protocols/protocol-v2/lockedError.ts +0 -10
- package/src/protocols/protocol-v2/settingsUnlockPolicy.ts +0 -61
- package/src/protocols/protocol-v2/uiInteraction.ts +0 -210
- package/src/protocols/protocol-v2/unlockRetry.ts +0 -76
- package/src/protocols/protocol-v2/walletSession.ts +0 -202
- package/src/types/api/firmwareUpdateCapabilities.ts +0 -13
- package/src/types/api/firmwareUpdatePlan.ts +0 -52
- package/src/types/api/firmwareUpdatePreparedPlan.ts +0 -55
- package/src/types/api/getDeviceState.ts +0 -19
- package/src/types/api/openWalletSession.ts +0 -54
- package/src/types/api/protocolV2.ts +0 -244
- package/src/types/api/sessionCache.ts +0 -14
- package/src/utils/deviceFeaturesCompat.ts +0 -173
- package/src/utils/pro2Wallpaper.ts +0 -109
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
2
|
-
|
|
3
|
-
import { DEVICE, type PassphraseRequestPayload } from '../../events';
|
|
4
|
-
import { assertCompleteDeviceSession } from './deviceSession';
|
|
5
|
-
import { isDeviceLockedError } from './lockedError';
|
|
6
|
-
|
|
7
|
-
import type { DeviceSessionOpen } from '@onekeyfe/hd-transport';
|
|
8
|
-
import type { Device } from '../../device/Device';
|
|
9
|
-
import type { PassphrasePromptResponse } from '../../device/DeviceCommands';
|
|
10
|
-
|
|
11
|
-
export const isProtocolV2InvalidSessionError = (error: unknown) =>
|
|
12
|
-
error !== null &&
|
|
13
|
-
typeof error === 'object' &&
|
|
14
|
-
'errorCode' in error &&
|
|
15
|
-
error.errorCode === HardwareErrorCode.WalletSessionInvalid;
|
|
16
|
-
|
|
17
|
-
const normalizeHostPassphrase = (passphrase: string | undefined) => {
|
|
18
|
-
const normalized = (passphrase ?? '').normalize('NFKD');
|
|
19
|
-
if (!normalized || normalized.includes('\0') || normalized.length > 50) {
|
|
20
|
-
throw ERRORS.TypedError(
|
|
21
|
-
HardwareErrorCode.CallMethodInvalidParameter,
|
|
22
|
-
'Invalid hidden wallet passphrase.'
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
return normalized;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export async function requestProtocolV2DeviceStatus(device: Device) {
|
|
29
|
-
const { message } = await device.commands.typedCall('DeviceStatusGet', 'DeviceStatus', {});
|
|
30
|
-
return message;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export async function refreshProtocolV2DeviceStatus(device: Device) {
|
|
34
|
-
const status = await requestProtocolV2DeviceStatus(device);
|
|
35
|
-
return device.updateProtocolV2Status(status);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const openDeviceSession = async (device: Device, request: DeviceSessionOpen) => {
|
|
39
|
-
try {
|
|
40
|
-
return await device.commands.typedCall('DeviceSessionOpen', 'DeviceSession', request);
|
|
41
|
-
} catch (error) {
|
|
42
|
-
if (!isDeviceLockedError(error)) {
|
|
43
|
-
throw error;
|
|
44
|
-
}
|
|
45
|
-
await device.unlockDevice();
|
|
46
|
-
return device.commands.typedCall('DeviceSessionOpen', 'DeviceSession', request);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const createHiddenWalletRequest = (
|
|
51
|
-
response: PassphrasePromptResponse
|
|
52
|
-
): {
|
|
53
|
-
request: DeviceSessionOpen;
|
|
54
|
-
deviceEvent?: typeof DEVICE.PASSPHRASE_ON_DEVICE | typeof DEVICE.ATTACH_PIN_ON_DEVICE;
|
|
55
|
-
} => {
|
|
56
|
-
if (response.attachPinOnDevice) {
|
|
57
|
-
return {
|
|
58
|
-
request: {
|
|
59
|
-
select: {
|
|
60
|
-
attach_pin_on_device: {},
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
deviceEvent: DEVICE.ATTACH_PIN_ON_DEVICE,
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (response.passphraseOnDevice) {
|
|
68
|
-
return {
|
|
69
|
-
request: {
|
|
70
|
-
select: {
|
|
71
|
-
passphrase_on_device: {},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
deviceEvent: DEVICE.PASSPHRASE_ON_DEVICE,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return {
|
|
79
|
-
request: {
|
|
80
|
-
select: {
|
|
81
|
-
host_passphrase: { passphrase: normalizeHostPassphrase(response.passphrase) },
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const openSelectedHiddenWallet = async (
|
|
88
|
-
device: Device,
|
|
89
|
-
promptPayload: PassphraseRequestPayload
|
|
90
|
-
) => {
|
|
91
|
-
const response = await device.commands.promptPassphrase(promptPayload, {
|
|
92
|
-
cancelDeviceOnReject: false,
|
|
93
|
-
});
|
|
94
|
-
const { request, deviceEvent } = createHiddenWalletRequest(response);
|
|
95
|
-
|
|
96
|
-
if (deviceEvent) {
|
|
97
|
-
device.emit(deviceEvent, device, promptPayload);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return openDeviceSession(device, request);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export async function getProtocolV2WalletSession(
|
|
104
|
-
device: Device,
|
|
105
|
-
options?: {
|
|
106
|
-
initSession?: boolean;
|
|
107
|
-
expectedPassphraseState?: string;
|
|
108
|
-
onlyMainPin?: boolean;
|
|
109
|
-
recoverInvalidSession?: boolean;
|
|
110
|
-
}
|
|
111
|
-
) {
|
|
112
|
-
if (options?.initSession) {
|
|
113
|
-
device.clearInternalState();
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const expectedPassphraseState = options?.expectedPassphraseState ?? device.passphraseState;
|
|
117
|
-
|
|
118
|
-
try {
|
|
119
|
-
// Unlock with PIN first. The unlock flow refreshes DeviceStatus so wallet
|
|
120
|
-
// selection uses confirmed passphrase and attach-to-PIN state.
|
|
121
|
-
if (device.features?.unlocked === false) {
|
|
122
|
-
await device.unlockDevice();
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// A standard wallet needs no DeviceSession. After unlock confirms passphrase is
|
|
126
|
-
// disabled, do not create or forward a hidden-wallet passphraseState.
|
|
127
|
-
if (options?.onlyMainPin || device.getCurrentPassphraseProtection() === false) {
|
|
128
|
-
return {
|
|
129
|
-
passphraseState: undefined,
|
|
130
|
-
newSession: undefined,
|
|
131
|
-
unlockedAttachPin: device.features?.unlockedAttachPin ?? false,
|
|
132
|
-
resumed: false,
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const cachedSessionId =
|
|
137
|
-
typeof device.getInternalState === 'function' ? device.getInternalState() : undefined;
|
|
138
|
-
let response;
|
|
139
|
-
let recoveryFailed = false;
|
|
140
|
-
let resumed = false;
|
|
141
|
-
|
|
142
|
-
if (cachedSessionId && expectedPassphraseState) {
|
|
143
|
-
try {
|
|
144
|
-
response = await openDeviceSession(device, {
|
|
145
|
-
resume: { session_id: cachedSessionId },
|
|
146
|
-
});
|
|
147
|
-
resumed = true;
|
|
148
|
-
} catch (error) {
|
|
149
|
-
if (!isProtocolV2InvalidSessionError(error)) {
|
|
150
|
-
throw error;
|
|
151
|
-
}
|
|
152
|
-
device.clearInternalState();
|
|
153
|
-
if (options?.recoverInvalidSession === false) {
|
|
154
|
-
throw error;
|
|
155
|
-
}
|
|
156
|
-
recoveryFailed = true;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
if (!response) {
|
|
161
|
-
const promptPayload: PassphraseRequestPayload = {
|
|
162
|
-
source: 'wallet-session-coordinator',
|
|
163
|
-
reason: recoveryFailed ? 'session-recovery' : 'open-wallet',
|
|
164
|
-
expectedPassphraseState,
|
|
165
|
-
existsAttachPinUser: device.features?.attachToPinEnabled === true,
|
|
166
|
-
};
|
|
167
|
-
response = await openSelectedHiddenWallet(device, promptPayload);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
const { message } = response;
|
|
171
|
-
try {
|
|
172
|
-
assertCompleteDeviceSession(message);
|
|
173
|
-
} catch (error) {
|
|
174
|
-
device.clearInternalState();
|
|
175
|
-
throw error;
|
|
176
|
-
}
|
|
177
|
-
if (expectedPassphraseState && expectedPassphraseState !== message.btc_test_address) {
|
|
178
|
-
device.clearInternalState();
|
|
179
|
-
throw ERRORS.TypedError(HardwareErrorCode.DeviceCheckPassphraseStateError);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
device.updateInternalState(
|
|
183
|
-
true,
|
|
184
|
-
message.btc_test_address,
|
|
185
|
-
device.getCurrentDeviceId(),
|
|
186
|
-
message.session_id,
|
|
187
|
-
options?.initSession ? null : device.features?.sessionId ?? null
|
|
188
|
-
);
|
|
189
|
-
|
|
190
|
-
return {
|
|
191
|
-
passphraseState: message.btc_test_address,
|
|
192
|
-
newSession: message.session_id,
|
|
193
|
-
unlockedAttachPin: device.features?.unlockedAttachPin ?? undefined,
|
|
194
|
-
resumed,
|
|
195
|
-
};
|
|
196
|
-
} catch (error) {
|
|
197
|
-
if (isProtocolV2InvalidSessionError(error)) {
|
|
198
|
-
device.clearInternalState();
|
|
199
|
-
}
|
|
200
|
-
throw error;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
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;
|
|
@@ -1,52 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
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;
|
|
@@ -1,19 +0,0 @@
|
|
|
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,54 +0,0 @@
|
|
|
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>;
|
|
@@ -1,244 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
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>;
|