Skip to content

Commit a39c0b6

Browse files
[Dashboard] Use testnet chains from useAllChainsData instead of hardcoded list
1 parent dd8530a commit a39c0b6

File tree

1 file changed

+5
-33
lines changed

1 file changed

+5
-33
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/engine/cloud/analytics/send-test-tx.client.tsx

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,10 @@ import { Loader2Icon, LockIcon } from "lucide-react";
1919
import { useState } from "react";
2020
import { useForm } from "react-hook-form";
2121
import { toast } from "sonner";
22-
import {
23-
arbitrumSepolia,
24-
baseSepolia,
25-
optimismSepolia,
26-
sepolia,
27-
} from "thirdweb/chains";
2822
import * as z from "zod";
2923
import { CopyTextButton } from "../../../../../../../../@/components/ui/CopyTextButton";
3024
import { useTrack } from "../../../../../../../../hooks/analytics/useTrack";
25+
import { useAllChainsData } from "../../../../../../../../hooks/chains/allChains";
3126
import type { Wallet } from "../server-wallets/wallet-table/types";
3227
import { SmartAccountCell } from "../server-wallets/wallet-table/wallet-table-ui.client";
3328
import { deleteUserAccessToken, getUserAccessToken } from "./utils";
@@ -53,6 +48,7 @@ export function SendTestTransaction(props: {
5348
const [hasSentTx, setHasSentTx] = useState(false);
5449
const router = useDashboardRouter();
5550
const trackEvent = useTrack();
51+
const chainsQuery = useAllChainsData();
5652

5753
const userAccessToken =
5854
props.userAccessToken ?? getUserAccessToken(props.project.id) ?? "";
@@ -227,33 +223,9 @@ export function SendTestTransaction(props: {
227223
<p className="text-sm">Network</p>
228224
<SingleNetworkSelector
229225
className="bg-background"
230-
chainIds={[
231-
baseSepolia.id,
232-
optimismSepolia.id,
233-
arbitrumSepolia.id,
234-
sepolia.id,
235-
1301,
236-
1946,
237-
1993,
238-
919,
239-
6342,
240-
10143,
241-
44787,
242-
80002,
243-
80069,
244-
98985,
245-
128123,
246-
167009,
247-
168587773,
248-
37714555429,
249-
1952959480,
250-
97,
251-
296,
252-
1740,
253-
4202,
254-
10200,
255-
13337,
256-
]}
226+
chainIds={chainsQuery.allChains
227+
.filter((chain) => chain.testnet === true)
228+
.map((chain) => chain.chainId)}
257229
client={thirdwebClient}
258230
chainId={form.watch("chainId")}
259231
onChange={(chainId) => {

0 commit comments

Comments
 (0)