reown-com / blockchain-api

WalletConnect's Blockchain API
MIT License
68 stars 53 forks source link

feat(identity): forward-lookup & optionally return avatar and/or return other fields #260

Open chris13524 opened 1 year ago

chris13524 commented 1 year ago

Support forward lookup (name -> address).

Some clients might not need the avatar and not looking this up can save latency. We can gate via query param. What do we do by default?

Optional fields need special consideration for caching, if e.g. if only the address is requested first, then the second time we would want to bypass the cache.

Similar cache considerations for forward lookup. For example, since the lookup_address ethers function needs to lookup the name internally, we can improve efficiency of looking up the avatar by using the cached address -> name value to lookup the avatar.

Possibly to reduce latency further, we need to access the underlying methods inside of ethers.

This will likely need a /v2 endpoint to avoid breaking compatibility with existing Web3Modal versions in the wild.

chris13524 commented 1 year ago

We may want forward lookup, but optionally returning avatar may be an unnecessary optimization.