Skip to main content

Overview

  • Returns the connected wallet address, adapting to the default chain’s format (hex for minievm, bech32 for others).
  • Use when you need a single address that matches the default chain’s format.

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 client provider tree, or use a dynamic import in Next.js.

Quickstart

'use client'

import { useAddress } from '@initia/interwovenkit-react'

function Address() {
  const address = useAddress()
  return <span>{address || 'Not connected'}</span>
}
This example assumes providers are already set up. For complete setup configurations, see Provider Setup.

Return value

function useAddress(): string
Returns a hex address when the default chain is minievm, or an Initia bech32 address for other chain types. Returns an empty string when there is no connected address.

Notes

  • Prefer this hook over chain-specific address hooks (useHexAddress, useInitiaAddress) when you need a single address that automatically adapts to the default chain’s format.
  • Returns hex format for minievm chains, bech32 format for other chain types.