From fc36f27beb0a5ca094151731db0cbd8ef6a6257b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 9 Jul 2025 08:11:45 +0000 Subject: [PATCH 01/10] Add advanced search functionality for in-app wallet users Co-authored-by: joaquim.verges --- .../users/components/AdvancedSearchInput.tsx | 95 ++++++++++++ .../users/components/SearchResults.tsx | 130 ++++++++++++++++ .../wallets/users/components/index.tsx | 142 ++++++++++++------ .../wallets/users/components/searchUsers.ts | 40 +++++ .../wallets/users/components/types.ts | 27 ++++ 5 files changed, 388 insertions(+), 46 deletions(-) create mode 100644 apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/AdvancedSearchInput.tsx create mode 100644 apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchResults.tsx create mode 100644 apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts create mode 100644 apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/types.ts diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/AdvancedSearchInput.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/AdvancedSearchInput.tsx new file mode 100644 index 00000000000..16d3a84c71f --- /dev/null +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/AdvancedSearchInput.tsx @@ -0,0 +1,95 @@ +"use client"; + +import { SearchIcon } from "lucide-react"; +import { useState } from "react"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; + +import type { SearchType } from "./types"; + +export function AdvancedSearchInput(props: { + onSearch: (searchType: SearchType, query: string) => void; + onClear: () => void; + isLoading: boolean; + hasResults: boolean; +}) { + const [searchType, setSearchType] = useState("email"); + const [query, setQuery] = useState(""); + + const handleSearch = () => { + if (query.trim()) { + props.onSearch(searchType, query.trim()); + } + }; + + const handleClear = () => { + setQuery(""); + props.onClear(); + }; + + const handleKeyDown = (e: React.KeyboardEvent) => { + if (e.key === "Enter") { + handleSearch(); + } + }; + + return ( +
+
+ + +
+ setQuery(e.target.value)} + onKeyDown={handleKeyDown} + /> + +
+ + +
+ + {props.hasResults && ( +
+ +
+ )} +
+ ); +} diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchResults.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchResults.tsx new file mode 100644 index 00000000000..627f19ef8ed --- /dev/null +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchResults.tsx @@ -0,0 +1,130 @@ +"use client"; + +import { format } from "date-fns"; +import type { ThirdwebClient } from "thirdweb"; +import { WalletAddress } from "@/components/blocks/wallet-address"; +import { Badge } from "@/components/ui/badge"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "@/components/ui/tooltip"; +import type { UserSearchResult } from "./types"; + +const getUserIdentifier = (user: UserSearchResult) => { + return user.email ?? user.phone ?? user.walletAddress ?? user.userId; +}; + +export function SearchResults(props: { + results: UserSearchResult[]; + client: ThirdwebClient; +}) { + if (props.results.length === 0) { + return ( + + +
+

No users found

+

+ Try searching with different criteria +

+
+
+
+ ); + } + + return ( +
+ {props.results.map((user) => ( + + + User Details + + +
+
+

+ User Identifier +

+

{getUserIdentifier(user)}

+
+ +
+

+ Wallet Address +

+ +
+ + {user.email && ( +
+

+ Email +

+

{user.email}

+
+ )} + + {user.phone && ( +
+

+ Phone +

+

{user.phone}

+
+ )} + +
+

+ Created +

+

+ {format(new Date(user.createdAt), "MMM dd, yyyy")} +

+
+ +
+

+ Login Methods +

+
+ {user.linkedAccounts.map((account, index) => ( + + + + + {account.type} + + + +
+ {Object.entries(account.details).map( + ([key, value]) => ( +
+ {key}:{" "} + {String(value)} +
+ ), + )} +
+
+
+
+ ))} +
+
+
+
+
+ ))} +
+ ); +} diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx index 6eedaced070..e277502de29 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx @@ -22,6 +22,10 @@ import { useEmbeddedWallets, } from "@/hooks/useEmbeddedWallets"; import { SearchInput } from "./SearchInput"; +import { AdvancedSearchInput } from "./AdvancedSearchInput"; +import { SearchResults } from "./SearchResults"; +import { searchUsers } from "./searchUsers"; +import type { SearchType, UserSearchResult } from "./types"; const getUserIdentifier = (accounts: WalletUser["linkedAccounts"]) => { const mainDetail = accounts[0]?.details; @@ -111,6 +115,9 @@ export function InAppWalletUsersPageContent(props: { const [activePage, setActivePage] = useState(1); const [searchValue, setSearchValue] = useState(""); + const [searchResults, setSearchResults] = useState([]); + const [isSearching, setIsSearching] = useState(false); + const [hasSearchResults, setHasSearchResults] = useState(false); const walletsQuery = useEmbeddedWallets({ authToken: props.authToken, clientId: props.projectClientId, @@ -147,6 +154,27 @@ export function InAppWalletUsersPageContent(props: { authToken: props.authToken, }); + const handleSearch = async (searchType: SearchType, query: string) => { + setIsSearching(true); + try { + const results = await searchUsers(props.authToken, searchType, query); + setSearchResults(results); + setHasSearchResults(true); + } catch (error) { + console.error("Search failed:", error); + setSearchResults([]); + setHasSearchResults(true); + } finally { + setIsSearching(false); + } + }; + + const handleClearSearch = () => { + setSearchResults([]); + setHasSearchResults(false); + setSearchValue(""); + }; + const downloadCSV = useCallback(async () => { if (wallets.length === 0 || !getAllEmbeddedWallets) { return; @@ -179,58 +207,80 @@ export function InAppWalletUsersPageContent(props: {
{/* Top section */} -
-
- -
- -
- -
- - -
- +
+
+
+ +
+ + {/* Fallback to old search for table filtering when not using advanced search */} + {!hasSearchResults && ( +
+
+ +
+
+ )} +
+ +
+ {hasSearchResults ? ( + + ) : ( + <> + + +
+ + +
+ + )}
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts new file mode 100644 index 00000000000..b8343340ea2 --- /dev/null +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts @@ -0,0 +1,40 @@ +import type { SearchParams, SearchType, UserSearchResult } from "./types"; + +export async function searchUsers( + authToken: string, + searchType: SearchType, + query: string, +): Promise { + const url = new URL( + "https://in-app-wallet.thirdweb.com/api/2023-11-30/embedded-wallet/user-details", + ); + + // Map search type to query parameter + const queryByMap: Record = { + email: "email", + phone: "phone", + id: "id", + address: "walletAddress", + }; + + const queryBy = queryByMap[searchType]; + url.searchParams.append("queryBy", queryBy); + url.searchParams.append(queryBy, query); + + const response = await fetch(url.toString(), { + headers: { + Authorization: `Bearer ${authToken}`, + "Content-Type": "application/json", + }, + method: "GET", + }); + + if (!response.ok) { + throw new Error( + `Failed to search users: ${response.status} ${response.statusText}`, + ); + } + + const data = await response.json(); + return data as UserSearchResult[]; +} diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/types.ts b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/types.ts new file mode 100644 index 00000000000..01bf2ab486d --- /dev/null +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/types.ts @@ -0,0 +1,27 @@ +export interface UserSearchResult { + userId: string; + walletAddress: string; + email?: string; + phone?: string; + createdAt: string; + linkedAccounts: { + type: string; + details: { + phone?: string; + email?: string; + address?: string; + id?: string; + [key: string]: unknown; + }; + }[]; +} + +export type SearchType = "email" | "phone" | "id" | "address"; + +export interface SearchParams { + queryBy: SearchType | "walletAddress"; + email?: string; + phone?: string; + id?: string; + walletAddress?: string; +} From ba586b2f13ffb9e47ad15911dce6bf0c331b24e5 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 10 Jul 2025 02:40:11 +0000 Subject: [PATCH 02/10] Update user search to use new Thirdweb wallet user type and API Co-authored-by: joaquim.verges --- .../users/components/SearchResults.tsx | 181 ++++++++++-------- .../wallets/users/components/index.tsx | 6 +- .../wallets/users/components/searchUsers.ts | 34 ++-- .../wallets/users/components/types.ts | 26 --- 4 files changed, 120 insertions(+), 127 deletions(-) diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchResults.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchResults.tsx index 627f19ef8ed..1968e9d25e3 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchResults.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchResults.tsx @@ -2,6 +2,7 @@ import { format } from "date-fns"; import type { ThirdwebClient } from "thirdweb"; +import type { WalletUser } from "thirdweb/wallets"; import { WalletAddress } from "@/components/blocks/wallet-address"; import { Badge } from "@/components/ui/badge"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; @@ -11,14 +12,20 @@ import { TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; -import type { UserSearchResult } from "./types"; -const getUserIdentifier = (user: UserSearchResult) => { - return user.email ?? user.phone ?? user.walletAddress ?? user.userId; +const getUserIdentifier = (user: WalletUser) => { + const mainDetail = user.linkedAccounts[0]?.details; + return ( + mainDetail?.email ?? + mainDetail?.phone ?? + mainDetail?.address ?? + mainDetail?.id ?? + user.id + ); }; export function SearchResults(props: { - results: UserSearchResult[]; + results: WalletUser[]; client: ThirdwebClient; }) { if (props.results.length === 0) { @@ -38,93 +45,105 @@ export function SearchResults(props: { return (
- {props.results.map((user) => ( - - - User Details - - -
-
-

- User Identifier -

-

{getUserIdentifier(user)}

-
- -
-

- Wallet Address -

- -
- - {user.email && ( + {props.results.map((user) => { + const walletAddress = user.wallets?.[0]?.address; + const createdAt = user.wallets?.[0]?.createdAt; + const mainDetail = user.linkedAccounts?.[0]?.details; + const email = mainDetail?.email as string | undefined; + const phone = mainDetail?.phone as string | undefined; + + return ( + + + User Details + + +

- Email + User Identifier

-

{user.email}

+

{getUserIdentifier(user)}

- )} - {user.phone && ( + {walletAddress && ( +
+

+ Wallet Address +

+ +
+ )} + + {email && ( +
+

+ Email +

+

{email}

+
+ )} + + {phone && ( +
+

+ Phone +

+

{phone}

+
+ )} + + {createdAt && ( +
+

+ Created +

+

+ {format(new Date(createdAt), "MMM dd, yyyy")} +

+
+ )} +

- Phone + Login Methods

-

{user.phone}

-
- )} - -
-

- Created -

-

- {format(new Date(user.createdAt), "MMM dd, yyyy")} -

-
- -
-

- Login Methods -

-
- {user.linkedAccounts.map((account, index) => ( - - - - - {account.type} - - - -
- {Object.entries(account.details).map( - ([key, value]) => ( -
- {key}:{" "} - {String(value)} -
- ), - )} -
-
-
-
- ))} +
+ {user.linkedAccounts?.map((account, index) => ( + + + + + {account.type} + + + +
+ {Object.entries(account.details).map( + ([key, value]) => ( +
+ {key}:{" "} + {String(value)} +
+ ), + )} +
+
+
+
+ ))} +
-
-
-
- ))} + + + ); + })}
); } diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx index e277502de29..397328e04fe 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx @@ -25,7 +25,7 @@ import { SearchInput } from "./SearchInput"; import { AdvancedSearchInput } from "./AdvancedSearchInput"; import { SearchResults } from "./SearchResults"; import { searchUsers } from "./searchUsers"; -import type { SearchType, UserSearchResult } from "./types"; +import type { SearchType } from "./types"; const getUserIdentifier = (accounts: WalletUser["linkedAccounts"]) => { const mainDetail = accounts[0]?.details; @@ -115,7 +115,7 @@ export function InAppWalletUsersPageContent(props: { const [activePage, setActivePage] = useState(1); const [searchValue, setSearchValue] = useState(""); - const [searchResults, setSearchResults] = useState([]); + const [searchResults, setSearchResults] = useState([]); const [isSearching, setIsSearching] = useState(false); const [hasSearchResults, setHasSearchResults] = useState(false); const walletsQuery = useEmbeddedWallets({ @@ -157,7 +157,7 @@ export function InAppWalletUsersPageContent(props: { const handleSearch = async (searchType: SearchType, query: string) => { setIsSearching(true); try { - const results = await searchUsers(props.authToken, searchType, query); + const results = await searchUsers(props.authToken, props.projectClientId, searchType, query); setSearchResults(results); setHasSearchResults(true); } catch (error) { diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts index b8343340ea2..b0c2066f901 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts @@ -1,30 +1,30 @@ -import type { SearchParams, SearchType, UserSearchResult } from "./types"; +import type { WalletUser } from "thirdweb/wallets"; +import { THIRDWEB_EWS_API_HOST } from "@/constants/urls"; +import type { SearchType } from "./types"; export async function searchUsers( authToken: string, + clientId: string, searchType: SearchType, query: string, -): Promise { - const url = new URL( - "https://in-app-wallet.thirdweb.com/api/2023-11-30/embedded-wallet/user-details", - ); - - // Map search type to query parameter - const queryByMap: Record = { - email: "email", - phone: "phone", - id: "id", - address: "walletAddress", +): Promise { + const url = new URL(`${THIRDWEB_EWS_API_HOST}/api/2024-05-05/account/list`); + + // Add clientId parameter + url.searchParams.append("clientId", clientId); + + // Add filter parameter as JSON string + const filter = { + field: searchType === "address" ? "walletAddress" : searchType, + value: query, }; - - const queryBy = queryByMap[searchType]; - url.searchParams.append("queryBy", queryBy); - url.searchParams.append(queryBy, query); + url.searchParams.append("filter", JSON.stringify(filter)); const response = await fetch(url.toString(), { headers: { Authorization: `Bearer ${authToken}`, "Content-Type": "application/json", + "x-client-id": clientId, }, method: "GET", }); @@ -36,5 +36,5 @@ export async function searchUsers( } const data = await response.json(); - return data as UserSearchResult[]; + return data.users as WalletUser[]; } diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/types.ts b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/types.ts index 01bf2ab486d..207189d8897 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/types.ts +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/types.ts @@ -1,27 +1 @@ -export interface UserSearchResult { - userId: string; - walletAddress: string; - email?: string; - phone?: string; - createdAt: string; - linkedAccounts: { - type: string; - details: { - phone?: string; - email?: string; - address?: string; - id?: string; - [key: string]: unknown; - }; - }[]; -} - export type SearchType = "email" | "phone" | "id" | "address"; - -export interface SearchParams { - queryBy: SearchType | "walletAddress"; - email?: string; - phone?: string; - id?: string; - walletAddress?: string; -} From a6371626086b84985ffd4d164de80825af71be86 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 10 Jul 2025 03:17:09 +0000 Subject: [PATCH 03/10] Refactor user search to use specific search param instead of filter JSON Co-authored-by: joaquim.verges --- .../wallets/users/components/searchUsers.ts | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts index b0c2066f901..1fa2d876292 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts @@ -13,12 +13,21 @@ export async function searchUsers( // Add clientId parameter url.searchParams.append("clientId", clientId); - // Add filter parameter as JSON string - const filter = { - field: searchType === "address" ? "walletAddress" : searchType, - value: query, - }; - url.searchParams.append("filter", JSON.stringify(filter)); + // Add search parameter based on search type + switch (searchType) { + case "email": + url.searchParams.append("email", query); + break; + case "phone": + url.searchParams.append("phone", query); + break; + case "id": + url.searchParams.append("id", query); + break; + case "address": + url.searchParams.append("address", query); + break; + } const response = await fetch(url.toString(), { headers: { From 990a1a78da4dbb0f49ff961a364fdbcbfddd058e Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 10 Jul 2025 04:23:49 +0000 Subject: [PATCH 04/10] Remove local search filtering in favor of advanced search functionality Co-authored-by: joaquim.verges --- .../wallets/users/components/index.tsx | 43 +------------------ 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx index 397328e04fe..e2d5a53738b 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx @@ -21,7 +21,6 @@ import { useAllEmbeddedWallets, useEmbeddedWallets, } from "@/hooks/useEmbeddedWallets"; -import { SearchInput } from "./SearchInput"; import { AdvancedSearchInput } from "./AdvancedSearchInput"; import { SearchResults } from "./SearchResults"; import { searchUsers } from "./searchUsers"; @@ -114,7 +113,6 @@ export function InAppWalletUsersPageContent(props: { }, [props.client]); const [activePage, setActivePage] = useState(1); - const [searchValue, setSearchValue] = useState(""); const [searchResults, setSearchResults] = useState([]); const [isSearching, setIsSearching] = useState(false); const [hasSearchResults, setHasSearchResults] = useState(false); @@ -124,31 +122,6 @@ export function InAppWalletUsersPageContent(props: { page: activePage, }); const wallets = walletsQuery?.data?.users || []; - const filteredWallets = searchValue - ? wallets.filter((wallet) => { - const term = searchValue.toLowerCase(); - if (wallet.id.toLowerCase().includes(term)) { - return true; - } - if ( - wallet.wallets?.some((w) => w.address?.toLowerCase().includes(term)) - ) { - return true; - } - if ( - wallet.linkedAccounts?.some((acc) => { - return Object.values(acc.details).some( - (detail) => - typeof detail === "string" && - detail.toLowerCase().includes(term), - ); - }) - ) { - return true; - } - return false; - }) - : wallets; const { mutateAsync: getAllEmbeddedWallets, isPending } = useAllEmbeddedWallets({ authToken: props.authToken, @@ -172,7 +145,6 @@ export function InAppWalletUsersPageContent(props: { const handleClearSearch = () => { setSearchResults([]); setHasSearchResults(false); - setSearchValue(""); }; const downloadCSV = useCallback(async () => { @@ -229,18 +201,7 @@ export function InAppWalletUsersPageContent(props: {
- {/* Fallback to old search for table filtering when not using advanced search */} - {!hasSearchResults && ( -
-
- -
-
- )} +
@@ -250,7 +211,7 @@ export function InAppWalletUsersPageContent(props: { <> Date: Thu, 10 Jul 2025 07:50:43 +0000 Subject: [PATCH 05/10] Add ecosystem support for embedded wallet users management Co-authored-by: joaquim.verges --- .../src/@/hooks/useEmbeddedWallets.ts | 30 ++++++++++---- .../components/EcosystemSlugLayout.tsx | 4 ++ .../ecosystem/[slug]/(active)/users/page.tsx | 41 +++++++++++++++++++ .../wallets/users/components/index.tsx | 16 ++++++-- .../wallets/users/components/searchUsers.ts | 13 ++++-- 5 files changed, 88 insertions(+), 16 deletions(-) create mode 100644 apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/users/page.tsx diff --git a/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts b/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts index b066bb2ec2e..07ea93d40c8 100644 --- a/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts +++ b/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts @@ -7,22 +7,31 @@ import { embeddedWalletsKeys } from "../query-keys/cache-keys"; const fetchAccountList = ({ jwt, clientId, + ecosystemSlug, pageNumber, }: { jwt: string; - clientId: string; + clientId?: string; + ecosystemSlug?: string; pageNumber: number; }) => { return async () => { const url = new URL(`${THIRDWEB_EWS_API_HOST}/api/2024-05-05/account/list`); - url.searchParams.append("clientId", clientId); + + // Add clientId or ecosystemSlug parameter + if (ecosystemSlug) { + url.searchParams.append("ecosystemSlug", ecosystemSlug); + } else if (clientId) { + url.searchParams.append("clientId", clientId); + } + url.searchParams.append("page", pageNumber.toString()); const res = await fetch(url.href, { headers: { Authorization: `Bearer ${jwt}`, "Content-Type": "application/json", - "x-client-id": clientId, + ...(clientId && { "x-client-id": clientId }), }, method: "GET", }); @@ -38,23 +47,25 @@ const fetchAccountList = ({ }; export function useEmbeddedWallets(params: { - clientId: string; + clientId?: string; + ecosystemSlug?: string; page: number; authToken: string; }) { - const { clientId, page, authToken } = params; + const { clientId, ecosystemSlug, page, authToken } = params; const address = useActiveAccount()?.address; return useQuery({ - enabled: !!address && !!clientId, + enabled: !!address && !!(clientId || ecosystemSlug), queryFn: fetchAccountList({ clientId, + ecosystemSlug, jwt: authToken, pageNumber: page, }), queryKey: embeddedWalletsKeys.embeddedWallets( address || "", - clientId, + clientId || ecosystemSlug || "", page, ), }); @@ -67,7 +78,7 @@ export function useAllEmbeddedWallets(params: { authToken: string }) { const address = useActiveAccount()?.address; return useMutation({ - mutationFn: async ({ clientId }: { clientId: string }) => { + mutationFn: async ({ clientId, ecosystemSlug }: { clientId?: string; ecosystemSlug?: string }) => { const responses: WalletUser[] = []; let page = 1; @@ -77,12 +88,13 @@ export function useAllEmbeddedWallets(params: { authToken: string }) { }>({ queryFn: fetchAccountList({ clientId, + ecosystemSlug, jwt: authToken, pageNumber: page, }), queryKey: embeddedWalletsKeys.embeddedWallets( address || "", - clientId, + clientId || ecosystemSlug || "", page, ), }); diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/EcosystemSlugLayout.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/EcosystemSlugLayout.tsx index d8ce5386c2e..2fec668eaa8 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/EcosystemSlugLayout.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/EcosystemSlugLayout.tsx @@ -62,6 +62,10 @@ export async function EcosystemLayoutSlug({ name: "Analytics", path: `${ecosystemLayoutPath}/${ecosystem.slug}/analytics`, }, + { + name: "Users", + path: `${ecosystemLayoutPath}/${ecosystem.slug}/users`, + }, { name: "Design (coming soon)", path: `${ecosystemLayoutPath}/${ecosystem.slug}/#`, diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/users/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/users/page.tsx new file mode 100644 index 00000000000..8ec39cce5d9 --- /dev/null +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/users/page.tsx @@ -0,0 +1,41 @@ +import { loginRedirect } from "@app/login/loginRedirect"; +import { InAppWalletUsersPageContent } from "@app/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components"; +import { redirect } from "next/navigation"; +import { getAuthToken } from "@/api/auth-token"; +import { fetchEcosystem } from "@/api/ecosystems"; +import { getTeamBySlug } from "@/api/team"; +import { getClientThirdwebClient } from "@/constants/thirdweb-client.client"; + +export default async function EcosystemUsersPage(props: { + params: Promise<{ team_slug: string; slug: string }>; +}) { + const params = await props.params; + const [authToken, ecosystem, team] = await Promise.all([ + getAuthToken(), + fetchEcosystem(params.slug, params.team_slug), + getTeamBySlug(params.team_slug), + ]); + + if (!authToken) { + loginRedirect( + `/team/${params.team_slug}/~/ecosystem/${params.slug}/users`, + ); + } + + if (!ecosystem || !team) { + redirect(`/team/${params.team_slug}`); + } + + const client = getClientThirdwebClient({ + jwt: authToken, + teamId: team.id, + }); + + return ( + + ); +} \ No newline at end of file diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx index e2d5a53738b..2fd8be7f4e8 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx @@ -40,9 +40,11 @@ const columnHelper = createColumnHelper(); export function InAppWalletUsersPageContent(props: { authToken: string; - projectClientId: string; client: ThirdwebClient; -}) { +} & ( + | { projectClientId: string; ecosystemSlug?: never } + | { ecosystemSlug: string; projectClientId?: never } +)) { const columns = useMemo(() => { return [ columnHelper.accessor("linkedAccounts", { @@ -119,6 +121,7 @@ export function InAppWalletUsersPageContent(props: { const walletsQuery = useEmbeddedWallets({ authToken: props.authToken, clientId: props.projectClientId, + ecosystemSlug: props.ecosystemSlug, page: activePage, }); const wallets = walletsQuery?.data?.users || []; @@ -130,7 +133,13 @@ export function InAppWalletUsersPageContent(props: { const handleSearch = async (searchType: SearchType, query: string) => { setIsSearching(true); try { - const results = await searchUsers(props.authToken, props.projectClientId, searchType, query); + const results = await searchUsers( + props.authToken, + props.projectClientId, + props.ecosystemSlug, + searchType, + query + ); setSearchResults(results); setHasSearchResults(true); } catch (error) { @@ -153,6 +162,7 @@ export function InAppWalletUsersPageContent(props: { } const usersWallets = await getAllEmbeddedWallets({ clientId: props.projectClientId, + ecosystemSlug: props.ecosystemSlug, }); const csv = Papa.unparse( usersWallets.map((row) => { diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts index 1fa2d876292..3d2660a2596 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts @@ -4,14 +4,19 @@ import type { SearchType } from "./types"; export async function searchUsers( authToken: string, - clientId: string, + clientId: string | undefined, + ecosystemSlug: string | undefined, searchType: SearchType, query: string, ): Promise { const url = new URL(`${THIRDWEB_EWS_API_HOST}/api/2024-05-05/account/list`); - // Add clientId parameter - url.searchParams.append("clientId", clientId); + // Add clientId or ecosystemSlug parameter + if (ecosystemSlug) { + url.searchParams.append("ecosystemSlug", ecosystemSlug); + } else if (clientId) { + url.searchParams.append("clientId", clientId); + } // Add search parameter based on search type switch (searchType) { @@ -33,7 +38,7 @@ export async function searchUsers( headers: { Authorization: `Bearer ${authToken}`, "Content-Type": "application/json", - "x-client-id": clientId, + ...(clientId && { "x-client-id": clientId }), }, method: "GET", }); From 13a8cccd0ab3c09379e7c071ca97a17b8895c9c0 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 10 Jul 2025 08:05:20 +0000 Subject: [PATCH 06/10] Add teamId support for embedded wallet user queries Co-authored-by: joaquim.verges --- apps/dashboard/src/@/hooks/useEmbeddedWallets.ts | 10 ++++++++-- .../(team)/~/ecosystem/[slug]/(active)/users/page.tsx | 1 + .../(sidebar)/wallets/users/components/index.tsx | 4 ++++ .../(sidebar)/wallets/users/components/searchUsers.ts | 2 ++ .../[project_slug]/(sidebar)/wallets/users/page.tsx | 1 + 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts b/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts index 07ea93d40c8..3634b4d8ae7 100644 --- a/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts +++ b/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts @@ -8,11 +8,13 @@ const fetchAccountList = ({ jwt, clientId, ecosystemSlug, + teamId, pageNumber, }: { jwt: string; clientId?: string; ecosystemSlug?: string; + teamId: string; pageNumber: number; }) => { return async () => { @@ -31,6 +33,7 @@ const fetchAccountList = ({ headers: { Authorization: `Bearer ${jwt}`, "Content-Type": "application/json", + "x-team-id": teamId, ...(clientId && { "x-client-id": clientId }), }, method: "GET", @@ -49,10 +52,11 @@ const fetchAccountList = ({ export function useEmbeddedWallets(params: { clientId?: string; ecosystemSlug?: string; + teamId: string; page: number; authToken: string; }) { - const { clientId, ecosystemSlug, page, authToken } = params; + const { clientId, ecosystemSlug, teamId, page, authToken } = params; const address = useActiveAccount()?.address; return useQuery({ @@ -60,6 +64,7 @@ export function useEmbeddedWallets(params: { queryFn: fetchAccountList({ clientId, ecosystemSlug, + teamId, jwt: authToken, pageNumber: page, }), @@ -78,7 +83,7 @@ export function useAllEmbeddedWallets(params: { authToken: string }) { const address = useActiveAccount()?.address; return useMutation({ - mutationFn: async ({ clientId, ecosystemSlug }: { clientId?: string; ecosystemSlug?: string }) => { + mutationFn: async ({ clientId, ecosystemSlug, teamId }: { clientId?: string; ecosystemSlug?: string; teamId: string }) => { const responses: WalletUser[] = []; let page = 1; @@ -89,6 +94,7 @@ export function useAllEmbeddedWallets(params: { authToken: string }) { queryFn: fetchAccountList({ clientId, ecosystemSlug, + teamId, jwt: authToken, pageNumber: page, }), diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/users/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/users/page.tsx index 8ec39cce5d9..730a55b2ac7 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/users/page.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/users/page.tsx @@ -36,6 +36,7 @@ export default async function EcosystemUsersPage(props: { authToken={authToken} client={client} ecosystemSlug={ecosystem.slug} + teamId={team.id} /> ); } \ No newline at end of file diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx index 2fd8be7f4e8..b6e64a59bcd 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx @@ -41,6 +41,7 @@ const columnHelper = createColumnHelper(); export function InAppWalletUsersPageContent(props: { authToken: string; client: ThirdwebClient; + teamId: string; } & ( | { projectClientId: string; ecosystemSlug?: never } | { ecosystemSlug: string; projectClientId?: never } @@ -122,6 +123,7 @@ export function InAppWalletUsersPageContent(props: { authToken: props.authToken, clientId: props.projectClientId, ecosystemSlug: props.ecosystemSlug, + teamId: props.teamId, page: activePage, }); const wallets = walletsQuery?.data?.users || []; @@ -137,6 +139,7 @@ export function InAppWalletUsersPageContent(props: { props.authToken, props.projectClientId, props.ecosystemSlug, + props.teamId, searchType, query ); @@ -163,6 +166,7 @@ export function InAppWalletUsersPageContent(props: { const usersWallets = await getAllEmbeddedWallets({ clientId: props.projectClientId, ecosystemSlug: props.ecosystemSlug, + teamId: props.teamId, }); const csv = Papa.unparse( usersWallets.map((row) => { diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts index 3d2660a2596..20c1eb418c1 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts @@ -6,6 +6,7 @@ export async function searchUsers( authToken: string, clientId: string | undefined, ecosystemSlug: string | undefined, + teamId: string, searchType: SearchType, query: string, ): Promise { @@ -38,6 +39,7 @@ export async function searchUsers( headers: { Authorization: `Bearer ${authToken}`, "Content-Type": "application/json", + "x-team-id": teamId, ...(clientId && { "x-client-id": clientId }), }, method: "GET", diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/page.tsx index 4af11dac835..3856b22ab4d 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/page.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/page.tsx @@ -34,6 +34,7 @@ export default async function Page(props: { authToken={authToken} client={client} projectClientId={project.publishableKey} + teamId={project.teamId} /> ); } From e545b8d0948a20b44b1f0e9b515adcf2325ad616 Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Thu, 10 Jul 2025 20:26:34 +1200 Subject: [PATCH 07/10] lint --- .../src/@/hooks/useEmbeddedWallets.ts | 16 +++++++--- .../ecosystem/[slug]/(active)/users/page.tsx | 6 ++-- .../users/components/SearchResults.tsx | 2 +- .../wallets/users/components/index.tsx | 30 +++++++++++-------- .../wallets/users/components/searchUsers.ts | 6 ++-- 5 files changed, 36 insertions(+), 24 deletions(-) diff --git a/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts b/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts index 3634b4d8ae7..8ea1c1f0caa 100644 --- a/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts +++ b/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts @@ -19,21 +19,21 @@ const fetchAccountList = ({ }) => { return async () => { const url = new URL(`${THIRDWEB_EWS_API_HOST}/api/2024-05-05/account/list`); - + // Add clientId or ecosystemSlug parameter if (ecosystemSlug) { url.searchParams.append("ecosystemSlug", ecosystemSlug); } else if (clientId) { url.searchParams.append("clientId", clientId); } - + url.searchParams.append("page", pageNumber.toString()); const res = await fetch(url.href, { headers: { Authorization: `Bearer ${jwt}`, "Content-Type": "application/json", - "x-team-id": teamId, + "x-team-id": teamId.replace("team_", ""), ...(clientId && { "x-client-id": clientId }), }, method: "GET", @@ -83,7 +83,15 @@ export function useAllEmbeddedWallets(params: { authToken: string }) { const address = useActiveAccount()?.address; return useMutation({ - mutationFn: async ({ clientId, ecosystemSlug, teamId }: { clientId?: string; ecosystemSlug?: string; teamId: string }) => { + mutationFn: async ({ + clientId, + ecosystemSlug, + teamId, + }: { + clientId?: string; + ecosystemSlug?: string; + teamId: string; + }) => { const responses: WalletUser[] = []; let page = 1; diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/users/page.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/users/page.tsx index 730a55b2ac7..190344df67e 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/users/page.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/users/page.tsx @@ -17,9 +17,7 @@ export default async function EcosystemUsersPage(props: { ]); if (!authToken) { - loginRedirect( - `/team/${params.team_slug}/~/ecosystem/${params.slug}/users`, - ); + loginRedirect(`/team/${params.team_slug}/~/ecosystem/${params.slug}/users`); } if (!ecosystem || !team) { @@ -39,4 +37,4 @@ export default async function EcosystemUsersPage(props: { teamId={team.id} /> ); -} \ No newline at end of file +} diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchResults.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchResults.tsx index 1968e9d25e3..d24ad8b489a 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchResults.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchResults.tsx @@ -51,7 +51,7 @@ export function SearchResults(props: { const mainDetail = user.linkedAccounts?.[0]?.details; const email = mainDetail?.email as string | undefined; const phone = mainDetail?.phone as string | undefined; - + return ( diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx index b6e64a59bcd..da1e0cfdff1 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/index.tsx @@ -38,14 +38,16 @@ const getUserIdentifier = (accounts: WalletUser["linkedAccounts"]) => { const columnHelper = createColumnHelper(); -export function InAppWalletUsersPageContent(props: { - authToken: string; - client: ThirdwebClient; - teamId: string; -} & ( - | { projectClientId: string; ecosystemSlug?: never } - | { ecosystemSlug: string; projectClientId?: never } -)) { +export function InAppWalletUsersPageContent( + props: { + authToken: string; + client: ThirdwebClient; + teamId: string; + } & ( + | { projectClientId: string; ecosystemSlug?: never } + | { ecosystemSlug: string; projectClientId?: never } + ), +) { const columns = useMemo(() => { return [ columnHelper.accessor("linkedAccounts", { @@ -141,7 +143,7 @@ export function InAppWalletUsersPageContent(props: { props.ecosystemSlug, props.teamId, searchType, - query + query, ); setSearchResults(results); setHasSearchResults(true); @@ -187,7 +189,13 @@ export function InAppWalletUsersPageContent(props: { tempLink.href = csvUrl; tempLink.setAttribute("download", "download.csv"); tempLink.click(); - }, [wallets, props.projectClientId, getAllEmbeddedWallets]); + }, [ + wallets, + props.projectClientId, + getAllEmbeddedWallets, + props.teamId, + props.ecosystemSlug, + ]); return (
@@ -214,8 +222,6 @@ export function InAppWalletUsersPageContent(props: { Download as .csv
- -
diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts index 20c1eb418c1..a995f939405 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts @@ -11,14 +11,14 @@ export async function searchUsers( query: string, ): Promise { const url = new URL(`${THIRDWEB_EWS_API_HOST}/api/2024-05-05/account/list`); - + // Add clientId or ecosystemSlug parameter if (ecosystemSlug) { url.searchParams.append("ecosystemSlug", ecosystemSlug); } else if (clientId) { url.searchParams.append("clientId", clientId); } - + // Add search parameter based on search type switch (searchType) { case "email": @@ -39,7 +39,7 @@ export async function searchUsers( headers: { Authorization: `Bearer ${authToken}`, "Content-Type": "application/json", - "x-team-id": teamId, + "x-team-id": teamId.replace("team_", ""), ...(clientId && { "x-client-id": clientId }), }, method: "GET", From f26912d12edc6dac506b5520208daf6861377b64 Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Thu, 10 Jul 2025 21:30:47 +1200 Subject: [PATCH 08/10] cleanup --- apps/dashboard/src/@/hooks/useEmbeddedWallets.ts | 2 +- .../(sidebar)/wallets/users/components/searchUsers.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts b/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts index 8ea1c1f0caa..98d3c6c4b84 100644 --- a/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts +++ b/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts @@ -33,7 +33,7 @@ const fetchAccountList = ({ headers: { Authorization: `Bearer ${jwt}`, "Content-Type": "application/json", - "x-team-id": teamId.replace("team_", ""), + "x-team-id": teamId, ...(clientId && { "x-client-id": clientId }), }, method: "GET", diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts index a995f939405..c5b6841106a 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts @@ -39,7 +39,7 @@ export async function searchUsers( headers: { Authorization: `Bearer ${authToken}`, "Content-Type": "application/json", - "x-team-id": teamId.replace("team_", ""), + "x-team-id": teamId, ...(clientId && { "x-client-id": clientId }), }, method: "GET", From 936aa84092ba90e8f3f806880a8c5acd5f5c03e1 Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Thu, 10 Jul 2025 21:50:11 +1200 Subject: [PATCH 09/10] fix team id --- apps/dashboard/src/@/hooks/useEmbeddedWallets.ts | 2 +- .../(sidebar)/wallets/users/components/searchUsers.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts b/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts index 98d3c6c4b84..d4fbc967b0a 100644 --- a/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts +++ b/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts @@ -33,7 +33,7 @@ const fetchAccountList = ({ headers: { Authorization: `Bearer ${jwt}`, "Content-Type": "application/json", - "x-team-id": teamId, + "x-thirdweb-team-id": teamId, ...(clientId && { "x-client-id": clientId }), }, method: "GET", diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts index c5b6841106a..683d21997d7 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts @@ -39,7 +39,7 @@ export async function searchUsers( headers: { Authorization: `Bearer ${authToken}`, "Content-Type": "application/json", - "x-team-id": teamId, + "x-thirdweb-team-id": teamId, ...(clientId && { "x-client-id": clientId }), }, method: "GET", From 5afb0b0b9506e1f9960a101f55c5da3d62b972b9 Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Thu, 10 Jul 2025 22:01:05 +1200 Subject: [PATCH 10/10] ecosystem slug --- .../src/@/hooks/useEmbeddedWallets.ts | 2 +- .../wallets/users/components/SearchInput.tsx | 22 ------------------- .../wallets/users/components/searchUsers.ts | 2 +- 3 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchInput.tsx diff --git a/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts b/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts index d4fbc967b0a..2a5bf9ad1a4 100644 --- a/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts +++ b/apps/dashboard/src/@/hooks/useEmbeddedWallets.ts @@ -22,7 +22,7 @@ const fetchAccountList = ({ // Add clientId or ecosystemSlug parameter if (ecosystemSlug) { - url.searchParams.append("ecosystemSlug", ecosystemSlug); + url.searchParams.append("ecosystemSlug", `ecosystem.${ecosystemSlug}`); } else if (clientId) { url.searchParams.append("clientId", clientId); } diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchInput.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchInput.tsx deleted file mode 100644 index 41eb3d62936..00000000000 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/SearchInput.tsx +++ /dev/null @@ -1,22 +0,0 @@ -"use client"; - -import { SearchIcon } from "lucide-react"; -import { Input } from "@/components/ui/input"; - -export function SearchInput(props: { - placeholder: string; - value: string; - onValueChange: (value: string) => void; -}) { - return ( -
- props.onValueChange(e.target.value)} - placeholder={props.placeholder} - value={props.value} - /> - -
- ); -} diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts index 683d21997d7..3f60e0ae105 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/wallets/users/components/searchUsers.ts @@ -14,7 +14,7 @@ export async function searchUsers( // Add clientId or ecosystemSlug parameter if (ecosystemSlug) { - url.searchParams.append("ecosystemSlug", ecosystemSlug); + url.searchParams.append("ecosystemSlug", `ecosystem.${ecosystemSlug}`); } else if (clientId) { url.searchParams.append("clientId", clientId); }