diff --git a/packages/multichain/src/scope/supported.ts b/packages/multichain/src/scope/supported.ts index 032c3d5dfd..7bb21e3652 100644 --- a/packages/multichain/src/scope/supported.ts +++ b/packages/multichain/src/scope/supported.ts @@ -8,7 +8,7 @@ import { KnownWalletNamespaceRpcMethods, KnownWalletRpcMethods, } from './constants'; -import type { NonWalletKnownCaipNamespace, ExternalScopeString } from './types'; +import type { ExternalScopeString } from './types'; import { parseScopeString } from './types'; /** @@ -112,11 +112,15 @@ export const isSupportedNotification = ( ): boolean => { const { namespace } = parseScopeString(scopeString); - if (!namespace || !isNonWalletKnownCaipNamespace(namespace)) { + if ( + !namespace || + !isKnownCaipNamespace(namespace) || + namespace === KnownCaipNamespace.Wallet + ) { return false; } - return (KnownNotifications[namespace] || []).includes(notification); + return KnownNotifications[namespace].includes(notification); }; /** @@ -134,19 +138,3 @@ function isKnownCaipNamespace( return knownNamespaces.includes(namespace); } - -/** - * Checks whether the given namespace is a known non-wallet CAIP namespace. - * - * @param namespace - The namespace to check - * @returns Whether the given namespace is a known non-wallet CAIP namespace. - */ -function isNonWalletKnownCaipNamespace( - namespace: string, -): namespace is NonWalletKnownCaipNamespace { - const knownNamespaces = Object.keys(KnownCaipNamespace) - .filter((key) => key !== KnownCaipNamespace.Wallet) - .map((key) => key.toLowerCase()); - - return knownNamespaces.includes(namespace); -}