diff --git a/packages/engine/src/types/account.ts b/packages/engine/src/types/account.ts index e3b0c25055b..a22c845e820 100644 --- a/packages/engine/src/types/account.ts +++ b/packages/engine/src/types/account.ts @@ -16,7 +16,6 @@ enum AccountCredentialType { PrivateKey = 'PrivateKey', PrivateViewKey = 'PrivateViewKey', PrivateSpendKey = 'PrivateSpendKey', - TrackingKey = 'TrackingKey', Mnemonic = 'Mnemonic', } diff --git a/packages/engine/src/vaults/impl/dynex/KeyringHardware.ts b/packages/engine/src/vaults/impl/dynex/KeyringHardware.ts index b7a59acf6cb..113fa312fa3 100644 --- a/packages/engine/src/vaults/impl/dynex/KeyringHardware.ts +++ b/packages/engine/src/vaults/impl/dynex/KeyringHardware.ts @@ -198,19 +198,4 @@ export class KeyringHardware extends KeyringHardwareBase { override signMessage(): Promise { throw new Error('Method not implemented.'); } - - async getTrackingKey(params: { path: string }): Promise { - const HardwareSDK = await this.getHardwareSDKInstance(); - const { connectId, deviceId } = await this.getHardwareInfo(); - const passphraseState = await this.getWalletPassphraseState(); - const resp = await HardwareSDK.dnxGetTrackingKey(connectId, deviceId, { - path: params.path, - ...passphraseState, - }); - - if (resp.success && !!resp.payload?.trackingKey) { - return resp.payload?.trackingKey; - } - throw convertDeviceError(resp.payload); - } } diff --git a/packages/engine/src/vaults/impl/dynex/Vault.ts b/packages/engine/src/vaults/impl/dynex/Vault.ts index df657abb3ba..d352fdfd6ff 100644 --- a/packages/engine/src/vaults/impl/dynex/Vault.ts +++ b/packages/engine/src/vaults/impl/dynex/Vault.ts @@ -13,7 +13,6 @@ import { NotImplemented, OneKeyInternalError, } from '../../../errors'; -import { AccountCredentialType } from '../../../types/account'; import { type IApproveInfo, type IDecodedTx, @@ -130,22 +129,8 @@ export default class Vault extends VaultBase { }; } - override async getExportedCredential( - password: string, - credentialType: AccountCredentialType, - ): Promise { - if ( - this.accountId.startsWith('hw-') && - credentialType === AccountCredentialType.TrackingKey - ) { - const path = await this.getAccountPath(); - - return (this.keyring as KeyringHardware).getTrackingKey({ path }); - } - - throw new OneKeyInternalError( - 'Only tracking key of HW accounts can be exported', - ); + override async getExportedCredential(): Promise { + throw new Error('Method not implemented.'); } override fetchTokenInfos( diff --git a/packages/engine/src/vaults/impl/dynex/settings.ts b/packages/engine/src/vaults/impl/dynex/settings.ts index d23c3b89d87..01639666589 100644 --- a/packages/engine/src/vaults/impl/dynex/settings.ts +++ b/packages/engine/src/vaults/impl/dynex/settings.ts @@ -1,16 +1,13 @@ -import type { LocaleIds } from '@onekeyhq/components/src/locale'; import { COINTYPE_DYNEX, INDEX_PLACEHOLDER, } from '@onekeyhq/shared/src/engine/engineConsts'; -import { AccountCredentialType } from '../../../types/account'; - import type { IVaultSettings } from '../../types'; const settings: IVaultSettings = Object.freeze({ feeInfoEditable: false, - privateKeyExportEnabled: true, + privateKeyExportEnabled: false, tokenEnabled: false, txCanBeReplaced: false, @@ -40,13 +37,6 @@ const settings: IVaultSettings = Object.freeze({ subDesc: `m/44'/${COINTYPE_DYNEX}'/0'/0'/x'`, }, }, - - exportCredentialInfo: [ - { - type: AccountCredentialType.TrackingKey, - key: 'content__export_tracking_key' as LocaleIds, - }, - ], }); export default settings; diff --git a/packages/kit/src/views/ManagerAccount/AccountInfo/accountInfoConstants.ts b/packages/kit/src/views/ManagerAccount/AccountInfo/accountInfoConstants.ts index 72d1d776d9d..e7434dd206f 100644 --- a/packages/kit/src/views/ManagerAccount/AccountInfo/accountInfoConstants.ts +++ b/packages/kit/src/views/ManagerAccount/AccountInfo/accountInfoConstants.ts @@ -10,7 +10,6 @@ export enum ManageAccountKeys { ExportSecretMnemonic = 'ExportSecretMnemonic', ExportPrivateViewKey = 'ExportPrivateViewKey', ExportPrivateSpendKey = 'ExportPrivateSpendKey', - ExportTrackingKey = 'ExportTrackingKey', HardwareCanNotExportPrivateKey = 'HardwareCanNotExportPrivateKey', RemoveAccount = 'RemoveAccount', } @@ -19,7 +18,6 @@ export const SpecialExportCredentialKeys = [ ManageAccountKeys.ExportPrivateViewKey, ManageAccountKeys.ExportPrivateSpendKey, ManageAccountKeys.ExportSecretMnemonic, - ManageAccountKeys.ExportTrackingKey, ]; export const getManageAccountOptions: ( @@ -51,17 +49,6 @@ export const getManageAccountOptions: ( }, }, - [ManageAccountKeys.ExportTrackingKey]: { - label: intl.formatMessage({ id: 'content__export_tracking_key' }), - description: intl.formatMessage({ - id: 'content__export_tracking_key_desc', - }), - key: ManageAccountKeys.ExportTrackingKey, - credentialInfo: { - type: AccountCredentialType.TrackingKey, - key: 'content__export_tracking_key', - }, - }, [ManageAccountKeys.ExportPrivateViewKey]: { label: intl.formatMessage({ id: 'action__export_private_view_key' }), description: intl.formatMessage({ diff --git a/packages/kit/src/views/ManagerAccount/AccountInfo/index.tsx b/packages/kit/src/views/ManagerAccount/AccountInfo/index.tsx index 52d2b0f09a9..8d4677ee6c6 100644 --- a/packages/kit/src/views/ManagerAccount/AccountInfo/index.tsx +++ b/packages/kit/src/views/ManagerAccount/AccountInfo/index.tsx @@ -126,8 +126,7 @@ const ManagerAccountModal: FC = () => { case ManageAccountKeys.ExportPrivateKey: case ManageAccountKeys.ExportPrivateSpendKey: case ManageAccountKeys.ExportPrivateViewKey: - case ManageAccountKeys.ExportSecretMnemonic: - case ManageAccountKeys.ExportTrackingKey: { + case ManageAccountKeys.ExportSecretMnemonic: { if (item.credentialInfo) { navigation.navigate(RootRoutes.Modal, { screen: ModalRoutes.ManagerAccount, diff --git a/packages/kit/src/views/ManagerAccount/AccountInfo/useAccountInfoDataSource.ts b/packages/kit/src/views/ManagerAccount/AccountInfo/useAccountInfoDataSource.ts index 834ac4e76e7..c61612232fa 100644 --- a/packages/kit/src/views/ManagerAccount/AccountInfo/useAccountInfoDataSource.ts +++ b/packages/kit/src/views/ManagerAccount/AccountInfo/useAccountInfoDataSource.ts @@ -51,9 +51,7 @@ export function useAccountInfoDataSource({ } if ( privateKeyExportEnabled && - (wallet.type === 'hd' || - wallet.type === 'imported' || - (wallet.type === 'hw' && network.impl === IMPL_DYNEX)) + (wallet.type === 'hd' || wallet.type === 'imported') ) { if (exportCredentialInfo) { SpecialExportCredentialKeys.forEach((key) => { @@ -70,7 +68,7 @@ export function useAccountInfoDataSource({ keys.push(ManageAccountKeys.ExportPrivateKey); } } - if (wallet.type === 'hw' && network.impl !== IMPL_DYNEX) { + if (wallet.type === 'hw') { keys.push(ManageAccountKeys.HardwareCanNotExportPrivateKey); } keys.push(ManageAccountKeys.RemoveAccount);