> 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.

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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
