HomePhabricator
Diffusion Comm beebb3904ead

[lib] Introduce getENSNames: async function equivalent to useENSNames

Description

[lib] Introduce getENSNames: async function equivalent to useENSNames

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

Reviewers: atul

Reviewed By: atul

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D6565

Details

Provenance
ashoatAuthored on Feb 3 2023, 11:53 AM
Reviewer
atul
Differential Revision
D6565: [lib] Introduce getENSNames: async function equivalent to useENSNames
Parents
rCOMM6572bd9e7663: [lib] Pass object of props into createPendingSidebar
Branches
Unknown
Tags
Unknown