Overview
- React Query hook that fetches the
.initusername for the connected address. - Automatically re-runs when the address changes.
- Exposes standard React Query state (
isLoading,error, etc.).
Prerequisites
- Must be rendered within
InterwovenKitProvider. - Must be used within a React Query
QueryClientProvider. - Must be used within a wagmi
WagmiProvider. - Client-only (no SSR): Put this in a
use clientprovider tree, or use a dynamic import in Next.js.
Quickstart
This example assumes providers are already set up. For complete setup
configurations, see Provider Setup.
Return value
UseQueryResult<string | null> object. The data
property is:
stringwhen a username exists (ends with.init)nullwhen no username exists or the address is invalidundefinedbefore the query has produced a value or when the query is disabled (e.g., when no address is connected)
UseQueryResult is from @tanstack/react-query.
Notes
- The query is disabled until a non‑empty address is available from
useAddress().