> For the complete documentation index, see [llms.txt](https://docs.zama.org/protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zama.org/protocol/sdk/api-references/react/usemetadata.md).

# useMetadata

Get token name, symbol, and decimals in one call. The result is cached indefinitely since token metadata never changes.

## Import

```ts
import { useMetadata } from "@zama-fhe/react-sdk";
```

## Usage

{% tabs %}
{% tab title="TokenHeader.tsx" %}

```tsx
import { useMetadata } from "@zama-fhe/react-sdk";

function TokenHeader({ tokenAddress }: { tokenAddress: `0x${string}` }) {
  const { data: meta, isLoading } = useMetadata(tokenAddress);

  if (isLoading) return <p>Loading metadata...</p>;

  return (
    <h2>
      {meta?.name} ({meta?.symbol}) -- {meta?.decimals} decimals
    </h2>
  );
}
```

{% endtab %}
{% endtabs %}

## Parameters

### tokenAddress

`Address`

Address of the token contract to read metadata from.

```ts
const { data: meta } = useMetadata("0xToken");
```

## Return Type

The `data` field resolves to:

```ts
{
  name: string
  symbol: string
  decimals: number
} | undefined
```

## Caching

The query uses `staleTime: Infinity`. Token metadata is immutable, so the result never re-fetches automatically.

## Suspense

Use `useMetadataSuspense` inside a `<Suspense>` boundary to avoid manual loading state handling:

```tsx
import { useMetadataSuspense } from "@zama-fhe/react-sdk";

function TokenHeader({ tokenAddress }: { tokenAddress: `0x${string}` }) {
  const { data: meta } = useMetadataSuspense(tokenAddress);

  return (
    <h2>
      {meta.name} ({meta.symbol}) -- {meta.decimals} decimals
    </h2>
  );
}
```

## Related

* [useWrapperDiscovery](/protocol/sdk/api-references/react/usewrapperdiscovery.md) -- find the wrapper address for a token
* [useConfidentialBalance](/protocol/sdk/api-references/react/useconfidentialbalance.md) -- read the decrypted confidential balance
* [Hooks overview](/protocol/sdk/api-references/react/query-keys.md) -- all available hooks


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zama.org/protocol/sdk/api-references/react/usemetadata.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
