@onekeyfe/hd-core 1.2.0-alpha.24 → 1.2.0-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/AllNetworkGetAddressBase.tracing.test.ts +2 -0
- package/__tests__/chain-params-onekey-compatibility.test.ts +229 -0
- package/__tests__/connectSettings.test.ts +47 -5
- package/__tests__/device-state-events.test.ts +124 -0
- package/__tests__/evmLedgerLegacySafety.test.ts +3 -1
- package/__tests__/firmware-update/check-all-firmware-release.test.ts +127 -0
- package/__tests__/firmware-update/firmware-artifact-source.test.ts +119 -0
- package/__tests__/firmware-update/firmware-host-binding.test.ts +70 -0
- package/__tests__/firmware-update/firmware-update-capabilities.test.ts +13 -0
- package/__tests__/firmware-update/firmware-update-plan.test.ts +354 -0
- package/__tests__/firmware-update/firmware-update-prepared-plan.test.ts +213 -0
- package/__tests__/firmware-update/firmware-update-v2-download-before-boot.test.ts +39 -30
- package/__tests__/firmware-update/firmware-upload-source.test.ts +70 -0
- package/__tests__/kaspa-public-types.type-test.ts +16 -0
- package/__tests__/kaspaSignTransaction.test.ts +4 -3
- package/__tests__/method-protocol-support.test.ts +113 -0
- package/__tests__/protocol-v2.test.ts +400 -123
- package/__tests__/public-device-state-api.test.ts +10 -8
- package/__tests__/tron-sign-message-init.test.ts +74 -0
- package/dist/api/BaseMethod.d.ts +6 -2
- package/dist/api/BaseMethod.d.ts.map +1 -1
- package/dist/api/CheckAllFirmwareRelease.d.ts.map +1 -1
- package/dist/api/CipherKeyValue.d.ts +1 -0
- package/dist/api/CipherKeyValue.d.ts.map +1 -1
- package/dist/api/DirList.d.ts +1 -0
- package/dist/api/DirList.d.ts.map +1 -1
- package/dist/api/DirMake.d.ts +1 -0
- package/dist/api/DirMake.d.ts.map +1 -1
- package/dist/api/DirRemove.d.ts +1 -0
- package/dist/api/DirRemove.d.ts.map +1 -1
- package/dist/api/FileDelete.d.ts +1 -0
- package/dist/api/FileDelete.d.ts.map +1 -1
- package/dist/api/FileRead.d.ts +1 -0
- package/dist/api/FileRead.d.ts.map +1 -1
- package/dist/api/FileWrite.d.ts +1 -0
- package/dist/api/FileWrite.d.ts.map +1 -1
- package/dist/api/FirmwareUpdate.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV2.d.ts +11 -0
- package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV3.d.ts +7 -3
- package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
- package/dist/api/FirmwareUpdateV4.d.ts +23 -5
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/GetDeviceState.d.ts +1 -0
- package/dist/api/GetDeviceState.d.ts.map +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 +1 -0
- package/dist/api/GetPassphraseState.d.ts.map +1 -1
- package/dist/api/OpenWalletSession.d.ts +1 -0
- package/dist/api/OpenWalletSession.d.ts.map +1 -1
- package/dist/api/PathInfo.d.ts +1 -0
- package/dist/api/PathInfo.d.ts.map +1 -1
- package/dist/api/alephium/AlephiumGetAddress.d.ts.map +1 -1
- package/dist/api/alephium/AlephiumSignMessage.d.ts.map +1 -1
- package/dist/api/alephium/AlephiumSignTransaction.d.ts.map +1 -1
- package/dist/api/algo/AlgoGetAddress.d.ts +1 -0
- package/dist/api/algo/AlgoGetAddress.d.ts.map +1 -1
- package/dist/api/algo/AlgoSignTransaction.d.ts +1 -0
- package/dist/api/algo/AlgoSignTransaction.d.ts.map +1 -1
- package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts +1 -0
- package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
- package/dist/api/aptos/AptosGetAddress.d.ts +1 -0
- package/dist/api/aptos/AptosGetAddress.d.ts.map +1 -1
- package/dist/api/aptos/AptosGetPublicKey.d.ts +1 -0
- package/dist/api/aptos/AptosGetPublicKey.d.ts.map +1 -1
- package/dist/api/aptos/AptosSignInMessage.d.ts +1 -0
- package/dist/api/aptos/AptosSignInMessage.d.ts.map +1 -1
- package/dist/api/aptos/AptosSignMessage.d.ts +1 -0
- package/dist/api/aptos/AptosSignMessage.d.ts.map +1 -1
- package/dist/api/aptos/AptosSignTransaction.d.ts +1 -0
- package/dist/api/aptos/AptosSignTransaction.d.ts.map +1 -1
- package/dist/api/benfen/BenfenGetAddress.d.ts.map +1 -1
- package/dist/api/benfen/BenfenGetPublicKey.d.ts.map +1 -1
- package/dist/api/benfen/BenfenSignMessage.d.ts.map +1 -1
- package/dist/api/benfen/BenfenSignTransaction.d.ts.map +1 -1
- package/dist/api/btc/BTCGetAddress.d.ts +1 -0
- package/dist/api/btc/BTCGetAddress.d.ts.map +1 -1
- package/dist/api/btc/BTCGetPublicKey.d.ts +1 -0
- package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
- package/dist/api/btc/BTCSignMessage.d.ts +1 -0
- package/dist/api/btc/BTCSignMessage.d.ts.map +1 -1
- package/dist/api/btc/BTCSignPsbt.d.ts +1 -0
- package/dist/api/btc/BTCSignPsbt.d.ts.map +1 -1
- package/dist/api/btc/BTCSignTransaction.d.ts +1 -0
- package/dist/api/btc/BTCSignTransaction.d.ts.map +1 -1
- package/dist/api/btc/BTCVerifyMessage.d.ts +1 -0
- package/dist/api/btc/BTCVerifyMessage.d.ts.map +1 -1
- package/dist/api/btc/helpers/versionLimit.d.ts +2 -0
- package/dist/api/btc/helpers/versionLimit.d.ts.map +1 -1
- package/dist/api/cardano/CardanoGetAddress.d.ts +1 -0
- package/dist/api/cardano/CardanoGetAddress.d.ts.map +1 -1
- package/dist/api/cardano/CardanoGetPublicKey.d.ts +1 -0
- package/dist/api/cardano/CardanoGetPublicKey.d.ts.map +1 -1
- package/dist/api/cardano/CardanoSignMessage.d.ts +1 -0
- package/dist/api/cardano/CardanoSignMessage.d.ts.map +1 -1
- package/dist/api/cardano/CardanoSignTransaction.d.ts +1 -0
- package/dist/api/cardano/CardanoSignTransaction.d.ts.map +1 -1
- package/dist/api/conflux/ConfluxGetAddress.d.ts +1 -0
- package/dist/api/conflux/ConfluxGetAddress.d.ts.map +1 -1
- package/dist/api/conflux/ConfluxSignMessage.d.ts +1 -0
- package/dist/api/conflux/ConfluxSignMessage.d.ts.map +1 -1
- package/dist/api/conflux/ConfluxSignMessageCIP23.d.ts +1 -0
- package/dist/api/conflux/ConfluxSignMessageCIP23.d.ts.map +1 -1
- package/dist/api/conflux/ConfluxSignTransaction.d.ts +1 -0
- package/dist/api/conflux/ConfluxSignTransaction.d.ts.map +1 -1
- package/dist/api/cosmos/CosmosGetAddress.d.ts +1 -0
- package/dist/api/cosmos/CosmosGetAddress.d.ts.map +1 -1
- package/dist/api/cosmos/CosmosGetPublicKey.d.ts +1 -0
- package/dist/api/cosmos/CosmosGetPublicKey.d.ts.map +1 -1
- package/dist/api/cosmos/CosmosSignTransaction.d.ts +1 -0
- package/dist/api/cosmos/CosmosSignTransaction.d.ts.map +1 -1
- package/dist/api/device/DeviceCancel.d.ts +1 -0
- package/dist/api/device/DeviceCancel.d.ts.map +1 -1
- package/dist/api/device/DeviceChangePin.d.ts +1 -0
- package/dist/api/device/DeviceChangePin.d.ts.map +1 -1
- package/dist/api/device/DeviceLock.d.ts +1 -0
- package/dist/api/device/DeviceLock.d.ts.map +1 -1
- package/dist/api/device/DeviceRebootToBoardloader.d.ts +1 -0
- package/dist/api/device/DeviceRebootToBoardloader.d.ts.map +1 -1
- package/dist/api/device/DeviceRebootToBootloader.d.ts +1 -0
- package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -1
- package/dist/api/device/DeviceSettings.d.ts +1 -0
- package/dist/api/device/DeviceSettings.d.ts.map +1 -1
- package/dist/api/device/DeviceSupportFeatures.d.ts +1 -0
- package/dist/api/device/DeviceSupportFeatures.d.ts.map +1 -1
- package/dist/api/device/DeviceUnlock.d.ts +1 -0
- package/dist/api/device/DeviceUnlock.d.ts.map +1 -1
- package/dist/api/device/DeviceUpdateBootloader.d.ts +5 -1
- package/dist/api/device/DeviceUpdateBootloader.d.ts.map +1 -1
- package/dist/api/device/DeviceWipe.d.ts +1 -0
- package/dist/api/device/DeviceWipe.d.ts.map +1 -1
- package/dist/api/device/PreInitialize.d.ts +1 -0
- package/dist/api/device/PreInitialize.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/EVMGetAddress.d.ts +1 -0
- package/dist/api/evm/EVMGetAddress.d.ts.map +1 -1
- package/dist/api/evm/EVMGetPublicKey.d.ts +1 -0
- package/dist/api/evm/EVMGetPublicKey.d.ts.map +1 -1
- package/dist/api/evm/EVMSignMessage.d.ts +1 -0
- package/dist/api/evm/EVMSignMessage.d.ts.map +1 -1
- package/dist/api/evm/EVMSignMessageEIP712.d.ts.map +1 -1
- package/dist/api/evm/EVMSignTransaction.d.ts +1 -0
- package/dist/api/evm/EVMSignTransaction.d.ts.map +1 -1
- package/dist/api/evm/EVMSignTypedData.d.ts +1 -0
- package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
- package/dist/api/evm/EVMVerifyMessage.d.ts +1 -0
- package/dist/api/evm/EVMVerifyMessage.d.ts.map +1 -1
- package/dist/api/filecoin/FilecoinGetAddress.d.ts +1 -0
- package/dist/api/filecoin/FilecoinGetAddress.d.ts.map +1 -1
- package/dist/api/filecoin/FilecoinSignTransaction.d.ts +1 -0
- package/dist/api/filecoin/FilecoinSignTransaction.d.ts.map +1 -1
- package/dist/api/firmware/FirmwareArtifactSource.d.ts +25 -0
- package/dist/api/firmware/FirmwareArtifactSource.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareHostBinding.d.ts +6 -0
- package/dist/api/firmware/FirmwareHostBinding.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +7 -0
- package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
- package/dist/api/firmware/FirmwareUpdateCapabilities.d.ts +3 -0
- package/dist/api/firmware/FirmwareUpdateCapabilities.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareUpdatePlan.d.ts +23 -0
- package/dist/api/firmware/FirmwareUpdatePlan.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareUpdatePreparedPlan.d.ts +30 -0
- package/dist/api/firmware/FirmwareUpdatePreparedPlan.d.ts.map +1 -0
- package/dist/api/firmware/getBinary.d.ts +7 -0
- package/dist/api/firmware/getBinary.d.ts.map +1 -1
- package/dist/api/firmware/updateBootloader.d.ts +2 -0
- package/dist/api/firmware/updateBootloader.d.ts.map +1 -1
- package/dist/api/firmware/uploadFirmware.d.ts +9 -1
- package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
- package/dist/api/kaspa/KaspaGetAddress.d.ts +1 -0
- package/dist/api/kaspa/KaspaGetAddress.d.ts.map +1 -1
- package/dist/api/kaspa/KaspaSignTransaction.d.ts +1 -0
- package/dist/api/kaspa/KaspaSignTransaction.d.ts.map +1 -1
- package/dist/api/kaspa/helpers/TransferSerialize.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/near/NearGetAddress.d.ts +1 -0
- package/dist/api/near/NearGetAddress.d.ts.map +1 -1
- package/dist/api/near/NearSignTransaction.d.ts +1 -0
- package/dist/api/near/NearSignTransaction.d.ts.map +1 -1
- package/dist/api/nem/NEMGetAddress.d.ts +1 -0
- package/dist/api/nem/NEMGetAddress.d.ts.map +1 -1
- package/dist/api/nem/NEMSignTransaction.d.ts +1 -0
- package/dist/api/nem/NEMSignTransaction.d.ts.map +1 -1
- package/dist/api/neo/NeoGetAddress.d.ts.map +1 -1
- package/dist/api/neo/NeoSignTransaction.d.ts.map +1 -1
- package/dist/api/nervos/NervosGetAddress.d.ts.map +1 -1
- package/dist/api/nervos/NervosSignTransaction.d.ts.map +1 -1
- package/dist/api/nexa/NexaGetAddress.d.ts.map +1 -1
- package/dist/api/nexa/NexaSignTransaction.d.ts.map +1 -1
- package/dist/api/nostr/NostrDecryptMessage.d.ts +1 -0
- package/dist/api/nostr/NostrDecryptMessage.d.ts.map +1 -1
- package/dist/api/nostr/NostrEncryptMessage.d.ts +1 -0
- package/dist/api/nostr/NostrEncryptMessage.d.ts.map +1 -1
- package/dist/api/nostr/NostrGetPublicKey.d.ts +1 -0
- package/dist/api/nostr/NostrGetPublicKey.d.ts.map +1 -1
- package/dist/api/nostr/NostrSignEvent.d.ts +1 -0
- package/dist/api/nostr/NostrSignEvent.d.ts.map +1 -1
- package/dist/api/nostr/NostrSignSchnorr.d.ts +1 -0
- package/dist/api/nostr/NostrSignSchnorr.d.ts.map +1 -1
- package/dist/api/polkadot/PolkadotGetAddress.d.ts +1 -0
- package/dist/api/polkadot/PolkadotGetAddress.d.ts.map +1 -1
- package/dist/api/polkadot/PolkadotSignTransaction.d.ts +1 -0
- package/dist/api/polkadot/PolkadotSignTransaction.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts +1 -0
- package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts +1 -0
- package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts +1 -0
- package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts +1 -0
- package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts +1 -0
- package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceInfoGet.d.ts +1 -0
- package/dist/api/protocol-v2/DeviceInfoGet.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceReboot.d.ts +1 -0
- package/dist/api/protocol-v2/DeviceReboot.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceStatusGet.d.ts +1 -0
- package/dist/api/protocol-v2/DeviceStatusGet.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts +1 -0
- package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts.map +1 -1
- package/dist/api/protocol-v2/FilesystemFormat.d.ts +1 -0
- package/dist/api/protocol-v2/FilesystemFormat.d.ts.map +1 -1
- package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts +1 -0
- package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts.map +1 -1
- package/dist/api/protocol-v2/Ping.d.ts +1 -0
- package/dist/api/protocol-v2/Ping.d.ts.map +1 -1
- package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts +1 -0
- package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts.map +1 -1
- package/dist/api/scdo/ScdoGetAddress.d.ts.map +1 -1
- package/dist/api/scdo/ScdoSignMessage.d.ts.map +1 -1
- package/dist/api/scdo/ScdoSignTransaction.d.ts.map +1 -1
- package/dist/api/solana/SolGetAddress.d.ts +1 -0
- package/dist/api/solana/SolGetAddress.d.ts.map +1 -1
- package/dist/api/solana/SolSignMessage.d.ts +1 -0
- package/dist/api/solana/SolSignMessage.d.ts.map +1 -1
- package/dist/api/solana/SolSignOffchainMessage.d.ts +1 -0
- package/dist/api/solana/SolSignOffchainMessage.d.ts.map +1 -1
- package/dist/api/solana/SolSignTransaction.d.ts +1 -0
- package/dist/api/solana/SolSignTransaction.d.ts.map +1 -1
- package/dist/api/starcoin/StarcoinGetAddress.d.ts +1 -0
- package/dist/api/starcoin/StarcoinGetAddress.d.ts.map +1 -1
- package/dist/api/starcoin/StarcoinGetPublicKey.d.ts +1 -0
- package/dist/api/starcoin/StarcoinGetPublicKey.d.ts.map +1 -1
- package/dist/api/starcoin/StarcoinSignMessage.d.ts +1 -0
- package/dist/api/starcoin/StarcoinSignMessage.d.ts.map +1 -1
- package/dist/api/starcoin/StarcoinSignTransaction.d.ts +1 -0
- package/dist/api/starcoin/StarcoinSignTransaction.d.ts.map +1 -1
- package/dist/api/starcoin/StarcoinVerifyMessage.d.ts +1 -0
- package/dist/api/starcoin/StarcoinVerifyMessage.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 +1 -0
- package/dist/api/sui/SuiGetAddress.d.ts.map +1 -1
- package/dist/api/sui/SuiGetPublicKey.d.ts +1 -0
- package/dist/api/sui/SuiGetPublicKey.d.ts.map +1 -1
- package/dist/api/sui/SuiSignMessage.d.ts +1 -0
- package/dist/api/sui/SuiSignMessage.d.ts.map +1 -1
- package/dist/api/sui/SuiSignTransaction.d.ts +1 -0
- package/dist/api/sui/SuiSignTransaction.d.ts.map +1 -1
- package/dist/api/ton/TonGetAddress.d.ts +1 -0
- package/dist/api/ton/TonGetAddress.d.ts.map +1 -1
- package/dist/api/ton/TonSignData.d.ts +1 -0
- package/dist/api/ton/TonSignData.d.ts.map +1 -1
- package/dist/api/ton/TonSignMessage.d.ts +1 -0
- package/dist/api/ton/TonSignMessage.d.ts.map +1 -1
- package/dist/api/ton/TonSignProof.d.ts +1 -0
- package/dist/api/ton/TonSignProof.d.ts.map +1 -1
- package/dist/api/tron/TronGetAddress.d.ts +1 -0
- package/dist/api/tron/TronGetAddress.d.ts.map +1 -1
- package/dist/api/tron/TronSignMessage.d.ts +5 -0
- package/dist/api/tron/TronSignMessage.d.ts.map +1 -1
- package/dist/api/tron/TronSignTransaction.d.ts +1 -0
- package/dist/api/tron/TronSignTransaction.d.ts.map +1 -1
- package/dist/api/xrp/XrpGetAddress.d.ts +1 -0
- package/dist/api/xrp/XrpGetAddress.d.ts.map +1 -1
- package/dist/api/xrp/XrpSignTransaction.d.ts +1 -0
- package/dist/api/xrp/XrpSignTransaction.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/data-manager/DataManager.d.ts +1 -0
- package/dist/data-manager/DataManager.d.ts.map +1 -1
- package/dist/data-manager/connectSettings.d.ts.map +1 -1
- package/dist/device/Device.d.ts +3 -1
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/index.d.ts +271 -87
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2864 -893
- package/dist/inject.d.ts.map +1 -1
- package/dist/lowLevelInject.d.ts.map +1 -1
- package/dist/protocols/protocol-v2/unlockRetry.d.ts.map +1 -1
- package/dist/topLevelInject.d.ts.map +1 -1
- package/dist/types/api/checkAllFirmwareRelease.d.ts +3 -0
- package/dist/types/api/checkAllFirmwareRelease.d.ts.map +1 -1
- package/dist/types/api/deviceUpdateBootloader.d.ts +6 -0
- package/dist/types/api/deviceUpdateBootloader.d.ts.map +1 -1
- package/dist/types/api/export.d.ts +5 -2
- package/dist/types/api/export.d.ts.map +1 -1
- package/dist/types/api/firmwareUpdate.d.ts +69 -0
- package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
- package/dist/types/api/firmwareUpdateCapabilities.d.ts +9 -0
- package/dist/types/api/firmwareUpdateCapabilities.d.ts.map +1 -0
- package/dist/types/api/firmwareUpdatePlan.d.ts +27 -0
- package/dist/types/api/firmwareUpdatePlan.d.ts.map +1 -0
- package/dist/types/api/firmwareUpdatePreparedPlan.d.ts +42 -0
- package/dist/types/api/firmwareUpdatePreparedPlan.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +9 -1
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/kaspaSignTransaction.d.ts +15 -2
- package/dist/types/api/kaspaSignTransaction.d.ts.map +1 -1
- package/dist/types/device.d.ts +0 -1
- package/dist/types/device.d.ts.map +1 -1
- package/dist/types/settings.d.ts +13 -0
- package/dist/types/settings.d.ts.map +1 -1
- package/dist/utils/deviceInfoUtils.d.ts +0 -1
- package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
- package/dist/utils/deviceVersionUtils.d.ts +1 -0
- package/dist/utils/deviceVersionUtils.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/BaseMethod.ts +21 -18
- package/src/api/CheckAllFirmwareRelease.ts +44 -4
- package/src/api/CipherKeyValue.ts +4 -0
- package/src/api/DirList.ts +4 -1
- package/src/api/DirMake.ts +4 -1
- package/src/api/DirRemove.ts +4 -1
- package/src/api/FileDelete.ts +4 -1
- package/src/api/FileRead.ts +4 -1
- package/src/api/FileWrite.ts +4 -1
- package/src/api/FirmwareUpdate.ts +0 -8
- package/src/api/FirmwareUpdateV2.ts +292 -120
- package/src/api/FirmwareUpdateV3.ts +256 -61
- package/src/api/FirmwareUpdateV4.ts +767 -289
- package/src/api/GetDeviceState.ts +4 -0
- package/src/api/GetFeatures.ts +1 -4
- package/src/api/GetOnekeyFeatures.ts +0 -5
- package/src/api/GetPassphraseState.ts +4 -0
- package/src/api/OpenWalletSession.ts +4 -0
- package/src/api/PathInfo.ts +4 -1
- package/src/api/UploadPortfolio.ts +1 -1
- package/src/api/alephium/AlephiumGetAddress.ts +0 -4
- package/src/api/alephium/AlephiumSignMessage.ts +0 -4
- package/src/api/alephium/AlephiumSignTransaction.ts +0 -4
- package/src/api/algo/AlgoGetAddress.ts +4 -0
- package/src/api/algo/AlgoSignTransaction.ts +4 -0
- package/src/api/allnetwork/AllNetworkGetAddressBase.ts +5 -13
- package/src/api/aptos/AptosGetAddress.ts +4 -0
- package/src/api/aptos/AptosGetPublicKey.ts +4 -0
- package/src/api/aptos/AptosSignInMessage.ts +4 -0
- package/src/api/aptos/AptosSignMessage.ts +4 -0
- package/src/api/aptos/AptosSignTransaction.ts +4 -0
- package/src/api/benfen/BenfenGetAddress.ts +11 -7
- package/src/api/benfen/BenfenGetPublicKey.ts +0 -4
- package/src/api/benfen/BenfenSignMessage.ts +0 -4
- package/src/api/benfen/BenfenSignTransaction.ts +0 -4
- package/src/api/btc/BTCGetAddress.ts +8 -1
- package/src/api/btc/BTCGetPublicKey.ts +8 -1
- package/src/api/btc/BTCSignMessage.ts +8 -1
- package/src/api/btc/BTCSignPsbt.ts +4 -0
- package/src/api/btc/BTCSignTransaction.ts +8 -1
- package/src/api/btc/BTCVerifyMessage.ts +8 -1
- package/src/api/btc/helpers/versionLimit.ts +7 -4
- package/src/api/cardano/CardanoGetAddress.ts +4 -0
- package/src/api/cardano/CardanoGetPublicKey.ts +4 -0
- package/src/api/cardano/CardanoSignMessage.ts +4 -0
- package/src/api/cardano/CardanoSignTransaction.ts +4 -0
- package/src/api/conflux/ConfluxGetAddress.ts +4 -0
- package/src/api/conflux/ConfluxSignMessage.ts +4 -0
- package/src/api/conflux/ConfluxSignMessageCIP23.ts +4 -0
- package/src/api/conflux/ConfluxSignTransaction.ts +6 -5
- package/src/api/cosmos/CosmosGetAddress.ts +4 -0
- package/src/api/cosmos/CosmosGetPublicKey.ts +4 -0
- package/src/api/cosmos/CosmosSignTransaction.ts +4 -0
- package/src/api/device/DeviceCancel.ts +4 -0
- package/src/api/device/DeviceChangePin.ts +4 -0
- package/src/api/device/DeviceLock.ts +4 -0
- package/src/api/device/DeviceRebootToBoardloader.ts +4 -0
- package/src/api/device/DeviceRebootToBootloader.ts +4 -0
- package/src/api/device/DeviceSettings.ts +4 -0
- package/src/api/device/DeviceSupportFeatures.ts +4 -0
- package/src/api/device/DeviceUnlock.ts +4 -0
- package/src/api/device/DeviceUpdateBootloader.ts +122 -6
- package/src/api/device/DeviceWipe.ts +4 -0
- package/src/api/device/PreInitialize.ts +4 -0
- package/src/api/dynex/DnxGetAddress.ts +0 -6
- package/src/api/dynex/DnxSignTransaction.ts +0 -6
- package/src/api/evm/EVMGetAddress.ts +4 -0
- package/src/api/evm/EVMGetPublicKey.ts +4 -0
- package/src/api/evm/EVMSignMessage.ts +4 -0
- package/src/api/evm/EVMSignMessageEIP712.ts +1 -11
- package/src/api/evm/EVMSignTransaction.ts +4 -0
- package/src/api/evm/EVMSignTypedData.ts +4 -0
- package/src/api/evm/EVMVerifyMessage.ts +4 -0
- package/src/api/filecoin/FilecoinGetAddress.ts +4 -0
- package/src/api/filecoin/FilecoinSignTransaction.ts +4 -0
- package/src/api/firmware/FirmwareArtifactSource.ts +278 -0
- package/src/api/firmware/FirmwareHostBinding.ts +100 -0
- package/src/api/firmware/FirmwareUpdateBaseMethod.ts +50 -0
- package/src/api/firmware/FirmwareUpdateCapabilities.ts +9 -0
- package/src/api/firmware/FirmwareUpdatePlan.ts +628 -0
- package/src/api/firmware/FirmwareUpdatePreparedPlan.ts +392 -0
- package/src/api/firmware/updateBootloader.ts +19 -4
- package/src/api/firmware/uploadFirmware.ts +140 -22
- package/src/api/kaspa/KaspaGetAddress.ts +4 -0
- package/src/api/kaspa/KaspaSignTransaction.ts +37 -15
- package/src/api/kaspa/helpers/TransferSerialize.ts +3 -7
- package/src/api/lightning/LnurlAuth.ts +0 -4
- package/src/api/near/NearGetAddress.ts +4 -0
- package/src/api/near/NearSignTransaction.ts +4 -0
- package/src/api/nem/NEMGetAddress.ts +4 -0
- package/src/api/nem/NEMSignTransaction.ts +4 -0
- package/src/api/neo/NeoGetAddress.ts +0 -4
- package/src/api/neo/NeoSignTransaction.ts +0 -4
- package/src/api/nervos/NervosGetAddress.ts +0 -4
- package/src/api/nervos/NervosSignTransaction.ts +0 -4
- package/src/api/nexa/NexaGetAddress.ts +0 -4
- package/src/api/nexa/NexaSignTransaction.ts +0 -4
- package/src/api/nostr/NostrDecryptMessage.ts +4 -0
- package/src/api/nostr/NostrEncryptMessage.ts +4 -0
- package/src/api/nostr/NostrGetPublicKey.ts +4 -0
- package/src/api/nostr/NostrSignEvent.ts +4 -0
- package/src/api/nostr/NostrSignSchnorr.ts +4 -0
- package/src/api/polkadot/PolkadotGetAddress.ts +4 -0
- package/src/api/polkadot/PolkadotSignTransaction.ts +4 -0
- package/src/api/protocol-v2/DeviceFactoryInfoGet.ts +4 -1
- package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +4 -1
- package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +4 -1
- package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +4 -1
- package/src/api/protocol-v2/DeviceGetOnboardingStatus.ts +4 -1
- package/src/api/protocol-v2/DeviceInfoGet.ts +4 -8
- package/src/api/protocol-v2/DeviceReboot.ts +4 -2
- package/src/api/protocol-v2/DeviceStatusGet.ts +4 -1
- package/src/api/protocol-v2/DeviceUploadWallpaper.ts +4 -1
- package/src/api/protocol-v2/FilesystemFormat.ts +4 -1
- package/src/api/protocol-v2/FilesystemPermissionFix.ts +4 -1
- package/src/api/protocol-v2/Ping.ts +4 -1
- package/src/api/protocol-v2/ProtocolInfoRequest.ts +4 -1
- package/src/api/scdo/ScdoGetAddress.ts +0 -4
- package/src/api/scdo/ScdoSignMessage.ts +0 -4
- package/src/api/scdo/ScdoSignTransaction.ts +0 -4
- package/src/api/solana/SolGetAddress.ts +4 -0
- package/src/api/solana/SolSignMessage.ts +4 -0
- package/src/api/solana/SolSignOffchainMessage.ts +4 -0
- package/src/api/solana/SolSignTransaction.ts +4 -0
- package/src/api/starcoin/StarcoinGetAddress.ts +4 -0
- package/src/api/starcoin/StarcoinGetPublicKey.ts +4 -0
- package/src/api/starcoin/StarcoinSignMessage.ts +4 -0
- package/src/api/starcoin/StarcoinSignTransaction.ts +4 -0
- package/src/api/starcoin/StarcoinVerifyMessage.ts +4 -0
- package/src/api/stellar/StellarGetAddress.ts +1 -10
- package/src/api/stellar/StellarSignTransaction.ts +1 -14
- package/src/api/sui/SuiGetAddress.ts +4 -0
- package/src/api/sui/SuiGetPublicKey.ts +4 -0
- package/src/api/sui/SuiSignMessage.ts +4 -0
- package/src/api/sui/SuiSignTransaction.ts +4 -0
- package/src/api/ton/TonGetAddress.ts +4 -0
- package/src/api/ton/TonSignData.ts +5 -1
- package/src/api/ton/TonSignMessage.ts +4 -0
- package/src/api/ton/TonSignProof.ts +4 -0
- package/src/api/tron/TronGetAddress.ts +4 -0
- package/src/api/tron/TronSignMessage.ts +18 -7
- package/src/api/tron/TronSignTransaction.ts +4 -0
- package/src/api/xrp/XrpGetAddress.ts +4 -0
- package/src/api/xrp/XrpSignTransaction.ts +5 -1
- package/src/core/index.ts +4 -17
- package/src/data-manager/DataManager.ts +33 -33
- package/src/data-manager/connectSettings.ts +11 -0
- package/src/device/Device.ts +53 -53
- package/src/index.ts +5 -0
- package/src/inject.ts +22 -2
- package/src/lowLevelInject.ts +5 -1
- package/src/protocols/protocol-v2/unlockRetry.ts +18 -11
- package/src/topLevelInject.ts +5 -1
- package/src/types/api/checkAllFirmwareRelease.ts +3 -0
- package/src/types/api/deviceUpdateBootloader.ts +6 -0
- package/src/types/api/export.ts +20 -0
- package/src/types/api/firmwareUpdate.ts +76 -0
- package/src/types/api/firmwareUpdateCapabilities.ts +9 -0
- package/src/types/api/firmwareUpdatePlan.ts +36 -0
- package/src/types/api/firmwareUpdatePreparedPlan.ts +53 -0
- package/src/types/api/index.ts +14 -0
- package/src/types/api/kaspaSignTransaction.ts +20 -2
- package/src/types/device.ts +0 -1
- package/src/types/settings.ts +13 -0
- package/src/utils/deviceInfoUtils.ts +0 -3
- package/src/utils/deviceVersionUtils.ts +1 -1
- package/src/utils/index.ts +0 -1
- package/tsconfig.type-tests.json +8 -0
|
@@ -3,6 +3,10 @@ import { BaseMethod } from '../BaseMethod';
|
|
|
3
3
|
import type { Cancel } from '@onekeyfe/hd-transport';
|
|
4
4
|
|
|
5
5
|
export default class DeviceCancel extends BaseMethod<Cancel> {
|
|
6
|
+
getSupportedProtocols() {
|
|
7
|
+
return ['V1', 'V2'] as const;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
init() {
|
|
7
11
|
this.useDevicePassphraseState = false;
|
|
8
12
|
this.unlockPolicy = 'none';
|
|
@@ -7,6 +7,10 @@ import { invalidParameter } from '../helpers/filesystemValidation';
|
|
|
7
7
|
import type { ChangePin } from '@onekeyfe/hd-transport';
|
|
8
8
|
|
|
9
9
|
export default class DeviceChangePin extends BaseMethod<ChangePin> {
|
|
10
|
+
getSupportedProtocols() {
|
|
11
|
+
return ['V1', 'V2'] as const;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
init() {
|
|
11
15
|
this.unlockPolicy = 'unlock-before-run';
|
|
12
16
|
this.useDevicePassphraseState = false;
|
|
@@ -3,6 +3,10 @@ import { BaseMethod } from '../BaseMethod';
|
|
|
3
3
|
import type { LockDevice } from '@onekeyfe/hd-transport';
|
|
4
4
|
|
|
5
5
|
export default class DeviceLock extends BaseMethod<LockDevice> {
|
|
6
|
+
getSupportedProtocols() {
|
|
7
|
+
return ['V1', 'V2'] as const;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
init() {
|
|
7
11
|
this.useDevicePassphraseState = false;
|
|
8
12
|
this.unlockPolicy = 'none';
|
|
@@ -6,6 +6,10 @@ import type { RebootToBoardloaderParams } from '../../types/api/deviceRebootToBo
|
|
|
6
6
|
|
|
7
7
|
// Reboot BoardLoader
|
|
8
8
|
export default class DeviceRebootToBoardloader extends BaseMethod<RebootToBoardloaderParams> {
|
|
9
|
+
getSupportedProtocols() {
|
|
10
|
+
return ['V1', 'V2'] as const;
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
init() {
|
|
10
14
|
this.useDevicePassphraseState = false;
|
|
11
15
|
this.skipForceUpdateCheck = true;
|
|
@@ -6,6 +6,10 @@ import type { RebootToBootloader } from '@onekeyfe/hd-transport';
|
|
|
6
6
|
|
|
7
7
|
// Reboot BootLoader
|
|
8
8
|
export default class DeviceRebootToBootloader extends BaseMethod<RebootToBootloader> {
|
|
9
|
+
getSupportedProtocols() {
|
|
10
|
+
return ['V1', 'V2'] as const;
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
init() {
|
|
10
14
|
this.useDevicePassphraseState = false;
|
|
11
15
|
this.skipForceUpdateCheck = true;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { BaseMethod } from '../BaseMethod';
|
|
2
2
|
|
|
3
3
|
export default class DeviceSupportFeatures extends BaseMethod {
|
|
4
|
+
getSupportedProtocols() {
|
|
5
|
+
return ['V1', 'V2'] as const;
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
init() {
|
|
5
9
|
this.useDevicePassphraseState = false;
|
|
6
10
|
this.skipForceUpdateCheck = true;
|
|
@@ -3,6 +3,10 @@ import { BaseMethod } from '../BaseMethod';
|
|
|
3
3
|
import type { LockDevice } from '@onekeyfe/hd-transport';
|
|
4
4
|
|
|
5
5
|
export default class DeviceUnlock extends BaseMethod<LockDevice> {
|
|
6
|
+
getSupportedProtocols() {
|
|
7
|
+
return ['V1', 'V2'] as const;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
init() {
|
|
7
11
|
this.useDevicePassphraseState = false;
|
|
8
12
|
this.unlockPolicy = 'none';
|
|
@@ -5,15 +5,23 @@ import { UI_REQUEST } from '../../constants/ui-request';
|
|
|
5
5
|
import { FirmwareUpdateTipMessage } from '../../events/ui-request';
|
|
6
6
|
import { FirmwareUpdateBaseMethod } from '../firmware/FirmwareUpdateBaseMethod';
|
|
7
7
|
import { getSysResourceBinary } from '../firmware/getBinary';
|
|
8
|
-
import { updateBootloader } from '../firmware/uploadFirmware';
|
|
8
|
+
import { updateBootloader, updateBootloaderFromSource } from '../firmware/uploadFirmware';
|
|
9
9
|
import { DeviceModelToTypes } from '../../types';
|
|
10
10
|
import { DataManager } from '../../data-manager';
|
|
11
|
-
import { checkBootloaderLength } from '../firmware/updateBootloader';
|
|
11
|
+
import { checkBootloaderLength, checkBootloaderSourceLength } from '../firmware/updateBootloader';
|
|
12
|
+
import { openFirmwareByteSource } from '../firmware/FirmwareArtifactSource';
|
|
13
|
+
import { resolveFirmwareUpdateHostBinding } from '../firmware/FirmwareHostBinding';
|
|
14
|
+
import {
|
|
15
|
+
assertFirmwareUpdatePreparedPlanBinding,
|
|
16
|
+
assertFirmwareUpdatePreparedPlanDeviceIdentity,
|
|
17
|
+
} from '../firmware/FirmwareUpdatePreparedPlan';
|
|
18
|
+
import { getDeviceUUID } from '../../utils';
|
|
12
19
|
|
|
13
20
|
import type { DeviceUpdateBootloaderParams } from '../../types/api/deviceUpdateBootloader';
|
|
14
21
|
import type { EFirmwareType } from '@onekeyfe/hd-shared';
|
|
15
22
|
import type { Device } from '../../device/Device';
|
|
16
23
|
import type { Features } from '../../types';
|
|
24
|
+
import type { FirmwareByteSource } from '../firmware/FirmwareArtifactSource';
|
|
17
25
|
|
|
18
26
|
export default class DeviceUpdateBootloader extends FirmwareUpdateBaseMethod<any> {
|
|
19
27
|
init() {
|
|
@@ -43,17 +51,68 @@ export default class DeviceUpdateBootloader extends FirmwareUpdateBaseMethod<any
|
|
|
43
51
|
return true;
|
|
44
52
|
}
|
|
45
53
|
|
|
54
|
+
async updateBootloaderWithEmmcFileWriteFromSource(_device: Device, source: FirmwareByteSource) {
|
|
55
|
+
const filePath = '0:boot/bootloader.bin';
|
|
56
|
+
|
|
57
|
+
this.postTipMessage(FirmwareUpdateTipMessage.StartTransferData);
|
|
58
|
+
await this.emmcCommonUpdateProcessFromSource({
|
|
59
|
+
source,
|
|
60
|
+
filePath,
|
|
61
|
+
});
|
|
62
|
+
this.postTipMessage(FirmwareUpdateTipMessage.ConfirmOnDevice);
|
|
63
|
+
await this.reboot(RebootType.Normal);
|
|
64
|
+
this.postTipMessage(FirmwareUpdateTipMessage.UpdateBootloaderSuccess);
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
|
|
46
68
|
async updateTouchBootloader({
|
|
47
69
|
device,
|
|
48
70
|
features,
|
|
49
71
|
firmwareType,
|
|
72
|
+
binary: preparedBinary,
|
|
73
|
+
source: preparedSource,
|
|
50
74
|
}: {
|
|
51
75
|
device: Device;
|
|
52
76
|
features?: Features;
|
|
53
77
|
firmwareType: EFirmwareType;
|
|
78
|
+
binary?: ArrayBuffer;
|
|
79
|
+
source?: FirmwareByteSource;
|
|
54
80
|
}) {
|
|
55
|
-
|
|
81
|
+
if (preparedSource) {
|
|
82
|
+
if (!(await checkBootloaderSourceLength(preparedSource))) {
|
|
83
|
+
throw ERRORS.TypedError(HardwareErrorCode.CheckDownloadFileError);
|
|
84
|
+
}
|
|
85
|
+
if (features && device.isBootloader()) {
|
|
86
|
+
this.postTipMessage(FirmwareUpdateTipMessage.UpdateBootloader);
|
|
87
|
+
const result = await this.updateBootloaderWithEmmcFileWriteFromSource(
|
|
88
|
+
device,
|
|
89
|
+
preparedSource
|
|
90
|
+
);
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
if (features && !device.isBootloader()) {
|
|
94
|
+
await updateBootloaderFromSource(
|
|
95
|
+
this.device.getCommands().typedCall.bind(this.device.getCommands()),
|
|
96
|
+
this.postMessage,
|
|
97
|
+
device,
|
|
98
|
+
preparedSource
|
|
99
|
+
);
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
let binary = preparedBinary;
|
|
56
105
|
if (!binary) {
|
|
106
|
+
if (DataManager.getSettings('firmwareManifestMode') === 'external-only') {
|
|
107
|
+
throw ERRORS.TypedError(
|
|
108
|
+
HardwareErrorCode.RuntimeError,
|
|
109
|
+
'Bootloader must be prepared by the external firmware host',
|
|
110
|
+
{
|
|
111
|
+
firmwareUpdateCode: 'FirmwareArtifactsNotPrepared',
|
|
112
|
+
artifactName: 'bootloader',
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
57
116
|
this.postTipMessage(FirmwareUpdateTipMessage.CheckLatestUiResource);
|
|
58
117
|
const resourceUrl = features
|
|
59
118
|
? DataManager.getBootloaderResource(features, firmwareType)
|
|
@@ -68,7 +127,7 @@ export default class DeviceUpdateBootloader extends FirmwareUpdateBaseMethod<any
|
|
|
68
127
|
}
|
|
69
128
|
}
|
|
70
129
|
|
|
71
|
-
if (!checkBootloaderLength(binary)) {
|
|
130
|
+
if (!binary || !checkBootloaderLength(binary)) {
|
|
72
131
|
throw ERRORS.TypedError(HardwareErrorCode.CheckDownloadFileError);
|
|
73
132
|
}
|
|
74
133
|
|
|
@@ -76,7 +135,8 @@ export default class DeviceUpdateBootloader extends FirmwareUpdateBaseMethod<any
|
|
|
76
135
|
if (features && device.isBootloader()) {
|
|
77
136
|
// Use emmcFileWrite + reboot logic for bootloader mode
|
|
78
137
|
this.postTipMessage(FirmwareUpdateTipMessage.UpdateBootloader);
|
|
79
|
-
|
|
138
|
+
const result = await this.updateBootloaderWithEmmcFileWrite(device, binary);
|
|
139
|
+
return result;
|
|
80
140
|
}
|
|
81
141
|
|
|
82
142
|
if (features && !device.isBootloader()) {
|
|
@@ -96,13 +156,69 @@ export default class DeviceUpdateBootloader extends FirmwareUpdateBaseMethod<any
|
|
|
96
156
|
const { features } = device;
|
|
97
157
|
|
|
98
158
|
const payload = this.payload as DeviceUpdateBootloaderParams;
|
|
159
|
+
const hostBinding = payload.artifact
|
|
160
|
+
? resolveFirmwareUpdateHostBinding(payload.hostBindingGeneration)
|
|
161
|
+
: undefined;
|
|
162
|
+
const executionParams = {
|
|
163
|
+
...payload,
|
|
164
|
+
artifactReader: hostBinding?.artifactReader ?? payload.artifactReader,
|
|
165
|
+
};
|
|
166
|
+
if (payload.artifact) {
|
|
167
|
+
assertFirmwareUpdatePreparedPlanDeviceIdentity({
|
|
168
|
+
preparedPlan: payload.preparedPlan,
|
|
169
|
+
deviceIdentity: getDeviceUUID(features) || undefined,
|
|
170
|
+
});
|
|
171
|
+
assertFirmwareUpdatePreparedPlanBinding({
|
|
172
|
+
preparedPlan: payload.preparedPlan,
|
|
173
|
+
executor: 'v2',
|
|
174
|
+
scopeTargets: ['bootloader'],
|
|
175
|
+
bindings: [
|
|
176
|
+
{
|
|
177
|
+
target: 'bootloader',
|
|
178
|
+
artifact: payload.artifact,
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
});
|
|
182
|
+
const source = await openFirmwareByteSource({
|
|
183
|
+
artifact: payload.artifact,
|
|
184
|
+
reader: executionParams.artifactReader,
|
|
185
|
+
});
|
|
186
|
+
if (!source) {
|
|
187
|
+
throw ERRORS.TypedError(
|
|
188
|
+
HardwareErrorCode.RuntimeError,
|
|
189
|
+
'Bootloader artifact is not prepared'
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
try {
|
|
193
|
+
const deviceType = device.getCurrentDeviceType();
|
|
194
|
+
const deviceFirmwareType = device.getCurrentFirmwareType();
|
|
195
|
+
const firmwareType = payload.firmwareType ?? deviceFirmwareType;
|
|
196
|
+
if (DeviceModelToTypes.model_touch.includes(deviceType)) {
|
|
197
|
+
return await this.updateTouchBootloader({
|
|
198
|
+
device,
|
|
199
|
+
features,
|
|
200
|
+
firmwareType,
|
|
201
|
+
source,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return true;
|
|
205
|
+
} finally {
|
|
206
|
+
await source.close();
|
|
207
|
+
}
|
|
208
|
+
}
|
|
99
209
|
|
|
210
|
+
const { binary } = payload;
|
|
100
211
|
const deviceType = device.getCurrentDeviceType();
|
|
101
212
|
const deviceFirmwareType = device.getCurrentFirmwareType();
|
|
102
213
|
const firmwareType = payload.firmwareType ?? deviceFirmwareType;
|
|
103
214
|
|
|
104
215
|
if (DeviceModelToTypes.model_touch.includes(deviceType)) {
|
|
105
|
-
return this.updateTouchBootloader({
|
|
216
|
+
return this.updateTouchBootloader({
|
|
217
|
+
device,
|
|
218
|
+
features,
|
|
219
|
+
firmwareType,
|
|
220
|
+
binary,
|
|
221
|
+
});
|
|
106
222
|
}
|
|
107
223
|
|
|
108
224
|
return Promise.resolve(true);
|
|
@@ -5,6 +5,10 @@ import { BaseMethod } from '../BaseMethod';
|
|
|
5
5
|
import type { WipeDevice } from '@onekeyfe/hd-transport';
|
|
6
6
|
|
|
7
7
|
export default class DeviceWipe extends BaseMethod<WipeDevice> {
|
|
8
|
+
getSupportedProtocols() {
|
|
9
|
+
return ['V1', 'V2'] as const;
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
init() {
|
|
9
13
|
this.unlockPolicy = 'unlock-before-run';
|
|
10
14
|
this.useDevicePassphraseState = false;
|
|
@@ -18,6 +18,10 @@ const parseInitOptions = (payload?: {
|
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
export default class PreInitialize extends BaseMethod {
|
|
21
|
+
getSupportedProtocols() {
|
|
22
|
+
return ['V1', 'V2'] as const;
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
init() {
|
|
22
26
|
this.skipForceUpdateCheck = true;
|
|
23
27
|
this.useDevicePassphraseState = false;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { createDeviceNotSupportMethodError } from '@onekeyfe/hd-shared';
|
|
2
|
-
|
|
3
1
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
4
2
|
import { serializedPath, validatePath } from '../helpers/pathUtils';
|
|
5
3
|
import { BaseMethod } from '../BaseMethod';
|
|
@@ -49,10 +47,6 @@ export default class DnxGetAddress extends BaseMethod<HardwareDnxGetAddress[]> {
|
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
async run() {
|
|
52
|
-
if (this.device.isProtocolV2()) {
|
|
53
|
-
throw createDeviceNotSupportMethodError(this.name, this.device.getCurrentFirmwareType());
|
|
54
|
-
}
|
|
55
|
-
|
|
56
50
|
const responses: DnxAddress[] = [];
|
|
57
51
|
|
|
58
52
|
for (let i = 0; i < this.params.length; i++) {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { createDeviceNotSupportMethodError } from '@onekeyfe/hd-shared';
|
|
2
|
-
|
|
3
1
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
4
2
|
import { serializedPath, validatePath } from '../helpers/pathUtils';
|
|
5
3
|
import { BaseMethod } from '../BaseMethod';
|
|
@@ -118,10 +116,6 @@ export default class DnxSignTransaction extends BaseMethod<DnxSignTx> {
|
|
|
118
116
|
}
|
|
119
117
|
|
|
120
118
|
async run() {
|
|
121
|
-
if (this.device.isProtocolV2()) {
|
|
122
|
-
throw createDeviceNotSupportMethodError(this.name, this.device.getCurrentFirmwareType());
|
|
123
|
-
}
|
|
124
|
-
|
|
125
119
|
const typedCall = this.device.getCommands().typedCall.bind(this.device.getCommands());
|
|
126
120
|
|
|
127
121
|
const res = await this.device.commands.typedCall('DnxSignTx', 'DnxInputRequest', {
|
|
@@ -10,6 +10,10 @@ import type { EVMAddress, EVMGetAddressParams } from '../../types';
|
|
|
10
10
|
import type { EthereumGetAddressOneKey } from '@onekeyfe/hd-transport';
|
|
11
11
|
|
|
12
12
|
export default class EvmGetAddress extends BaseMethod<EthereumGetAddressOneKey[]> {
|
|
13
|
+
getSupportedProtocols() {
|
|
14
|
+
return ['V1', 'V2'] as const;
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
hasBundle = false;
|
|
14
18
|
|
|
15
19
|
init() {
|
|
@@ -11,6 +11,10 @@ import type { EVMGetPublicKeyParams, EVMPublicKey } from '../../types';
|
|
|
11
11
|
import type { EthereumGetPublicKey, EthereumGetPublicKeyOneKey } from '@onekeyfe/hd-transport';
|
|
12
12
|
|
|
13
13
|
export default class EVMGetPublicKey extends BaseMethod<EthereumGetPublicKeyOneKey[]> {
|
|
14
|
+
getSupportedProtocols() {
|
|
15
|
+
return ['V1', 'V2'] as const;
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
hasBundle = false;
|
|
15
19
|
|
|
16
20
|
confirmShowOnOneKey = false;
|
|
@@ -10,6 +10,10 @@ import signMessageLegacyV1 from './legacyV1/signMessage';
|
|
|
10
10
|
import type { EthereumSignMessageOneKey } from '@onekeyfe/hd-transport';
|
|
11
11
|
|
|
12
12
|
export default class EVMSignMessage extends BaseMethod<EthereumSignMessageOneKey> {
|
|
13
|
+
getSupportedProtocols() {
|
|
14
|
+
return ['V1', 'V2'] as const;
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
init() {
|
|
14
18
|
this.checkDeviceId = true;
|
|
15
19
|
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|
|
@@ -35,10 +35,6 @@ export default class EVMSignMessageEIP712 extends BaseMethod<EthereumSignMessage
|
|
|
35
35
|
|
|
36
36
|
getVersionRange(): DeviceFirmwareRange {
|
|
37
37
|
return {
|
|
38
|
-
pro2: {
|
|
39
|
-
min: '0.0.0',
|
|
40
|
-
unsupported: true,
|
|
41
|
-
},
|
|
42
38
|
model_mini: {
|
|
43
39
|
min: '2.1.9',
|
|
44
40
|
},
|
|
@@ -49,13 +45,7 @@ export default class EVMSignMessageEIP712 extends BaseMethod<EthereumSignMessage
|
|
|
49
45
|
}
|
|
50
46
|
|
|
51
47
|
async run() {
|
|
52
|
-
this.
|
|
53
|
-
() => true,
|
|
54
|
-
() => this.getVersionRange(),
|
|
55
|
-
{
|
|
56
|
-
strictCheckDeviceSupport: true,
|
|
57
|
-
}
|
|
58
|
-
);
|
|
48
|
+
this.assertProtocolSupported(this.device.getProtocol(), this.device.getCurrentFirmwareType());
|
|
59
49
|
|
|
60
50
|
const res = await this.device.commands.typedCall(
|
|
61
51
|
'EthereumSignMessageEIP712',
|
|
@@ -18,6 +18,10 @@ import type {
|
|
|
18
18
|
import type { SchemaParam } from '../helpers/paramsValidator';
|
|
19
19
|
|
|
20
20
|
export default class EVMSignTransaction extends BaseMethod {
|
|
21
|
+
getSupportedProtocols() {
|
|
22
|
+
return ['V1', 'V2'] as const;
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
addressN: number[] = [];
|
|
22
26
|
|
|
23
27
|
isEIP1559 = false;
|
|
@@ -56,6 +56,10 @@ const MINI_MAX_ARRAY_TYPE_FIELDS = 24;
|
|
|
56
56
|
const MINI_MAX_ARRAY_ELEMENTS = 24;
|
|
57
57
|
|
|
58
58
|
export default class EVMSignTypedData extends BaseMethod<EVMSignTypedDataParams> {
|
|
59
|
+
getSupportedProtocols() {
|
|
60
|
+
return ['V1', 'V2'] as const;
|
|
61
|
+
}
|
|
62
|
+
|
|
59
63
|
init() {
|
|
60
64
|
this.checkDeviceId = true;
|
|
61
65
|
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|
|
@@ -9,6 +9,10 @@ import verifyMessage from './latest/verifyMessage';
|
|
|
9
9
|
import type { EthereumVerifyMessageOneKey } from '@onekeyfe/hd-transport';
|
|
10
10
|
|
|
11
11
|
export default class EVMSignMessage extends BaseMethod<EthereumVerifyMessageOneKey> {
|
|
12
|
+
getSupportedProtocols() {
|
|
13
|
+
return ['V1', 'V2'] as const;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
init() {
|
|
13
17
|
this.checkDeviceId = true;
|
|
14
18
|
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|
|
@@ -7,6 +7,10 @@ import type { FilecoinGetAddress as HardwareFilecoinGetAddress } from '@onekeyfe
|
|
|
7
7
|
import type { FilecoinAddress, FilecoinGetAddressParams } from '../../types';
|
|
8
8
|
|
|
9
9
|
export default class FilecoinGetAddress extends BaseMethod<HardwareFilecoinGetAddress[]> {
|
|
10
|
+
getSupportedProtocols() {
|
|
11
|
+
return ['V1', 'V2'] as const;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
hasBundle = false;
|
|
11
15
|
|
|
12
16
|
init() {
|
|
@@ -7,6 +7,10 @@ import type { FilecoinSignTransactionParams } from '../../types';
|
|
|
7
7
|
import type { FilecoinSignTx as HardwareFilecoinSignTx } from '@onekeyfe/hd-transport';
|
|
8
8
|
|
|
9
9
|
export default class FilecoinSignTransaction extends BaseMethod<HardwareFilecoinSignTx> {
|
|
10
|
+
getSupportedProtocols() {
|
|
11
|
+
return ['V1', 'V2'] as const;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
hasBundle = false;
|
|
11
15
|
|
|
12
16
|
init() {
|