Skip to content

[Feat]: Add a read-only account-profile lens #217

Description

@sphamjoli

Component

Other

Priority

P2

Summary

Reading everything about an account, its lite name, full name, chat key, lite-to-full link and personhood tier, takes several calls to different contracts today. Add a read-only lens that returns the lot in one call, without moving ownership of any of that data away from the contract that owns it. Part of #214. Depends on the address reads added in the permanent-names issue.

Proposal

  • Add a separate read-only contract with one entry point, profileOf(address), returning the account's lite name, full names, chat key, linked full node, personhood tier, and whether the name is settled.
  • Compose each field from the contract that owns it: the names from the controller's liteNameOf and fullNameOf, the chat key and link from the resolver, the tier from the pricing rules.
  • Read the tier defensively. The classifier reverts on an empty or non-canonical label, which is exactly a cold or unminted name, so wrap the call and return a no-tier value instead of reverting. Otherwise the aggregate fails on the names a caller most needs to look up.
  • State the read's bound and paginate if an account can hold many names.
  • Do not put this on the controller. The controller issues names, and hosting an all-about-an-account read there would make it a second resolver.

Acceptance criteria

  • profileOf returns the full record in one call for any address.
  • It never reverts on a cold, unminted, or non-canonical name; the tier reads as a no-tier value in that case.
  • The contract holds no state and owns none of the data it returns.
  • Tests cover an account with a cold name, one with a settled name, a lite name promoted to full, and an address that holds nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions