-
Notifications
You must be signed in to change notification settings - Fork 7
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
Refactor useResolveAddressMultichain
to useResolveENSName
#2637
Refactor useResolveAddressMultichain
to useResolveENSName
#2637
Conversation
✅ Deploy Preview for decent-interface-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…S address resolution
…for single address resolution
…tion and update resolved address handling
4cbf0c5
to
8fc85e2
Compare
useResolveAddressMultichain
to useResolveENSName
…d update related logic
src/hooks/utils/useResolveENSName.ts
Outdated
try { | ||
const resolvedAddress = await mainnetPublicClient.getEnsAddress({ name: normalizedName }); | ||
if (resolvedAddress) { | ||
returnedResult.resolvedAddress = resolvedAddress; | ||
returnedResult.isValid = true; | ||
} | ||
} catch { | ||
// do nothing | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this try/catch is necessary any longer. I believe it was here previously to catch the error in .getEnsAddress
when the call was made on a network that didn't ahve the ENS contracts deployed (all of them except for mainnet and sepolia IIRC).
@adamgall
Very similar to
useAddress
.Main difference it that the execution the lookup doesn't kickoff via
useEffect
but rather the hook spits out the function to be used as directed.if you prefer I just refactor this back and fit
useAddress
in I can do that. I just prefer using acallback
function to time the execution