diff --git a/packages/kit-bg/src/services/ServiceNetwork/ServiceNetwork.ts b/packages/kit-bg/src/services/ServiceNetwork/ServiceNetwork.ts index 61674108b09..6590bf4a1de 100644 --- a/packages/kit-bg/src/services/ServiceNetwork/ServiceNetwork.ts +++ b/packages/kit-bg/src/services/ServiceNetwork/ServiceNetwork.ts @@ -10,6 +10,7 @@ import { } from '@onekeyhq/shared/src/background/backgroundDecorators'; import { getNetworkIdsMap } from '@onekeyhq/shared/src/config/networkIds'; import { getPresetNetworks } from '@onekeyhq/shared/src/config/presetNetworks'; +import { ETranslations } from '@onekeyhq/shared/src/locale'; import { appLocale } from '@onekeyhq/shared/src/locale/appLocale'; import accountUtils from '@onekeyhq/shared/src/utils/accountUtils'; import { memoizee } from '@onekeyhq/shared/src/utils/cacheUtils'; @@ -32,7 +33,6 @@ import type { IAccountDeriveInfoItems, IAccountDeriveTypes, } from '../../vaults/types'; -import { ETranslations } from '@onekeyhq/shared/src/locale'; const defaultPinnedNetworkIds = [ getNetworkIdsMap().btc, diff --git a/packages/kit-bg/src/vaults/impls/evm/Vault.ts b/packages/kit-bg/src/vaults/impls/evm/Vault.ts index b6badd36506..70f5c30ef31 100644 --- a/packages/kit-bg/src/vaults/impls/evm/Vault.ts +++ b/packages/kit-bg/src/vaults/impls/evm/Vault.ts @@ -11,6 +11,7 @@ import type { IEncodedTxEvm } from '@onekeyhq/core/src/chains/evm/types'; import coreChainApi from '@onekeyhq/core/src/instance/coreChainApi'; import type { ISignedTxPro, IUnsignedTxPro } from '@onekeyhq/core/src/types'; import { getNetworkIdsMap } from '@onekeyhq/shared/src/config/networkIds'; +import { getEnabledNFTNetworkIds } from '@onekeyhq/shared/src/engine/engineConsts'; import { OneKeyError, OneKeyInternalError } from '@onekeyhq/shared/src/errors'; import chainValueUtils from '@onekeyhq/shared/src/utils/chainValueUtils'; import hexUtils from '@onekeyhq/shared/src/utils/hexUtils'; @@ -109,6 +110,8 @@ import type { IDBWalletType } from '../../../dbs/local/types'; import type { KeyringBase } from '../../base/KeyringBase'; import type { IJsonRpcRequest } from '@onekeyfe/cross-inpage-provider-types'; +const enabledNFTNetworkIds = getEnabledNFTNetworkIds(); + // evm vault export default class Vault extends VaultBase { override coreApi = coreChainApi.evm.hd; @@ -240,7 +243,7 @@ export default class Vault extends VaultBase { icon: network.logoURI ?? '', }, }; - let isToContract = false; + let isToContract: boolean | undefined; let extraNativeTransferAction: IDecodedTxAction | undefined; if (swapInfo) { @@ -988,6 +991,10 @@ export default class Vault extends VaultBase { const { encodedTx, txDesc, transferPayload } = params; const accountAddress = await this.getAccountAddress(); + if (!enabledNFTNetworkIds.includes(this.networkId)) { + return; + } + if ( txDesc.name !== EErc721TxDescriptionName.SafeTransferFrom && txDesc.name !== EErc1155TxDescriptionName.SafeTransferFrom diff --git a/packages/kit/src/components/AddressInfo/index.tsx b/packages/kit/src/components/AddressInfo/index.tsx index 137e862ec3a..9eea80eb650 100644 --- a/packages/kit/src/components/AddressInfo/index.tsx +++ b/packages/kit/src/components/AddressInfo/index.tsx @@ -1,9 +1,10 @@ +import { useIntl } from 'react-intl'; + import { Badge, Dialog, Stack, XStack } from '@onekeyhq/components'; +import { ETranslations } from '@onekeyhq/shared/src/locale/enum/translations'; import { ERootRoutes, ETabRoutes } from '@onekeyhq/shared/src/routes'; import { EAccountSelectorSceneName } from '@onekeyhq/shared/types'; -import { ETranslations } from '@onekeyhq/shared/src/locale/enum/translations'; -import { useIntl } from 'react-intl'; import backgroundApiProxy from '../../background/instance/backgroundApiProxy'; import useAppNavigation from '../../hooks/useAppNavigation'; import { usePromiseResult } from '../../hooks/usePromiseResult';