diff --git a/packages/kit-bg/src/vaults/impls/aptos/KeyringHardware.ts b/packages/kit-bg/src/vaults/impls/aptos/KeyringHardware.ts index beb7f201098..6ddb315301e 100644 --- a/packages/kit-bg/src/vaults/impls/aptos/KeyringHardware.ts +++ b/packages/kit-bg/src/vaults/impls/aptos/KeyringHardware.ts @@ -75,6 +75,7 @@ export class KeyringHardware extends KeyringHardwareBase { buildResultAccount: ({ account }) => ({ path: account.path, address: account.payload?.address || '', + pub: account.payload?.pub || '', }), hwSdkNetwork: this.hwSdkNetwork, }); @@ -106,15 +107,14 @@ export class KeyringHardware extends KeyringHardwareBase { const ret: ICoreApiGetAddressItem[] = []; for (let i = 0; i < list.length; i += 1) { const item = list[i]; - const { path, address } = item; + const { path, address, pub } = item; const { normalizedAddress } = await this.vault.validateAddress( address || '', ); const addressInfo: ICoreApiGetAddressItem = { address: normalizedAddress || address || '', path, - publicKey: '', - // publicKey: publicKey || '', + publicKey: pub || '', }; ret.push(addressInfo); } diff --git a/packages/kit-bg/src/vaults/impls/cosmos/KeyringHardware.ts b/packages/kit-bg/src/vaults/impls/cosmos/KeyringHardware.ts index 73fea3214a5..21f4e6ef961 100644 --- a/packages/kit-bg/src/vaults/impls/cosmos/KeyringHardware.ts +++ b/packages/kit-bg/src/vaults/impls/cosmos/KeyringHardware.ts @@ -18,6 +18,7 @@ import type { import { convertDeviceResponse } from '@onekeyhq/shared/src/errors/utils/deviceErrorUtils'; import accountUtils from '@onekeyhq/shared/src/utils/accountUtils'; import { checkIsDefined } from '@onekeyhq/shared/src/utils/assertUtils'; +import hexUtils from '@onekeyhq/shared/src/utils/hexUtils'; import { KeyringHardwareBase } from '../../base/KeyringHardwareBase'; @@ -30,7 +31,6 @@ import type { ISignTransactionParams, } from '../../types'; import type { AllNetworkAddressParams } from '@onekeyfe/hd-core'; -import type { HDNodeType } from '@onekeyfe/hd-transport'; export class KeyringHardware extends KeyringHardwareBase { override coreApi = coreChainApi.cosmos.hd; @@ -112,7 +112,7 @@ export class KeyringHardware extends KeyringHardwareBase { for (let i = 0; i < publicKeys.length; i += 1) { const item = publicKeys[i]; const { path, publicKey } = item; - const pubkey = hexToBytes(`0x${publicKey}`); + const pubkey = hexToBytes(hexUtils.addHexPrefix(publicKey)); const addressInfo: ICoreApiGetAddressItem = { address: '', path, diff --git a/packages/kit/src/views/WalletAddress/pages/WalletAddress/index.tsx b/packages/kit/src/views/WalletAddress/pages/WalletAddress/index.tsx index a985ad761d7..87a7e851930 100644 --- a/packages/kit/src/views/WalletAddress/pages/WalletAddress/index.tsx +++ b/packages/kit/src/views/WalletAddress/pages/WalletAddress/index.tsx @@ -29,9 +29,6 @@ import { XStack, useSafeAreaInsets, } from '@onekeyhq/components'; -import type { IAllNetworksDBStruct } from '@onekeyhq/kit-bg/src/dbs/simple/entity/SimpleDbEntityAllNetworks'; -import type { IAllNetworkAccountInfo } from '@onekeyhq/kit-bg/src/services/ServiceAllNetwork/ServiceAllNetwork'; -import type { IAccountDeriveTypes } from '@onekeyhq/kit-bg/src/vaults/types'; import backgroundApiProxy from '@onekeyhq/kit/src/background/instance/backgroundApiProxy'; import { AccountSelectorProviderMirror } from '@onekeyhq/kit/src/components/AccountSelector'; import { useAccountSelectorCreateAddress } from '@onekeyhq/kit/src/components/AccountSelector/hooks/useAccountSelectorCreateAddress'; @@ -41,6 +38,9 @@ import useAppNavigation from '@onekeyhq/kit/src/hooks/useAppNavigation'; import { useCopyAccountAddress } from '@onekeyhq/kit/src/hooks/useCopyAccountAddress'; import { usePromiseResult } from '@onekeyhq/kit/src/hooks/usePromiseResult'; import { useFuseSearch } from '@onekeyhq/kit/src/views/ChainSelector/hooks/useFuseSearch'; +import type { IAllNetworksDBStruct } from '@onekeyhq/kit-bg/src/dbs/simple/entity/SimpleDbEntityAllNetworks'; +import type { IAllNetworkAccountInfo } from '@onekeyhq/kit-bg/src/services/ServiceAllNetwork/ServiceAllNetwork'; +import type { IAccountDeriveTypes } from '@onekeyhq/kit-bg/src/vaults/types'; import { getNetworkIdsMap } from '@onekeyhq/shared/src/config/networkIds'; import { EAppEventBusNames,