diff --git a/.changeset/wide-flies-raise.md b/.changeset/wide-flies-raise.md new file mode 100644 index 00000000000..87d6b4b394d --- /dev/null +++ b/.changeset/wide-flies-raise.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Filter out AGW from searchable wallets (needs explicit adding) diff --git a/packages/thirdweb/src/react/native/ui/connect/ExternalWalletsList.tsx b/packages/thirdweb/src/react/native/ui/connect/ExternalWalletsList.tsx index a5ded327ab5..26217b6829f 100644 --- a/packages/thirdweb/src/react/native/ui/connect/ExternalWalletsList.tsx +++ b/packages/thirdweb/src/react/native/ui/connect/ExternalWalletsList.tsx @@ -12,6 +12,7 @@ import { import type { Chain } from "../../../../chains/types.js"; import type { ThirdwebClient } from "../../../../client/client.js"; import walletInfos from "../../../../wallets/__generated__/wallet-infos.js"; +import { NON_SEARCHABLE_WALLETS } from "../../../../wallets/constants.js"; import type { Wallet } from "../../../../wallets/interfaces/wallet.js"; import { createWallet } from "../../../../wallets/native/create-wallet.js"; import type { WalletId } from "../../../../wallets/wallet-types.js"; @@ -100,10 +101,7 @@ export function AllWalletsList( .filter( (info) => !externalWallets.find((wallet) => wallet.id === info.id), ) - .filter( - (info) => - info.id !== "inApp" && info.id !== "embedded" && info.id !== "smart", - ) + .filter((info) => !NON_SEARCHABLE_WALLETS.includes(info.id)) .filter((info) => info.hasMobileSupport); const fuse = new Fuse(filteredWallets, { diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx index cf4fe2c8658..7e7b7e86bfc 100644 --- a/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx +++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx @@ -5,6 +5,7 @@ import Fuse from "fuse.js"; import { useMemo, useRef, useState } from "react"; import type { ThirdwebClient } from "../../../../../client/client.js"; import walletInfos from "../../../../../wallets/__generated__/wallet-infos.js"; +import { NON_SEARCHABLE_WALLETS } from "../../../../../wallets/constants.js"; import { createWallet } from "../../../../../wallets/create-wallet.js"; import type { Wallet } from "../../../../../wallets/interfaces/wallet.js"; import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js"; @@ -39,8 +40,7 @@ function AllWalletsUI(props: { const walletList = useMemo(() => { return walletInfos.filter( - (info) => - info.id !== "inApp" && info.id !== "embedded" && info.id !== "smart", + (info) => !NON_SEARCHABLE_WALLETS.includes(info.id), ); }, []); diff --git a/packages/thirdweb/src/wallets/constants.ts b/packages/thirdweb/src/wallets/constants.ts index 9ec7570c854..e4bef01512f 100644 --- a/packages/thirdweb/src/wallets/constants.ts +++ b/packages/thirdweb/src/wallets/constants.ts @@ -1,5 +1,15 @@ +import type { WalletId } from "./wallet-types.js"; + // Constants for most common wallets export const COINBASE = "com.coinbase.wallet"; export const METAMASK = "io.metamask"; export const RAINBOW = "me.rainbow"; export const ZERION = "io.zerion.wallet"; + +// Wallet IDs that should not appear in searchable wallet lists +export const NON_SEARCHABLE_WALLETS: WalletId[] = [ + "inApp", + "embedded", + "smart", + "xyz.abs", +];