Skip to content

Commit f276dcf

Browse files
[SDK] Filter out AGW from searchable wallets (#8062)
1 parent 6495b94 commit f276dcf

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
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 & 4 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";
@@ -100,10 +101,7 @@ export function AllWalletsList(
100101
.filter(
101102
(info) => !externalWallets.find((wallet) => wallet.id === info.id),
102103
)
103-
.filter(
104-
(info) =>
105-
info.id !== "inApp" && info.id !== "embedded" && info.id !== "smart",
106-
)
104+
.filter((info) => !NON_SEARCHABLE_WALLETS.includes(info.id))
107105
.filter((info) => info.hasMobileSupport);
108106

109107
const fuse = new Fuse(filteredWallets, {

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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
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[] = [
11+
"inApp",
12+
"embedded",
13+
"smart",
14+
"xyz.abs",
15+
];

0 commit comments

Comments
 (0)