Skip to content

feat: make agent NFT view coherent with standard NFT metadata#611

Merged
davidecarpini merged 1 commit into
feat/nft-contract-pagefrom
feat/agent-nft-coherence
Jul 14, 2026
Merged

feat: make agent NFT view coherent with standard NFT metadata#611
davidecarpini merged 1 commit into
feat/nft-contract-pagefrom
feat/agent-nft-coherence

Conversation

@Agilulfo1820

@Agilulfo1820 Agilulfo1820 commented Jul 14, 2026

Copy link
Copy Markdown
Member

What & why

The agent NFT view (shown for ERC-8004 agent NFTs) had a completely different UI that dropped the standard NFT info the rest of the explorer always shows — owner, mint date/tx, contract address, token standard, collection details, attributes were either missing or buried in the raw-metadata JSON. This makes the agent page coherent with the standard NFT view while keeping the agent-specific tabs primary.

Changes

  • Owner / Minted-on stats cards now render above the tabs (NftStatsCards), same as the standard NFT view — restores at-a-glance owner and mint date.
  • New "NFT" tab rendering NftDetailsSection: contract address (clickable), token standard, mint block/tx/minted-by, collection symbol & supply, and attributes — all in readable rows instead of only in the raw JSON.
  • Reuses the existing components; the token metadata is threaded through from NftDetailPageContent. Same DetailRow/SectionCard styling as before, so it's visually consistent.

No new i18n keys (the NFT label already exists).

Stacking

Based on feat/nft-contract-page (#609) — it depends on the contractAddress prop added to NftDetailHeader there. Retarget to main once #609 merges.

image image

Validation

ts-check, lint, knip, prettier, full test suite (234) all pass.

The agent NFT view dropped the standard NFT info the rest of the explorer
shows. It now:

- shows the Owner / Minted-on stats cards above the tabs (NftStatsCards),
  matching the standard NFT view;
- adds an "NFT" tab rendering NftDetailsSection, so contract address,
  token standard, mint info, collection details and attributes are all
  available in readable rows (no longer only buried in the raw metadata JSON).

Agent-specific tabs stay primary; standard NFT data is one click away and
uses the same DetailRow/SectionCard styling. Reuses the existing components,
threading the token metadata through from NftDetailPageContent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Agilulfo1820 Agilulfo1820 added the increment:minor PR adds functionality in a backwards compatible manner label Jul 14, 2026
@davidecarpini
davidecarpini merged commit 3bfcc6f into feat/nft-contract-page Jul 14, 2026
2 of 3 checks passed
@davidecarpini
davidecarpini deleted the feat/agent-nft-coherence branch July 14, 2026 13:18
davidecarpini pushed a commit that referenced this pull request Jul 14, 2026
)

* feat: NFT-aware contract page with recent mints and NFT transfer filter

On ERC-721 contract pages, add a "Latest Minted Tokens" section listing the
collection's most recently minted tokens (last 10), each linking to the
existing /nft/{contract}/{tokenId} detail page.

Because the indexer has no per-collection endpoint (all NFT queries require an
owner address), the mints are read on-chain from the Thor node via
`Transfer` event logs where `from` is the zero address, newest first. This
also works on Solo, since it hits the node directly rather than the indexer.

Contract type is detected with the existing bytecode sniff (useContractSniff),
so the section self-hides on non-ERC-721 contracts.

Also add an "NFT" filter to the address Token Transfers table (the shared
TransfersTable already renders NFT rows), addressing the ERC-20-only gap.

Adds i18n keys "Latest Minted Tokens", "No tokens have been minted yet" and
"Owner" across all 11 locales.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix: detect ERC-721 via ERC-165 so proxy NFT collections are recognized

Bytecode sniffing misses proxy-deployed collections (ERC-1967/minimal
proxy), because the ERC-721 selectors live in the implementation, not the
proxy bytecode. Detect ERC-721 with an on-chain ERC-165
`supportsInterface(0x80ac58cd)` call instead, which is executed by the
implementation through the proxy. Bytecode sniffing is kept as a fallback
for older collections that predate ERC-165.

Applies to both the "Latest Minted Tokens" section gating and the ERC-721
badge in the contract summary.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* revert: drop NFT filter from Token Transfers table

The dedicated "Latest Minted Tokens" section covers NFT discovery on contract
pages, and the owner-scoped transfers endpoint returns nothing for a collection
contract anyway, so the NFT toggle was redundant. Restores the section to its
original ERC-20/VET filter set.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat: focused Collection view for NFT contracts + link NFT page to collection

- On an ERC-721 contract's address page, the Activity card becomes a focused
  "Collection" view (Name / Symbol / Total Supply from on-chain getters, plus
  creation date, master and creation tx) instead of the generic VET/VTHO/gas
  cards, which are rarely meaningful for a token contract. Total Supply falls
  back to "-" when the collection doesn't implement ERC721Enumerable.

- Extract useIsErc721Contract (ERC-165 + bytecode-sniff fallback) so contract
  detection is shared across ContractSummary, the mints section and the
  collection view.

- The collection name in the NFT detail header now links to the collection
  contract's address page. This was the only path back to the contract from
  the agent NFT view, which doesn't render NftDetailsSection.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix: convert mint block timestamps to ms so ages render correctly

Node event-log timestamps are in seconds, but AgeText and the date
formatters expect milliseconds (indexer responses are normalised to ms via
timestampSchema). The Latest Minted Tokens ages were all showing "57y ago"
(seconds read as ms → ~1970). Multiply by 1000 to match app convention.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat: make agent NFT view coherent with standard NFT metadata (#611)

The agent NFT view dropped the standard NFT info the rest of the explorer
shows. It now:

- shows the Owner / Minted-on stats cards above the tabs (NftStatsCards),
  matching the standard NFT view;
- adds an "NFT" tab rendering NftDetailsSection, so contract address,
  token standard, mint info, collection details and attributes are all
  available in readable rows (no longer only buried in the raw metadata JSON).

Agent-specific tabs stay primary; standard NFT data is one click away and
uses the same DetailRow/SectionCard styling. Reuses the existing components,
threading the token metadata through from NftDetailPageContent.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

increment:minor PR adds functionality in a backwards compatible manner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants