# token.getMetadata

Reads the metadata (`decimals`, `name`, `symbol`) of a token.

Fields declared on the connected Client's [`tokens` array](/tokens/tokens#token-lookup)
are used as-is; any missing field is fetched from the token contract.

## Usage

:::code-group

```ts twoslash [example.ts]
import { client } from './viem.config'

const metadata = await client.token.getMetadata({ token: 'usdc' })
// @log: { decimals: 6, name: 'USD Coin', symbol: 'USDC' }
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
// [!include ~/snippets/token/viem.config.ts:setup]
```

:::

## Return Type

```ts
type ReturnType = {
  /** Number of decimals the token uses. */
  decimals: number
  /** Human-readable name of the token. */
  name: string
  /** Ticker symbol of the token. */
  symbol: string
}
```

## Parameters

### token

* **Type:** `string`

Token to operate on: a [Client-declared](/tokens/tokens#token-lookup)
token symbol (resolving its `address` and metadata), or a token address.
