Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wide-flies-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Filter out AGW from searchable wallets (needs explicit adding)
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
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";
Expand Down Expand Up @@ -39,8 +40,7 @@

const walletList = useMemo(() => {
return walletInfos.filter(
(info) =>
info.id !== "inApp" && info.id !== "embedded" && info.id !== "smart",
(info) => !NON_SEARCHABLE_WALLETS.includes(info.id),

Check warning on line 43 in packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx#L43

Added line #L43 was not covered by tests
);
}, []);

Expand Down
10 changes: 10 additions & 0 deletions packages/thirdweb/src/wallets/constants.ts
Original file line number Diff line number Diff line change
@@ -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",
];
Loading