-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deal with ENS names #858
Comments
Research findings
Conclusions
|
haha, not a good start, would be the largest library our market uses, bigger than web3.js. What is wrong with js developers? But made it work given that a web3 account is connected in #860. We can't use same mechanism for cases where wallet is not connected though, like for publisher line and ultimately not for account profiles. So looks like we have to rather look into hitting the ENS subgraph to get that info https://thegraph.com/legacy-explorer/subgraph/ensdomains/ens {
domains(where: { resolvedAddress: "lowercased_accountId" }) {
name
}
} |
Created 2 methods over in #860 and made sure both return exactly the same: Tending towards only using |
Or we can just try to see what that function does and implement it in the market, if it's reasonable. |
I made almost everything work over in #860 regarding functionality, working nicely but of course we get lots of ens subgraph hits on frontpage as this is what the publisher line now does in addition to 3box. There still might be edge cases like multiple domains attached to one address where there might be differences between the direct web3 call & using subgraph for the user wallet display but can deal with this when real problem arises. Last remaining use case is adjusting profile fetching logic a bit so that |
Example for ENS name in publisher line: Data Union profile is then good example as they have both, ENS & 3box: Decided to only display ENS name in place of address, but keep using ETH address in the explorer links & copy action. Reason being that ENS names will work only on networks where ENS contracts are deployed which right now is only ETH networks, which is why |
Aaaand covered final use case after some refactoring, essentially creating decentralized vanity URLs for publishers, which kinda covers oceanprotocol/pm#117 too: When I find an ENS name attached to an ETH address passed in the URL, then that will get replaced too so in UI the ENS names take over. Pretty neat so far and needs testing which we have as soon as that typing stuff is figured out |
there we go, some preview example profiles:
as for original reported URL, this now works and everything on the profile is mapped to resolved address as you can see on the explorer links: |
This should work for kicking off profile page fetching but think we might prevent fetching in this case:
https://market-git-feature-accountpage-oceanprotocol.vercel.app/profile/officialoceandao.eth
As a generic solution, if an ETH address is attached to an ENS name, it should take over in all display which is an industry standard as per ENS design guidelines. So instead of
0xxx
we show e.g.domain.eth
in profile page, user wallet, publisher line. So all logic for showing wallet addresses in UI would be:3box names are still valid for the main profile title with this logic:
A good start: https://docs.ens.domains/dapp-developer-guide/resolving-names
The text was updated successfully, but these errors were encountered: