# List Tokens

List the tokens configured for your tenant, grouped by chain.

## Overview

Returns every chain with its tokens: symbol, name, contract address (`null` for the native coin), decimals, logo and whether it is the native coin. Use it to populate send and swap token selectors.

- The bearer token is optional. With it, the list is your tenant's; without it, Aurea returns the list of its system tenant.
- `isTestnet=true` returns testnet tokens; the default is mainnet.
- For one chain only, use [Tokens by Chain](https://docs.aureahub.com/docs/tokens-by-chain.md).

## Endpoint

### `GET /v1/tokens/`

Lists supported tokens across all chains, grouped by chain. Authentication is optional.

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `isTestnet` | string | no | "true" for testnet tokens, "false" for mainnet (default) |

**Responses**

`200` OK

```json
{
  "data": [
    {
      "chain": "gnosis",
      "tokens": [
        { "symbol": "xDAI", "name": "xDAI", "address": null, "decimals": 18, "logoUri": "<logo URL>", "isNative": true },
        { "symbol": "EURe", "name": "<token name>", "address": "<contract address>", "decimals": 18, "logoUri": "<logo URL>", "isNative": false }
      ]
    }
  ]
}
```

## Implementation

```javascript
// Map "chain:address" (or "chain:native") -> token, for a token selector
async function getTokenIndex(accessToken, { testnet = false } = {}) {
  const res = await fetch(`https://api.aureahub.com/v1/tokens/?isTestnet=${testnet}`, {
    headers: accessToken ? { Authorization: `Bearer ${accessToken}` } : {}
  });
  if (!res.ok) throw new Error(`Token list failed: ${res.status}`);

  const { data } = await res.json();
  const index = {};
  for (const { chain, tokens } of data) {
    for (const t of tokens) index[`${chain}:${t.isNative ? 'native' : t.address.toLowerCase()}`] = { chain, ...t };
  }
  return index;
}
```

---

Web version: https://docs.aureahub.com/#tokens-list
