@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,21 @@
|
|
|
1
|
+
import { BaseMethod } from '../BaseMethod';
|
|
2
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
|
+
|
|
4
|
+
import type { EmmcFileRead as HardwareEmmcFileRead } from '@onekeyfe/hd-transport';
|
|
5
|
+
|
|
6
|
+
export default class EmmcFileRead extends BaseMethod<HardwareEmmcFileRead> {
|
|
7
|
+
init() {
|
|
8
|
+
this.useDevicePassphraseState = false;
|
|
9
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.BOOTLOADER];
|
|
10
|
+
this.params = {
|
|
11
|
+
file: this.payload.file,
|
|
12
|
+
ui_percentage: this.payload.ui_percentage,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async run() {
|
|
17
|
+
const res = await this.device.commands.typedCall('EmmcFileRead', 'EmmcFile', this.params);
|
|
18
|
+
|
|
19
|
+
return Promise.resolve(res.message);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseMethod } from '../BaseMethod';
|
|
2
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
|
+
|
|
4
|
+
import type { EmmcFileWrite as HardwareEmmcFileWrite } from '@onekeyfe/hd-transport';
|
|
5
|
+
|
|
6
|
+
export default class EmmcFileWrite extends BaseMethod<HardwareEmmcFileWrite> {
|
|
7
|
+
init() {
|
|
8
|
+
this.useDevicePassphraseState = false;
|
|
9
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.BOOTLOADER];
|
|
10
|
+
this.params = {
|
|
11
|
+
file: this.payload.file,
|
|
12
|
+
overwrite: this.payload.overwrite,
|
|
13
|
+
append: this.payload.append,
|
|
14
|
+
ui_percentage: this.payload.ui_percentage,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async run() {
|
|
19
|
+
const res = await this.device.commands.typedCall('EmmcFileWrite', 'EmmcFile', this.params);
|
|
20
|
+
|
|
21
|
+
return Promise.resolve(res.message);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseMethod } from '../BaseMethod';
|
|
2
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
|
+
|
|
4
|
+
import type { EmmcFixPermission as HardwareEmmcFixPermission } from '@onekeyfe/hd-transport';
|
|
5
|
+
|
|
6
|
+
export default class EmmcFixPermission extends BaseMethod<HardwareEmmcFixPermission> {
|
|
7
|
+
init() {
|
|
8
|
+
this.useDevicePassphraseState = false;
|
|
9
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.BOOTLOADER];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async run() {
|
|
13
|
+
const res = await this.device.commands.typedCall('EmmcFixPermission', 'Success');
|
|
14
|
+
|
|
15
|
+
return Promise.resolve(res.message);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseMethod } from '../BaseMethod';
|
|
2
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
|
+
|
|
4
|
+
import type { EmmcPathInfo as HardwareEmmcPathInfo } from '@onekeyfe/hd-transport';
|
|
5
|
+
|
|
6
|
+
export default class EmmcPathInfo extends BaseMethod<HardwareEmmcPathInfo> {
|
|
7
|
+
init() {
|
|
8
|
+
this.useDevicePassphraseState = false;
|
|
9
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.BOOTLOADER];
|
|
10
|
+
this.params = {
|
|
11
|
+
path: this.payload.path,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async run() {
|
|
16
|
+
const res = await this.device.commands.typedCall('EmmcPathInfo', 'EmmcFile');
|
|
17
|
+
|
|
18
|
+
return Promise.resolve(res.message);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
2
|
+
import { validatePath } from '../helpers/pathUtils';
|
|
3
|
+
import { BaseMethod } from '../BaseMethod';
|
|
4
|
+
|
|
5
|
+
import type { EosGetPublicKey as HardwareEosGetPublicKey } from '@onekeyfe/hd-transport';
|
|
6
|
+
|
|
7
|
+
export default class EosGetPublicKey extends BaseMethod<HardwareEosGetPublicKey> {
|
|
8
|
+
hasBundle = false;
|
|
9
|
+
|
|
10
|
+
init() {
|
|
11
|
+
this.checkDeviceId = true;
|
|
12
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|
|
13
|
+
|
|
14
|
+
// init params
|
|
15
|
+
this.params = {
|
|
16
|
+
address_n: validatePath(this.payload.path, 3),
|
|
17
|
+
show_display: this.payload.showOnOneKey ?? true,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async run() {
|
|
22
|
+
return this.device.commands.typedCall('EosGetPublicKey', 'EosPublicKey', {
|
|
23
|
+
...this.params,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
2
|
+
import { validatePath } from '../helpers/pathUtils';
|
|
3
|
+
import { BaseMethod } from '../BaseMethod';
|
|
4
|
+
|
|
5
|
+
import type { EosSignTx as HardwareEosSignTx } from '@onekeyfe/hd-transport';
|
|
6
|
+
|
|
7
|
+
export default class EosSignTx extends BaseMethod<HardwareEosSignTx> {
|
|
8
|
+
init() {
|
|
9
|
+
this.checkDeviceId = true;
|
|
10
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|
|
11
|
+
|
|
12
|
+
const { path } = this.payload;
|
|
13
|
+
|
|
14
|
+
const addressN = validatePath(path, 3);
|
|
15
|
+
|
|
16
|
+
// init params
|
|
17
|
+
this.params = {
|
|
18
|
+
address_n: addressN,
|
|
19
|
+
chain_id: this.payload.chain_id,
|
|
20
|
+
header: this.payload.header,
|
|
21
|
+
num_actions: this.payload.num_actions,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
getVersionRange() {
|
|
26
|
+
return {
|
|
27
|
+
model_mini: {
|
|
28
|
+
min: '2.5.0',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async run() {
|
|
34
|
+
const res = await this.device.commands.typedCall('EosSignTx', 'EosTxActionRequest', {
|
|
35
|
+
...this.params,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
return Promise.resolve(res.message);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
2
|
+
import { serializedPath, validatePath } from '../helpers/pathUtils';
|
|
3
|
+
import { BaseMethod } from '../BaseMethod';
|
|
4
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
5
|
+
import getAddressLegacyV1 from './legacyV1/getAddress';
|
|
6
|
+
|
|
7
|
+
import type { EVMAddress, EVMGetAddressParams } from '../../types';
|
|
8
|
+
import type { EthereumGetAddressOneKey } from '@onekeyfe/hd-transport';
|
|
9
|
+
|
|
10
|
+
export default class EvmGetAddress extends BaseMethod<EthereumGetAddressOneKey[]> {
|
|
11
|
+
hasBundle = false;
|
|
12
|
+
|
|
13
|
+
init() {
|
|
14
|
+
this.checkDeviceId = true;
|
|
15
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|
|
16
|
+
|
|
17
|
+
this.hasBundle = !!this.payload?.bundle;
|
|
18
|
+
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
19
|
+
|
|
20
|
+
// check payload
|
|
21
|
+
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
22
|
+
|
|
23
|
+
// init params
|
|
24
|
+
this.params = [];
|
|
25
|
+
payload.bundle.forEach((batch: EVMGetAddressParams) => {
|
|
26
|
+
const addressN = validatePath(batch.path, 3);
|
|
27
|
+
|
|
28
|
+
validateParams(batch, [
|
|
29
|
+
{ name: 'path', required: true },
|
|
30
|
+
{ name: 'showOnOneKey', type: 'boolean' },
|
|
31
|
+
{ name: 'chainId', type: 'number' },
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
const showOnOneKey = batch.showOnOneKey ?? true;
|
|
35
|
+
|
|
36
|
+
this.params.push({
|
|
37
|
+
address_n: addressN,
|
|
38
|
+
show_display: showOnOneKey,
|
|
39
|
+
chain_id: batch.chainId,
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async getEvmAddress(param: EthereumGetAddressOneKey) {
|
|
45
|
+
return getAddressLegacyV1({
|
|
46
|
+
typedCall: this.device.commands.typedCall.bind(this.device.commands),
|
|
47
|
+
param,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async run() {
|
|
52
|
+
const responses: EVMAddress[] = [];
|
|
53
|
+
|
|
54
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
55
|
+
const param = this.params[i];
|
|
56
|
+
|
|
57
|
+
const res = await this.getEvmAddress(param);
|
|
58
|
+
|
|
59
|
+
const { address } = res.message;
|
|
60
|
+
|
|
61
|
+
if (!address) {
|
|
62
|
+
throw new Error('EthereumGetAddress: address is undefined');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const result = {
|
|
66
|
+
path: serializedPath(param.address_n),
|
|
67
|
+
address,
|
|
68
|
+
};
|
|
69
|
+
responses.push(result);
|
|
70
|
+
this.postPreviousAddressMessage(result);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
2
|
+
import { serializedPath, validatePath } from '../helpers/pathUtils';
|
|
3
|
+
import { BaseMethod } from '../BaseMethod';
|
|
4
|
+
import { validateParams, validateResult } from '../helpers/paramsValidator';
|
|
5
|
+
import { batchGetPublickeys, supportBatchPublicKeyByDevice } from '../helpers/batchGetPublickeys';
|
|
6
|
+
import getPublicKeyLegacyV1 from './legacyV1/getPublicKey';
|
|
7
|
+
|
|
8
|
+
import type { EVMGetPublicKeyParams, EVMPublicKey } from '../../types';
|
|
9
|
+
import type { EthereumGetPublicKey, EthereumGetPublicKeyOneKey } from '@onekeyfe/hd-transport';
|
|
10
|
+
|
|
11
|
+
export default class EVMGetPublicKey extends BaseMethod<EthereumGetPublicKeyOneKey[]> {
|
|
12
|
+
hasBundle = false;
|
|
13
|
+
|
|
14
|
+
confirmShowOnOneKey = false;
|
|
15
|
+
|
|
16
|
+
useBatch = false;
|
|
17
|
+
|
|
18
|
+
init() {
|
|
19
|
+
this.checkDeviceId = true;
|
|
20
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|
|
21
|
+
|
|
22
|
+
this.hasBundle = !!this.payload?.bundle;
|
|
23
|
+
|
|
24
|
+
this.confirmShowOnOneKey = this.payload?.bundle?.some(
|
|
25
|
+
(item: EVMGetPublicKeyParams) => !!item.showOnOneKey
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
this.useBatch = !this.confirmShowOnOneKey && this.hasBundle && this.payload.useBatch;
|
|
29
|
+
|
|
30
|
+
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
31
|
+
|
|
32
|
+
// check payload
|
|
33
|
+
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
34
|
+
|
|
35
|
+
// init params
|
|
36
|
+
this.params = [];
|
|
37
|
+
payload.bundle.forEach((batch: EVMGetPublicKeyParams) => {
|
|
38
|
+
const addressN = validatePath(batch.path, 3);
|
|
39
|
+
|
|
40
|
+
validateParams(batch, [
|
|
41
|
+
{ name: 'path', required: true },
|
|
42
|
+
{ name: 'showOnOneKey', type: 'boolean' },
|
|
43
|
+
{ name: 'chainId', type: 'number' },
|
|
44
|
+
]);
|
|
45
|
+
|
|
46
|
+
const showOnOneKey = batch.showOnOneKey ?? true;
|
|
47
|
+
|
|
48
|
+
this.params.push({
|
|
49
|
+
address_n: addressN,
|
|
50
|
+
show_display: showOnOneKey,
|
|
51
|
+
chain_id: batch.chainId,
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
getEvmPublicKey(param: EthereumGetPublicKey) {
|
|
57
|
+
return getPublicKeyLegacyV1({
|
|
58
|
+
typedCall: this.device.commands.typedCall.bind(this.device.commands),
|
|
59
|
+
param,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async run() {
|
|
64
|
+
const responses: EVMPublicKey[] = [];
|
|
65
|
+
|
|
66
|
+
if (this.useBatch && supportBatchPublicKeyByDevice(this.device)) {
|
|
67
|
+
try {
|
|
68
|
+
const res = await batchGetPublickeys(this.device, this.params, 'secp256k1', 60, {
|
|
69
|
+
includeNode: false,
|
|
70
|
+
ignoreCoinType: true,
|
|
71
|
+
});
|
|
72
|
+
const result = res.public_keys.map((publicKey: string, index: number) => ({
|
|
73
|
+
path: serializedPath((this.params as unknown as any[])[index].address_n),
|
|
74
|
+
pub: publicKey,
|
|
75
|
+
publicKey,
|
|
76
|
+
}));
|
|
77
|
+
|
|
78
|
+
validateResult(result, ['pub'], {
|
|
79
|
+
expectedLength: this.params.length,
|
|
80
|
+
});
|
|
81
|
+
return await Promise.resolve(result);
|
|
82
|
+
} catch (e) {
|
|
83
|
+
// ignore error, fallback to single get public key
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
for (let i = 0; i < this.params.length; i++) {
|
|
88
|
+
const param = this.params[i];
|
|
89
|
+
|
|
90
|
+
const res = await this.getEvmPublicKey(param);
|
|
91
|
+
|
|
92
|
+
responses.push({
|
|
93
|
+
path: serializedPath(param.address_n),
|
|
94
|
+
pub: res.message.node.public_key,
|
|
95
|
+
publicKey: res.message.node.public_key,
|
|
96
|
+
...res.message,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
validateResult(responses, ['pub'], {
|
|
101
|
+
expectedLength: this.params.length,
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
return Promise.resolve(this.hasBundle ? responses : responses[0]);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
2
|
+
import { validatePath } from '../helpers/pathUtils';
|
|
3
|
+
import { BaseMethod } from '../BaseMethod';
|
|
4
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
5
|
+
import { formatAnyHex } from '../helpers/hexUtils';
|
|
6
|
+
import signMessageLegacyV1 from './legacyV1/signMessage';
|
|
7
|
+
|
|
8
|
+
import type { EthereumSignMessageOneKey } from '@onekeyfe/hd-transport';
|
|
9
|
+
|
|
10
|
+
export default class EVMSignMessage extends BaseMethod<EthereumSignMessageOneKey> {
|
|
11
|
+
init() {
|
|
12
|
+
this.checkDeviceId = true;
|
|
13
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|
|
14
|
+
|
|
15
|
+
// check payload
|
|
16
|
+
validateParams(this.payload, [
|
|
17
|
+
{ name: 'path', required: true },
|
|
18
|
+
{ name: 'messageHex', type: 'hexString', required: true },
|
|
19
|
+
{ name: 'chainId', type: 'number' },
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
const { path, messageHex, chainId } = this.payload;
|
|
23
|
+
|
|
24
|
+
const addressN = validatePath(path, 3);
|
|
25
|
+
|
|
26
|
+
// init params
|
|
27
|
+
this.params = {
|
|
28
|
+
address_n: addressN,
|
|
29
|
+
message: formatAnyHex(messageHex),
|
|
30
|
+
chain_id: chainId,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async run() {
|
|
35
|
+
return signMessageLegacyV1({
|
|
36
|
+
typedCall: this.device.commands.typedCall.bind(this.device.commands),
|
|
37
|
+
params: this.params,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { ERRORS } from '@onekeyfe/hd-shared';
|
|
2
|
+
|
|
3
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
4
|
+
import { validatePath } from '../helpers/pathUtils';
|
|
5
|
+
import { BaseMethod } from '../BaseMethod';
|
|
6
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
7
|
+
import { formatAnyHex } from '../helpers/hexUtils';
|
|
8
|
+
import { signTransaction as signTransactionLegacyV1 } from './legacyV1/signTransaction';
|
|
9
|
+
|
|
10
|
+
import type { EVMSignTransactionParams, EVMTransaction, EVMTransactionEIP1559 } from '../../types';
|
|
11
|
+
import type { SchemaParam } from '../helpers/paramsValidator';
|
|
12
|
+
|
|
13
|
+
export default class EVMSignTransaction extends BaseMethod {
|
|
14
|
+
addressN: number[] = [];
|
|
15
|
+
|
|
16
|
+
isEIP1559 = false;
|
|
17
|
+
|
|
18
|
+
formattedTx: EVMTransaction | EVMTransactionEIP1559 | undefined;
|
|
19
|
+
|
|
20
|
+
init() {
|
|
21
|
+
this.checkDeviceId = true;
|
|
22
|
+
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.NOT_INITIALIZE];
|
|
23
|
+
|
|
24
|
+
validateParams(this.payload, [
|
|
25
|
+
{ name: 'path', required: true },
|
|
26
|
+
{ name: 'transaction', type: 'object', required: true },
|
|
27
|
+
]);
|
|
28
|
+
const { path, transaction } = this.payload;
|
|
29
|
+
this.addressN = validatePath(path, 3);
|
|
30
|
+
|
|
31
|
+
const tx: EVMSignTransactionParams['transaction'] = transaction;
|
|
32
|
+
|
|
33
|
+
this.isEIP1559 = !!tx.maxFeePerGas && !!tx.maxPriorityFeePerGas;
|
|
34
|
+
|
|
35
|
+
// check if transaction is valid
|
|
36
|
+
const schema: SchemaParam[] = [
|
|
37
|
+
{ name: 'to', type: 'hexString', required: true },
|
|
38
|
+
{ name: 'value', type: 'hexString', required: true },
|
|
39
|
+
{ name: 'gasLimit', type: 'hexString', required: true },
|
|
40
|
+
{ name: 'nonce', type: 'hexString', required: true },
|
|
41
|
+
{ name: 'chainId', type: 'number', required: true },
|
|
42
|
+
{ name: 'data', type: 'hexString' },
|
|
43
|
+
];
|
|
44
|
+
if (this.isEIP1559) {
|
|
45
|
+
schema.push({ name: 'maxFeePerGas', type: 'hexString', required: true });
|
|
46
|
+
schema.push({ name: 'maxPriorityFeePerGas', type: 'hexString', required: true });
|
|
47
|
+
} else {
|
|
48
|
+
schema.push({ name: 'gasPrice', type: 'hexString', required: true });
|
|
49
|
+
schema.push({ name: 'txType', type: 'number' });
|
|
50
|
+
}
|
|
51
|
+
validateParams(tx, schema);
|
|
52
|
+
|
|
53
|
+
this.formattedTx = formatAnyHex(tx);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
getVersionRange() {
|
|
57
|
+
if (this.isEIP1559) {
|
|
58
|
+
return {
|
|
59
|
+
model_mini: {
|
|
60
|
+
min: '2.1.11',
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
model_mini: {
|
|
66
|
+
min: '1.0.0',
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async run() {
|
|
72
|
+
const { addressN, isEIP1559, formattedTx } = this;
|
|
73
|
+
|
|
74
|
+
if (formattedTx == null) throw ERRORS.TypedError('Runtime', 'formattedTx is not set');
|
|
75
|
+
|
|
76
|
+
return signTransactionLegacyV1({
|
|
77
|
+
typedCall: this.device.commands.typedCall.bind(this.device.commands),
|
|
78
|
+
addressN,
|
|
79
|
+
tx: formattedTx,
|
|
80
|
+
isEIP1559,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|