diff --git a/utilities/wallet-tester/src/common/helpers/getCardano.ts b/utilities/wallet-tester/src/common/helpers/getCardano.ts index 68f491b6b4..797597ce01 100644 --- a/utilities/wallet-tester/src/common/helpers/getCardano.ts +++ b/utilities/wallet-tester/src/common/helpers/getCardano.ts @@ -1,9 +1,14 @@ +import { pickBy } from "lodash-es"; import type { WalletCollections } from "types/cardano"; export default function getCardano( walletName?: T ): T extends string ? WalletCollections[string] : WalletCollections { - return (walletName ? globalThis.cardano[walletName] : globalThis.cardano) as T extends string + return (walletName ? globalThis.cardano[walletName] : filterPolluteObjects(globalThis.cardano)) as T extends string ? WalletCollections[string] : WalletCollections; } + +function filterPolluteObjects(cardano: any): WalletCollections { + return pickBy(cardano, (v) => typeof v === "object" && "enable" in v) +} \ No newline at end of file