Skip to content

Primary names

A wallet can own several accounts. To show it as one name, each wallet can pick a primary name: one handle per platform.

The wallet picks it when it binds an account, by passing publishName: true to bind. Later binds from the same wallet on the same platform update the primary name to the handle just proved, even with publishName: false. So a wallet that renames on the platform shows its new handle once it proves it.

unpublish(platformId) removes the primary name. The binding stays.

function primaryOf(address wallet, bytes32 platformId) view returns (string)

primaryOf returns the name only while the handle still resolves to that wallet. If someone else has taken the handle, it returns an empty string. You never show a name the wallet has lost.

This is the check ENS asks its integrators to do themselves for reverse records. Here the contract does it.

reverseOf returns the stored name without that check. Use primaryOf to show a name.

You wantUse
One name to show next to a walletprimaryOf, or primaryName in TypeScript
Every account a wallet ownsaccountsOf

See Look up a wallet.

ENS names under handles.link resolve from name to address only. A wallet has no ENS reverse record.