@onekeyfe/hd-core 1.2.0-alpha.56 → 1.2.0-alpha.57
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__/protocol-v2.test.ts +125 -3
- package/__tests__/public-pro2-api-boundary.test.ts +98 -2
- package/__tests__/public-test-api-boundary.test.ts +167 -0
- package/dist/api/BixinBackupDevice.d.ts +7 -0
- package/dist/api/BixinBackupDevice.d.ts.map +1 -0
- package/dist/api/BixinLoadDevice.d.ts +7 -0
- package/dist/api/BixinLoadDevice.d.ts.map +1 -0
- package/dist/api/BixinMessageSE.d.ts +8 -0
- package/dist/api/BixinMessageSE.d.ts.map +1 -0
- package/dist/api/BixinVerifyDeviceRequest.d.ts +8 -0
- package/dist/api/BixinVerifyDeviceRequest.d.ts.map +1 -0
- package/dist/api/WebAuthnAddResidentCredential.d.ts +8 -0
- package/dist/api/WebAuthnAddResidentCredential.d.ts.map +1 -0
- package/dist/api/WebAuthnListResidentCredentials.d.ts +8 -0
- package/dist/api/WebAuthnListResidentCredentials.d.ts.map +1 -0
- package/dist/api/WebAuthnRemoveResidentCredential.d.ts +8 -0
- package/dist/api/WebAuthnRemoveResidentCredential.d.ts.map +1 -0
- package/dist/api/binance/BinanceGetAddress.d.ts +8 -0
- package/dist/api/binance/BinanceGetAddress.d.ts.map +1 -0
- package/dist/api/binance/BinanceGetPublicKey.d.ts +8 -0
- package/dist/api/binance/BinanceGetPublicKey.d.ts.map +1 -0
- package/dist/api/binance/BinanceSignTx.d.ts +7 -0
- package/dist/api/binance/BinanceSignTx.d.ts.map +1 -0
- package/dist/api/btc/BTCAuthorizeCoinJoin.d.ts +7 -0
- package/dist/api/btc/BTCAuthorizeCoinJoin.d.ts.map +1 -0
- package/dist/api/btc/BTCGetOwnershipId.d.ts +7 -0
- package/dist/api/btc/BTCGetOwnershipId.d.ts.map +1 -0
- package/dist/api/btc/BTCGetOwnershipProof.d.ts +7 -0
- package/dist/api/btc/BTCGetOwnershipProof.d.ts.map +1 -0
- package/dist/api/crypto/CryptoBatchGetPublickeys.d.ts +8 -0
- package/dist/api/crypto/CryptoBatchGetPublickeys.d.ts.map +1 -0
- package/dist/api/crypto/CryptoCipherKeyValue.d.ts +8 -0
- package/dist/api/crypto/CryptoCipherKeyValue.d.ts.map +1 -0
- package/dist/api/crypto/CryptoCosiCommit.d.ts +8 -0
- package/dist/api/crypto/CryptoCosiCommit.d.ts.map +1 -0
- package/dist/api/crypto/CryptoCosiSign.d.ts +8 -0
- package/dist/api/crypto/CryptoCosiSign.d.ts.map +1 -0
- package/dist/api/crypto/CryptoGetECDHSessionKey.d.ts +8 -0
- package/dist/api/crypto/CryptoGetECDHSessionKey.d.ts.map +1 -0
- package/dist/api/crypto/CryptoSignIdentity.d.ts +8 -0
- package/dist/api/crypto/CryptoSignIdentity.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkDecision.d.ts +7 -0
- package/dist/api/debug/DebugLinkDecision.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkEraseSdCard.d.ts +7 -0
- package/dist/api/debug/DebugLinkEraseSdCard.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkFlashErase.d.ts +7 -0
- package/dist/api/debug/DebugLinkFlashErase.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkGetState.d.ts +7 -0
- package/dist/api/debug/DebugLinkGetState.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkMemoryRead.d.ts +7 -0
- package/dist/api/debug/DebugLinkMemoryRead.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkMemoryWrite.d.ts +7 -0
- package/dist/api/debug/DebugLinkMemoryWrite.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkRecordScreen.d.ts +7 -0
- package/dist/api/debug/DebugLinkRecordScreen.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkReseedRandom.d.ts +7 -0
- package/dist/api/debug/DebugLinkReseedRandom.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkStop.d.ts +7 -0
- package/dist/api/debug/DebugLinkStop.d.ts.map +1 -0
- package/dist/api/debug/DebugLinkWatchLayout.d.ts +7 -0
- package/dist/api/debug/DebugLinkWatchLayout.d.ts.map +1 -0
- package/dist/api/device/DeviceVerify.d.ts.map +1 -1
- package/dist/api/emmc/EmmcDirList.d.ts +7 -0
- package/dist/api/emmc/EmmcDirList.d.ts.map +1 -0
- package/dist/api/emmc/EmmcDirMake.d.ts +7 -0
- package/dist/api/emmc/EmmcDirMake.d.ts.map +1 -0
- package/dist/api/emmc/EmmcDirRemove.d.ts +7 -0
- package/dist/api/emmc/EmmcDirRemove.d.ts.map +1 -0
- package/dist/api/emmc/EmmcFileDelete.d.ts +7 -0
- package/dist/api/emmc/EmmcFileDelete.d.ts.map +1 -0
- package/dist/api/emmc/EmmcFileRead.d.ts +7 -0
- package/dist/api/emmc/EmmcFileRead.d.ts.map +1 -0
- package/dist/api/emmc/EmmcFileWrite.d.ts +7 -0
- package/dist/api/emmc/EmmcFileWrite.d.ts.map +1 -0
- package/dist/api/emmc/EmmcFixPermission.d.ts +7 -0
- package/dist/api/emmc/EmmcFixPermission.d.ts.map +1 -0
- package/dist/api/emmc/EmmcPathInfo.d.ts +7 -0
- package/dist/api/emmc/EmmcPathInfo.d.ts.map +1 -0
- package/dist/api/eos/EosGetPublicKey.d.ts +8 -0
- package/dist/api/eos/EosGetPublicKey.d.ts.map +1 -0
- package/dist/api/eos/EosSignTx.d.ts +12 -0
- package/dist/api/eos/EosSignTx.d.ts.map +1 -0
- package/dist/api/evmTrezor/EVMGetAddress.d.ts +10 -0
- package/dist/api/evmTrezor/EVMGetAddress.d.ts.map +1 -0
- package/dist/api/evmTrezor/EVMGetPublicKey.d.ts +16 -0
- package/dist/api/evmTrezor/EVMGetPublicKey.d.ts.map +1 -0
- package/dist/api/evmTrezor/EVMSignMessage.d.ts +7 -0
- package/dist/api/evmTrezor/EVMSignMessage.d.ts.map +1 -0
- package/dist/api/evmTrezor/EVMSignTransaction.d.ts +15 -0
- package/dist/api/evmTrezor/EVMSignTransaction.d.ts.map +1 -0
- package/dist/api/evmTrezor/EVMSignTypedData.d.ts +43 -0
- package/dist/api/evmTrezor/EVMSignTypedData.d.ts.map +1 -0
- package/dist/api/evmTrezor/EVMVerifyMessage.d.ts +7 -0
- package/dist/api/evmTrezor/EVMVerifyMessage.d.ts.map +1 -0
- package/dist/api/evmTrezor/legacyV1/getAddress.d.ts +6 -0
- package/dist/api/evmTrezor/legacyV1/getAddress.d.ts.map +1 -0
- package/dist/api/evmTrezor/legacyV1/getPublicKey.d.ts +6 -0
- package/dist/api/evmTrezor/legacyV1/getPublicKey.d.ts.map +1 -0
- package/dist/api/evmTrezor/legacyV1/signMessage.d.ts +6 -0
- package/dist/api/evmTrezor/legacyV1/signMessage.d.ts.map +1 -0
- package/dist/api/evmTrezor/legacyV1/signTransaction.d.ts +9 -0
- package/dist/api/evmTrezor/legacyV1/signTransaction.d.ts.map +1 -0
- package/dist/api/evmTrezor/legacyV1/signTypedData.d.ts +10 -0
- package/dist/api/evmTrezor/legacyV1/signTypedData.d.ts.map +1 -0
- package/dist/api/evmTrezor/legacyV1/signTypedHash.d.ts +11 -0
- package/dist/api/evmTrezor/legacyV1/signTypedHash.d.ts.map +1 -0
- package/dist/api/evmTrezor/legacyV1/verifyMessage.d.ts +6 -0
- package/dist/api/evmTrezor/legacyV1/verifyMessage.d.ts.map +1 -0
- package/dist/api/extensionMethodNames.d.ts +3 -0
- package/dist/api/extensionMethodNames.d.ts.map +1 -0
- package/dist/api/factoryMethods.d.ts +3 -0
- package/dist/api/factoryMethods.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareErase.d.ts +12 -0
- package/dist/api/firmware/FirmwareErase.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareEraseEx.d.ts +12 -0
- package/dist/api/firmware/FirmwareEraseEx.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareUpdateEmmcTest.d.ts +7 -0
- package/dist/api/firmware/FirmwareUpdateEmmcTest.d.ts.map +1 -0
- package/dist/api/firmware/FirmwareUploadTest.d.ts +7 -0
- package/dist/api/firmware/FirmwareUploadTest.d.ts.map +1 -0
- package/dist/api/firmware/Reboot.d.ts +7 -0
- package/dist/api/firmware/Reboot.d.ts.map +1 -0
- package/dist/api/firmware/SelfTest.d.ts +7 -0
- package/dist/api/firmware/SelfTest.d.ts.map +1 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/manager/DeviceCancelAuthorization.d.ts +7 -0
- package/dist/api/manager/DeviceCancelAuthorization.d.ts.map +1 -0
- package/dist/api/manager/DeviceChangeWipeCode.d.ts +7 -0
- package/dist/api/manager/DeviceChangeWipeCode.d.ts.map +1 -0
- package/dist/api/manager/DeviceDoPreauthorized.d.ts +7 -0
- package/dist/api/manager/DeviceDoPreauthorized.d.ts.map +1 -0
- package/dist/api/manager/DeviceEndSession.d.ts +7 -0
- package/dist/api/manager/DeviceEndSession.d.ts.map +1 -0
- package/dist/api/manager/DeviceGetEntropy.d.ts +7 -0
- package/dist/api/manager/DeviceGetEntropy.d.ts.map +1 -0
- package/dist/api/manager/DeviceGetFirmwareHash.d.ts +7 -0
- package/dist/api/manager/DeviceGetFirmwareHash.d.ts.map +1 -0
- package/dist/api/manager/DeviceInfoSettings.d.ts +7 -0
- package/dist/api/manager/DeviceInfoSettings.d.ts.map +1 -0
- package/dist/api/manager/DeviceLoad.d.ts +7 -0
- package/dist/api/manager/DeviceLoad.d.ts.map +1 -0
- package/dist/api/manager/DevicePing.d.ts +7 -0
- package/dist/api/manager/DevicePing.d.ts.map +1 -0
- package/dist/api/manager/DeviceReadSEPublicCert.d.ts +7 -0
- package/dist/api/manager/DeviceReadSEPublicCert.d.ts.map +1 -0
- package/dist/api/manager/DeviceSESignMessage.d.ts +7 -0
- package/dist/api/manager/DeviceSESignMessage.d.ts.map +1 -0
- package/dist/api/manager/DeviceSdProtect.d.ts +7 -0
- package/dist/api/manager/DeviceSdProtect.d.ts.map +1 -0
- package/dist/api/manager/DeviceSpiFlashRead.d.ts +7 -0
- package/dist/api/manager/DeviceSpiFlashRead.d.ts.map +1 -0
- package/dist/api/manager/DeviceSpiFlashWrite.d.ts +7 -0
- package/dist/api/manager/DeviceSpiFlashWrite.d.ts.map +1 -0
- package/dist/api/manager/DeviceUnlockPath.d.ts +7 -0
- package/dist/api/manager/DeviceUnlockPath.d.ts.map +1 -0
- package/dist/api/manager/DeviceWriteSEPrivateKey.d.ts +7 -0
- package/dist/api/manager/DeviceWriteSEPrivateKey.d.ts.map +1 -0
- package/dist/api/manager/DeviceWriteSEPublicCert.d.ts +7 -0
- package/dist/api/manager/DeviceWriteSEPublicCert.d.ts.map +1 -0
- package/dist/api/manager/GetDeviceInfoSettings.d.ts +7 -0
- package/dist/api/manager/GetDeviceInfoSettings.d.ts.map +1 -0
- package/dist/api/manager/GetPublicKeyMultiple.d.ts +7 -0
- package/dist/api/manager/GetPublicKeyMultiple.d.ts.map +1 -0
- package/dist/api/manager/ListResDir.d.ts +7 -0
- package/dist/api/manager/ListResDir.d.ts.map +1 -0
- package/dist/api/manager/NFTWriteData.d.ts +7 -0
- package/dist/api/manager/NFTWriteData.d.ts.map +1 -0
- package/dist/api/manager/NFTWriteInfo.d.ts +7 -0
- package/dist/api/manager/NFTWriteInfo.d.ts.map +1 -0
- package/dist/api/manager/ReadSEPublicKey.d.ts +7 -0
- package/dist/api/manager/ReadSEPublicKey.d.ts.map +1 -0
- package/dist/api/manager/ResourceUpdate.d.ts +6 -0
- package/dist/api/manager/ResourceUpdate.d.ts.map +1 -0
- package/dist/api/methodExtension.d.ts +13 -0
- package/dist/api/methodExtension.d.ts.map +1 -0
- package/dist/api/monero/MoneroGetAddress.d.ts +9 -0
- package/dist/api/monero/MoneroGetAddress.d.ts.map +1 -0
- package/dist/api/monero/MoneroGetWatchKey.d.ts +8 -0
- package/dist/api/monero/MoneroGetWatchKey.d.ts.map +1 -0
- package/dist/api/nem/NEMDecryptMessage.d.ts +8 -0
- package/dist/api/nem/NEMDecryptMessage.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceFactoryCertificateRead.d.ts +7 -0
- package/dist/api/protocol-v2/DeviceFactoryCertificateRead.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceFactoryCertificateWrite.d.ts +8 -0
- package/dist/api/protocol-v2/DeviceFactoryCertificateWrite.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceFactoryChallengeSign.d.ts +8 -0
- package/dist/api/protocol-v2/DeviceFactoryChallengeSign.d.ts.map +1 -0
- package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts.map +1 -1
- package/dist/api/protocol-v2/helpers.d.ts +15 -5
- package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
- package/dist/api/stellar/StellarSignTransaction.d.ts +1 -1
- package/dist/api/testMethods.d.ts +82 -0
- package/dist/api/testMethods.d.ts.map +1 -0
- package/dist/api/tezos/TezosGetAddress.d.ts +9 -0
- package/dist/api/tezos/TezosGetAddress.d.ts.map +1 -0
- package/dist/api/tezos/TezosGetPublicKey.d.ts +8 -0
- package/dist/api/tezos/TezosGetPublicKey.d.ts.map +1 -0
- package/dist/api/tezos/TezosSignTx.d.ts +12 -0
- package/dist/api/tezos/TezosSignTx.d.ts.map +1 -0
- package/dist/api/utils.d.ts +6 -1
- package/dist/api/utils.d.ts.map +1 -1
- package/dist/core/index.d.ts +10 -4
- package/dist/core/index.d.ts.map +1 -1
- package/dist/index.d.ts +722 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2617 -51
- package/dist/inject.d.ts +6 -2
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/binanceGetAddress.d.ts +11 -0
- package/dist/types/api/binanceGetAddress.d.ts.map +1 -0
- package/dist/types/api/binanceGetPublicKey.d.ts +11 -0
- package/dist/types/api/binanceGetPublicKey.d.ts.map +1 -0
- package/dist/types/api/binanceSignTx.d.ts +7 -0
- package/dist/types/api/binanceSignTx.d.ts.map +1 -0
- package/dist/types/api/bixinBackupDevice.d.ts +4 -0
- package/dist/types/api/bixinBackupDevice.d.ts.map +1 -0
- package/dist/types/api/bixinLoadDevice.d.ts +4 -0
- package/dist/types/api/bixinLoadDevice.d.ts.map +1 -0
- package/dist/types/api/bixinMessageSE.d.ts +4 -0
- package/dist/types/api/bixinMessageSE.d.ts.map +1 -0
- package/dist/types/api/bixinVerifyDeviceRequest.d.ts +4 -0
- package/dist/types/api/bixinVerifyDeviceRequest.d.ts.map +1 -0
- package/dist/types/api/btcAuthorizeCoinJoin.d.ts +13 -0
- package/dist/types/api/btcAuthorizeCoinJoin.d.ts.map +1 -0
- package/dist/types/api/btcGetOwnershipId.d.ts +10 -0
- package/dist/types/api/btcGetOwnershipId.d.ts.map +1 -0
- package/dist/types/api/btcGetOwnershipProof.d.ts +13 -0
- package/dist/types/api/btcGetOwnershipProof.d.ts.map +1 -0
- package/dist/types/api/cryptoBatchGetPublickeys.d.ts +12 -0
- package/dist/types/api/cryptoBatchGetPublickeys.d.ts.map +1 -0
- package/dist/types/api/cryptoCipherKeyValue.d.ts +13 -0
- package/dist/types/api/cryptoCipherKeyValue.d.ts.map +1 -0
- package/dist/types/api/cryptoCosiCommit.d.ts +8 -0
- package/dist/types/api/cryptoCosiCommit.d.ts.map +1 -0
- package/dist/types/api/cryptoCosiSign.d.ts +10 -0
- package/dist/types/api/cryptoCosiSign.d.ts.map +1 -0
- package/dist/types/api/cryptoGetECDHSessionKey.d.ts +4 -0
- package/dist/types/api/cryptoGetECDHSessionKey.d.ts.map +1 -0
- package/dist/types/api/cryptoSignIdentity.d.ts +4 -0
- package/dist/types/api/cryptoSignIdentity.d.ts.map +1 -0
- package/dist/types/api/debugLinkDecision.d.ts +4 -0
- package/dist/types/api/debugLinkDecision.d.ts.map +1 -0
- package/dist/types/api/debugLinkEraseSdCard.d.ts +4 -0
- package/dist/types/api/debugLinkEraseSdCard.d.ts.map +1 -0
- package/dist/types/api/debugLinkFlashErase.d.ts +4 -0
- package/dist/types/api/debugLinkFlashErase.d.ts.map +1 -0
- package/dist/types/api/debugLinkGetState.d.ts +4 -0
- package/dist/types/api/debugLinkGetState.d.ts.map +1 -0
- package/dist/types/api/debugLinkMemoryRead.d.ts +4 -0
- package/dist/types/api/debugLinkMemoryRead.d.ts.map +1 -0
- package/dist/types/api/debugLinkMemoryWrite.d.ts +4 -0
- package/dist/types/api/debugLinkMemoryWrite.d.ts.map +1 -0
- package/dist/types/api/debugLinkRecordScreen.d.ts +4 -0
- package/dist/types/api/debugLinkRecordScreen.d.ts.map +1 -0
- package/dist/types/api/debugLinkReseedRandom.d.ts +4 -0
- package/dist/types/api/debugLinkReseedRandom.d.ts.map +1 -0
- package/dist/types/api/debugLinkStop.d.ts +4 -0
- package/dist/types/api/debugLinkStop.d.ts.map +1 -0
- package/dist/types/api/debugLinkWatchLayout.d.ts +4 -0
- package/dist/types/api/debugLinkWatchLayout.d.ts.map +1 -0
- package/dist/types/api/deviceCancelAuthorization.d.ts +4 -0
- package/dist/types/api/deviceCancelAuthorization.d.ts.map +1 -0
- package/dist/types/api/deviceChangeWipeCode.d.ts +4 -0
- package/dist/types/api/deviceChangeWipeCode.d.ts.map +1 -0
- package/dist/types/api/deviceDoPreauthorized.d.ts +4 -0
- package/dist/types/api/deviceDoPreauthorized.d.ts.map +1 -0
- package/dist/types/api/deviceEndSession.d.ts +4 -0
- package/dist/types/api/deviceEndSession.d.ts.map +1 -0
- package/dist/types/api/deviceGetEntropy.d.ts +4 -0
- package/dist/types/api/deviceGetEntropy.d.ts.map +1 -0
- package/dist/types/api/deviceGetFirmwareHash.d.ts +4 -0
- package/dist/types/api/deviceGetFirmwareHash.d.ts.map +1 -0
- package/dist/types/api/deviceGetInfo.d.ts +4 -0
- package/dist/types/api/deviceGetInfo.d.ts.map +1 -0
- package/dist/types/api/deviceInfoSettings.d.ts +4 -0
- package/dist/types/api/deviceInfoSettings.d.ts.map +1 -0
- package/dist/types/api/deviceLoad.d.ts +16 -0
- package/dist/types/api/deviceLoad.d.ts.map +1 -0
- package/dist/types/api/devicePing.d.ts +4 -0
- package/dist/types/api/devicePing.d.ts.map +1 -0
- package/dist/types/api/deviceReadSEPublicCert.d.ts +4 -0
- package/dist/types/api/deviceReadSEPublicCert.d.ts.map +1 -0
- package/dist/types/api/deviceSESignMessage.d.ts +4 -0
- package/dist/types/api/deviceSESignMessage.d.ts.map +1 -0
- package/dist/types/api/deviceSdProtect.d.ts +4 -0
- package/dist/types/api/deviceSdProtect.d.ts.map +1 -0
- package/dist/types/api/deviceSpiFlashRead.d.ts +4 -0
- package/dist/types/api/deviceSpiFlashRead.d.ts.map +1 -0
- package/dist/types/api/deviceSpiFlashWrite.d.ts +4 -0
- package/dist/types/api/deviceSpiFlashWrite.d.ts.map +1 -0
- package/dist/types/api/deviceUnlockPath.d.ts +11 -0
- package/dist/types/api/deviceUnlockPath.d.ts.map +1 -0
- package/dist/types/api/deviceWriteSEPrivateKey.d.ts +4 -0
- package/dist/types/api/deviceWriteSEPrivateKey.d.ts.map +1 -0
- package/dist/types/api/deviceWriteSEPublicCert.d.ts +4 -0
- package/dist/types/api/deviceWriteSEPublicCert.d.ts.map +1 -0
- package/dist/types/api/emmcDirList.d.ts +4 -0
- package/dist/types/api/emmcDirList.d.ts.map +1 -0
- package/dist/types/api/emmcDirMake.d.ts +4 -0
- package/dist/types/api/emmcDirMake.d.ts.map +1 -0
- package/dist/types/api/emmcDirRemove.d.ts +4 -0
- package/dist/types/api/emmcDirRemove.d.ts.map +1 -0
- package/dist/types/api/emmcFileDelete.d.ts +4 -0
- package/dist/types/api/emmcFileDelete.d.ts.map +1 -0
- package/dist/types/api/emmcFileRead.d.ts +4 -0
- package/dist/types/api/emmcFileRead.d.ts.map +1 -0
- package/dist/types/api/emmcFileWrite.d.ts +4 -0
- package/dist/types/api/emmcFileWrite.d.ts.map +1 -0
- package/dist/types/api/emmcFixPermission.d.ts +4 -0
- package/dist/types/api/emmcFixPermission.d.ts.map +1 -0
- package/dist/types/api/emmcPathInfo.d.ts +4 -0
- package/dist/types/api/emmcPathInfo.d.ts.map +1 -0
- package/dist/types/api/eosGetPublicKey.d.ts +8 -0
- package/dist/types/api/eosGetPublicKey.d.ts.map +1 -0
- package/dist/types/api/eosSignTx.d.ts +7 -0
- package/dist/types/api/eosSignTx.d.ts.map +1 -0
- package/dist/types/api/evmGetAddressTrezor.d.ts +15 -0
- package/dist/types/api/evmGetAddressTrezor.d.ts.map +1 -0
- package/dist/types/api/evmGetPublicKeyTrezor.d.ts +20 -0
- package/dist/types/api/evmGetPublicKeyTrezor.d.ts.map +1 -0
- package/dist/types/api/evmSignMessageTrezor.d.ts +9 -0
- package/dist/types/api/evmSignMessageTrezor.d.ts.map +1 -0
- package/dist/types/api/evmSignTransactionTrezor.d.ts +40 -0
- package/dist/types/api/evmSignTransactionTrezor.d.ts.map +1 -0
- package/dist/types/api/evmSignTypedDataTrezor.d.ts +34 -0
- package/dist/types/api/evmSignTypedDataTrezor.d.ts.map +1 -0
- package/dist/types/api/evmVerifyMessageTrezor.d.ts +10 -0
- package/dist/types/api/evmVerifyMessageTrezor.d.ts.map +1 -0
- package/dist/types/api/firmwareErase.d.ts +4 -0
- package/dist/types/api/firmwareErase.d.ts.map +1 -0
- package/dist/types/api/firmwareEraseEx.d.ts +4 -0
- package/dist/types/api/firmwareEraseEx.d.ts.map +1 -0
- package/dist/types/api/firmwareUpdateEmmcTest.d.ts +4 -0
- package/dist/types/api/firmwareUpdateEmmcTest.d.ts.map +1 -0
- package/dist/types/api/firmwareUploadTest.d.ts +4 -0
- package/dist/types/api/firmwareUploadTest.d.ts.map +1 -0
- package/dist/types/api/getPublicKeyMultiple.d.ts +4 -0
- package/dist/types/api/getPublicKeyMultiple.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +176 -3
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/listResDir.d.ts +4 -0
- package/dist/types/api/listResDir.d.ts.map +1 -0
- package/dist/types/api/moneroGetAddress.d.ts +14 -0
- package/dist/types/api/moneroGetAddress.d.ts.map +1 -0
- package/dist/types/api/moneroGetWatchKey.d.ts +14 -0
- package/dist/types/api/moneroGetWatchKey.d.ts.map +1 -0
- package/dist/types/api/nemDecryptMessage.d.ts +10 -0
- package/dist/types/api/nemDecryptMessage.d.ts.map +1 -0
- package/dist/types/api/nftWriteData.d.ts +4 -0
- package/dist/types/api/nftWriteData.d.ts.map +1 -0
- package/dist/types/api/nftWriteInfo.d.ts +4 -0
- package/dist/types/api/nftWriteInfo.d.ts.map +1 -0
- package/dist/types/api/protocolV2.d.ts +8 -2
- package/dist/types/api/protocolV2.d.ts.map +1 -1
- package/dist/types/api/readSEPublicKey.d.ts +4 -0
- package/dist/types/api/readSEPublicKey.d.ts.map +1 -0
- package/dist/types/api/reboot.d.ts +4 -0
- package/dist/types/api/reboot.d.ts.map +1 -0
- package/dist/types/api/resourceUpdate.d.ts +7 -0
- package/dist/types/api/resourceUpdate.d.ts.map +1 -0
- package/dist/types/api/selfTest.d.ts +4 -0
- package/dist/types/api/selfTest.d.ts.map +1 -0
- package/dist/types/api/tezosGetAddress.d.ts +14 -0
- package/dist/types/api/tezosGetAddress.d.ts.map +1 -0
- package/dist/types/api/tezosGetPublicKey.d.ts +14 -0
- package/dist/types/api/tezosGetPublicKey.d.ts.map +1 -0
- package/dist/types/api/tezosSignTx.d.ts +7 -0
- package/dist/types/api/tezosSignTx.d.ts.map +1 -0
- package/dist/types/api/webAuthnAddResidentCredential.d.ts +4 -0
- package/dist/types/api/webAuthnAddResidentCredential.d.ts.map +1 -0
- package/dist/types/api/webAuthnListResidentCredentials.d.ts +4 -0
- package/dist/types/api/webAuthnListResidentCredentials.d.ts.map +1 -0
- package/dist/types/api/webAuthnRemoveResidentCredential.d.ts +4 -0
- package/dist/types/api/webAuthnRemoveResidentCredential.d.ts.map +1 -0
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/patch.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/BixinBackupDevice.ts +15 -0
- package/src/api/BixinLoadDevice.ts +22 -0
- package/src/api/BixinMessageSE.ts +22 -0
- package/src/api/BixinVerifyDeviceRequest.ts +22 -0
- package/src/api/WebAuthnAddResidentCredential.ts +22 -0
- package/src/api/WebAuthnListResidentCredentials.ts +24 -0
- package/src/api/WebAuthnRemoveResidentCredential.ts +22 -0
- package/src/api/binance/BinanceGetAddress.ts +26 -0
- package/src/api/binance/BinanceGetPublicKey.ts +26 -0
- package/src/api/binance/BinanceSignTx.ts +35 -0
- package/src/api/btc/BTCAuthorizeCoinJoin.ts +37 -0
- package/src/api/btc/BTCGetOwnershipId.ts +34 -0
- package/src/api/btc/BTCGetOwnershipProof.ts +37 -0
- package/src/api/crypto/CryptoBatchGetPublickeys.ts +30 -0
- package/src/api/crypto/CryptoCipherKeyValue.ts +29 -0
- package/src/api/crypto/CryptoCosiCommit.ts +24 -0
- package/src/api/crypto/CryptoCosiSign.ts +26 -0
- package/src/api/crypto/CryptoGetECDHSessionKey.ts +24 -0
- package/src/api/crypto/CryptoSignIdentity.ts +25 -0
- package/src/api/debug/DebugLinkDecision.ts +25 -0
- package/src/api/debug/DebugLinkEraseSdCard.ts +23 -0
- package/src/api/debug/DebugLinkFlashErase.ts +23 -0
- package/src/api/debug/DebugLinkGetState.ts +21 -0
- package/src/api/debug/DebugLinkMemoryRead.ts +24 -0
- package/src/api/debug/DebugLinkMemoryWrite.ts +25 -0
- package/src/api/debug/DebugLinkRecordScreen.ts +23 -0
- package/src/api/debug/DebugLinkReseedRandom.ts +23 -0
- package/src/api/debug/DebugLinkStop.ts +25 -0
- package/src/api/debug/DebugLinkWatchLayout.ts +23 -0
- package/src/api/device/DeviceVerify.ts +2 -0
- package/src/api/emmc/EmmcDirList.ts +20 -0
- package/src/api/emmc/EmmcDirMake.ts +20 -0
- package/src/api/emmc/EmmcDirRemove.ts +20 -0
- package/src/api/emmc/EmmcFileDelete.ts +20 -0
- package/src/api/emmc/EmmcFileRead.ts +21 -0
- package/src/api/emmc/EmmcFileWrite.ts +23 -0
- package/src/api/emmc/EmmcFixPermission.ts +17 -0
- package/src/api/emmc/EmmcPathInfo.ts +20 -0
- package/src/api/eos/EosGetPublicKey.ts +26 -0
- package/src/api/eos/EosSignTx.ts +40 -0
- package/src/api/evmTrezor/EVMGetAddress.ts +75 -0
- package/src/api/evmTrezor/EVMGetPublicKey.ts +106 -0
- package/src/api/evmTrezor/EVMSignMessage.ts +40 -0
- package/src/api/evmTrezor/EVMSignTransaction.ts +83 -0
- package/src/api/evmTrezor/EVMSignTypedData.ts +366 -0
- package/src/api/evmTrezor/EVMVerifyMessage.ts +37 -0
- package/src/api/evmTrezor/legacyV1/getAddress.ts +16 -0
- package/src/api/evmTrezor/legacyV1/getPublicKey.ts +20 -0
- package/src/api/evmTrezor/legacyV1/signMessage.ts +22 -0
- package/src/api/evmTrezor/legacyV1/signTransaction.ts +24 -0
- package/src/api/evmTrezor/legacyV1/signTypedData.ts +36 -0
- package/src/api/evmTrezor/legacyV1/signTypedHash.ts +48 -0
- package/src/api/evmTrezor/legacyV1/verifyMessage.ts +19 -0
- package/src/api/extensionMethodNames.ts +88 -0
- package/src/api/factoryMethods.ts +2 -0
- package/src/api/firmware/FirmwareErase.ts +18 -0
- package/src/api/firmware/FirmwareEraseEx.ts +18 -0
- package/src/api/firmware/FirmwareUpdateEmmcTest.ts +18 -0
- package/src/api/firmware/FirmwareUploadTest.ts +17 -0
- package/src/api/firmware/Reboot.ts +17 -0
- package/src/api/firmware/SelfTest.ts +17 -0
- package/src/api/index.ts +3 -0
- package/src/api/manager/DeviceCancelAuthorization.ts +15 -0
- package/src/api/manager/DeviceChangeWipeCode.ts +19 -0
- package/src/api/manager/DeviceDoPreauthorized.ts +15 -0
- package/src/api/manager/DeviceEndSession.ts +19 -0
- package/src/api/manager/DeviceGetEntropy.ts +19 -0
- package/src/api/manager/DeviceGetFirmwareHash.ts +23 -0
- package/src/api/manager/DeviceInfoSettings.ts +23 -0
- package/src/api/manager/DeviceLoad.ts +27 -0
- package/src/api/manager/DevicePing.ts +19 -0
- package/src/api/manager/DeviceReadSEPublicCert.ts +18 -0
- package/src/api/manager/DeviceSESignMessage.ts +23 -0
- package/src/api/manager/DeviceSdProtect.ts +18 -0
- package/src/api/manager/DeviceSpiFlashRead.ts +22 -0
- package/src/api/manager/DeviceSpiFlashWrite.ts +22 -0
- package/src/api/manager/DeviceUnlockPath.ts +26 -0
- package/src/api/manager/DeviceWriteSEPrivateKey.ts +23 -0
- package/src/api/manager/DeviceWriteSEPublicCert.ts +23 -0
- package/src/api/manager/GetDeviceInfoSettings.ts +20 -0
- package/src/api/manager/GetPublicKeyMultiple.ts +24 -0
- package/src/api/manager/ListResDir.ts +19 -0
- package/src/api/manager/NFTWriteData.ts +21 -0
- package/src/api/manager/NFTWriteInfo.ts +23 -0
- package/src/api/manager/ReadSEPublicKey.ts +20 -0
- package/src/api/manager/ResourceUpdate.ts +22 -0
- package/src/api/methodExtension.ts +27 -0
- package/src/api/monero/MoneroGetAddress.ts +64 -0
- package/src/api/monero/MoneroGetWatchKey.ts +59 -0
- package/src/api/nem/NEMDecryptMessage.ts +29 -0
- package/src/api/protocol-v2/DeviceFactoryCertificateRead.ts +25 -0
- package/src/api/protocol-v2/DeviceFactoryCertificateWrite.ts +30 -0
- package/src/api/protocol-v2/DeviceFactoryChallengeSign.ts +28 -0
- package/src/api/protocol-v2/DeviceFactoryInfoGet.ts +3 -0
- package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +6 -7
- package/src/api/protocol-v2/helpers.ts +152 -5
- package/src/api/testMethods.ts +95 -0
- package/src/api/tezos/TezosGetAddress.ts +64 -0
- package/src/api/tezos/TezosGetPublicKey.ts +63 -0
- package/src/api/tezos/TezosSignTx.ts +44 -0
- package/src/api/utils.ts +46 -1
- package/src/core/index.ts +22 -7
- package/src/index.ts +5 -0
- package/src/inject.ts +209 -7
- package/src/types/api/binanceGetAddress.ts +17 -0
- package/src/types/api/binanceGetPublicKey.ts +17 -0
- package/src/types/api/binanceSignTx.ts +15 -0
- package/src/types/api/bixinBackupDevice.ts +8 -0
- package/src/types/api/bixinLoadDevice.ts +8 -0
- package/src/types/api/bixinMessageSE.ts +8 -0
- package/src/types/api/bixinVerifyDeviceRequest.ts +8 -0
- package/src/types/api/btcAuthorizeCoinJoin.ts +18 -0
- package/src/types/api/btcGetOwnershipId.ts +19 -0
- package/src/types/api/btcGetOwnershipProof.ts +22 -0
- package/src/types/api/cryptoBatchGetPublickeys.ts +18 -0
- package/src/types/api/cryptoCipherKeyValue.ts +18 -0
- package/src/types/api/cryptoCosiCommit.ts +13 -0
- package/src/types/api/cryptoCosiSign.ts +15 -0
- package/src/types/api/cryptoGetECDHSessionKey.ts +8 -0
- package/src/types/api/cryptoSignIdentity.ts +8 -0
- package/src/types/api/debugLinkDecision.ts +7 -0
- package/src/types/api/debugLinkEraseSdCard.ts +7 -0
- package/src/types/api/debugLinkFlashErase.ts +7 -0
- package/src/types/api/debugLinkGetState.ts +7 -0
- package/src/types/api/debugLinkMemoryRead.ts +7 -0
- package/src/types/api/debugLinkMemoryWrite.ts +7 -0
- package/src/types/api/debugLinkRecordScreen.ts +7 -0
- package/src/types/api/debugLinkReseedRandom.ts +7 -0
- package/src/types/api/debugLinkStop.ts +7 -0
- package/src/types/api/debugLinkWatchLayout.ts +7 -0
- package/src/types/api/deviceCancelAuthorization.ts +7 -0
- package/src/types/api/deviceChangeWipeCode.ts +7 -0
- package/src/types/api/deviceDoPreauthorized.ts +7 -0
- package/src/types/api/deviceEndSession.ts +7 -0
- package/src/types/api/deviceGetEntropy.ts +7 -0
- package/src/types/api/deviceGetFirmwareHash.ts +7 -0
- package/src/types/api/deviceGetInfo.ts +7 -0
- package/src/types/api/deviceInfoSettings.ts +7 -0
- package/src/types/api/deviceLoad.ts +19 -0
- package/src/types/api/devicePing.ts +7 -0
- package/src/types/api/deviceReadSEPublicCert.ts +7 -0
- package/src/types/api/deviceSESignMessage.ts +7 -0
- package/src/types/api/deviceSdProtect.ts +7 -0
- package/src/types/api/deviceSpiFlashRead.ts +7 -0
- package/src/types/api/deviceSpiFlashWrite.ts +7 -0
- package/src/types/api/deviceUnlockPath.ts +16 -0
- package/src/types/api/deviceWriteSEPrivateKey.ts +7 -0
- package/src/types/api/deviceWriteSEPublicCert.ts +7 -0
- package/src/types/api/emmcDirList.ts +7 -0
- package/src/types/api/emmcDirMake.ts +7 -0
- package/src/types/api/emmcDirRemove.ts +7 -0
- package/src/types/api/emmcFileDelete.ts +7 -0
- package/src/types/api/emmcFileRead.ts +7 -0
- package/src/types/api/emmcFileWrite.ts +7 -0
- package/src/types/api/emmcFixPermission.ts +7 -0
- package/src/types/api/emmcPathInfo.ts +7 -0
- package/src/types/api/eosGetPublicKey.ts +13 -0
- package/src/types/api/eosSignTx.ts +12 -0
- package/src/types/api/evmGetAddressTrezor.ts +24 -0
- package/src/types/api/evmGetPublicKeyTrezor.ts +31 -0
- package/src/types/api/evmSignMessageTrezor.ts +14 -0
- package/src/types/api/evmSignTransactionTrezor.ts +49 -0
- package/src/types/api/evmSignTypedDataTrezor.ts +42 -0
- package/src/types/api/evmVerifyMessageTrezor.ts +15 -0
- package/src/types/api/firmwareErase.ts +4 -0
- package/src/types/api/firmwareEraseEx.ts +7 -0
- package/src/types/api/firmwareUpdateEmmcTest.ts +7 -0
- package/src/types/api/firmwareUploadTest.ts +7 -0
- package/src/types/api/getPublicKeyMultiple.ts +11 -0
- package/src/types/api/index.ts +288 -2
- package/src/types/api/listResDir.ts +8 -0
- package/src/types/api/moneroGetAddress.ts +23 -0
- package/src/types/api/moneroGetWatchKey.ts +26 -0
- package/src/types/api/nemDecryptMessage.ts +15 -0
- package/src/types/api/nftWriteData.ts +8 -0
- package/src/types/api/nftWriteInfo.ts +8 -0
- package/src/types/api/protocolV2.ts +43 -2
- package/src/types/api/readSEPublicKey.ts +8 -0
- package/src/types/api/reboot.ts +4 -0
- package/src/types/api/resourceUpdate.ts +11 -0
- package/src/types/api/selfTest.ts +7 -0
- package/src/types/api/tezosGetAddress.ts +23 -0
- package/src/types/api/tezosGetPublicKey.ts +23 -0
- package/src/types/api/tezosSignTx.ts +12 -0
- package/src/types/api/webAuthnAddResidentCredential.ts +8 -0
- package/src/types/api/webAuthnListResidentCredentials.ts +8 -0
- package/src/types/api/webAuthnRemoveResidentCredential.ts +8 -0
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import semver from 'semver';
|
|
2
|
+
import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
3
|
+
import { get } from 'lodash';
|
|
4
|
+
|
|
5
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
6
|
+
import { validatePath } from '../helpers/pathUtils';
|
|
7
|
+
import { BaseMethod } from '../BaseMethod';
|
|
8
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
9
|
+
import { formatAnyHex } from '../helpers/hexUtils';
|
|
10
|
+
import { getDeviceFirmwareVersion, getDeviceType } from '../../utils';
|
|
11
|
+
import {
|
|
12
|
+
DeviceModelToTypes,
|
|
13
|
+
type EthereumSignTypedDataMessage,
|
|
14
|
+
type EthereumSignTypedDataTypes,
|
|
15
|
+
} from '../../types';
|
|
16
|
+
import { signTypedHash as signTypedHashLegacyV1 } from './legacyV1/signTypedHash';
|
|
17
|
+
import { signTypedData as signTypedDataLegacyV1 } from './legacyV1/signTypedData';
|
|
18
|
+
import { encodeData, getFieldType, parseArrayType } from '../helpers/typeNameUtils';
|
|
19
|
+
|
|
20
|
+
import type {
|
|
21
|
+
EthereumTypedDataSignature,
|
|
22
|
+
EthereumTypedDataStructAck,
|
|
23
|
+
MessageKey,
|
|
24
|
+
MessageResponse,
|
|
25
|
+
TypedCall,
|
|
26
|
+
} from '@onekeyfe/hd-transport';
|
|
27
|
+
|
|
28
|
+
export type EVMSignTypedDataParams = {
|
|
29
|
+
addressN: number[];
|
|
30
|
+
metamaskV4Compat: boolean;
|
|
31
|
+
data: EthereumSignTypedDataMessage<EthereumSignTypedDataTypes>;
|
|
32
|
+
domainHash?: string;
|
|
33
|
+
messageHash?: string;
|
|
34
|
+
chainId?: number;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default class EVMSignTypedData extends BaseMethod<EVMSignTypedDataParams> {
|
|
38
|
+
init() {
|
|
39
|
+
this.checkDeviceId = true;
|
|
40
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|
|
41
|
+
|
|
42
|
+
validateParams(this.payload, [
|
|
43
|
+
{ name: 'path', required: true },
|
|
44
|
+
{ name: 'metamaskV4Compat', type: 'boolean' },
|
|
45
|
+
{ name: 'data', type: 'object' },
|
|
46
|
+
{ name: 'domainHash', type: 'hexString' },
|
|
47
|
+
{ name: 'messageHash', type: 'hexString' },
|
|
48
|
+
{ name: 'chainId', type: 'number' },
|
|
49
|
+
]);
|
|
50
|
+
|
|
51
|
+
const { path, data, metamaskV4Compat, domainHash, messageHash, chainId } = this.payload;
|
|
52
|
+
|
|
53
|
+
const addressN = validatePath(path, 3);
|
|
54
|
+
|
|
55
|
+
this.params = {
|
|
56
|
+
addressN,
|
|
57
|
+
metamaskV4Compat,
|
|
58
|
+
data,
|
|
59
|
+
chainId,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
if (domainHash) {
|
|
63
|
+
this.params.domainHash = formatAnyHex(domainHash);
|
|
64
|
+
if (messageHash) {
|
|
65
|
+
this.params.messageHash = formatAnyHex(messageHash);
|
|
66
|
+
} else if (!!data && (!data.primaryType || data.primaryType !== 'EIP712Domain')) {
|
|
67
|
+
throw ERRORS.TypedError(
|
|
68
|
+
HardwareErrorCode.CallMethodInvalidParameter,
|
|
69
|
+
'message_hash should only be empty when data.primaryType=EIP712Domain'
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async handleSignTypedData({
|
|
76
|
+
typedCall,
|
|
77
|
+
signData,
|
|
78
|
+
response,
|
|
79
|
+
}: {
|
|
80
|
+
typedCall: TypedCall;
|
|
81
|
+
signData: EthereumSignTypedDataMessage<EthereumSignTypedDataTypes>;
|
|
82
|
+
response: MessageResponse<MessageKey>;
|
|
83
|
+
}) {
|
|
84
|
+
const {
|
|
85
|
+
types,
|
|
86
|
+
primaryType,
|
|
87
|
+
domain,
|
|
88
|
+
message,
|
|
89
|
+
}: EthereumSignTypedDataMessage<EthereumSignTypedDataTypes> = signData;
|
|
90
|
+
|
|
91
|
+
while (response.type === 'EthereumTypedDataStructRequest') {
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
const { name: typeDefinitionName } = response.message;
|
|
94
|
+
const typeDefinition = types[typeDefinitionName];
|
|
95
|
+
if (typeDefinition === undefined) {
|
|
96
|
+
throw ERRORS.TypedError(
|
|
97
|
+
'Runtime',
|
|
98
|
+
`Type ${typeDefinitionName} was not defined in types object`
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const dataStruckAck: EthereumTypedDataStructAck = {
|
|
103
|
+
members: typeDefinition.map(({ name, type: typeName }) => ({
|
|
104
|
+
name,
|
|
105
|
+
type: getFieldType(typeName, types),
|
|
106
|
+
})),
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
response = await typedCall(
|
|
110
|
+
'EthereumTypedDataStructAck',
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
[
|
|
113
|
+
'EthereumTypedDataStructRequest',
|
|
114
|
+
'EthereumTypedDataValueRequest',
|
|
115
|
+
'EthereumTypedDataSignature',
|
|
116
|
+
],
|
|
117
|
+
dataStruckAck
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
while (response.type === 'EthereumTypedDataValueRequest') {
|
|
122
|
+
// @ts-ignore
|
|
123
|
+
const { member_path } = response.message;
|
|
124
|
+
|
|
125
|
+
let memberData;
|
|
126
|
+
let memberTypeName: string;
|
|
127
|
+
|
|
128
|
+
const [rootIndex, ...nestedMemberPath] = member_path;
|
|
129
|
+
switch (rootIndex) {
|
|
130
|
+
case 0:
|
|
131
|
+
memberData = domain;
|
|
132
|
+
memberTypeName = 'EIP712Domain';
|
|
133
|
+
break;
|
|
134
|
+
case 1:
|
|
135
|
+
memberData = message;
|
|
136
|
+
memberTypeName = primaryType as string;
|
|
137
|
+
break;
|
|
138
|
+
default:
|
|
139
|
+
throw ERRORS.TypedError('Runtime', 'Root index can only be 0 or 1');
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
for (const index of nestedMemberPath) {
|
|
143
|
+
if (Array.isArray(memberData)) {
|
|
144
|
+
memberTypeName = parseArrayType(memberTypeName).entryTypeName;
|
|
145
|
+
memberData = memberData[index];
|
|
146
|
+
} else if (typeof memberData === 'object' && memberData !== null) {
|
|
147
|
+
const memberTypeDefinition = types[memberTypeName][index];
|
|
148
|
+
memberTypeName = memberTypeDefinition.type;
|
|
149
|
+
memberData = (memberData as Record<string, unknown>)[memberTypeDefinition.name];
|
|
150
|
+
} else {
|
|
151
|
+
// TODO
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
let encodedData;
|
|
156
|
+
if (Array.isArray(memberData)) {
|
|
157
|
+
// Sending the length as uint16
|
|
158
|
+
encodedData = encodeData('uint16', memberData.length);
|
|
159
|
+
} else {
|
|
160
|
+
encodedData = encodeData(memberTypeName, memberData);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
response = await typedCall(
|
|
164
|
+
'EthereumTypedDataValueAck',
|
|
165
|
+
// @ts-ignore
|
|
166
|
+
['EthereumTypedDataValueRequest', 'EthereumTypedDataSignature'],
|
|
167
|
+
{
|
|
168
|
+
value: encodedData,
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (response.type !== 'EthereumTypedDataSignature') {
|
|
174
|
+
throw ERRORS.TypedError('Runtime', 'Unexpected response type');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// @ts-ignore
|
|
178
|
+
const { address, signature }: EthereumTypedDataSignature = response.message;
|
|
179
|
+
return {
|
|
180
|
+
address,
|
|
181
|
+
signature,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
async signTypedData() {
|
|
186
|
+
const { addressN, data, metamaskV4Compat, chainId } = this.params;
|
|
187
|
+
|
|
188
|
+
const response = await signTypedDataLegacyV1({
|
|
189
|
+
typedCall: this.device.commands.typedCall.bind(this.device.commands),
|
|
190
|
+
addressN,
|
|
191
|
+
data,
|
|
192
|
+
metamaskV4Compat,
|
|
193
|
+
chainId,
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
return this.handleSignTypedData({
|
|
197
|
+
typedCall: this.device.commands.typedCall.bind(this.device.commands),
|
|
198
|
+
signData: data,
|
|
199
|
+
response,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
signTypedHash({
|
|
204
|
+
typedCall,
|
|
205
|
+
addressN,
|
|
206
|
+
domainHash,
|
|
207
|
+
messageHash,
|
|
208
|
+
chainId,
|
|
209
|
+
}: {
|
|
210
|
+
typedCall: TypedCall;
|
|
211
|
+
addressN: number[];
|
|
212
|
+
domainHash: string | undefined;
|
|
213
|
+
messageHash: string | undefined;
|
|
214
|
+
chainId: number | undefined;
|
|
215
|
+
}) {
|
|
216
|
+
if (!domainHash) throw ERRORS.TypedError('Runtime', 'domainHash is required');
|
|
217
|
+
|
|
218
|
+
return signTypedHashLegacyV1({
|
|
219
|
+
typedCall,
|
|
220
|
+
addressN,
|
|
221
|
+
chainId,
|
|
222
|
+
domainHash,
|
|
223
|
+
messageHash,
|
|
224
|
+
device: this.device,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
getVersionRange() {
|
|
229
|
+
return {
|
|
230
|
+
model_mini: {
|
|
231
|
+
min: '2.1.9',
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
hasBiggerData(item: EthereumSignTypedDataMessage<EthereumSignTypedDataTypes>) {
|
|
237
|
+
const data = get(item.message, 'data', undefined) as string | undefined;
|
|
238
|
+
if (!data) return false;
|
|
239
|
+
|
|
240
|
+
let biggerLimit = 1024; // 1k
|
|
241
|
+
|
|
242
|
+
const currentVersion = getDeviceFirmwareVersion(this.device.features).join('.');
|
|
243
|
+
const supportBiggerDataVersion = '4.4.0';
|
|
244
|
+
|
|
245
|
+
if (semver.gte(currentVersion, supportBiggerDataVersion)) {
|
|
246
|
+
biggerLimit = 1536; // 1.5k
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const startIndex = data.startsWith('0x') ? 2 : 0;
|
|
250
|
+
return (data.length - startIndex) / 2 > biggerLimit;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
hasNestedArrays(item: any): boolean {
|
|
254
|
+
if (!item) return false;
|
|
255
|
+
|
|
256
|
+
if (Array.isArray(item)) {
|
|
257
|
+
// item is an array
|
|
258
|
+
for (const element of item) {
|
|
259
|
+
if (Array.isArray(element)) {
|
|
260
|
+
// element is a nested array
|
|
261
|
+
return true;
|
|
262
|
+
}
|
|
263
|
+
if (typeof element === 'object' && element !== null) {
|
|
264
|
+
// element is an object, so check its properties recursively
|
|
265
|
+
if (this.hasNestedArrays(element)) {
|
|
266
|
+
return true;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
} else if (typeof item === 'object' && item !== null) {
|
|
271
|
+
// item is an object, so check its properties recursively
|
|
272
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
273
|
+
for (const property in item) {
|
|
274
|
+
if (this.hasNestedArrays(item[property])) {
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
// no nested arrays found
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
supportSignTyped() {
|
|
284
|
+
const deviceType = getDeviceType(this.device.features);
|
|
285
|
+
if (DeviceModelToTypes.model_mini.includes(deviceType)) {
|
|
286
|
+
const currentVersion = getDeviceFirmwareVersion(this.device.features).join('.');
|
|
287
|
+
const supportSignTypedVersion = '2.2.0';
|
|
288
|
+
|
|
289
|
+
if (semver.lt(currentVersion, supportSignTypedVersion)) {
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
return true;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
async run() {
|
|
298
|
+
if (!this.device.features) {
|
|
299
|
+
throw ERRORS.TypedError(
|
|
300
|
+
'Device_InitializeFailed',
|
|
301
|
+
'Device initialization failed. Please try again.'
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const { addressN, chainId } = this.params;
|
|
306
|
+
|
|
307
|
+
// For Classic、Mini device we use EthereumSignTypedData
|
|
308
|
+
const deviceType = getDeviceType(this.device.features);
|
|
309
|
+
if (DeviceModelToTypes.model_mini.includes(deviceType)) {
|
|
310
|
+
validateParams(this.params, [
|
|
311
|
+
{ name: 'domainHash', type: 'hexString', required: true },
|
|
312
|
+
{ name: 'messageHash', type: 'hexString', required: true },
|
|
313
|
+
]);
|
|
314
|
+
|
|
315
|
+
const { domainHash, messageHash } = this.params;
|
|
316
|
+
|
|
317
|
+
let response;
|
|
318
|
+
if (this.supportSignTyped()) {
|
|
319
|
+
response = await this.signTypedHash({
|
|
320
|
+
typedCall: this.device.commands.typedCall.bind(this.device.commands),
|
|
321
|
+
addressN,
|
|
322
|
+
chainId,
|
|
323
|
+
domainHash,
|
|
324
|
+
messageHash,
|
|
325
|
+
});
|
|
326
|
+
} else {
|
|
327
|
+
response = await this.device.commands.typedCall(
|
|
328
|
+
'EthereumSignMessageEIP712',
|
|
329
|
+
'EthereumMessageSignature',
|
|
330
|
+
{
|
|
331
|
+
address_n: addressN,
|
|
332
|
+
domain_hash: domainHash ?? '',
|
|
333
|
+
message_hash: messageHash ?? '',
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
return Promise.resolve(response.message);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// Touch Pro Sign NestedArrays
|
|
342
|
+
if (this.hasNestedArrays(this.params.data) || this.hasBiggerData(this.params.data)) {
|
|
343
|
+
validateParams(this.params, [
|
|
344
|
+
{ name: 'domainHash', type: 'hexString', required: true },
|
|
345
|
+
{ name: 'messageHash', type: 'hexString', required: true },
|
|
346
|
+
]);
|
|
347
|
+
|
|
348
|
+
const { domainHash, messageHash } = this.params;
|
|
349
|
+
|
|
350
|
+
if (!domainHash) throw ERRORS.TypedError('Runtime', 'domainHash is required');
|
|
351
|
+
|
|
352
|
+
const response = await this.signTypedHash({
|
|
353
|
+
typedCall: this.device.commands.typedCall.bind(this.device.commands),
|
|
354
|
+
addressN,
|
|
355
|
+
chainId,
|
|
356
|
+
domainHash,
|
|
357
|
+
messageHash,
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
return Promise.resolve(response.message);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// For Touch、Pro we use EthereumSignTypedData
|
|
364
|
+
return this.signTypedData();
|
|
365
|
+
}
|
|
366
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
2
|
+
import { BaseMethod } from '../BaseMethod';
|
|
3
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
4
|
+
import { formatAnyHex } from '../helpers/hexUtils';
|
|
5
|
+
import verifyMessageLegacyV1 from './legacyV1/verifyMessage';
|
|
6
|
+
|
|
7
|
+
import type { EthereumVerifyMessageOneKey } from '@onekeyfe/hd-transport';
|
|
8
|
+
|
|
9
|
+
export default class EVMSignMessage extends BaseMethod<EthereumVerifyMessageOneKey> {
|
|
10
|
+
init() {
|
|
11
|
+
this.checkDeviceId = true;
|
|
12
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|
|
13
|
+
|
|
14
|
+
validateParams(this.payload, [
|
|
15
|
+
{ name: 'address', type: 'string', required: true },
|
|
16
|
+
{ name: 'messageHex', type: 'hexString', required: true },
|
|
17
|
+
{ name: 'signature', type: 'hexString', required: true },
|
|
18
|
+
{ name: 'chainId', type: 'number' },
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
const { address, messageHex, signature } = formatAnyHex(this.payload);
|
|
22
|
+
|
|
23
|
+
this.params = {
|
|
24
|
+
address,
|
|
25
|
+
message: messageHex,
|
|
26
|
+
signature,
|
|
27
|
+
chain_id: this.payload.chainId,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async run() {
|
|
32
|
+
return verifyMessageLegacyV1({
|
|
33
|
+
typedCall: this.device.commands.typedCall.bind(this.device.commands),
|
|
34
|
+
params: this.params,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EthereumGetAddressOneKey, MessageResponse, TypedCall } from '@onekeyfe/hd-transport';
|
|
2
|
+
|
|
3
|
+
export default async function ({
|
|
4
|
+
typedCall,
|
|
5
|
+
param,
|
|
6
|
+
}: {
|
|
7
|
+
typedCall: TypedCall;
|
|
8
|
+
param: EthereumGetAddressOneKey;
|
|
9
|
+
}): Promise<MessageResponse<'EthereumAddress'>> {
|
|
10
|
+
const message = {
|
|
11
|
+
address_n: param.address_n,
|
|
12
|
+
show_display: param.show_display,
|
|
13
|
+
chain_id: param.chain_id,
|
|
14
|
+
};
|
|
15
|
+
return typedCall('EthereumGetAddress', 'EthereumAddress', message);
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
EthereumGetPublicKeyOneKey,
|
|
3
|
+
MessageResponse,
|
|
4
|
+
TypedCall,
|
|
5
|
+
} from '@onekeyfe/hd-transport';
|
|
6
|
+
|
|
7
|
+
export default async function ({
|
|
8
|
+
typedCall,
|
|
9
|
+
param,
|
|
10
|
+
}: {
|
|
11
|
+
typedCall: TypedCall;
|
|
12
|
+
param: EthereumGetPublicKeyOneKey;
|
|
13
|
+
}): Promise<MessageResponse<'EthereumPublicKey'>> {
|
|
14
|
+
const message = {
|
|
15
|
+
address_n: param.address_n,
|
|
16
|
+
show_display: param.show_display,
|
|
17
|
+
chain_id: param.chain_id,
|
|
18
|
+
};
|
|
19
|
+
return typedCall('EthereumGetPublicKey', 'EthereumPublicKey', message);
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
EthereumMessageSignature,
|
|
3
|
+
EthereumSignMessageOneKey,
|
|
4
|
+
TypedCall,
|
|
5
|
+
} from '@onekeyfe/hd-transport';
|
|
6
|
+
|
|
7
|
+
export default async function ({
|
|
8
|
+
typedCall,
|
|
9
|
+
params,
|
|
10
|
+
}: {
|
|
11
|
+
typedCall: TypedCall;
|
|
12
|
+
params: EthereumSignMessageOneKey;
|
|
13
|
+
}): Promise<EthereumMessageSignature> {
|
|
14
|
+
const message = {
|
|
15
|
+
address_n: params.address_n,
|
|
16
|
+
message: params.message,
|
|
17
|
+
chain_id: params.chain_id,
|
|
18
|
+
};
|
|
19
|
+
const res = await typedCall('EthereumSignMessage', 'EthereumMessageSignature', message);
|
|
20
|
+
|
|
21
|
+
return Promise.resolve(res.message);
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { evmSignTx, evmSignTxEip1559 } from '../../evm/latest/signTransaction';
|
|
2
|
+
|
|
3
|
+
import type { TypedCall } from '@onekeyfe/hd-transport';
|
|
4
|
+
import type { EVMTransaction, EVMTransactionEIP1559 } from '../../../types';
|
|
5
|
+
|
|
6
|
+
export const signTransaction = async ({
|
|
7
|
+
typedCall,
|
|
8
|
+
isEIP1559,
|
|
9
|
+
addressN,
|
|
10
|
+
tx,
|
|
11
|
+
}: {
|
|
12
|
+
addressN: number[];
|
|
13
|
+
tx: EVMTransaction | EVMTransactionEIP1559;
|
|
14
|
+
isEIP1559: boolean;
|
|
15
|
+
typedCall: TypedCall;
|
|
16
|
+
}) =>
|
|
17
|
+
isEIP1559
|
|
18
|
+
? evmSignTxEip1559({
|
|
19
|
+
typedCall,
|
|
20
|
+
addressN,
|
|
21
|
+
tx: tx as EVMTransactionEIP1559,
|
|
22
|
+
supportTrezor: true,
|
|
23
|
+
})
|
|
24
|
+
: evmSignTx({ typedCall, addressN, tx: tx as EVMTransaction, supportTrezor: true });
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { TypedCall } from '@onekeyfe/hd-transport';
|
|
2
|
+
import type { EthereumSignTypedDataMessage, EthereumSignTypedDataTypes } from '../../../types';
|
|
3
|
+
|
|
4
|
+
export const signTypedData = async ({
|
|
5
|
+
typedCall,
|
|
6
|
+
addressN,
|
|
7
|
+
data,
|
|
8
|
+
metamaskV4Compat,
|
|
9
|
+
chainId,
|
|
10
|
+
}: {
|
|
11
|
+
typedCall: TypedCall;
|
|
12
|
+
addressN: number[];
|
|
13
|
+
data: EthereumSignTypedDataMessage<EthereumSignTypedDataTypes>;
|
|
14
|
+
metamaskV4Compat: boolean;
|
|
15
|
+
chainId?: number;
|
|
16
|
+
}) => {
|
|
17
|
+
const { primaryType }: EthereumSignTypedDataMessage<EthereumSignTypedDataTypes> = data;
|
|
18
|
+
|
|
19
|
+
const message = {
|
|
20
|
+
address_n: addressN,
|
|
21
|
+
primary_type: primaryType as string,
|
|
22
|
+
metamask_v4_compat: metamaskV4Compat,
|
|
23
|
+
chain_id: chainId,
|
|
24
|
+
};
|
|
25
|
+
const response = await typedCall(
|
|
26
|
+
'EthereumSignTypedData',
|
|
27
|
+
[
|
|
28
|
+
'EthereumTypedDataStructRequest',
|
|
29
|
+
'EthereumTypedDataValueRequest',
|
|
30
|
+
'EthereumTypedDataSignature',
|
|
31
|
+
'EthereumGnosisSafeTxRequest',
|
|
32
|
+
],
|
|
33
|
+
message
|
|
34
|
+
);
|
|
35
|
+
return response;
|
|
36
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import semver from 'semver';
|
|
2
|
+
import { EDeviceType, ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
3
|
+
|
|
4
|
+
import type { Device } from '../../../device/Device';
|
|
5
|
+
import type { MessageResponse, TypedCall } from '@onekeyfe/hd-transport';
|
|
6
|
+
|
|
7
|
+
export const signTypedHash = async ({
|
|
8
|
+
typedCall,
|
|
9
|
+
addressN,
|
|
10
|
+
device,
|
|
11
|
+
chainId,
|
|
12
|
+
domainHash,
|
|
13
|
+
messageHash,
|
|
14
|
+
}: {
|
|
15
|
+
typedCall: TypedCall;
|
|
16
|
+
addressN: number[];
|
|
17
|
+
device: Device;
|
|
18
|
+
chainId: number | undefined;
|
|
19
|
+
domainHash: string;
|
|
20
|
+
messageHash: string | undefined;
|
|
21
|
+
}): Promise<
|
|
22
|
+
| MessageResponse<'EthereumTypedDataSignature'>
|
|
23
|
+
| MessageResponse<'EthereumTypedDataSignatureOneKey'>
|
|
24
|
+
> => {
|
|
25
|
+
const deviceType = device.getCurrentDeviceType();
|
|
26
|
+
if (deviceType === EDeviceType.Touch || deviceType === EDeviceType.Pro) {
|
|
27
|
+
// Touch Pro Sign NestedArrays
|
|
28
|
+
const currentVersion = device.getCurrentFirmwareVersionString() ?? '0.0.0';
|
|
29
|
+
const supportNestedArraysSignVersion = '4.2.0';
|
|
30
|
+
|
|
31
|
+
// 4.2.0 is the first version that supports nested arrays in signTypedData
|
|
32
|
+
if (semver.lt(currentVersion, supportNestedArraysSignVersion)) {
|
|
33
|
+
throw ERRORS.TypedError(
|
|
34
|
+
HardwareErrorCode.CallMethodNeedUpgradeFirmware,
|
|
35
|
+
`Device firmware version is too low, please update to ${supportNestedArraysSignVersion}`,
|
|
36
|
+
{ current: currentVersion, require: supportNestedArraysSignVersion }
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const message = {
|
|
42
|
+
address_n: addressN,
|
|
43
|
+
domain_separator_hash: domainHash ?? '',
|
|
44
|
+
message_hash: messageHash,
|
|
45
|
+
chain_id: chainId,
|
|
46
|
+
};
|
|
47
|
+
return typedCall('EthereumSignTypedHash', 'EthereumTypedDataSignature', message);
|
|
48
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { EthereumVerifyMessageOneKey, Success, TypedCall } from '@onekeyfe/hd-transport';
|
|
2
|
+
|
|
3
|
+
export default async function ({
|
|
4
|
+
typedCall,
|
|
5
|
+
params,
|
|
6
|
+
}: {
|
|
7
|
+
typedCall: TypedCall;
|
|
8
|
+
params: EthereumVerifyMessageOneKey;
|
|
9
|
+
}): Promise<Success> {
|
|
10
|
+
const message = {
|
|
11
|
+
signature: params.signature,
|
|
12
|
+
message: params.message,
|
|
13
|
+
address: params.address,
|
|
14
|
+
chain_id: params.chain_id,
|
|
15
|
+
};
|
|
16
|
+
const res = await typedCall('EthereumVerifyMessage', 'Success', message);
|
|
17
|
+
|
|
18
|
+
return Promise.resolve(res.message);
|
|
19
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export const TEST_API_METHOD_NAMES = [
|
|
2
|
+
'btcGetOwnershipId',
|
|
3
|
+
'btcGetOwnershipProof',
|
|
4
|
+
'btcAuthorizeCoinJoin',
|
|
5
|
+
'cryptoBatchGetPublickeys',
|
|
6
|
+
'cryptoCipherKeyValue',
|
|
7
|
+
'cryptoCosiCommit',
|
|
8
|
+
'cryptoCosiSign',
|
|
9
|
+
'cryptoGetECDHSessionKey',
|
|
10
|
+
'cryptoSignIdentity',
|
|
11
|
+
'evmGetAddressTrezor',
|
|
12
|
+
'evmGetPublicKeyTrezor',
|
|
13
|
+
'evmSignMessageTrezor',
|
|
14
|
+
'evmSignTransactionTrezor',
|
|
15
|
+
'evmSignTypedDataTrezor',
|
|
16
|
+
'evmVerifyMessageTrezor',
|
|
17
|
+
'nemDecryptMessage',
|
|
18
|
+
'deviceSpiFlashWrite',
|
|
19
|
+
'deviceSpiFlashRead',
|
|
20
|
+
'deviceInfoSettings',
|
|
21
|
+
'deviceGetInfo',
|
|
22
|
+
'deviceReadSEPublicCert',
|
|
23
|
+
'deviceWriteSEPrivateKey',
|
|
24
|
+
'deviceWriteSEPublicCert',
|
|
25
|
+
'deviceSESignMessage',
|
|
26
|
+
'devicePing',
|
|
27
|
+
'deviceGetEntropy',
|
|
28
|
+
'deviceGetFirmwareHash',
|
|
29
|
+
'deviceUnlockPath',
|
|
30
|
+
'deviceSdProtect',
|
|
31
|
+
'deviceChangeWipeCode',
|
|
32
|
+
'deviceEndSession',
|
|
33
|
+
'deviceLoad',
|
|
34
|
+
'deviceDoPreauthorized',
|
|
35
|
+
'deviceCancelAuthorization',
|
|
36
|
+
'emmcDirList',
|
|
37
|
+
'emmcDirMake',
|
|
38
|
+
'emmcDirRemove',
|
|
39
|
+
'emmcFileDelete',
|
|
40
|
+
'emmcFileRead',
|
|
41
|
+
'emmcFileWrite',
|
|
42
|
+
'emmcFixPermission',
|
|
43
|
+
'emmcPathInfo',
|
|
44
|
+
'debugLinkDecision',
|
|
45
|
+
'debugLinkEraseSdCard',
|
|
46
|
+
'debugLinkFlashErase',
|
|
47
|
+
'debugLinkGetState',
|
|
48
|
+
'debugLinkMemoryRead',
|
|
49
|
+
'debugLinkMemoryWrite',
|
|
50
|
+
'debugLinkRecordScreen',
|
|
51
|
+
'debugLinkReseedRandom',
|
|
52
|
+
'debugLinkStop',
|
|
53
|
+
'debugLinkWatchLayout',
|
|
54
|
+
'firmwareErase',
|
|
55
|
+
'firmwareEraseEx',
|
|
56
|
+
'firmwareUpdateEmmcTest',
|
|
57
|
+
'firmwareUploadTest',
|
|
58
|
+
'reboot',
|
|
59
|
+
'selfTest',
|
|
60
|
+
'tezosGetAddress',
|
|
61
|
+
'tezosGetPublicKey',
|
|
62
|
+
'tezosSignTx',
|
|
63
|
+
'moneroGetAddress',
|
|
64
|
+
'moneroGetWatchKey',
|
|
65
|
+
'eosGetPublicKey',
|
|
66
|
+
'eosSignTx',
|
|
67
|
+
'binanceGetAddress',
|
|
68
|
+
'binanceGetPublicKey',
|
|
69
|
+
'binanceSignTx',
|
|
70
|
+
'webAuthnAddResidentCredential',
|
|
71
|
+
'webAuthnListResidentCredentials',
|
|
72
|
+
'webAuthnRemoveResidentCredential',
|
|
73
|
+
'getPublicKeyMultiple',
|
|
74
|
+
'listResDir',
|
|
75
|
+
'nftWriteData',
|
|
76
|
+
'nftWriteInfo',
|
|
77
|
+
'readSEPublicKey',
|
|
78
|
+
'resourceUpdate',
|
|
79
|
+
'bixinBackupDevice',
|
|
80
|
+
'bixinLoadDevice',
|
|
81
|
+
'bixinMessageSE',
|
|
82
|
+
'bixinVerifyDeviceRequest',
|
|
83
|
+
] as const;
|
|
84
|
+
|
|
85
|
+
export const FACTORY_API_METHOD_NAMES = [
|
|
86
|
+
'deviceProvisionFactoryInfo',
|
|
87
|
+
'deviceWriteFactoryCertificate',
|
|
88
|
+
] as const;
|