@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
|
@@ -7,6 +7,10 @@ import type { KaspaGetAddress as HardwareKaspaGetAddress } from '@onekeyfe/hd-tr
|
|
|
7
7
|
import type { KaspaAddress, KaspaGetAddressParams } from '../../types';
|
|
8
8
|
|
|
9
9
|
export default class KaspaGetAddress extends BaseMethod<HardwareKaspaGetAddress[]> {
|
|
10
|
+
getSupportedProtocols() {
|
|
11
|
+
return ['V1', 'V2'] as const;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
hasBundle = false;
|
|
11
15
|
|
|
12
16
|
init() {
|
|
@@ -9,12 +9,7 @@ import { serialize, zeroSubnetworkID } from './helpers/TransferSerialize';
|
|
|
9
9
|
import { SignatureType } from './helpers/SignatureType';
|
|
10
10
|
|
|
11
11
|
import type { TypedResponseMessage } from '../../device/DeviceCommands';
|
|
12
|
-
import type {
|
|
13
|
-
KaspaSignInputParams,
|
|
14
|
-
KaspaSignOutputParams,
|
|
15
|
-
KaspaSignTransactionParams,
|
|
16
|
-
KaspaSignature,
|
|
17
|
-
} from '../../types';
|
|
12
|
+
import type { KaspaSignTransactionParams, KaspaSignature } from '../../types';
|
|
18
13
|
import type {
|
|
19
14
|
KaspaInputScriptType,
|
|
20
15
|
KaspaTxRequest,
|
|
@@ -28,7 +23,19 @@ const P2PK_SCRIPT = /^(20[0-9a-f]{64}ac|21[0-9a-f]{66}ab)$/i;
|
|
|
28
23
|
|
|
29
24
|
const isStreamableScript = (script?: string) => !script || P2PK_SCRIPT.test(script);
|
|
30
25
|
|
|
26
|
+
type KaspaOutputParam = KaspaSignTransactionParams['outputs'][number];
|
|
27
|
+
|
|
28
|
+
const getOutputAddress = (output: KaspaOutputParam) =>
|
|
29
|
+
'address' in output ? output.address : undefined;
|
|
30
|
+
|
|
31
|
+
const getOutputAddressN = (output: KaspaOutputParam) =>
|
|
32
|
+
'addressN' in output ? output.addressN : undefined;
|
|
33
|
+
|
|
31
34
|
export default class KaspaSignTransaction extends BaseMethod<KaspaSignTransactionParams> {
|
|
35
|
+
getSupportedProtocols() {
|
|
36
|
+
return ['V1', 'V2'] as const;
|
|
37
|
+
}
|
|
38
|
+
|
|
32
39
|
hasBundle = false;
|
|
33
40
|
|
|
34
41
|
// Protocols this tx can be signed with; the device picks via its first response.
|
|
@@ -43,10 +50,20 @@ export default class KaspaSignTransaction extends BaseMethod<KaspaSignTransactio
|
|
|
43
50
|
|
|
44
51
|
const payload = this.payload as KaspaSignTransactionParams;
|
|
45
52
|
|
|
53
|
+
const payloadInputs = Array.isArray(payload.inputs) ? payload.inputs : [];
|
|
54
|
+
const payloadOutputs = Array.isArray(payload.outputs) ? payload.outputs : [];
|
|
55
|
+
|
|
56
|
+
const usesStreamingParams =
|
|
57
|
+
payload.refTxs !== undefined ||
|
|
58
|
+
payload.payload !== undefined ||
|
|
59
|
+
payload.gas !== undefined ||
|
|
60
|
+
payloadInputs.some(input => !input.output?.script) ||
|
|
61
|
+
payloadOutputs.some(output => !!getOutputAddress(output) || !!getOutputAddressN(output));
|
|
62
|
+
|
|
46
63
|
// check payload
|
|
47
64
|
validateParams(payload, [
|
|
48
65
|
{ name: 'version', type: 'number' },
|
|
49
|
-
{ name: 'sigHashType', type: 'number' },
|
|
66
|
+
{ name: 'sigHashType', type: 'number', required: !usesStreamingParams },
|
|
50
67
|
{ name: 'inputs', type: 'array', required: true },
|
|
51
68
|
{ name: 'outputs', type: 'array', required: true },
|
|
52
69
|
{ name: 'lockTime', required: true },
|
|
@@ -57,7 +74,7 @@ export default class KaspaSignTransaction extends BaseMethod<KaspaSignTransactio
|
|
|
57
74
|
{ name: 'useTweak', type: 'boolean' },
|
|
58
75
|
]);
|
|
59
76
|
|
|
60
|
-
const inputs:
|
|
77
|
+
const inputs: KaspaSignTransactionParams['inputs'] = payload.inputs.map(input => {
|
|
61
78
|
validateParams(input, [
|
|
62
79
|
{ name: 'path', type: 'string', required: true },
|
|
63
80
|
{ name: 'prevTxId', type: 'string', required: true },
|
|
@@ -86,17 +103,18 @@ export default class KaspaSignTransaction extends BaseMethod<KaspaSignTransactio
|
|
|
86
103
|
]);
|
|
87
104
|
});
|
|
88
105
|
|
|
89
|
-
const outputs:
|
|
106
|
+
const outputs: KaspaSignTransactionParams['outputs'] = payload.outputs.map(output => {
|
|
107
|
+
const addressN = getOutputAddressN(output);
|
|
90
108
|
validateParams(output, [
|
|
91
109
|
{ name: 'satoshis', required: true },
|
|
92
110
|
{ name: 'address', type: 'string' },
|
|
93
|
-
{ name: 'script', type: 'string' },
|
|
111
|
+
{ name: 'script', type: 'string', required: !usesStreamingParams },
|
|
94
112
|
{ name: 'scriptVersion', type: 'number' },
|
|
95
113
|
]);
|
|
96
114
|
|
|
97
115
|
return {
|
|
98
116
|
...output,
|
|
99
|
-
addressN:
|
|
117
|
+
addressN: addressN ? validatePath(addressN, 3) : undefined,
|
|
100
118
|
scriptVersion: output.scriptVersion ?? 0,
|
|
101
119
|
};
|
|
102
120
|
});
|
|
@@ -132,7 +150,9 @@ export default class KaspaSignTransaction extends BaseMethod<KaspaSignTransactio
|
|
|
132
150
|
|
|
133
151
|
this.supportsStreaming =
|
|
134
152
|
isDefaultSigHashType &&
|
|
135
|
-
this.params.outputs.every(
|
|
153
|
+
this.params.outputs.every(
|
|
154
|
+
output => !!getOutputAddress(output) || !!getOutputAddressN(output)
|
|
155
|
+
) &&
|
|
136
156
|
this.params.inputs.every(input => isStreamableScript(input.output.script)) &&
|
|
137
157
|
this.params.outputs.every(output => isStreamableScript(output.script));
|
|
138
158
|
|
|
@@ -361,12 +381,14 @@ export default class KaspaSignTransaction extends BaseMethod<KaspaSignTransactio
|
|
|
361
381
|
`KaspaSignTransaction: device requested output ${requestIndex} out of range`
|
|
362
382
|
);
|
|
363
383
|
}
|
|
364
|
-
const
|
|
384
|
+
const address = getOutputAddress(output);
|
|
385
|
+
const addressN = getOutputAddressN(output);
|
|
386
|
+
const isChange = !!addressN;
|
|
365
387
|
response = await typedCall('KaspaTxAckOutput', 'KaspaTxRequest', {
|
|
366
388
|
script_type: isChange ? 'KASPA_PAYTOCHANGE' : 'KASPA_PAYTOADDRESS',
|
|
367
389
|
amount: output.satoshis,
|
|
368
|
-
address_n: (
|
|
369
|
-
address
|
|
390
|
+
address_n: (addressN as number[]) ?? [],
|
|
391
|
+
address,
|
|
370
392
|
scheme: params.scheme,
|
|
371
393
|
use_tweak: params.useTweak,
|
|
372
394
|
});
|
|
@@ -4,11 +4,7 @@ import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
|
4
4
|
import { SignatureType } from './SignatureType';
|
|
5
5
|
import { HashWriter } from './HashWriter';
|
|
6
6
|
|
|
7
|
-
import type {
|
|
8
|
-
KaspaSignInputParams,
|
|
9
|
-
KaspaSignOutputParams,
|
|
10
|
-
KaspaSignTransactionParams,
|
|
11
|
-
} from '../../../types';
|
|
7
|
+
import type { KaspaSignTransactionParams } from '../../../types';
|
|
12
8
|
|
|
13
9
|
export function zeroHash() {
|
|
14
10
|
return Buffer.alloc(32);
|
|
@@ -33,7 +29,7 @@ function isSighashNone(sighashType: number) {
|
|
|
33
29
|
return (sighashType & 31) === SignatureType.SIGHASH_NONE;
|
|
34
30
|
}
|
|
35
31
|
|
|
36
|
-
function hashOutpoint(hashWriter: HashWriter, input:
|
|
32
|
+
function hashOutpoint(hashWriter: HashWriter, input: KaspaSignTransactionParams['inputs'][number]) {
|
|
37
33
|
hashWriter.writeHash(Buffer.from(input.prevTxId, 'hex'));
|
|
38
34
|
hashWriter.writeUInt32LE(input.outputIndex);
|
|
39
35
|
}
|
|
@@ -75,7 +71,7 @@ function getSigOpCountsHash(transaction: KaspaSignTransactionParams, sighashType
|
|
|
75
71
|
return hashWriter.finalize();
|
|
76
72
|
}
|
|
77
73
|
|
|
78
|
-
function hashTxOut(hashWriter: HashWriter, output:
|
|
74
|
+
function hashTxOut(hashWriter: HashWriter, output: KaspaSignTransactionParams['outputs'][number]) {
|
|
79
75
|
hashWriter.writeUInt64LE(output.satoshis);
|
|
80
76
|
hashWriter.writeUInt16LE(0); // TODO: USE REAL SCRIPT VERSION
|
|
81
77
|
if (output.script === undefined) {
|
|
@@ -7,6 +7,10 @@ import type { NearGetAddress as HardwareNearGetAddress } from '@onekeyfe/hd-tran
|
|
|
7
7
|
import type { NearAddress, NearGetAddressParams } from '../../types';
|
|
8
8
|
|
|
9
9
|
export default class NearGetAddress extends BaseMethod<HardwareNearGetAddress[]> {
|
|
10
|
+
getSupportedProtocols() {
|
|
11
|
+
return ['V1', 'V2'] as const;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
hasBundle = false;
|
|
11
15
|
|
|
12
16
|
init() {
|
|
@@ -7,6 +7,10 @@ import { formatAnyHex } from '../helpers/hexUtils';
|
|
|
7
7
|
import type { NearSignTx as HardwareNearSignTx } from '@onekeyfe/hd-transport';
|
|
8
8
|
|
|
9
9
|
export default class NearSignTransaction extends BaseMethod<HardwareNearSignTx> {
|
|
10
|
+
getSupportedProtocols() {
|
|
11
|
+
return ['V1', 'V2'] as const;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
init() {
|
|
11
15
|
this.checkDeviceId = true;
|
|
12
16
|
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|
|
@@ -9,6 +9,10 @@ import type { NEMAddress, NEMGetAddressParams } from '../../types';
|
|
|
9
9
|
const MAINNET = 0x68; // 104
|
|
10
10
|
|
|
11
11
|
export default class NEMGetAddress extends BaseMethod<HardwareNEMGetAddress[]> {
|
|
12
|
+
getSupportedProtocols() {
|
|
13
|
+
return ['V1', 'V2'] as const;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
hasBundle = false;
|
|
13
17
|
|
|
14
18
|
init() {
|
|
@@ -37,6 +37,10 @@ const NEM_MOSAIC_CREATION = 0x4001;
|
|
|
37
37
|
const NEM_SUPPLY_CHANGE = 0x4002;
|
|
38
38
|
|
|
39
39
|
export default class NEMSignTransaction extends BaseMethod<NEMSignTx> {
|
|
40
|
+
getSupportedProtocols() {
|
|
41
|
+
return ['V1', 'V2'] as const;
|
|
42
|
+
}
|
|
43
|
+
|
|
40
44
|
NEM_MOSAIC_LEVY_TYPES: Record<number, string> = {
|
|
41
45
|
1: 'MosaicLevy_Absolute',
|
|
42
46
|
2: 'MosaicLevy_Percentile',
|
|
@@ -6,6 +6,10 @@ import { validateParams } from '../helpers/paramsValidator';
|
|
|
6
6
|
import type { NostrDecryptMessage as DecryptMessage } from '@onekeyfe/hd-transport';
|
|
7
7
|
|
|
8
8
|
export default class NostrDecryptMessage extends BaseMethod<DecryptMessage> {
|
|
9
|
+
getSupportedProtocols() {
|
|
10
|
+
return ['V1', 'V2'] as const;
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
hasBundle = false;
|
|
10
14
|
|
|
11
15
|
init() {
|
|
@@ -6,6 +6,10 @@ import { validateParams } from '../helpers/paramsValidator';
|
|
|
6
6
|
import type { NostrEncryptMessage as EncryptMessage } from '@onekeyfe/hd-transport';
|
|
7
7
|
|
|
8
8
|
export default class NostrEncryptMessage extends BaseMethod<EncryptMessage> {
|
|
9
|
+
getSupportedProtocols() {
|
|
10
|
+
return ['V1', 'V2'] as const;
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
hasBundle = false;
|
|
10
14
|
|
|
11
15
|
init() {
|
|
@@ -8,6 +8,10 @@ import type { BTCGetAddressParams } from '../../types/api/btcGetAddress';
|
|
|
8
8
|
import type { NostrPublicKey } from '../../types/api/nostrGetPublicKey';
|
|
9
9
|
|
|
10
10
|
export default class NostrGetPublicKey extends BaseMethod<GetPublicKey[]> {
|
|
11
|
+
getSupportedProtocols() {
|
|
12
|
+
return ['V1', 'V2'] as const;
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
hasBundle = false;
|
|
12
16
|
|
|
13
17
|
init() {
|
|
@@ -10,6 +10,10 @@ import { bytesToHex, hexToBytes } from '../helpers/hexUtils';
|
|
|
10
10
|
import type { NostrSignEvent as SignEvent } from '@onekeyfe/hd-transport';
|
|
11
11
|
|
|
12
12
|
export default class NostrSignEvent extends BaseMethod<SignEvent> {
|
|
13
|
+
getSupportedProtocols() {
|
|
14
|
+
return ['V1', 'V2'] as const;
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
hasBundle = false;
|
|
14
18
|
|
|
15
19
|
init() {
|
|
@@ -6,6 +6,10 @@ import { validateParams } from '../helpers/paramsValidator';
|
|
|
6
6
|
import type { NostrSignSchnorr as SignSchnorr } from '@onekeyfe/hd-transport';
|
|
7
7
|
|
|
8
8
|
export default class NostrSignSchnorr extends BaseMethod<SignSchnorr> {
|
|
9
|
+
getSupportedProtocols() {
|
|
10
|
+
return ['V1', 'V2'] as const;
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
hasBundle = false;
|
|
10
14
|
|
|
11
15
|
init() {
|
|
@@ -7,6 +7,10 @@ import type { PolkadotGetAddress as HardwarePolkadotGetAddress } from '@onekeyfe
|
|
|
7
7
|
import type { PolkadotAddress, PolkadotGetAddressParams } from '../../types';
|
|
8
8
|
|
|
9
9
|
export default class PolkadotGetAddress extends BaseMethod<HardwarePolkadotGetAddress[]> {
|
|
10
|
+
getSupportedProtocols() {
|
|
11
|
+
return ['V1', 'V2'] as const;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
hasBundle = false;
|
|
11
15
|
|
|
12
16
|
init() {
|
|
@@ -8,6 +8,10 @@ import type { PolkadotSignTransactionParams } from '../../types';
|
|
|
8
8
|
import type { PolkadotSignTx as HardwarePolkadotSignTx } from '@onekeyfe/hd-transport';
|
|
9
9
|
|
|
10
10
|
export default class PolkadotSignTransaction extends BaseMethod<HardwarePolkadotSignTx> {
|
|
11
|
+
getSupportedProtocols() {
|
|
12
|
+
return ['V1', 'V2'] as const;
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
hasBundle = false;
|
|
12
16
|
|
|
13
17
|
init() {
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { BaseMethod } from '../BaseMethod';
|
|
2
2
|
|
|
3
3
|
export default class DeviceFactoryInfoGet extends BaseMethod {
|
|
4
|
+
getSupportedProtocols() {
|
|
5
|
+
return ['V2'] as const;
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
init() {
|
|
5
9
|
// Protocol V2 (Pro2) only; Core rejects non-V2 devices.
|
|
6
|
-
this.requireProtocolV2 = true;
|
|
7
10
|
this.skipForceUpdateCheck = true;
|
|
8
11
|
this.useDevicePassphraseState = false;
|
|
9
12
|
this.params = undefined;
|
|
@@ -3,9 +3,12 @@ import { BaseMethod } from '../BaseMethod';
|
|
|
3
3
|
import type { DeviceFactoryInfoSetParams } from './helpers';
|
|
4
4
|
|
|
5
5
|
export default class DeviceFactoryInfoSet extends BaseMethod<DeviceFactoryInfoSetParams> {
|
|
6
|
+
getSupportedProtocols() {
|
|
7
|
+
return ['V2'] as const;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
init() {
|
|
7
11
|
// Protocol V2 (Pro2) only; Core rejects non-V2 devices.
|
|
8
|
-
this.requireProtocolV2 = true;
|
|
9
12
|
this.skipForceUpdateCheck = true;
|
|
10
13
|
this.useDevicePassphraseState = false;
|
|
11
14
|
this.params = {
|
|
@@ -12,9 +12,12 @@ import type { MessageFromOneKey } from '@onekeyfe/hd-transport';
|
|
|
12
12
|
import type { DeviceFirmwareUpdateParams } from './helpers';
|
|
13
13
|
|
|
14
14
|
export default class DeviceFirmwareUpdate extends BaseMethod<DeviceFirmwareUpdateParams> {
|
|
15
|
+
getSupportedProtocols() {
|
|
16
|
+
return ['V2'] as const;
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
init() {
|
|
16
20
|
// Protocol V2 (Pro2) only; Core rejects non-V2 devices.
|
|
17
|
-
this.requireProtocolV2 = true;
|
|
18
21
|
this.skipForceUpdateCheck = true;
|
|
19
22
|
this.useDevicePassphraseState = false;
|
|
20
23
|
this.params = {
|
|
@@ -35,9 +35,12 @@ function normalizeStatusFields(
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export default class DeviceGetFirmwareUpdateStatus extends BaseMethod<DeviceFirmwareUpdateStatusGetParams> {
|
|
38
|
+
getSupportedProtocols() {
|
|
39
|
+
return ['V2'] as const;
|
|
40
|
+
}
|
|
41
|
+
|
|
38
42
|
init() {
|
|
39
43
|
// Protocol V2 (Pro2) only; Core rejects non-V2 devices.
|
|
40
|
-
this.requireProtocolV2 = true;
|
|
41
44
|
this.skipForceUpdateCheck = true;
|
|
42
45
|
this.useDevicePassphraseState = false;
|
|
43
46
|
const fields = normalizeStatusFields(this.payload.fields);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { BaseMethod } from '../BaseMethod';
|
|
2
2
|
|
|
3
3
|
export default class DeviceGetOnboardingStatus extends BaseMethod {
|
|
4
|
+
getSupportedProtocols() {
|
|
5
|
+
return ['V2'] as const;
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
init() {
|
|
5
|
-
this.requireProtocolV2 = true;
|
|
6
9
|
this.skipForceUpdateCheck = true;
|
|
7
10
|
this.useDevicePassphraseState = false;
|
|
8
11
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { createDeviceNotSupportMethodError } from '@onekeyfe/hd-shared';
|
|
2
|
-
|
|
3
1
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
4
2
|
import { PROTOCOL_V2_DEVICE_INFO_TIMEOUT_MS } from '../../protocols/protocol-v2';
|
|
5
3
|
import { BaseMethod } from '../BaseMethod';
|
|
@@ -109,9 +107,11 @@ export default class DeviceInfoGet extends BaseMethod<{
|
|
|
109
107
|
targets: DeviceInfoGetTargets;
|
|
110
108
|
types: DeviceInfoGetTypes;
|
|
111
109
|
}> {
|
|
110
|
+
getSupportedProtocols() {
|
|
111
|
+
return ['V2'] as const;
|
|
112
|
+
}
|
|
113
|
+
|
|
112
114
|
init() {
|
|
113
|
-
// Protocol V2 (Pro2) only; Core rejects non-V2 devices.
|
|
114
|
-
this.requireProtocolV2 = true;
|
|
115
115
|
this.unlockPolicy = 'none';
|
|
116
116
|
this.allowDeviceMode = [
|
|
117
117
|
...this.allowDeviceMode,
|
|
@@ -127,10 +127,6 @@ export default class DeviceInfoGet extends BaseMethod<{
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
async run() {
|
|
130
|
-
if (!this.device.isProtocolV2()) {
|
|
131
|
-
throw createDeviceNotSupportMethodError(this.name, this.device.getCurrentFirmwareType());
|
|
132
|
-
}
|
|
133
|
-
|
|
134
130
|
const res = await this.device.commands.typedCall(
|
|
135
131
|
'DeviceInfoGet',
|
|
136
132
|
'DeviceInfo',
|
|
@@ -4,9 +4,11 @@ import { normalizeRebootType } from './helpers';
|
|
|
4
4
|
import type { DeviceRebootParams } from './helpers';
|
|
5
5
|
|
|
6
6
|
export default class DeviceReboot extends BaseMethod<DeviceRebootParams> {
|
|
7
|
+
getSupportedProtocols() {
|
|
8
|
+
return ['V2'] as const;
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
init() {
|
|
8
|
-
// Protocol V2 (Pro2) only; Core rejects non-V2 devices.
|
|
9
|
-
this.requireProtocolV2 = true;
|
|
10
12
|
this.skipForceUpdateCheck = true;
|
|
11
13
|
this.useDevicePassphraseState = false;
|
|
12
14
|
this.params = {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { BaseMethod } from '../BaseMethod';
|
|
2
2
|
|
|
3
3
|
export default class DeviceStatusGet extends BaseMethod {
|
|
4
|
+
getSupportedProtocols() {
|
|
5
|
+
return ['V2'] as const;
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
init() {
|
|
5
|
-
this.requireProtocolV2 = true;
|
|
6
9
|
this.unlockPolicy = 'none';
|
|
7
10
|
this.useDevicePassphraseState = false;
|
|
8
11
|
this.skipForceUpdateCheck = true;
|
|
@@ -41,6 +41,10 @@ function normalizeFileName(fileName: string | undefined, data: Uint8Array): stri
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export default class DeviceUploadWallpaper extends BaseMethod<DeviceUploadWallpaperParams> {
|
|
44
|
+
getSupportedProtocols() {
|
|
45
|
+
return ['V2'] as const;
|
|
46
|
+
}
|
|
47
|
+
|
|
44
48
|
private encoded?: { data: Uint8Array; colorFormat: Pro2WallpaperColorFormat };
|
|
45
49
|
|
|
46
50
|
private directoryReady = false;
|
|
@@ -70,7 +74,6 @@ export default class DeviceUploadWallpaper extends BaseMethod<DeviceUploadWallpa
|
|
|
70
74
|
this.encoded = encodePro2Wallpaper({ width, height, rgba: rgbaBytes });
|
|
71
75
|
this.path = `${WALLPAPER_DIRECTORY}/${normalizeFileName(fileName, this.encoded.data)}`;
|
|
72
76
|
this.params = { width, height, rgba: rgbaBytes, fileName, chunkSize };
|
|
73
|
-
this.requireProtocolV2 = true;
|
|
74
77
|
this.unlockPolicy = 'unlock-before-run';
|
|
75
78
|
this.skipForceUpdateCheck = true;
|
|
76
79
|
this.useDevicePassphraseState = false;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { BaseMethod } from '../BaseMethod';
|
|
2
2
|
|
|
3
3
|
export default class FilesystemFormat extends BaseMethod {
|
|
4
|
+
getSupportedProtocols() {
|
|
5
|
+
return ['V2'] as const;
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
init() {
|
|
5
9
|
// Protocol V2 (Pro2) only; Core rejects non-V2 devices.
|
|
6
|
-
this.requireProtocolV2 = true;
|
|
7
10
|
this.skipForceUpdateCheck = true;
|
|
8
11
|
this.useDevicePassphraseState = false;
|
|
9
12
|
this.params = undefined;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { BaseMethod } from '../BaseMethod';
|
|
2
2
|
|
|
3
3
|
export default class FilesystemPermissionFix extends BaseMethod {
|
|
4
|
+
getSupportedProtocols() {
|
|
5
|
+
return ['V2'] as const;
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
init() {
|
|
5
9
|
// Protocol V2 (Pro2) only; Core rejects non-V2 devices.
|
|
6
|
-
this.requireProtocolV2 = true;
|
|
7
10
|
this.skipForceUpdateCheck = true;
|
|
8
11
|
this.useDevicePassphraseState = false;
|
|
9
12
|
this.params = undefined;
|
|
@@ -32,9 +32,12 @@ export function validateProtocolV2PingMessage(value: unknown): string {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export default class Ping extends BaseMethod<{ message?: string }> {
|
|
35
|
+
getSupportedProtocols() {
|
|
36
|
+
return ['V2'] as const;
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
init() {
|
|
36
40
|
// Protocol V2 (Pro2) only; Core rejects non-V2 devices.
|
|
37
|
-
this.requireProtocolV2 = true;
|
|
38
41
|
this.skipForceUpdateCheck = true;
|
|
39
42
|
this.useDevicePassphraseState = false;
|
|
40
43
|
this.params = { message: validateProtocolV2PingMessage(this.payload.message) };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { BaseMethod } from '../BaseMethod';
|
|
2
2
|
|
|
3
3
|
export default class ProtocolInfoRequest extends BaseMethod {
|
|
4
|
+
getSupportedProtocols() {
|
|
5
|
+
return ['V2'] as const;
|
|
6
|
+
}
|
|
7
|
+
|
|
4
8
|
init() {
|
|
5
9
|
// Protocol V2 (Pro2) only; Core rejects non-V2 devices.
|
|
6
|
-
this.requireProtocolV2 = true;
|
|
7
10
|
this.skipForceUpdateCheck = true;
|
|
8
11
|
this.useDevicePassphraseState = false;
|
|
9
12
|
this.params = undefined;
|
|
@@ -9,6 +9,10 @@ import type { SolanaAddress, SolanaGetAddressParams } from '../../types';
|
|
|
9
9
|
export default class SolGetAddress extends BaseMethod<SolanaGetAddress[]> {
|
|
10
10
|
hasBundle = false;
|
|
11
11
|
|
|
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 { stripHexPrefix } from '../helpers/hexUtils';
|
|
|
7
7
|
import type { SolanaSignUnsafeMessage as HardwareSolSignUnsafeMessage } from '@onekeyfe/hd-transport';
|
|
8
8
|
|
|
9
9
|
export default class SolSignMessage extends BaseMethod<HardwareSolSignUnsafeMessage> {
|
|
10
|
+
getSupportedProtocols() {
|
|
11
|
+
return ['V1', 'V2'] as const;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
init() {
|
|
11
15
|
this.checkDeviceId = true;
|
|
12
16
|
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|
|
@@ -7,6 +7,10 @@ import { stripHexPrefix } from '../helpers/hexUtils';
|
|
|
7
7
|
import type { SolanaSignOffChainMessage as HardwareSolSignOffChainMessage } from '@onekeyfe/hd-transport';
|
|
8
8
|
|
|
9
9
|
export default class SolSignOffchainMessage extends BaseMethod<HardwareSolSignOffChainMessage> {
|
|
10
|
+
getSupportedProtocols() {
|
|
11
|
+
return ['V1', 'V2'] as const;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
init() {
|
|
11
15
|
this.checkDeviceId = true;
|
|
12
16
|
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|