diff --git a/tools/tenscan/frontend/pages/batch/txs/[fullHash].tsx b/tools/tenscan/frontend/pages/batch/txs/[hash].tsx similarity index 66% rename from tools/tenscan/frontend/pages/batch/txs/[fullHash].tsx rename to tools/tenscan/frontend/pages/batch/txs/[hash].tsx index 805d969d9c..4de42bc959 100644 --- a/tools/tenscan/frontend/pages/batch/txs/[fullHash].tsx +++ b/tools/tenscan/frontend/pages/batch/txs/[hash].tsx @@ -14,15 +14,17 @@ import { import { useQuery } from "@tanstack/react-query"; import { useRouter } from "next/router"; import { getOptions } from "../../../src/lib/constants"; +import { pathToUrl } from "@/src/routes/router"; +import { pageLinks } from "@/src/routes"; export default function BatchTransactions() { const router = useRouter(); - const { fullHash } = router.query; + const { hash } = router.query; const options = getOptions(router.query); const { data, isLoading, refetch } = useQuery({ - queryKey: ["batchTransactions", { fullHash, options }], - queryFn: () => fetchBatchTransactions(fullHash as string, options), + queryKey: ["batchTransactions", { hash, options }], + queryFn: () => fetchBatchTransactions(hash as string, options), }); const { TransactionsData, Total } = data?.result || { @@ -35,14 +37,20 @@ export default function BatchTransactions() { Transactions - -

Overview of all transactions in this batch:

- -
+
+ + + Overview of all transactions in this batch: + + + +
{ - setNoPolling(true); - - return () => { - setNoPolling(false); - }; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - const firstBatchHeight = Number(getItem(BatchesData, "height")); const lastBatchHeight = Number( getItem(BatchesData, "height", ItemPosition.LAST) diff --git a/tools/tenscan/frontend/pages/blocks/index.tsx b/tools/tenscan/frontend/pages/blocks/index.tsx index 996df2b082..4383266fe3 100644 --- a/tools/tenscan/frontend/pages/blocks/index.tsx +++ b/tools/tenscan/frontend/pages/blocks/index.tsx @@ -15,19 +15,12 @@ export const metadata: Metadata = { }; export default function Blocks() { - const { blocks, setNoPolling, refetchBlocks, isBlocksLoading } = - useBlocksService(); + const { blocks, refetchBlocks, isBlocksLoading } = useBlocksService(); const { BlocksData, Total } = blocks?.result || { BlocksData: [], Total: 0, }; - React.useEffect(() => { - setNoPolling(true); - return () => setNoPolling(false); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - const firstBlockNumber = Number(getItem(BlocksData, "blockHeader.number")); const lastBlockNumber = Number( getItem(BlocksData, "blockHeader.number", ItemPosition.LAST) diff --git a/tools/tenscan/frontend/pages/tx/personal/[hash].tsx b/tools/tenscan/frontend/pages/personal/tx/[hash].tsx similarity index 100% rename from tools/tenscan/frontend/pages/tx/personal/[hash].tsx rename to tools/tenscan/frontend/pages/personal/tx/[hash].tsx diff --git a/tools/tenscan/frontend/pages/rollups/index.tsx b/tools/tenscan/frontend/pages/rollups/index.tsx index c41fb0ae67..7d8b6a19d1 100644 --- a/tools/tenscan/frontend/pages/rollups/index.tsx +++ b/tools/tenscan/frontend/pages/rollups/index.tsx @@ -15,22 +15,12 @@ export const metadata: Metadata = { }; export default function Rollups() { - const { rollups, setNoPolling, isRollupsLoading, refetchRollups } = - useRollupsService(); + const { rollups, isRollupsLoading, refetchRollups } = useRollupsService(); const { RollupsData, Total } = rollups?.result || { RollupsData: [], Total: 0, }; - React.useEffect(() => { - setNoPolling(true); - - return () => { - setNoPolling(false); - }; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - const firstRollupID = Number(getItem(RollupsData, "ID")); const lastRollupID = Number(getItem(RollupsData, "ID", ItemPosition.LAST)); diff --git a/tools/tenscan/frontend/pages/transactions/index.tsx b/tools/tenscan/frontend/pages/transactions/index.tsx index aba6a98503..5225b70d3d 100644 --- a/tools/tenscan/frontend/pages/transactions/index.tsx +++ b/tools/tenscan/frontend/pages/transactions/index.tsx @@ -15,26 +15,13 @@ export const metadata: Metadata = { }; export default function Transactions() { - const { - transactions, - refetchTransactions, - setNoPolling, - isTransactionsLoading, - } = useTransactionsService(); + const { transactions, refetchTransactions, isTransactionsLoading } = + useTransactionsService(); const { TransactionsData, Total } = transactions?.result || { TransactionsData: [], Total: 0, }; - React.useEffect(() => { - setNoPolling(true); - - return () => { - setNoPolling(false); - }; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - const firstBatchHeight = getItem(TransactionsData, "BatchHeight"); const lastBatchHeight = getItem( TransactionsData, diff --git a/tools/tenscan/frontend/src/components/health-indicator.tsx b/tools/tenscan/frontend/src/components/health-indicator.tsx index 20ee4deb24..c522ac2a5d 100644 --- a/tools/tenscan/frontend/src/components/health-indicator.tsx +++ b/tools/tenscan/frontend/src/components/health-indicator.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Badge, badgeVariants } from "@repo/ui/components/shared/badge"; import { useGeneralService } from "../services/useGeneralService"; -import { BarChart } from "lucide-react"; +import { BarChart } from "@repo/ui/components/shared/react-icons"; import { TooltipProvider, TooltipTrigger, diff --git a/tools/tenscan/frontend/src/components/layouts/header.tsx b/tools/tenscan/frontend/src/components/layouts/header.tsx index c76b5f193f..b473e027c5 100644 --- a/tools/tenscan/frontend/src/components/layouts/header.tsx +++ b/tools/tenscan/frontend/src/components/layouts/header.tsx @@ -19,7 +19,6 @@ export default function Header() { width={150} height={40} className="cursor-pointer dark:hidden" - fetchPriority="auto" />
diff --git a/tools/tenscan/frontend/src/components/modules/batches/batch-hash-details.tsx b/tools/tenscan/frontend/src/components/modules/batches/batch-hash-details.tsx index 6dd9d2e57c..159d9b146d 100644 --- a/tools/tenscan/frontend/src/components/modules/batches/batch-hash-details.tsx +++ b/tools/tenscan/frontend/src/components/modules/batches/batch-hash-details.tsx @@ -1,11 +1,15 @@ +import { useMemo, useState } from "react"; import { Separator } from "@repo/ui/components/shared/separator"; import TruncatedAddress from "@repo/ui/components/common/truncated-address"; import KeyValueItem, { KeyValueList, } from "@repo/ui/components/shared/key-value"; -import { formatNumber, formatTimeAgo } from "@repo/ui/lib/utils"; +import { + formatNumber, + formatTimeAgo, + formatTimestampToDate, +} from "@repo/ui/lib/utils"; import { Badge } from "@repo/ui/components/shared/badge"; -import { BatchDetails } from "@/src/types/interfaces/BatchInterfaces"; import Link from "next/link"; import { EyeClosedIcon, @@ -15,13 +19,15 @@ import { Button } from "@repo/ui/components/shared/button"; import Copy from "@repo/ui/components/common/copy"; import { useRollupsService } from "@/src/services/useRollupsService"; import JSONPretty from "react-json-pretty"; -import { useState } from "react"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@repo/ui/components/shared/tooltip"; +import { pathToUrl } from "@/src/routes/router"; +import { pageLinks } from "@/src/routes"; +import { BatchDetails } from "@/src/types/interfaces/BatchInterfaces"; export function BatchHashDetailsComponent({ batchDetails, @@ -31,6 +37,31 @@ export function BatchHashDetailsComponent({ const { decryptedRollup, decryptEncryptedData } = useRollupsService(); const [showDecryptedData, setShowDecryptedData] = useState(false); + const transactionHashes = useMemo( + () => + batchDetails?.TxHashes.length > 0 ? ( +
    + {batchDetails.TxHashes.map((txHash, index) => ( +
  • + +
  • + ))} +
+ ) : ( + "-" + ), + [batchDetails?.TxHashes] + ); + + const handleDecryptToggle = () => { + decryptEncryptedData({ StrData: batchDetails?.EncryptedTxBlob }); + setShowDecryptedData(!showDecryptedData); + }; + return (
@@ -38,7 +69,9 @@ export function BatchHashDetailsComponent({ label="Batch Height" value={ {"#" + Number(batchDetails?.Header?.number)} @@ -47,47 +80,75 @@ export function BatchHashDetailsComponent({ /> } + value={ + + } /> + } /> } + value={ + + } /> } /> + } /> - {formatTimeAgo(batchDetails?.Header?.timestamp)} + + {formatTimeAgo(batchDetails?.Header?.timestamp) + + " - " + + formatTimestampToDate(batchDetails?.Header?.timestamp)} } /> } + value={ + + } /> + {formatNumber(batchDetails?.Header?.gasLimit)} + + } /> + {formatNumber(batchDetails?.Header?.baseFeePerGas)} + + } /> } /> @@ -111,73 +177,54 @@ export function BatchHashDetailsComponent({ /> } - /> - + } /> - - - + - {batchDetails?.TxHashes?.map((txHash, index) => ( -
  • - -
  • - ))} - - ) : ( - "-" - ) - } + value={transactionHashes} isLastItem />
    + +
    - {" "} + - {showDecryptedData && decryptedRollup ? ( + + {showDecryptedData && decryptedRollup && ( @@ -188,14 +235,14 @@ export function BatchHashDetailsComponent({ - ) : null} + )}
    - {decryptedRollup && showDecryptedData ? ( + {showDecryptedData && decryptedRollup && ( <> - ) : null} + )} } isLastItem diff --git a/tools/tenscan/frontend/src/components/modules/batches/batch-height-details.tsx b/tools/tenscan/frontend/src/components/modules/batches/batch-height-details.tsx index 81f37e3c28..4c58f4654f 100644 --- a/tools/tenscan/frontend/src/components/modules/batches/batch-height-details.tsx +++ b/tools/tenscan/frontend/src/components/modules/batches/batch-height-details.tsx @@ -3,7 +3,11 @@ import TruncatedAddress from "@repo/ui/components/common/truncated-address"; import KeyValueItem, { KeyValueList, } from "@repo/ui/components/shared/key-value"; -import { formatNumber, formatTimeAgo } from "@repo/ui/lib/utils"; +import { + formatNumber, + formatTimeAgo, + formatTimestampToDate, +} from "@repo/ui/lib/utils"; import { Badge } from "@repo/ui/components/shared/badge"; import { Batch } from "@/src/types/interfaces/BatchInterfaces"; import Link from "next/link"; @@ -14,13 +18,15 @@ import { import { Button } from "@repo/ui/components/shared/button"; import { useRollupsService } from "@/src/services/useRollupsService"; import JSONPretty from "react-json-pretty"; -import { useState } from "react"; +import React, { useState } from "react"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@repo/ui/components/shared/tooltip"; +import { pageLinks } from "@/src/routes"; +import { pathToUrl } from "@/src/routes/router"; export function BatchHeightDetailsComponent({ batchDetails, @@ -46,45 +52,67 @@ export function BatchHeightDetailsComponent({ value={ } /> + } /> } + value={ + + } /> } /> + } /> - {formatTimeAgo(batchDetails?.header?.timestamp)} + {formatTimeAgo(batchDetails?.header?.timestamp) + + " - " + + formatTimestampToDate(batchDetails?.header?.timestamp)} } /> } + value={ + + } /> } /> @@ -120,7 +149,12 @@ export function BatchHeightDetailsComponent({ /> } + value={ + + } /> - {batchDetails?.txCount || "-"} - + batchDetails?.txCount > 0 ? ( + + {batchDetails?.txCount}{" "} + + View + + + ) : ( + batchDetails?.txCount || "-" + ) } isLastItem /> diff --git a/tools/tenscan/frontend/src/components/modules/batches/columns.tsx b/tools/tenscan/frontend/src/components/modules/batches/columns.tsx index bcfbd09e29..721d15b5b2 100644 --- a/tools/tenscan/frontend/src/components/modules/batches/columns.tsx +++ b/tools/tenscan/frontend/src/components/modules/batches/columns.tsx @@ -8,6 +8,8 @@ import { formatNumber, formatTimeAgo } from "@repo/ui/lib/utils"; import { Batch } from "@/src/types/interfaces/BatchInterfaces"; import Link from "next/link"; import { Badge } from "@repo/ui/components/shared/badge"; +import { pathToUrl } from "@/src/routes/router"; +import { pageLinks } from "@/src/routes"; export const columns: ColumnDef[] = [ { @@ -19,7 +21,9 @@ export const columns: ColumnDef[] = [ return (
    @@ -98,7 +102,9 @@ export const columns: ColumnDef[] = [ return ( ); }, @@ -124,7 +130,9 @@ export const columns: ColumnDef[] = [ cell: ({ row }) => { return ( {row.original.sequence} @@ -140,13 +148,17 @@ export const columns: ColumnDef[] = [ ), cell: ({ row }) => { - return ( + return row.original.txCount > 0 ? ( {row.original.txCount} + ) : ( + {row.original.txCount} ); }, enableSorting: false, diff --git a/tools/tenscan/frontend/src/components/modules/batches/transaction-columns.tsx b/tools/tenscan/frontend/src/components/modules/batches/transaction-columns.tsx index 760a7aaaa8..5ce0aa849b 100644 --- a/tools/tenscan/frontend/src/components/modules/batches/transaction-columns.tsx +++ b/tools/tenscan/frontend/src/components/modules/batches/transaction-columns.tsx @@ -8,6 +8,8 @@ import { Transaction } from "@/src/types/interfaces/TransactionInterfaces"; import TruncatedAddress from "@repo/ui/components/common/truncated-address"; import { formatTimeAgo } from "@repo/ui/lib/utils"; import Link from "next/link"; +import { pathToUrl } from "@/src/routes/router"; +import { pageLinks } from "@/src/routes"; export const columns: ColumnDef[] = [ { @@ -37,7 +39,9 @@ export const columns: ColumnDef[] = [ return ( ); }, diff --git a/tools/tenscan/frontend/src/components/modules/blocks/columns.tsx b/tools/tenscan/frontend/src/components/modules/blocks/columns.tsx index c9cb165a6f..b7b04e657a 100644 --- a/tools/tenscan/frontend/src/components/modules/blocks/columns.tsx +++ b/tools/tenscan/frontend/src/components/modules/blocks/columns.tsx @@ -8,8 +8,9 @@ import TruncatedAddress from "@repo/ui/components/common/truncated-address"; import { formatNumber, formatTimeAgo } from "@repo/ui/lib/utils"; import { Badge } from "@repo/ui/components/shared/badge"; import ExternalLink from "@repo/ui/components/shared/external-link"; -import { externalLinks } from "@/src/routes"; +import { externalPageLinks, pageLinks } from "@/src/routes"; import { EyeOpenIcon } from "@repo/ui/components/shared/react-icons"; +import { pathToUrl } from "@/src/routes/router"; export const columns: ColumnDef[] = [ { @@ -62,7 +63,9 @@ export const columns: ColumnDef[] = [ ) : ( ); }, @@ -152,7 +155,9 @@ export const columns: ColumnDef[] = [ const blockHeader = row.original.blockHeader as BlockHeader; return ( diff --git a/tools/tenscan/frontend/src/components/modules/dashboard/index.tsx b/tools/tenscan/frontend/src/components/modules/dashboard/index.tsx index 7f839b2474..7726b6e769 100644 --- a/tools/tenscan/frontend/src/components/modules/dashboard/index.tsx +++ b/tools/tenscan/frontend/src/components/modules/dashboard/index.tsx @@ -30,6 +30,7 @@ import { BlocksIcon } from "@repo/ui/components/shared/react-icons"; import { useRollupsService } from "@/src/services/useRollupsService"; import { RecentRollups } from "./recent-rollups"; import { DashboardAnalyticsData } from "@/src/types/interfaces"; +import { pageLinks } from "@/src/routes"; interface RecentData { title: string; @@ -46,10 +47,29 @@ export default function Dashboard() { transactions, transactionCount, isTransactionCountLoading, + setNoPolling: setNoPollingTransactions, } = useTransactionsService(); const { contractCount, isContractCountLoading } = useContractsService(); - const { batches, latestBatch, isLatestBatchLoading } = useBatchesService(); - const { rollups } = useRollupsService(); + const { + batches, + latestBatch, + isLatestBatchLoading, + setNoPolling: setNoPollingBatches, + } = useBatchesService(); + const { rollups, setNoPolling: setNoPollingRollups } = useRollupsService(); + + React.useEffect(() => { + setNoPollingTransactions(false); + setNoPollingBatches(false); + setNoPollingRollups(false); + + return () => { + setNoPollingTransactions(true); + setNoPollingBatches(true); + setNoPollingRollups(true); + }; + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); const DASHBOARD_DATA = [ { @@ -118,21 +138,21 @@ export default function Dashboard() { title: "Recent Rollups", data: rollups, component: , - goTo: "/rollups", + goTo: pageLinks.rollups, className: "col-span-1 md:col-span-2 lg:col-span-3", }, { title: "Recent Batches", data: batches, component: , - goTo: "/batches", + goTo: pageLinks.batches, className: "col-span-1 md:col-span-2 lg:col-span-3", }, { title: "Recent Transactions", data: transactions, component: , - goTo: "/transactions", + goTo: pageLinks.transactions, className: "col-span-1 md:col-span-2 lg:col-span-3", }, ]; diff --git a/tools/tenscan/frontend/src/components/modules/dashboard/recent-batches.tsx b/tools/tenscan/frontend/src/components/modules/dashboard/recent-batches.tsx index 635a4ddc35..510ba09cae 100644 --- a/tools/tenscan/frontend/src/components/modules/dashboard/recent-batches.tsx +++ b/tools/tenscan/frontend/src/components/modules/dashboard/recent-batches.tsx @@ -3,6 +3,8 @@ import { formatTimeAgo } from "@repo/ui/lib/utils"; import { Batch } from "@/src/types/interfaces/BatchInterfaces"; import { Avatar, AvatarFallback } from "@repo/ui/components/shared/avatar"; import Link from "next/link"; +import { pathToUrl } from "@/src/routes/router"; +import { pageLinks } from "@/src/routes"; export function RecentBatches({ batches }: { batches: any }) { return ( @@ -15,7 +17,9 @@ export function RecentBatches({ batches }: { batches: any }) {

    #{Number(batch?.height)} @@ -28,7 +32,9 @@ export function RecentBatches({ batches }: { batches: any }) {

    diff --git a/tools/tenscan/frontend/src/components/modules/dashboard/recent-rollups.tsx b/tools/tenscan/frontend/src/components/modules/dashboard/recent-rollups.tsx index 2deb54cce6..1c1dd93dec 100644 --- a/tools/tenscan/frontend/src/components/modules/dashboard/recent-rollups.tsx +++ b/tools/tenscan/frontend/src/components/modules/dashboard/recent-rollups.tsx @@ -2,6 +2,8 @@ import TruncatedAddress from "@repo/ui/components/common/truncated-address"; import { formatTimeAgo } from "@repo/ui/lib/utils"; import { Avatar, AvatarFallback } from "@repo/ui/components/shared/avatar"; import { Rollup } from "@/src/types/interfaces/RollupInterfaces"; +import { pathToUrl } from "@/src/routes/router"; +import { pageLinks } from "@/src/routes"; export function RecentRollups({ rollups }: { rollups: any }) { return ( @@ -22,7 +24,7 @@ export function RecentRollups({ rollups }: { rollups: any }) {
    diff --git a/tools/tenscan/frontend/src/components/modules/dashboard/recent-transactions.tsx b/tools/tenscan/frontend/src/components/modules/dashboard/recent-transactions.tsx index 63a90645d7..e94fc1b00d 100644 --- a/tools/tenscan/frontend/src/components/modules/dashboard/recent-transactions.tsx +++ b/tools/tenscan/frontend/src/components/modules/dashboard/recent-transactions.tsx @@ -4,6 +4,8 @@ import { Transaction } from "@/src/types/interfaces/TransactionInterfaces"; import { Badge } from "@repo/ui/components/shared/badge"; import { formatTimeAgo } from "@repo/ui/lib/utils"; import Link from "next/link"; +import { pathToUrl } from "@/src/routes/router"; +import { pageLinks } from "@/src/routes"; export function RecentTransactions({ transactions }: { transactions: any }) { return ( @@ -18,7 +20,9 @@ export function RecentTransactions({ transactions }: { transactions: any }) {

    Batch #{Number(transaction?.BatchHeight)} @@ -31,7 +35,9 @@ export function RecentTransactions({ transactions }: { transactions: any }) {

    diff --git a/tools/tenscan/frontend/src/components/modules/personal/columns.tsx b/tools/tenscan/frontend/src/components/modules/personal/columns.tsx index c6fc4fe06c..9dda107e44 100644 --- a/tools/tenscan/frontend/src/components/modules/personal/columns.tsx +++ b/tools/tenscan/frontend/src/components/modules/personal/columns.tsx @@ -8,8 +8,9 @@ import { DataTableColumnHeader } from "@repo/ui/components/common/data-table/dat import { PersonalTransactions } from "../../..//types/interfaces/TransactionInterfaces"; import TruncatedAddress from "@repo/ui/components/common/truncated-address"; import { formatNumber } from "@repo/ui/lib/utils"; +import { pathToUrl } from "@/src/routes/router"; +import { pageLinks } from "@/src/routes"; import Link from "next/link"; -import { EyeOpenIcon } from "@repo/ui/components/shared/react-icons"; export const columns: ColumnDef[] = [ { @@ -19,11 +20,16 @@ export const columns: ColumnDef[] = [ ), cell: ({ row }) => { return ( -
    + #{Number(row.getValue("blockNumber"))} -
    + ); }, enableSorting: false, @@ -35,7 +41,14 @@ export const columns: ColumnDef[] = [ ), cell: ({ row }) => { - return ; + return ( + + ); }, enableSorting: false, enableHiding: false, @@ -46,7 +59,14 @@ export const columns: ColumnDef[] = [ ), cell: ({ row }) => { - return ; + return ( + + ); }, enableSorting: false, enableHiding: false, @@ -125,14 +145,4 @@ export const columns: ColumnDef[] = [ return value.includes(row.getValue(id)); }, }, - { - id: "actions", - cell: ({ row }) => { - return ( - - - - ); - }, - }, ]; diff --git a/tools/tenscan/frontend/src/components/modules/personal/index.tsx b/tools/tenscan/frontend/src/components/modules/personal/index.tsx index ba4a899736..948c0e4722 100644 --- a/tools/tenscan/frontend/src/components/modules/personal/index.tsx +++ b/tools/tenscan/frontend/src/components/modules/personal/index.tsx @@ -4,22 +4,12 @@ import { DataTable } from "@repo/ui/components/common/data-table/data-table"; import { useTransactionsService } from "@/src/services/useTransactionsService"; export default function PersonalTransactions() { - const { personalTxns, setNoPolling, personalTxnsLoading } = - useTransactionsService(); + const { personalTxns, personalTxnsLoading } = useTransactionsService(); const { Receipts, Total } = personalTxns || { Receipts: [], Total: 0, }; - React.useEffect(() => { - setNoPolling(true); - - return () => { - setNoPolling(false); - }; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - return ( <>
    diff --git a/tools/tenscan/frontend/src/components/modules/personal/personal-txn-details.tsx b/tools/tenscan/frontend/src/components/modules/personal/personal-txn-details.tsx index e4cd75306c..0e33d3225e 100644 --- a/tools/tenscan/frontend/src/components/modules/personal/personal-txn-details.tsx +++ b/tools/tenscan/frontend/src/components/modules/personal/personal-txn-details.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useState } from "react"; import KeyValueItem, { KeyValueList, } from "@repo/ui/components/shared/key-value"; @@ -7,16 +7,21 @@ import { TransactionReceipt, TransactionType, } from "../../../types/interfaces/TransactionInterfaces"; -import Link from "next/link"; import TruncatedAddress from "@repo/ui/components/common/truncated-address"; import { Badge } from "@repo/ui/components/shared/badge"; import { BadgeType } from "@repo/ui/lib/enums/badge"; +import { Button } from "@repo/ui/components/shared/button"; +import { pathToUrl } from "@/src/routes/router"; +import { pageLinks } from "@/src/routes"; export function PersonalTxnDetailsComponent({ transactionDetails, }: { transactionDetails: TransactionReceipt; }) { + const [logsExpanded, setLogsExpanded] = useState(false); + const toggleLogs = () => setLogsExpanded(!logsExpanded); + const getTransactionType = (type: TransactionType) => { switch (type) { case PersonalTransactionType.Legacy: @@ -33,14 +38,16 @@ export function PersonalTxnDetailsComponent({ }; return ( -
    +
    } /> @@ -49,14 +56,16 @@ export function PersonalTxnDetailsComponent({ value={ } /> + {Number(transactionDetails?.transactionIndex)} } @@ -64,13 +73,7 @@ export function PersonalTxnDetailsComponent({ + {getTransactionType(transactionDetails?.type)} } @@ -89,27 +92,26 @@ export function PersonalTxnDetailsComponent({ } /> - + {Number(transactionDetails?.blockNumber)} - + } /> - {Number(transactionDetails?.gasUsed)}{" "} + + {Number(transactionDetails?.gasUsed)} } /> + {Number(transactionDetails?.cumulativeGasUsed)} } @@ -117,7 +119,7 @@ export function PersonalTxnDetailsComponent({ + {Number(transactionDetails?.effectiveGasPrice)} } @@ -133,10 +135,7 @@ export function PersonalTxnDetailsComponent({ + } /> } /> - 0 ? (
    - {transactionDetails?.logs.map((log, index) => ( -
    - - } - /> - } - /> - - } - /> - - + {logsExpanded + ? `Hide Logs (${transactionDetails.logs.length})` + : `Show Logs (${transactionDetails.logs.length})`} + + {logsExpanded && ( +
    + {transactionDetails?.logs.map((log, index) => ( +
    + + } + /> + } + /> + + } + /> + + + {log.removed ? "Yes" : "No"} + } - > - {log.removed ? "Yes" : "No"} - - } - /> - - {log.topics.map((topic, index) => ( -
    - } - /> + /> + + {log.topics.map((topic, index) => ( +
    + +
    + ))}
    - ))} -
    - } - /> - + + } + /> + + {Number(transactionDetails?.transactionIndex)} + + } + isLastItem /> - } - /> - - {Number(transactionDetails?.transactionIndex)} - - } - isLastItem - /> - + +
    + ))}
    - ))} + )}
    ) : ( - "No logs found" + "No logs found." ) } isLastItem diff --git a/tools/tenscan/frontend/src/components/modules/rollups/columns.tsx b/tools/tenscan/frontend/src/components/modules/rollups/columns.tsx index 37355e3d2a..429f4d6066 100644 --- a/tools/tenscan/frontend/src/components/modules/rollups/columns.tsx +++ b/tools/tenscan/frontend/src/components/modules/rollups/columns.tsx @@ -7,6 +7,8 @@ import { formatTimeAgo } from "@repo/ui/lib/utils"; import Link from "next/link"; import { EyeOpenIcon } from "@repo/ui/components/shared/react-icons"; import { Rollup } from "@/src/types/interfaces/RollupInterfaces"; +import { pathToUrl } from "@/src/routes/router"; +import { pageLinks } from "@/src/routes"; export const columns: ColumnDef[] = [ { @@ -33,10 +35,9 @@ export const columns: ColumnDef[] = [ return ( ); }, @@ -80,7 +81,9 @@ export const columns: ColumnDef[] = [ return (
    @@ -102,7 +105,9 @@ export const columns: ColumnDef[] = [ return (
    @@ -119,7 +124,9 @@ export const columns: ColumnDef[] = [ id: "actions", cell: ({ row }) => { return ( - + ); diff --git a/tools/tenscan/frontend/src/components/modules/rollups/rollup-details.tsx b/tools/tenscan/frontend/src/components/modules/rollups/rollup-details.tsx index 2d6ae19fc1..239c6082c4 100644 --- a/tools/tenscan/frontend/src/components/modules/rollups/rollup-details.tsx +++ b/tools/tenscan/frontend/src/components/modules/rollups/rollup-details.tsx @@ -2,9 +2,12 @@ import TruncatedAddress from "@repo/ui/components/common/truncated-address"; import KeyValueItem, { KeyValueList, } from "@repo/ui/components/shared/key-value"; -import { formatTimeAgo } from "@repo/ui/lib/utils"; +import { formatTimeAgo, formatTimestampToDate } from "@repo/ui/lib/utils"; import Link from "next/link"; import { Rollup } from "@/src/types/interfaces/RollupInterfaces"; +import { pathToUrl } from "@/src/routes/router"; +import { pageLinks } from "@/src/routes"; +import { Badge } from "@repo/ui/components/shared/badge"; export function RollupDetailsComponent({ rollupDetails, @@ -17,14 +20,23 @@ export function RollupDetailsComponent({ + {formatTimeAgo(rollupDetails?.Timestamp) + + " - " + + formatTimestampToDate(rollupDetails?.Timestamp)} + + } /> } /> @@ -33,19 +45,26 @@ export function RollupDetailsComponent({ value={ } /> } + value={ + + } /> {"#" + rollupDetails?.FirstSeq} @@ -56,7 +75,9 @@ export function RollupDetailsComponent({ label="Last Batch Seq No." value={ {"#" + rollupDetails?.LastSeq} @@ -68,13 +89,17 @@ export function RollupDetailsComponent({ value={ } /> + } /> {"#" + msg.Sequence} diff --git a/tools/tenscan/frontend/src/components/modules/transactions/columns.tsx b/tools/tenscan/frontend/src/components/modules/transactions/columns.tsx index 3b103dd5e0..d09df4d386 100644 --- a/tools/tenscan/frontend/src/components/modules/transactions/columns.tsx +++ b/tools/tenscan/frontend/src/components/modules/transactions/columns.tsx @@ -9,6 +9,8 @@ import { Transaction } from "@/src/types/interfaces/TransactionInterfaces"; import TruncatedAddress from "@repo/ui/components/common/truncated-address"; import { formatTimeAgo } from "@repo/ui/lib/utils"; import Link from "next/link"; +import { pathToUrl } from "@/src/routes/router"; +import { pageLinks } from "@/src/routes"; export const columns: ColumnDef[] = [ { @@ -60,7 +62,9 @@ export const columns: ColumnDef[] = [ return ( ); }, diff --git a/tools/tenscan/frontend/src/components/modules/transactions/transaction-details.tsx b/tools/tenscan/frontend/src/components/modules/transactions/transaction-details.tsx index bc0eff4fee..953461a847 100644 --- a/tools/tenscan/frontend/src/components/modules/transactions/transaction-details.tsx +++ b/tools/tenscan/frontend/src/components/modules/transactions/transaction-details.tsx @@ -2,11 +2,13 @@ import TruncatedAddress from "@repo/ui/components/common/truncated-address"; import KeyValueItem, { KeyValueList, } from "@repo/ui/components/shared/key-value"; -import { formatTimeAgo } from "@repo/ui/lib/utils"; +import { formatTimeAgo, formatTimestampToDate } from "@repo/ui/lib/utils"; import { BadgeType } from "@repo/ui/lib/enums/badge"; import { Badge } from "@repo/ui/components/shared/badge"; import { Transaction } from "@/src/types/interfaces/TransactionInterfaces"; import Link from "next/link"; +import { pathToUrl } from "@/src/routes/router"; +import { pageLinks } from "@/src/routes"; export function TransactionDetailsComponent({ transactionDetails, @@ -20,7 +22,9 @@ export function TransactionDetailsComponent({ label="Batch Height" value={ {"#" + Number(transactionDetails?.BatchHeight)} @@ -32,13 +36,21 @@ export function TransactionDetailsComponent({ value={ } /> + {formatTimeAgo(transactionDetails?.BatchTimestamp) + + " - " + + formatTimestampToDate(transactionDetails?.BatchTimestamp)} + + } /> { const { query } = useRouter(); - const [noPolling, setNoPolling] = useState(false); + const [noPolling, setNoPolling] = useState(true); const options = getOptions(query); diff --git a/tools/tenscan/frontend/src/services/useBlocksService.ts b/tools/tenscan/frontend/src/services/useBlocksService.ts index 1af7f9458d..97d318e313 100644 --- a/tools/tenscan/frontend/src/services/useBlocksService.ts +++ b/tools/tenscan/frontend/src/services/useBlocksService.ts @@ -7,7 +7,7 @@ import { useState } from "react"; export const useBlocksService = () => { const { query } = useRouter(); - const [noPolling, setNoPolling] = useState(false); + const [noPolling, setNoPolling] = useState(true); const options = getOptions(query); diff --git a/tools/tenscan/frontend/src/services/useRollupsService.ts b/tools/tenscan/frontend/src/services/useRollupsService.ts index eeb34e541c..2f1440ac4d 100644 --- a/tools/tenscan/frontend/src/services/useRollupsService.ts +++ b/tools/tenscan/frontend/src/services/useRollupsService.ts @@ -13,7 +13,7 @@ import { useRouter } from "next/router"; export const useRollupsService = () => { const { query } = useRouter(); - const [noPolling, setNoPolling] = useState(false); + const [noPolling, setNoPolling] = useState(true); const [decryptedRollup, setDecryptedRollup] = useState(); const options = getOptions(query); diff --git a/tools/tenscan/frontend/src/services/useTransactionsService.ts b/tools/tenscan/frontend/src/services/useTransactionsService.ts index 4fbc07265c..c507e9b256 100644 --- a/tools/tenscan/frontend/src/services/useTransactionsService.ts +++ b/tools/tenscan/frontend/src/services/useTransactionsService.ts @@ -18,7 +18,7 @@ export const useTransactionsService = () => { const { query } = useRouter(); const { address, provider } = useWalletStore(); - const [noPolling, setNoPolling] = useState(false); + const [noPolling, setNoPolling] = useState(true); const options = getOptions(query);