@onekeyfe/hd-core 1.1.27-alpha.4 → 1.1.27-alpha.40
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__/evmSignTransaction.test.ts +1 -1
- package/__tests__/evmSignTypedData.test.ts +1 -1
- package/__tests__/protocol-v2.test.ts +1661 -0
- package/dist/api/BaseMethod.d.ts +1 -7
- package/dist/api/BaseMethod.d.ts.map +1 -1
- 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 +23 -0
- package/dist/api/FileWrite.d.ts.map +1 -0
- package/dist/api/FirmwareUpdateV3.d.ts +1 -0
- package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV4.d.ts +32 -0
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -0
- package/dist/api/GetDeviceInfo.d.ts +9 -0
- package/dist/api/GetDeviceInfo.d.ts.map +1 -0
- package/dist/api/GetFeatures.d.ts +1 -1
- package/dist/api/GetOnekeyFeatures.d.ts.map +1 -1
- package/dist/api/GetPassphraseState.d.ts +6 -1
- package/dist/api/GetPassphraseState.d.ts.map +1 -1
- package/dist/api/PathInfo.d.ts +9 -0
- package/dist/api/PathInfo.d.ts.map +1 -0
- package/dist/api/SearchDevices.d.ts +2 -1
- package/dist/api/SearchDevices.d.ts.map +1 -1
- 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 +2 -5
- package/dist/api/alephium/AlephiumSignTransaction.d.ts.map +1 -1
- package/dist/api/algo/AlgoSignTransaction.d.ts.map +1 -1
- package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
- package/dist/api/aptos/AptosSignInMessage.d.ts.map +1 -1
- package/dist/api/aptos/AptosSignMessage.d.ts.map +1 -1
- package/dist/api/aptos/AptosSignTransaction.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/CardanoSignMessage.d.ts.map +1 -1
- package/dist/api/cardano/CardanoSignTransaction.d.ts.map +1 -1
- package/dist/api/conflux/ConfluxSignMessage.d.ts.map +1 -1
- package/dist/api/conflux/ConfluxSignMessageCIP23.d.ts.map +1 -1
- package/dist/api/conflux/ConfluxSignTransaction.d.ts.map +1 -1
- package/dist/api/cosmos/CosmosSignTransaction.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/dynex/DnxGetAddress.d.ts.map +1 -1
- package/dist/api/dynex/DnxSignTransaction.d.ts.map +1 -1
- package/dist/api/evm/EVMSignMessage.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/EVMSignTransaction.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/legacyV1/signTypedData.d.ts +1 -1
- package/dist/api/evm/legacyV1/signTypedData.d.ts.map +1 -1
- package/dist/api/filecoin/FilecoinSignTransaction.d.ts.map +1 -1
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +10 -2
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
- package/dist/api/helpers/deviceInfo.d.ts +15 -0
- package/dist/api/helpers/deviceInfo.d.ts.map +1 -0
- package/dist/api/helpers/filesystemValidation.d.ts +7 -0
- package/dist/api/helpers/filesystemValidation.d.ts.map +1 -0
- package/dist/api/index.d.ts +28 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/kaspa/KaspaSignTransaction.d.ts.map +1 -1
- package/dist/api/near/NearSignTransaction.d.ts.map +1 -1
- package/dist/api/nem/NEMSignTransaction.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 +2 -9
- 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/nostr/NostrSignEvent.d.ts.map +1 -1
- package/dist/api/nostr/NostrSignSchnorr.d.ts.map +1 -1
- package/dist/api/polkadot/PolkadotSignTransaction.d.ts.map +1 -1
- 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/DeviceGetDeviceInfo.d.ts +7 -0
- package/dist/api/protocol-v2/DeviceGetDeviceInfo.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts +6 -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/DeviceReboot.d.ts +7 -0
- package/dist/api/protocol-v2/DeviceReboot.d.ts.map +1 -0
- package/dist/api/protocol-v2/FactoryDeviceInfoSettings.d.ts +7 -0
- package/dist/api/protocol-v2/FactoryDeviceInfoSettings.d.ts.map +1 -0
- package/dist/api/protocol-v2/FactoryGetDeviceInfo.d.ts +6 -0
- package/dist/api/protocol-v2/FactoryGetDeviceInfo.d.ts.map +1 -0
- package/dist/api/protocol-v2/FilesystemDiskControl.d.ts +10 -0
- package/dist/api/protocol-v2/FilesystemDiskControl.d.ts.map +1 -0
- package/dist/api/protocol-v2/FilesystemFixPermission.d.ts +6 -0
- package/dist/api/protocol-v2/FilesystemFixPermission.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/GetProtoVersion.d.ts +6 -0
- package/dist/api/protocol-v2/GetProtoVersion.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/helpers.d.ts +49 -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 +6 -0
- package/dist/api/solana/SolGetAddress.d.ts.map +1 -1
- package/dist/api/solana/SolSignMessage.d.ts +4 -0
- package/dist/api/solana/SolSignMessage.d.ts.map +1 -1
- package/dist/api/solana/SolSignOffchainMessage.d.ts +4 -0
- package/dist/api/solana/SolSignOffchainMessage.d.ts.map +1 -1
- package/dist/api/solana/SolSignTransaction.d.ts +8 -0
- package/dist/api/solana/SolSignTransaction.d.ts.map +1 -1
- package/dist/api/starcoin/StarcoinSignMessage.d.ts.map +1 -1
- package/dist/api/starcoin/StarcoinSignTransaction.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 +2 -1
- package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -1
- package/dist/api/sui/SuiSignMessage.d.ts.map +1 -1
- package/dist/api/sui/SuiSignTransaction.d.ts +2 -2
- package/dist/api/sui/SuiSignTransaction.d.ts.map +1 -1
- package/dist/api/ton/TonSignData.d.ts.map +1 -1
- package/dist/api/ton/TonSignMessage.d.ts.map +1 -1
- package/dist/api/ton/TonSignProof.d.ts.map +1 -1
- package/dist/api/tron/TronGetAddress.d.ts +4 -0
- package/dist/api/tron/TronGetAddress.d.ts.map +1 -1
- package/dist/api/tron/TronSignMessage.d.ts +4 -0
- package/dist/api/tron/TronSignMessage.d.ts.map +1 -1
- package/dist/api/tron/TronSignTransaction.d.ts +4 -0
- package/dist/api/tron/TronSignTransaction.d.ts.map +1 -1
- package/dist/api/xrp/XrpSignTransaction.d.ts.map +1 -1
- package/dist/core/RequestQueue.d.ts +1 -1
- package/dist/core/RequestQueue.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/data-manager/DataManager.d.ts +7 -4
- 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/device/Device.d.ts +5 -18
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DeviceCommands.d.ts +8 -8
- 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/events/ui-request.d.ts +8 -0
- package/dist/events/ui-request.d.ts.map +1 -1
- package/dist/index.d.ts +292 -43
- package/dist/index.js +16693 -1497
- package/dist/inject.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/features.d.ts +104 -0
- package/dist/protocols/protocol-v2/features.d.ts.map +1 -0
- package/dist/protocols/protocol-v2/firmware.d.ts +12 -0
- package/dist/protocols/protocol-v2/firmware.d.ts.map +1 -0
- package/dist/protocols/protocol-v2/index.d.ts +3 -0
- package/dist/protocols/protocol-v2/index.d.ts.map +1 -0
- package/dist/types/api/export.d.ts +1 -1
- package/dist/types/api/export.d.ts.map +1 -1
- package/dist/types/api/firmwareUpdate.d.ts +7 -0
- package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
- package/dist/types/api/getDeviceInfo.d.ts +84 -0
- package/dist/types/api/getDeviceInfo.d.ts.map +1 -0
- package/dist/types/api/getPassphraseState.d.ts +10 -1
- package/dist/types/api/getPassphraseState.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +33 -3
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/protocolV2.d.ts +127 -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/device.d.ts +6 -2
- package/dist/types/device.d.ts.map +1 -1
- package/dist/types/params.d.ts +2 -1
- package/dist/types/params.d.ts.map +1 -1
- package/dist/types/settings.d.ts +1 -1
- package/dist/types/settings.d.ts.map +1 -1
- package/dist/utils/deviceFeaturesUtils.d.ts +5 -3
- package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
- package/dist/utils/deviceInfoUtils.d.ts +1 -0
- package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -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/versionUtils.d.ts +1 -1
- package/package.json +4 -4
- package/src/api/BaseMethod.ts +7 -82
- package/src/api/DirList.ts +29 -0
- package/src/api/DirMake.ts +21 -0
- package/src/api/DirRemove.ts +21 -0
- package/src/api/FileDelete.ts +21 -0
- package/src/api/FileRead.ts +165 -0
- package/src/api/FileWrite.ts +203 -0
- package/src/api/FirmwareUpdateV3.ts +21 -4
- package/src/api/FirmwareUpdateV4.ts +810 -0
- package/src/api/GetDeviceInfo.ts +161 -0
- package/src/api/GetOnekeyFeatures.ts +75 -3
- package/src/api/GetPassphraseState.ts +16 -7
- package/src/api/PathInfo.ts +25 -0
- package/src/api/SearchDevices.ts +7 -2
- package/src/api/alephium/AlephiumGetAddress.ts +6 -2
- package/src/api/alephium/AlephiumSignMessage.ts +6 -2
- package/src/api/alephium/AlephiumSignTransaction.ts +6 -3
- package/src/api/algo/AlgoSignTransaction.ts +0 -1
- package/src/api/allnetwork/AllNetworkGetAddressBase.ts +18 -9
- package/src/api/aptos/AptosSignInMessage.ts +0 -1
- package/src/api/aptos/AptosSignMessage.ts +0 -1
- package/src/api/aptos/AptosSignTransaction.ts +0 -1
- package/src/api/benfen/BenfenGetAddress.ts +6 -2
- package/src/api/benfen/BenfenGetPublicKey.ts +6 -2
- package/src/api/benfen/BenfenSignMessage.ts +6 -2
- package/src/api/benfen/BenfenSignTransaction.ts +6 -2
- package/src/api/btc/BTCSignMessage.ts +0 -1
- package/src/api/btc/BTCSignPsbt.ts +0 -1
- package/src/api/btc/BTCSignTransaction.ts +0 -1
- package/src/api/btc/helpers/versionLimit.ts +7 -1
- package/src/api/cardano/CardanoSignMessage.ts +0 -1
- package/src/api/cardano/CardanoSignTransaction.ts +0 -1
- package/src/api/conflux/ConfluxSignMessage.ts +0 -1
- package/src/api/conflux/ConfluxSignMessageCIP23.ts +0 -1
- package/src/api/conflux/ConfluxSignTransaction.ts +5 -3
- package/src/api/cosmos/CosmosSignTransaction.ts +0 -1
- package/src/api/device/DeviceRebootToBoardloader.ts +10 -1
- package/src/api/device/DeviceRebootToBootloader.ts +10 -1
- package/src/api/dynex/DnxGetAddress.ts +7 -0
- package/src/api/dynex/DnxSignTransaction.ts +7 -1
- package/src/api/evm/EVMGetAddress.ts +1 -1
- package/src/api/evm/EVMGetPublicKey.ts +1 -1
- package/src/api/evm/EVMSignMessage.ts +1 -3
- package/src/api/evm/EVMSignMessageEIP712.ts +14 -2
- package/src/api/evm/EVMSignTransaction.ts +1 -3
- package/src/api/evm/EVMSignTypedData.ts +6 -8
- package/src/api/evm/EVMVerifyMessage.ts +1 -1
- package/src/api/filecoin/FilecoinSignTransaction.ts +0 -1
- package/src/api/firmware/FirmwareUpdateBaseMethod.ts +27 -4
- package/src/api/helpers/deviceInfo.ts +205 -0
- package/src/api/helpers/filesystemValidation.ts +51 -0
- package/src/api/index.ts +30 -1
- package/src/api/kaspa/KaspaSignTransaction.ts +0 -1
- package/src/api/near/NearSignTransaction.ts +0 -1
- package/src/api/nem/NEMSignTransaction.ts +0 -1
- package/src/api/neo/NeoGetAddress.ts +6 -1
- package/src/api/neo/NeoSignTransaction.ts +6 -2
- package/src/api/nervos/NervosGetAddress.ts +6 -2
- package/src/api/nervos/NervosSignTransaction.ts +6 -3
- package/src/api/nexa/NexaGetAddress.ts +6 -2
- package/src/api/nexa/NexaSignTransaction.ts +6 -4
- package/src/api/nostr/NostrSignEvent.ts +0 -1
- package/src/api/nostr/NostrSignSchnorr.ts +0 -1
- package/src/api/polkadot/PolkadotSignTransaction.ts +0 -1
- package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +50 -0
- package/src/api/protocol-v2/DeviceGetDeviceInfo.ts +35 -0
- package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +18 -0
- package/src/api/protocol-v2/DeviceGetOnboardingStatus.ts +18 -0
- package/src/api/protocol-v2/DeviceReboot.ts +22 -0
- package/src/api/protocol-v2/FactoryDeviceInfoSettings.ts +27 -0
- package/src/api/protocol-v2/FactoryGetDeviceInfo.ts +18 -0
- package/src/api/protocol-v2/FilesystemDiskControl.ts +34 -0
- package/src/api/protocol-v2/FilesystemFixPermission.ts +14 -0
- package/src/api/protocol-v2/FilesystemFormat.ts +14 -0
- package/src/api/protocol-v2/GetProtoVersion.ts +14 -0
- package/src/api/protocol-v2/Ping.ts +16 -0
- package/src/api/protocol-v2/helpers.ts +161 -0
- package/src/api/scdo/ScdoGetAddress.ts +6 -2
- package/src/api/scdo/ScdoSignMessage.ts +6 -2
- package/src/api/scdo/ScdoSignTransaction.ts +6 -3
- package/src/api/solana/SolGetAddress.ts +9 -0
- package/src/api/solana/SolSignMessage.ts +4 -1
- package/src/api/solana/SolSignOffchainMessage.ts +4 -1
- package/src/api/solana/SolSignTransaction.ts +8 -1
- package/src/api/starcoin/StarcoinSignMessage.ts +0 -1
- package/src/api/starcoin/StarcoinSignTransaction.ts +0 -1
- package/src/api/stellar/StellarGetAddress.ts +10 -1
- package/src/api/stellar/StellarSignTransaction.ts +14 -2
- package/src/api/sui/SuiSignMessage.ts +0 -1
- package/src/api/sui/SuiSignTransaction.ts +12 -10
- package/src/api/ton/TonSignData.ts +0 -1
- package/src/api/ton/TonSignMessage.ts +0 -1
- package/src/api/ton/TonSignProof.ts +0 -1
- package/src/api/tron/TronGetAddress.ts +4 -0
- package/src/api/tron/TronSignMessage.ts +5 -2
- package/src/api/tron/TronSignTransaction.ts +4 -1
- package/src/api/xrp/XrpSignTransaction.ts +1 -2
- package/src/core/RequestQueue.ts +3 -10
- package/src/core/index.ts +62 -153
- package/src/data/messages/messages-protocol-v2.json +13128 -0
- package/src/data-manager/DataManager.ts +12 -7
- package/src/data-manager/MessagesConfig.ts +14 -14
- package/src/data-manager/TransportManager.ts +38 -12
- package/src/device/Device.ts +88 -77
- package/src/device/DeviceCommands.ts +166 -26
- package/src/device/DeviceConnector.ts +29 -4
- package/src/device/DevicePool.ts +1 -1
- package/src/events/ui-request.ts +8 -0
- package/src/inject.ts +46 -2
- package/src/protocols/protocol-v2/features.ts +287 -0
- package/src/protocols/protocol-v2/firmware.ts +26 -0
- package/src/protocols/protocol-v2/index.ts +2 -0
- package/src/types/api/export.ts +1 -0
- package/src/types/api/firmwareUpdate.ts +12 -0
- package/src/types/api/getDeviceInfo.ts +97 -0
- package/src/types/api/getPassphraseState.ts +13 -2
- package/src/types/api/index.ts +80 -3
- package/src/types/api/protocolV2.ts +226 -0
- package/src/types/api/searchDevices.ts +2 -2
- package/src/types/device.ts +33 -2
- package/src/types/params.ts +4 -2
- package/src/types/settings.ts +1 -1
- package/src/utils/deviceFeaturesUtils.ts +62 -21
- package/src/utils/deviceInfoUtils.ts +15 -8
- package/src/utils/index.ts +1 -0
- package/__tests__/DeviceCommands.test.ts +0 -99
- package/__tests__/evmLedgerLegacySafety.test.ts +0 -261
- package/__tests__/preInitialize.test.ts +0 -22
- package/dist/api/device/PreInitialize.d.ts +0 -6
- package/dist/api/device/PreInitialize.d.ts.map +0 -1
- package/dist/core/PollingStateManager.d.ts +0 -8
- package/dist/core/PollingStateManager.d.ts.map +0 -1
- package/dist/types/api/preInitialize.d.ts +0 -3
- package/dist/types/api/preInitialize.d.ts.map +0 -1
- package/src/api/device/PreInitialize.ts +0 -41
- package/src/core/PollingStateManager.ts +0 -47
- package/src/types/api/preInitialize.ts +0 -3
package/src/core/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import semver from 'semver';
|
|
2
2
|
import EventEmitter from 'events';
|
|
3
3
|
import {
|
|
4
|
+
EDeviceType,
|
|
4
5
|
ERRORS,
|
|
5
6
|
ERROR_CODES_REQUIRE_RELEASE,
|
|
6
7
|
HardwareError,
|
|
@@ -19,9 +20,11 @@ import {
|
|
|
19
20
|
enableLog,
|
|
20
21
|
getDeviceBLEFirmwareVersion,
|
|
21
22
|
getDeviceFirmwareVersion,
|
|
23
|
+
getDeviceType,
|
|
22
24
|
getFirmwareType,
|
|
23
25
|
getLogger,
|
|
24
26
|
getMethodVersionRange,
|
|
27
|
+
isMethodVersionRangeUnsupported,
|
|
25
28
|
setLoggerPostMessage,
|
|
26
29
|
wait,
|
|
27
30
|
} from '../utils';
|
|
@@ -42,7 +45,6 @@ import {
|
|
|
42
45
|
import { Device } from '../device/Device';
|
|
43
46
|
import { DeviceList } from '../device/DeviceList';
|
|
44
47
|
import { DevicePool } from '../device/DevicePool';
|
|
45
|
-
import { PollingStateManager } from './PollingStateManager';
|
|
46
48
|
import { findMethod } from '../api/utils';
|
|
47
49
|
import { DataManager } from '../data-manager';
|
|
48
50
|
import { UI_REQUEST as UI_REQUEST_CONST } from '../constants/ui-request';
|
|
@@ -74,12 +76,6 @@ import type {
|
|
|
74
76
|
import type { BaseMethod } from '../api/BaseMethod';
|
|
75
77
|
|
|
76
78
|
const Log = getLogger(LoggerNames.Core);
|
|
77
|
-
const PRE_INITIALIZE_TTL_MS = 60 * 1000;
|
|
78
|
-
|
|
79
|
-
// Dedup/coalesce state for "pre-warm signal" methods (isPreWarmSignal),
|
|
80
|
-
// keyed by getPreWarmKey(): coalesce in-flight, skip if warmed within TTL.
|
|
81
|
-
const preWarmInflight = new Map<string, Promise<any>>();
|
|
82
|
-
const preWarmDoneAt = new Map<string, number>();
|
|
83
79
|
|
|
84
80
|
export type CoreContext = ReturnType<Core['getCoreContext']>;
|
|
85
81
|
|
|
@@ -102,6 +98,7 @@ const parseInitOptions = (method?: BaseMethod): InitOptions => ({
|
|
|
102
98
|
passphraseState: method?.payload.passphraseState,
|
|
103
99
|
deviceId: method?.payload.deviceId,
|
|
104
100
|
deriveCardano: method && hasDeriveCardano(method),
|
|
101
|
+
connectProtocol: method?.payload.connectProtocol,
|
|
105
102
|
});
|
|
106
103
|
|
|
107
104
|
let _core: Core;
|
|
@@ -110,7 +107,8 @@ let _connector: DeviceConnector | undefined;
|
|
|
110
107
|
let _uiPromises: UiPromise<UiPromiseResponse['type']>[] = []; // Waiting for ui response
|
|
111
108
|
|
|
112
109
|
const deviceCacheMap = new Map<string, Device>();
|
|
113
|
-
|
|
110
|
+
let pollingId = 1;
|
|
111
|
+
const pollingState: Record<number, boolean> = {};
|
|
114
112
|
|
|
115
113
|
let preConnectCache: {
|
|
116
114
|
passphraseState: string | undefined;
|
|
@@ -212,63 +210,9 @@ export const callAPI = async (context: CoreContext, message: CoreMessage) => {
|
|
|
212
210
|
return createResponseMessage(method.responseID, false, { error });
|
|
213
211
|
}
|
|
214
212
|
|
|
215
|
-
// only the pre-warm signal (PreInitialize) forks here; normal methods fall
|
|
216
|
-
// through to onCallDevice below, so the pre-warm dedup/guards never touch them
|
|
217
|
-
if (method.isPreWarmSignal) {
|
|
218
|
-
return handlePreWarmSignal(context, message, method);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
213
|
return onCallDevice(context, message, method);
|
|
222
214
|
};
|
|
223
215
|
|
|
224
|
-
// Wrapper for "pre-warm signal" methods: coalesce in-flight same-key pre-warm,
|
|
225
|
-
// skip if warmed within TTL, else run + track. The "hang up so the next real
|
|
226
|
-
// call waits" part lives in onCallDevice (setPrePendingCallPromise).
|
|
227
|
-
const handlePreWarmSignal = async (
|
|
228
|
-
context: CoreContext,
|
|
229
|
-
message: CoreMessage,
|
|
230
|
-
method: BaseMethod
|
|
231
|
-
): Promise<any> => {
|
|
232
|
-
// no connectId: can't target a device safely, skip pre-warm (ack only)
|
|
233
|
-
if (!method.connectId) {
|
|
234
|
-
return createResponseMessage(method.responseID, true, true);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
const key = method.getPreWarmKey();
|
|
238
|
-
|
|
239
|
-
const inflight = preWarmInflight.get(key);
|
|
240
|
-
if (inflight) {
|
|
241
|
-
// reply with THIS call's responseID (not the other call's response object)
|
|
242
|
-
try {
|
|
243
|
-
await inflight;
|
|
244
|
-
} catch {
|
|
245
|
-
// pre-warm is best-effort; ignore its failure for the coalesced caller
|
|
246
|
-
}
|
|
247
|
-
return createResponseMessage(method.responseID, true, true);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
const doneAt = preWarmDoneAt.get(key);
|
|
251
|
-
if (typeof doneAt === 'number' && Date.now() - doneAt <= method.preWarmTtl) {
|
|
252
|
-
return createResponseMessage(method.responseID, true, true);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
const run = onCallDevice(context, message, method);
|
|
256
|
-
preWarmInflight.set(key, run);
|
|
257
|
-
try {
|
|
258
|
-
const result = await run;
|
|
259
|
-
// Only remember the warm if it actually succeeded — a failed pre-warm must
|
|
260
|
-
// not suppress the next pre-warm within the TTL.
|
|
261
|
-
if (result?.success === true && result?.payload === true) {
|
|
262
|
-
preWarmDoneAt.set(key, Date.now());
|
|
263
|
-
}
|
|
264
|
-
return result;
|
|
265
|
-
} finally {
|
|
266
|
-
if (preWarmInflight.get(key) === run) {
|
|
267
|
-
preWarmInflight.delete(key);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
|
|
272
216
|
const waitWithTimeout = async (promise: Promise<any>, timeout: number) => {
|
|
273
217
|
const timeoutPromise = new Promise((_, reject) => {
|
|
274
218
|
setTimeout(() => reject(new Error('Request timeout')), timeout);
|
|
@@ -304,15 +248,7 @@ const onCallDevice = async (
|
|
|
304
248
|
|
|
305
249
|
updateMethodRequestContext(method, { status: 'running' });
|
|
306
250
|
|
|
307
|
-
|
|
308
|
-
// passphrase". Without this, the first call (preConnectCache starts undefined)
|
|
309
|
-
// or any '' call after a non-'' one is wrongly treated as a passphrase switch
|
|
310
|
-
// and needlessly clears the device cache -> forces a re-enumeration Initialize.
|
|
311
|
-
// A real switch ('' <-> 'stateX', or 'stateX' <-> 'stateY') still differs.
|
|
312
|
-
const normalizePassphraseState = (s?: string | null) => s || '';
|
|
313
|
-
const connectStateChange =
|
|
314
|
-
normalizePassphraseState(preConnectCache.passphraseState) !==
|
|
315
|
-
normalizePassphraseState(method.payload.passphraseState);
|
|
251
|
+
const connectStateChange = preConnectCache.passphraseState !== method.payload.passphraseState;
|
|
316
252
|
|
|
317
253
|
preConnectCache = {
|
|
318
254
|
passphraseState: method.payload.passphraseState,
|
|
@@ -332,31 +268,18 @@ const onCallDevice = async (
|
|
|
332
268
|
|
|
333
269
|
const task = requestQueue.createTask(method);
|
|
334
270
|
|
|
335
|
-
// Pre-warm holds the device as a per-connectId callback task so a concurrent
|
|
336
|
-
// real call waits (before ensureConnected) instead of racing its Initialize.
|
|
337
|
-
// Only covers pre-warm -> real-call ordering; the reverse is fail-closed.
|
|
338
|
-
let preWarmCallbackTask: Deferred<void> | undefined;
|
|
339
|
-
if (method.isPreWarmSignal && method.connectId) {
|
|
340
|
-
preWarmCallbackTask = createDeferred<void>();
|
|
341
|
-
context.registerCallbackTask(method.connectId, preWarmCallbackTask);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
271
|
let device: Device;
|
|
345
272
|
try {
|
|
346
273
|
/**
|
|
347
274
|
* Polling to ensure successful connection
|
|
348
275
|
*/
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
pollingId,
|
|
356
|
-
task.abortController?.signal
|
|
357
|
-
);
|
|
276
|
+
if (pollingState[pollingId]) {
|
|
277
|
+
pollingState[pollingId] = false;
|
|
278
|
+
}
|
|
279
|
+
pollingId += 1;
|
|
280
|
+
|
|
281
|
+
device = await ensureConnected(context, method, pollingId, task.abortController?.signal);
|
|
358
282
|
} catch (e) {
|
|
359
|
-
preWarmCallbackTask?.resolve();
|
|
360
283
|
console.log('ensureConnected error: ', e);
|
|
361
284
|
|
|
362
285
|
completeMethodRequestContext(method, e);
|
|
@@ -372,7 +295,6 @@ const onCallDevice = async (
|
|
|
372
295
|
}
|
|
373
296
|
|
|
374
297
|
if (method.payload?.onlyConnectBleDevice) {
|
|
375
|
-
preWarmCallbackTask?.resolve();
|
|
376
298
|
Log.debug('Call API - only connect ble device: ', device?.mainId);
|
|
377
299
|
return createResponseMessage(method.responseID, true, null);
|
|
378
300
|
}
|
|
@@ -412,9 +334,8 @@ const onCallDevice = async (
|
|
|
412
334
|
);
|
|
413
335
|
|
|
414
336
|
try {
|
|
415
|
-
// Wait for any pending task except our own (self-wait would deadlock).
|
|
416
337
|
if (method.connectId) {
|
|
417
|
-
await context.waitForCallbackTasks(method.connectId
|
|
338
|
+
await context.waitForCallbackTasks(method.connectId);
|
|
418
339
|
}
|
|
419
340
|
|
|
420
341
|
await waitForPendingPromise(getPrePendingCallPromise, setPrePendingCallPromise);
|
|
@@ -475,6 +396,10 @@ const onCallDevice = async (
|
|
|
475
396
|
);
|
|
476
397
|
}
|
|
477
398
|
|
|
399
|
+
if (isMethodVersionRangeUnsupported(versionRange)) {
|
|
400
|
+
throw createDeviceNotSupportMethodError(method.name, getFirmwareType(device.features));
|
|
401
|
+
}
|
|
402
|
+
|
|
478
403
|
if (versionRange) {
|
|
479
404
|
if (
|
|
480
405
|
semver.valid(versionRange.min) &&
|
|
@@ -554,7 +479,7 @@ const onCallDevice = async (
|
|
|
554
479
|
// Check to see if it is safe to use Passphrase
|
|
555
480
|
checkPassphraseEnableState(method, device.features);
|
|
556
481
|
|
|
557
|
-
if (
|
|
482
|
+
if (shouldCheckPassphraseState(method, device)) {
|
|
558
483
|
// check version
|
|
559
484
|
const support = supportNewPassphrase(device.features);
|
|
560
485
|
if (!support.support) {
|
|
@@ -608,6 +533,7 @@ const onCallDevice = async (
|
|
|
608
533
|
|
|
609
534
|
try {
|
|
610
535
|
const response: object = await method.run();
|
|
536
|
+
Log.debug('Call API - Inner Method Run: ');
|
|
611
537
|
messageResponse = createResponseMessage(method.responseID, true, response);
|
|
612
538
|
requestQueue.resolveRequest(method.responseID, messageResponse);
|
|
613
539
|
completeMethodRequestContext(method);
|
|
@@ -630,7 +556,6 @@ const onCallDevice = async (
|
|
|
630
556
|
|
|
631
557
|
const runOptions: RunOptions = {
|
|
632
558
|
keepSession: method.payload.keepSession,
|
|
633
|
-
skipInitialize: canSkipInitialize(method, device),
|
|
634
559
|
...parseInitOptions(method),
|
|
635
560
|
};
|
|
636
561
|
const deviceRun = () => device.run(inner, runOptions);
|
|
@@ -652,9 +577,6 @@ const onCallDevice = async (
|
|
|
652
577
|
Log.debug('Call API - Run Error: ', error);
|
|
653
578
|
completeMethodRequestContext(method, error);
|
|
654
579
|
} finally {
|
|
655
|
-
// Release the pre-warm callback task so the next real call can proceed.
|
|
656
|
-
preWarmCallbackTask?.resolve();
|
|
657
|
-
|
|
658
580
|
const response = messageResponse;
|
|
659
581
|
|
|
660
582
|
if (response) {
|
|
@@ -734,6 +656,7 @@ function initDevice(method: BaseMethod) {
|
|
|
734
656
|
} else if (allDevices.length > 1) {
|
|
735
657
|
throw ERRORS.TypedError(
|
|
736
658
|
[
|
|
659
|
+
'firmwareUpdateV4',
|
|
737
660
|
'firmwareUpdateV3',
|
|
738
661
|
'firmwareUpdateV2',
|
|
739
662
|
'checkFirmwareRelease',
|
|
@@ -784,59 +707,38 @@ function initDeviceForBle(method: BaseMethod) {
|
|
|
784
707
|
}
|
|
785
708
|
|
|
786
709
|
/**
|
|
787
|
-
*
|
|
710
|
+
* If the Bluetooth connection times out, retry 6 times
|
|
788
711
|
*/
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
// device must have been initialized before (has features)
|
|
800
|
-
if (!device.features) reasons.push('features.missing');
|
|
801
|
-
// within pre-initialize TTL
|
|
802
|
-
if (!device.isPreInitializedValid(PRE_INITIALIZE_TTL_MS)) reasons.push('ttl.expired');
|
|
803
|
-
|
|
804
|
-
if (reasons.length) {
|
|
805
|
-
Log.debug(`[PRE-INIT][MISS] method=${method.name} ${reasons.join(',')}`);
|
|
806
|
-
return false;
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
const savedMs = device.getLastInitializeDuration();
|
|
810
|
-
const saved = typeof savedMs === 'number' ? `saved ${savedMs}ms` : 'within TTL + meta match';
|
|
811
|
-
Log.debug(`[PRE-INIT][HIT] method=${method.name} skip Initialize (${saved})`);
|
|
812
|
-
|
|
813
|
-
return true;
|
|
712
|
+
let bleTimeoutRetry = 0;
|
|
713
|
+
|
|
714
|
+
function isRetryableBleProtocolV2ProbeError(method: BaseMethod, error: unknown) {
|
|
715
|
+
const message = error instanceof Error ? error.message : String(error ?? '');
|
|
716
|
+
return (
|
|
717
|
+
method.payload.connectProtocol === 'V2' &&
|
|
718
|
+
message.includes('Device protocol mismatch') &&
|
|
719
|
+
message.includes('expected V2') &&
|
|
720
|
+
message.includes('did not respond to expected protocol')
|
|
721
|
+
);
|
|
814
722
|
}
|
|
815
723
|
|
|
816
|
-
|
|
817
|
-
* If the Bluetooth connection times out, retry up to 6 times
|
|
818
|
-
* @param retryCount - Current retry count (default 0)
|
|
819
|
-
*/
|
|
820
|
-
async function connectDeviceForBle(method: BaseMethod, device: Device, retryCount = 0) {
|
|
724
|
+
async function connectDeviceForBle(method: BaseMethod, device: Device) {
|
|
821
725
|
try {
|
|
822
|
-
await device.acquire();
|
|
726
|
+
await device.acquire(method.payload.connectProtocol);
|
|
823
727
|
if (method.payload?.onlyConnectBleDevice) {
|
|
824
728
|
return;
|
|
825
729
|
}
|
|
826
|
-
|
|
827
|
-
if (!canSkipInitialize(method, device)) {
|
|
828
|
-
const initOptions = parseInitOptions(method);
|
|
829
|
-
await device.initialize(initOptions);
|
|
830
|
-
device.markPreInitialized({
|
|
831
|
-
passphraseState: initOptions.passphraseState,
|
|
832
|
-
});
|
|
833
|
-
}
|
|
730
|
+
await device.initialize(parseInitOptions(method));
|
|
834
731
|
} catch (err) {
|
|
835
|
-
if (
|
|
836
|
-
|
|
837
|
-
|
|
732
|
+
if (
|
|
733
|
+
(err.errorCode === HardwareErrorCode.BleTimeoutError ||
|
|
734
|
+
err.errorCode === HardwareErrorCode.BleConnectedError ||
|
|
735
|
+
isRetryableBleProtocolV2ProbeError(method, err)) &&
|
|
736
|
+
bleTimeoutRetry <= 5
|
|
737
|
+
) {
|
|
738
|
+
bleTimeoutRetry += 1;
|
|
739
|
+
Log.debug(`Bletooth connect timeout and will retry, retry count: ${bleTimeoutRetry}`);
|
|
838
740
|
await wait(3000);
|
|
839
|
-
await connectDeviceForBle(method, device
|
|
741
|
+
await connectDeviceForBle(method, device);
|
|
840
742
|
} else {
|
|
841
743
|
throw err;
|
|
842
744
|
}
|
|
@@ -848,7 +750,6 @@ type IPollFn<T> = (time?: number) => T;
|
|
|
848
750
|
const ensureConnected = async (
|
|
849
751
|
_context: CoreContext,
|
|
850
752
|
method: BaseMethod,
|
|
851
|
-
connectId: string,
|
|
852
753
|
pollingId: number,
|
|
853
754
|
abortSignal?: AbortSignal
|
|
854
755
|
) => {
|
|
@@ -880,7 +781,7 @@ const ensureConnected = async (
|
|
|
880
781
|
return;
|
|
881
782
|
}
|
|
882
783
|
|
|
883
|
-
if (!
|
|
784
|
+
if (!pollingState[pollingId]) {
|
|
884
785
|
Log.debug('EnsureConnected function stop, polling id: ', pollingId);
|
|
885
786
|
reject(ERRORS.TypedError(HardwareErrorCode.PollingStop));
|
|
886
787
|
return;
|
|
@@ -938,6 +839,8 @@ const ensureConnected = async (
|
|
|
938
839
|
* Bluetooth should call initialize here
|
|
939
840
|
*/
|
|
940
841
|
if (DataManager.isBleConnect(env)) {
|
|
842
|
+
bleTimeoutRetry = 0;
|
|
843
|
+
|
|
941
844
|
if (abort()) {
|
|
942
845
|
return;
|
|
943
846
|
}
|
|
@@ -1000,7 +903,7 @@ const ensureConnected = async (
|
|
|
1000
903
|
// eslint-disable-next-line no-promise-executor-return
|
|
1001
904
|
return setTimeout(() => resolve(poll(time * 1.5)), time);
|
|
1002
905
|
});
|
|
1003
|
-
|
|
906
|
+
pollingState[pollingId] = true;
|
|
1004
907
|
return poll();
|
|
1005
908
|
};
|
|
1006
909
|
|
|
@@ -1109,6 +1012,16 @@ const checkPassphraseEnableState = (method: BaseMethod, features?: Features) =>
|
|
|
1109
1012
|
}
|
|
1110
1013
|
};
|
|
1111
1014
|
|
|
1015
|
+
const shouldCheckPassphraseState = (method: BaseMethod, device: Device) => {
|
|
1016
|
+
if (!method.useDevicePassphraseState) return false;
|
|
1017
|
+
|
|
1018
|
+
const isPro2 = getDeviceType(device.features) === EDeviceType.Pro2;
|
|
1019
|
+
const pro2ExplicitWalletSelection =
|
|
1020
|
+
isPro2 && (!!method.payload?.passphraseState || !!method.payload?.useEmptyPassphrase);
|
|
1021
|
+
|
|
1022
|
+
return device.hasUsePassphrase() || pro2ExplicitWalletSelection;
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1112
1025
|
const cleanup = () => {
|
|
1113
1026
|
_uiPromises = [];
|
|
1114
1027
|
Log.debug('Cleanup...');
|
|
@@ -1134,7 +1047,6 @@ const onDeviceConnectHandler = (device: Device) => {
|
|
|
1134
1047
|
};
|
|
1135
1048
|
|
|
1136
1049
|
const onDeviceDisconnectHandler = (device: Device) => {
|
|
1137
|
-
device.clearPreInitialized();
|
|
1138
1050
|
const env = DataManager.getSettings('env');
|
|
1139
1051
|
const deviceObject = DataManager.isBleConnect(env) ? device : device.toMessageObject();
|
|
1140
1052
|
postMessage(createDeviceMessage(DEVICE.DISCONNECT, { device: deviceObject as KnownDevice }));
|
|
@@ -1311,8 +1223,8 @@ export default class Core extends EventEmitter {
|
|
|
1311
1223
|
registerCallbackTask: (connectId: string, callbackPromise: Deferred<any>) => {
|
|
1312
1224
|
this.requestQueue.registerPendingCallbackTask(connectId, callbackPromise);
|
|
1313
1225
|
},
|
|
1314
|
-
waitForCallbackTasks: (connectId: string
|
|
1315
|
-
this.requestQueue.waitForPendingCallbackTasks(connectId
|
|
1226
|
+
waitForCallbackTasks: (connectId: string) =>
|
|
1227
|
+
this.requestQueue.waitForPendingCallbackTasks(connectId),
|
|
1316
1228
|
cancelCallbackTasks: (connectId: string) => this.requestQueue.cancelCallbackTasks(connectId),
|
|
1317
1229
|
};
|
|
1318
1230
|
}
|
|
@@ -1343,10 +1255,10 @@ export default class Core extends EventEmitter {
|
|
|
1343
1255
|
}
|
|
1344
1256
|
|
|
1345
1257
|
case IFRAME.CALL: {
|
|
1346
|
-
Log.log(
|
|
1258
|
+
Log.log('call API: ', message);
|
|
1347
1259
|
const response = await callAPI(this.getCoreContext(), message);
|
|
1348
1260
|
const { success, payload } = response;
|
|
1349
|
-
Log.log(
|
|
1261
|
+
Log.log('call API Response: ', response);
|
|
1350
1262
|
if (success) {
|
|
1351
1263
|
return response;
|
|
1352
1264
|
}
|
|
@@ -1379,9 +1291,6 @@ export default class Core extends EventEmitter {
|
|
|
1379
1291
|
dispose() {
|
|
1380
1292
|
_deviceList = undefined;
|
|
1381
1293
|
_connector = undefined;
|
|
1382
|
-
deviceCacheMap.clear();
|
|
1383
|
-
preWarmInflight.clear();
|
|
1384
|
-
preWarmDoneAt.clear();
|
|
1385
1294
|
Log.debug(`[Core] Disposing SDK instance: ${this.sdkInstanceId}`);
|
|
1386
1295
|
cleanupSdkInstance(this.sdkInstanceId);
|
|
1387
1296
|
}
|