Skip to content

Commit 84eaded

Browse files
[Dashboard] Show EOA server wallets by default (#7645)
1 parent 31d7173 commit 84eaded

File tree

4 files changed

+39
-30
lines changed

4 files changed

+39
-30
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import * as z from "zod";
1010
import { engineCloudProxy } from "@/actions/proxies";
1111
import type { Project } from "@/api/projects";
1212
import { SingleNetworkSelector } from "@/components/blocks/NetworkSelectors";
13+
import { WalletAddress } from "@/components/blocks/wallet-address";
1314
import { Button } from "@/components/ui/button";
1415
import {
1516
Dialog,
@@ -31,7 +32,6 @@ import { useAllChainsData } from "@/hooks/chains/allChains";
3132
import { useDashboardRouter } from "@/lib/DashboardRouter";
3233
import { TryItOut } from "../server-wallets/components/try-it-out";
3334
import type { Wallet } from "../server-wallets/wallet-table/types";
34-
import { SmartAccountCell } from "../server-wallets/wallet-table/wallet-table-ui.client";
3535

3636
const formSchema = z.object({
3737
secretKey: z.string().min(1, "Secret key is required"),
@@ -193,9 +193,9 @@ function SendTestTransactionModal(props: {
193193
<SelectTrigger className="w-full">
194194
<SelectValue>
195195
<div className="flex items-center gap-2">
196-
<SmartAccountCell
196+
<WalletAddress
197197
client={props.client}
198-
wallet={selectedWallet}
198+
address={selectedWallet.address}
199199
/>
200200
<span className="text-muted-foreground text-sm">
201201
{selectedWallet.metadata.label}
@@ -207,7 +207,10 @@ function SendTestTransactionModal(props: {
207207
{props.wallets.map((wallet, index) => (
208208
<SelectItem key={wallet.address} value={index.toString()}>
209209
<div className="flex items-center gap-2">
210-
<SmartAccountCell client={props.client} wallet={wallet} />
210+
<WalletAddress
211+
client={props.client}
212+
address={wallet.address}
213+
/>
211214
<span className="text-muted-foreground text-sm">
212215
{wallet.metadata.label}
213216
</span>

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/analytics/tx-table/tx-table-ui.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,18 +331,14 @@ function TxStatusCell(props: { transaction: Transaction }) {
331331
const { errorMessage } = transaction;
332332
const minedAt = transaction.confirmedAt;
333333
const status =
334-
(transaction.executionResult?.status as TransactionStatus) ?? null;
334+
(transaction.executionResult?.status as TransactionStatus) ?? "QUEUED";
335335

336336
const onchainStatus =
337337
transaction.executionResult &&
338338
"onchainStatus" in transaction.executionResult
339339
? transaction.executionResult.onchainStatus
340340
: null;
341341

342-
if (!status) {
343-
return null;
344-
}
345-
346342
const tooltip =
347343
onchainStatus !== "REVERTED"
348344
? errorMessage

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/server-wallets/wallet-table/wallet-table-ui.client.tsx

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ export function ServerWalletsTableUI({
5858
totalPages: number;
5959
client: ThirdwebClient;
6060
}) {
61-
const [showSigners, setShowSigners] = useState(false);
62-
const showSignersId = useId();
61+
const [showContractWallets, setShowContractWallets] = useState(false);
62+
const showContractWalletsId = useId();
6363
return (
6464
<div className="overflow-hidden rounded-lg border border-border bg-card">
65-
<div className="flex flex-row items-center gap-4 px-6 py-6">
66-
<div className="flex flex-1 flex-col gap-4 rounded-lg rounded-b-none lg:flex-row lg:justify-between">
65+
<div className="flex flex-col lg:flex-row items-center gap-4 px-6 py-6">
66+
<div className="flex flex-1 flex-col gap-4 rounded-lg rounded-b-none items-start">
6767
<div>
6868
<h2 className="font-semibold text-xl tracking-tight">
6969
Server Wallets
@@ -73,28 +73,36 @@ export function ServerWalletsTableUI({
7373
</p>
7474
</div>
7575
</div>
76-
<div className="flex items-center justify-end gap-2">
77-
<label className="cursor-pointer text-sm" htmlFor={showSignersId}>
78-
Show Signer Addresses
79-
</label>
80-
<Switch
81-
checked={showSigners}
82-
id={showSignersId}
83-
onCheckedChange={() => setShowSigners(!showSigners)}
76+
<div className="flex flex-col gap-4 items-end">
77+
<CreateServerWallet
78+
managementAccessToken={managementAccessToken}
79+
project={project}
80+
teamSlug={teamSlug}
8481
/>
8582
</div>
86-
<CreateServerWallet
87-
managementAccessToken={managementAccessToken}
88-
project={project}
89-
teamSlug={teamSlug}
83+
</div>
84+
85+
<div className="flex items-center justify-end gap-2 py-4">
86+
<label
87+
className="cursor-pointer text-sm text-muted-foreground"
88+
htmlFor={showContractWalletsId}
89+
>
90+
Show ERC4337 Smart Account Addresses
91+
</label>
92+
<Switch
93+
checked={showContractWallets}
94+
id={showContractWalletsId}
95+
onCheckedChange={() => setShowContractWallets(!showContractWallets)}
9096
/>
9197
</div>
9298

9399
<TableContainer className="rounded-none border-x-0 border-b-0">
94100
<Table>
95101
<TableHeader>
96102
<TableRow>
97-
<TableHead>Address</TableHead>
103+
<TableHead>
104+
{showContractWallets ? "Smart Account Address" : "EOA Address"}
105+
</TableHead>
98106
<TableHead>Label</TableHead>
99107
<TableHead className="text-right">Created At</TableHead>
100108
<TableHead className="text-right">Updated At</TableHead>
@@ -105,10 +113,10 @@ export function ServerWalletsTableUI({
105113
{wallets.map((wallet) => (
106114
<TableRow className="hover:bg-accent/50" key={wallet.id}>
107115
<TableCell>
108-
{showSigners ? (
109-
<WalletAddress address={wallet.address} client={client} />
110-
) : (
116+
{showContractWallets ? (
111117
<SmartAccountCell client={client} wallet={wallet} />
118+
) : (
119+
<WalletAddress address={wallet.address} client={client} />
112120
)}
113121
</TableCell>
114122
<TableCell>{wallet.metadata.label || "none"}</TableCell>
@@ -197,7 +205,7 @@ export function ServerWalletsTableUI({
197205
);
198206
}
199207

200-
export function SmartAccountCell({
208+
function SmartAccountCell({
201209
wallet,
202210
client,
203211
}: {

pnpm-lock.yaml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)