From 7d4f1d9786136fc79136afb6b53066115f05b51d Mon Sep 17 00:00:00 2001 From: stanlou Date: Mon, 13 Apr 2026 09:58:00 +0100 Subject: [PATCH] add transaction args to tx detail view --- src/app/transactions/[hash]/page.tsx | 50 +++++++++++++++++++++++++--- src/components/details/layout.tsx | 3 +- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/app/transactions/[hash]/page.tsx b/src/app/transactions/[hash]/page.tsx index f688b5a..2a9b73d 100644 --- a/src/app/transactions/[hash]/page.tsx +++ b/src/app/transactions/[hash]/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { CircleCheck, CircleX } from "lucide-react"; +import { CircleCheck, CircleX, ChevronDown } from "lucide-react"; import { useCallback, useEffect, useState } from "react"; import { useParams } from "next/navigation"; import TimeAgo from "react-timeago"; @@ -14,6 +14,7 @@ interface Transaction { sender: string; methodId: string; nonce: string; + argsFields: string[]; createdAt: string; executionResult: { status: boolean; @@ -38,6 +39,7 @@ export default function BlockDetail() { const params = useParams<{ hash: string }>(); const [data, setData] = useState(); const [loading, setLoading] = useState(true); + const [argsExpanded, setArgsExpanded] = useState(false); const query = useCallback(async () => { setLoading(true); const queryStr = `query GetTransaction($hash: String!) { @@ -46,6 +48,7 @@ export default function BlockDetail() { methodId sender nonce + argsFields createdAt executionResult { status @@ -82,6 +85,38 @@ export default function BlockDetail() { void query(); }, []); + const ArgsFieldsDisplay = () => { + if ( + !data?.transaction?.argsFields || + data.transaction.argsFields.length === 0 + ) { + return "—"; + } + + return ( +
+ + {argsExpanded && ( +
+            {JSON.stringify(data.transaction.argsFields, null, 2)}
+          
+ )} +
+ ); + }; + const getStatus = (tx: Transaction | undefined) => { const batch = tx?.executionResult?.block?.batch; @@ -136,9 +171,16 @@ export default function BlockDetail() { }, { label: "Created At", - value: data?.transaction?.createdAt - ? - : "—", + value: data?.transaction?.createdAt ? ( + + ) : ( + "—" + ), + }, + { + label: "Args Fields", + value: , + fullWidth: true, }, ]; diff --git a/src/components/details/layout.tsx b/src/components/details/layout.tsx index a7cd946..fb4a0cf 100644 --- a/src/components/details/layout.tsx +++ b/src/components/details/layout.tsx @@ -14,6 +14,7 @@ export interface DetailsLayoutProps { label: string; value: string | JSX.Element; link?: string; + fullWidth?: boolean; }[]; loading: boolean; } @@ -39,7 +40,7 @@ export function DetailsLayout({ {/* Details */}
{details.map((detail, i) => ( -
+