-
Notifications
You must be signed in to change notification settings - Fork 276
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
feat: Batch support for Basenames and ENS names #2102
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
780109a
to
2da4b4f
Compare
*/ | ||
export const useNames = ( | ||
{ addresses, chain = mainnet }: UseNamesOptions, | ||
queryOptions?: UseQueryOptions, |
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.
Ideally, allow dev to pass through any query options that Tanstack supports - will make the hook a lot more useful to support specific use cases
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.
Good idea
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.
Will fast follow along with Avatars.
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.
can you expose gcTime instead of cacheTime so that when you switch to Tanstack query options it won't be a breaking change and we won't have to support both?
src/identity/types.ts
Outdated
/** Array of Ethereum addresses to resolve names for */ | ||
addresses: Address[]; | ||
/** Optional chain for domain resolution */ | ||
chain?: typeof mainnet; |
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.
why wouldn't this be Chain?
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.
It should be Chain, good catch
What changed? Why?
Added identity resolution components for ENS and Basename support in OnchainKit. This includes:
useNames
hook for resolving addresses to ENS/Basename namesSupporting utility function (
getNames
) with proper chain fallback logicThe implementation follows the chain fallback pattern where Base-specific resolution is attempted first, then falls back to mainnet ENS resolution when needed
React Query is used for efficient caching and data fetching
Notes to reviewers
How has it been tested?

Without batching. 48 requests:
With batching. 14 requests:
