> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dzap.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Tokens

> Token lists, metadata, and account balances.

Token reads share the `/v1/token/*` namespace on `api.dzap.io`. All three endpoints are `GET` requests.

## List tokens

```
GET https://api.dzap.io/v1/token/tokens
```

Returns every known token for a chain, with live pricing.

<ParamField query="chainId" type="integer" required>Chain ID to list tokens for.</ParamField>

<ParamField query="source" type="string">Optional source filter for a curated token list.</ParamField>

<ParamField query="account" type="string">Wallet address - include balances for this account when set.</ParamField>

<ResponseField name="data" type="object">Map keyed by token address, each value a token info object (see shape below).</ResponseField>

## Token details

```
GET https://api.dzap.io/v1/token/details
```

Returns metadata for one or more tokens.

<ParamField query="chainId" type="integer" required>Chain ID the token(s) exist on.</ParamField>

<ParamField query="tokenAddress" type="string">Single token address.</ParamField>

<ParamField query="tokenAddresses" type="string">Comma-separated token addresses (use instead of `tokenAddress` for multiple).</ParamField>

<ParamField query="account" type="string">Include balance for this account when set.</ParamField>

<ParamField query="includeBalance" type="boolean" />

<ParamField query="includePrice" type="boolean" />

<ResponseField name="data" type="object">
  A single token info object when `tokenAddress` was used, or a map keyed by address when `tokenAddresses` was used.

  <Expandable title="token info">
    <ResponseField name="contract" type="string">Token contract address.</ResponseField>

    <ResponseField name="symbol" type="string" />

    <ResponseField name="name" type="string" />

    <ResponseField name="decimals" type="integer" />

    <ResponseField name="logo" type="string" />

    <ResponseField name="chainId" type="integer" />

    <ResponseField name="balance" type="string">Present when `includeBalance`/`account` is set.</ResponseField>

    <ResponseField name="balanceInUsd" type="number">Present when `includeBalance`/`account` is set.</ResponseField>

    <ResponseField name="price" type="string">Present when `includePrice` is set.</ResponseField>

    <ResponseField name="isDisabledOnSwapBridge" type="object">
      <Expandable title="isDisabledOnSwapBridge">
        <ResponseField name="source" type="boolean">Disabled as a swap/bridge source token.</ResponseField>
        <ResponseField name="destination" type="boolean">Disabled as a swap/bridge destination token.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="isDisabledOnZap" type="object">Same shape as `isDisabledOnSwapBridge` above, for zap operations.</ResponseField>

    <ResponseField name="permit" type="object">
      <Expandable title="permit">
        <ResponseField name="eip2612" type="object">`{ supported, data?: { domain? } }`.</ResponseField>
        <ResponseField name="permit2" type="object">`{ supported }`.</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Account balances

```
GET https://api.dzap.io/v1/token/balance-of
```

<ParamField query="chainId" type="integer" required />

<ParamField query="account" type="string" required />

<ResponseField name="data" type="object">Map keyed by token address, each value a token info object (same shape as Token Details above) with `balance`/`balanceInUsd` populated.</ResponseField>

### Examples

<RequestExample>
  ```bash tokens theme={null}
  curl "https://api.dzap.io/v1/token/tokens?chainId=1"
  ```

  ```bash details theme={null}
  curl "https://api.dzap.io/v1/token/details?chainId=1&tokenAddress=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&includePrice=true"
  ```

  ```bash balances theme={null}
  curl "https://api.dzap.io/v1/token/balance-of?chainId=1&account=0x99BCEBf44433E901597D9fCb16E799a4847519f6"
  ```

  ```ts SDK theme={null}
  const tokens = await dzap.getAllTokens(1);

  const tokenInfo = await dzap.getTokenDetails(
    '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
    1,
    undefined,
    false,
    true,
  );

  const balances = await dzap.getBalances(1, '0x99BCEBf44433E901597D9fCb16E799a4847519f6');
  ```
</RequestExample>

<ResponseExample>
  ```json balances theme={null}
  {
    "status": "success",
    "data": {
      "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913": {
        "contract": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "symbol": "USDC",
        "name": "USD Coin",
        "decimals": 6,
        "logo": "https://...",
        "chainId": 8453,
        "balance": "1000000",
        "balanceInUsd": 1.0
      }
    }
  }
  ```
</ResponseExample>

<Note>
  Live token prices (`GET /v1/token/price`) exist on the Trade API but aren't exposed through the `@dzapio/sdk` client - use `includePrice` on the endpoints above instead.
</Note>
