Skip to content

Commit 11651e3

Browse files
[SDK] Filter out AGW from searchable wallets
1 parent 210f631 commit 11651e3

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

.changeset/wide-flies-raise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Filter out AGW from searchable wallets (needs explicit adding)

packages/thirdweb/src/react/native/ui/connect/ExternalWalletsList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
import type { Chain } from "../../../../chains/types.js";
1313
import type { ThirdwebClient } from "../../../../client/client.js";
1414
import walletInfos from "../../../../wallets/__generated__/wallet-infos.js";
15+
import { NON_SEARCHABLE_WALLETS } from "../../../../wallets/constants.js";
1516
import type { Wallet } from "../../../../wallets/interfaces/wallet.js";
1617
import { createWallet } from "../../../../wallets/native/create-wallet.js";
1718
import type { WalletId } from "../../../../wallets/wallet-types.js";
@@ -101,8 +102,7 @@ export function AllWalletsList(
101102
(info) => !externalWallets.find((wallet) => wallet.id === info.id),
102103
)
103104
.filter(
104-
(info) =>
105-
info.id !== "inApp" && info.id !== "embedded" && info.id !== "smart",
105+
(info) => !NON_SEARCHABLE_WALLETS.includes(info.id),
106106
)
107107
.filter((info) => info.hasMobileSupport);
108108

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Fuse from "fuse.js";
55
import { useMemo, useRef, useState } from "react";
66
import type { ThirdwebClient } from "../../../../../client/client.js";
77
import walletInfos from "../../../../../wallets/__generated__/wallet-infos.js";
8+
import { NON_SEARCHABLE_WALLETS } from "../../../../../wallets/constants.js";
89
import { createWallet } from "../../../../../wallets/create-wallet.js";
910
import type { Wallet } from "../../../../../wallets/interfaces/wallet.js";
1011
import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js";
@@ -39,8 +40,7 @@ function AllWalletsUI(props: {
3940

4041
const walletList = useMemo(() => {
4142
return walletInfos.filter(
42-
(info) =>
43-
info.id !== "inApp" && info.id !== "embedded" && info.id !== "smart",
43+
(info) => !NON_SEARCHABLE_WALLETS.includes(info.id),
4444
);
4545
}, []);
4646

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
import type { WalletId } from "./wallet-types.js";
2+
13
// Constants for most common wallets
24
export const COINBASE = "com.coinbase.wallet";
35
export const METAMASK = "io.metamask";
46
export const RAINBOW = "me.rainbow";
57
export const ZERION = "io.zerion.wallet";
8+
9+
// Wallet IDs that should not appear in searchable wallet lists
10+
export const NON_SEARCHABLE_WALLETS: WalletId[] = ["inApp", "embedded", "smart", "xyz.abs"] as const;

0 commit comments

Comments
 (0)