feat: agent-aware view on the NFT detail page#608
Merged
Conversation
Detect agent-marketplace NFTs (ERC-8004 registration files) on the existing /nft/[contractAddress]/[tokenId] page and render a tabbed agent view: Overview, Services, Statistics, Quality, Feedback, and Metadata. Non-agent NFTs are unaffected. Detection keys off the tokenURI JSON's `type` marker (https://eips.ethereum.org/EIPS/eip-8004#registration-v1). All data is read on-chain / from the metadata the token points at: - Registration file (tokenURI) -> Overview, Services, Metadata - A2A AgentCard, fetched from the registration file's `A2A` service endpoint (.../agent-card.json) -> Services (skills, capabilities, modes) - AgentRegistry.getAgent (the NFT contract == the registry, tokenId == agentId) -> creator, status - ReputationRegistry (address taken from the registration file) getClients / getSummary / readAllFeedback -> Statistics, Quality, Feedback Reputation-backed tabs degrade to empty states when no feedback exists. Adds i18n keys across all 11 locales and unit tests for the schema, detection, A2A endpoint resolution, and CAIP-10 address parsing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Block explorer – Preview
Preview environment destroyed after PR was closed |
Agilulfo1820
temporarily deployed
to
preview-pr-608
July 1, 2026 15:03 — with
GitHub Actions
Inactive
Agilulfo1820
requested review from
daithihearn and
davidecarpini
and removed request for
daithihearn
July 1, 2026 15:04
daithihearn
approved these changes
Jul 1, 2026
davidecarpini
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an agent-aware view to the existing NFT detail page (
/nft/[contractAddress]/[tokenId]). When a token's metadata is a VeChain agent-marketplace ERC-8004 registration file, the page renders a tabbed agent profile — Overview · Services · Statistics · Quality · Feedback · Metadata — modelled on 8004scan.io. Any other NFT renders exactly as before.Registrazione.schermo.2026-07-01.alle.17.03.13.mov
Why
The agent marketplace mints a soulbound NFT per agent (e.g.
0x271eb84c5095db823d76f87e10bb19016b117073on testnet). Users following an agent link had no way to view it on the explorer. The generic NFT page already existed; this makes it agent-aware.How
Detection keys off the tokenURI JSON's
typemarkerhttps://eips.ethereum.org/EIPS/eip-8004#registration-v1. Everything is read on-chain / from the metadata the token points at — no dependency on the marketplace backend API:A2Aservice endpoint (.../agent-card.json) → Services (skills, capabilities, I/O modes)AgentRegistry.getAgent(the NFT contract is the registry;tokenId == agentId) → creator, statusReputationRegistry(address taken from the registration file'sreputationRegistry)getClients→getSummary/readAllFeedback→ Statistics, Quality, FeedbackReputation-backed tabs render clean empty states when no feedback exists yet.
Key files
services/agent-nft/{schemas,hooks}.ts— Zod schemas, detection (isAgentRegistration),useAgentRegistration/useAgentCard, CAIP-10 helperservices/thor/tokens/{agent-registry,reputation-registry}.ts— on-chain readsapp/[locale]/nft/[contractAddress]/[tokenId]/components/agent/**—AgentNftView+ tabsNftDetailPageContent.tsx— branches on detectioni18n/languages/*.json— new keys across all 11 localesTesting
ts-check,lint,knip,prettier, 234 tests (incl. 11 new schema/detection/A2A/CAIP tests), and production build all pass locally.The deployed testnet contract's
tokenURI(and the A2A/avatar endpoints) currently resolve tohttp://localhost:3001/:3000, so agent metadata is not publicly fetchable yet. This code is correct and will render live once the marketplace serves those from a public origin. View with?network=testnet.🤖 Generated with Claude Code