Skip to content

Add NFT name search to the global search bar #71

@pthmas

Description

@pthmas

Problem

The global search bar can return NFT collections, but it cannot return individual NFT tokens by name. The frontend already supports nft search results and token detail navigation, but the backend search handler does not currently query nft_tokens.

Proposed change

Add support for searching individual NFTs by token name from the global search bar.

Backend

  • Extend the search API to query nft_tokens.name
  • Return nft search results with the fields needed by the existing UI:
    • contract_address
    • token_id
    • name
    • image_url
  • Keep current collection search behavior intact
  • Consider joining nft_contracts to include collection context if needed for labeling

Frontend

  • Reuse the existing nft search result type in the search bar
  • Make sure NFT token matches are rendered clearly and navigate to /nfts/{contract_address}/{token_id}
  • Keep collection and token results visually distinguishable

Notes

  • Search should remain fast and avoid broad unbounded scans
  • It may be worth limiting NFT token matches more aggressively than collection matches if needed
  • This should use the existing raw token name already stored in nft_tokens

Acceptance criteria

  • Searching by an NFT token name can return matching NFT tokens
  • Selecting a token result opens the NFT detail page
  • Existing address / tx / block / collection search behavior is unchanged

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions