Skip to content

Commit 0db874c

Browse files
committed
feat: add method name to the tx activity
1 parent ad6c014 commit 0db874c

File tree

4 files changed

+10
-44
lines changed

4 files changed

+10
-44
lines changed

apps/dashboard/src/app/(dashboard)/hackweek/[chain_id]/[address]/actions/fetchRecentTransactions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ interface Transaction {
3131
blob_gas_price: number | null;
3232
logs_bloom: string | null;
3333
status: boolean | null; // true for success, false for failure
34+
decodedData: {
35+
name: string;
36+
signature: string;
37+
inputs: Record<string, unknown>;
38+
};
3439
}
3540

3641
interface InsightsResponse {

apps/dashboard/src/app/(dashboard)/hackweek/[chain_id]/[address]/components/ActivityOverview.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { useState } from "react";
1717
import type { ChainMetadata } from "thirdweb/chains";
1818
import { shortenHex } from "thirdweb/utils";
1919
import type { TransactionDetails } from "../hooks/useGetRecentTransactions";
20-
import { formatDistanceToNow } from "date-fns";
2120

2221
interface Contract {
2322
address: string;
@@ -88,6 +87,7 @@ export function ActivityOverview({
8887
<TableRow>
8988
<TableHead>Date</TableHead>
9089
<TableHead>Hash</TableHead>
90+
<TableHead>Method</TableHead>
9191
<TableHead>Activity</TableHead>
9292
<TableHead>Value ({chain.nativeCurrency.symbol})</TableHead>
9393
</TableRow>
@@ -113,6 +113,9 @@ export function ActivityOverview({
113113
{shortenHex(transaction.hash)}
114114
</Button>
115115
</TableCell>
116+
<TableCell>
117+
{transaction.method}
118+
</TableCell>
116119
<TableCell>
117120
{transaction.type === "in" ? (
118121
<div className="flex items-center gap-2">

apps/dashboard/src/app/(dashboard)/hackweek/[chain_id]/[address]/hooks/useGetRecentTransactions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function useGetRecentTransactions(chainId: number, address: string) {
2929
valueTokens: transaction.value / 10 ** 18,
3030
to: transaction.to_address || undefined,
3131
from: transaction.from_address,
32-
method: transaction.function_selector || undefined,
32+
method: transaction.decodedData.name || "transfer",
3333
date: new Date(transaction.block_timestamp * 1000),
3434
};
3535
});

apps/dashboard/src/app/(dashboard)/hackweek/[chain_id]/[address]/hooks/useGetTxActivity.ts

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)