> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://viem.sh/api/mcp` to find what you need.

# Tokens

Every Token Action selects the token it operates on via a single `token` parameter. This page
explains how that selection works.

## Token Lookup

<TokenLookup />

## Importing Tokens

Tokens in the lookup can be imported from `viem/tokens`. Use the imported definition to get the
token's chain-specific address and metadata.

```ts twoslash
import { tempo } from 'viem/chains'
import { ousd } from 'viem/tokens'

ousd
// @log: {
// @log:   addresses: {
// @log:     1: '0x9f6F3991D525015a6F8CaF062C83b62fD3AC4436',
// @log:     4217: '0x20c0000000000000000000006a37DA5C996874BE',
// @log:     8453: '0xB2000000000000000000002fEb517dFeC7415344',
// @log:   },
// @log:   currency: 'USD',
// @log:   decimals: 6,
// @log:   name: 'OpenUSD',
// @log:   symbol: 'OUSD',
// @log: }

const tempoOusd = ousd(tempo.id)
// @log: {
// @log:   address: '0x20c0000000000000000000006a37DA5C996874BE',
// @log:   currency: 'USD',
// @log:   decimals: 6,
// @log:   name: 'OpenUSD',
// @log:   symbol: 'OUSD',
// @log: }
```

## Token Sets

`viem/tokens` exports a `tokens` object of curated **token sets**: ready-made arrays of token
definitions you can pass straight to a Client's `tokens` property without listing each token by
hand.

| Set              | Contents                              |
| ---------------- | ------------------------------------- |
| `tokens.all`     | Every built-in token definition.      |
| `tokens.popular` | Tokens flagged as popular.            |
| `tokens.tempo`   | Every token available on Tempo chains.|

```ts twoslash
import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
import { tokens } from 'viem/tokens' // [!code hl]

const client = createPublicClient({
  chain: mainnet,
  tokens: tokens.all, // [!code hl]
  transport: http(),
})
```

Sets are plain arrays, so you can spread them alongside your own definitions:

```ts twoslash
import { createPublicClient, http } from 'viem'
import { tempo as tempoChain } from 'viem/chains'
import { defineToken, tokens } from 'viem/tokens'

const myToken = defineToken({
  addresses: { 1: '0x9f6F3991D525015a6F8CaF062C83b62fD3AC4436' },
  currency: 'USD',
  decimals: 6,
  name: 'My Token',
  symbol: 'MYT',
})

const client = createPublicClient({
  chain: tempoChain,
  tokens: [...tokens.tempo, myToken], // [!code hl]
  transport: http(),
})
```

## Using Named Tokens

The `token` parameter is either:

* **A token symbol** declared on the connected Client. See
  [Defining Tokens](/tokens/guides/defining-tokens) for how symbols are attached to Clients. The
  symbol is resolved to its token address and `decimals`.
* **A token address** for any token, declared or not.

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

// By token symbol (resolved from the Client).
await client.token.getBalance({
  account: '0x…',
  token: 'ousd', // [!code hl]
})
// @log: { amount: 1000000000n, decimals: 6, formatted: '1000' }

// By token address.
await client.token.getBalance({
  account: '0x…',
  token: '0x20c0000000000000000000006a37DA5C996874BE', // [!code hl]
})
// @log: { amount: 1000000000n, decimals: 6, formatted: '1000' }
```
