Page MenuHomePhabricator

[lib] Introduce getENSNames: async function equivalent to useENSNames
ClosedPublic

Authored by ashoat on Feb 3 2023, 12:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 16 2024, 10:25 PM
Unknown Object (File)
Nov 16 2024, 8:27 PM
Unknown Object (File)
Nov 3 2024, 8:33 PM
Unknown Object (File)
Oct 28 2024, 12:39 AM
Unknown Object (File)
Oct 28 2024, 12:39 AM
Unknown Object (File)
Oct 28 2024, 12:38 AM
Unknown Object (File)
Sep 28 2024, 4:22 AM
Unknown Object (File)
Sep 27 2024, 2:19 PM
Subscribers

Details

Summary

Up until now, we've only needed to do ENS resolutions from the context of a React hook. In that case, we initially show the ETH address, then fetch the ENS name and swap it in once we have it.

In contrast, in other places we need an async function that will fetch the ENS name and return when it's done. Similar to useENSNames, it's useful to have a function that can take an array of objects and swap in the ENS names.

Since getENSNames needs ensContext bound it (and can't fetch it like a hook), I added a bound version of this function to the ENSCacheContext.

Depends on D6564

Test Plan

Tested in combination with following diffs, where it's actually used

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage