> For the complete documentation index, see [llms.txt](https://docs.squidrouter.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.squidrouter.com/widget-integration/add-a-widget/widget/customization-guide/default-chains-and-tokens.md).

# Default Chains and Tokens

## Squid Widget v2.0: Default Chains and Tokens Configuration Guide

This guide explains how to configure default chains and tokens for the Squid Widget v2.0. Note that there have been significant changes from previous versions.

### Finding Chain IDs and Token Addresses

Before configuring, you'll need to know the correct chain IDs and token addresses:

* **Chain IDs**:
  * Use Squid's [API playground](https://api.squidrouter.com/docs)
  * Or access the [chains endpoint](https://api.squidrouter.com/v1/chains) directly
* **Token Addresses**:
  * Use the [tokens endpoint](https://api.squidrouter.com/v1/tokens)
  * Or filter by chain in the [API playground](https://api.squidrouter.com/docs#/tokens/get_v1_tokens) (input the chain ID in the `/tokens` reference)

### Configuring Initial Assets (Chains and Tokens)

In Squid v2.0, `initialFromChainId` and `initialToChainId` have been replaced by the `initialAssets` object:

```jsx
<SquidWidget
  config={{
    initialAssets: {
      from: {
        address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", // Token address
        chainId: "1", // Ethereum
      },
      to: {
        address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", // Token address
        chainId: "42161", // Arbitrum
      },
    },
    // ... other configuration options
  }}
/>
```

### Configuring Default Tokens Per Chain

The `defaultTokens` property has been renamed to `defaultTokensPerChain`:

```jsx
<SquidWidget
  config={{
    defaultTokensPerChain: [
      {
        address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", // ETH on Ethereum
        chainId: "1",
      },
      {
        address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", // ETH on Arbitrum
        chainId: "42161",
      },
    ],
    // ... other configuration options
  }}
/>
```

### Visible Tokens And Chains

Limit the tokens and chains visible on your widget by applying `availableChains` and `availableTokens` on the `source` or `destination`.

```jsx
<SquidWidget
  config={{
    "availableChains": {
      "destination": [
        "56",
        "8453",
        "42161"
      ]
    },
    "availableTokens": {
      "destination": {
        "56": [
          "0xf3527ef8de265eaa3716fb312c12847bfba66cef",
          "0x7788a3538c5fc7f9c7c8a74eac4c898fc8d87d92"
        ],
        "8453": [
          "0xf3527ef8de265eaa3716fb312c12847bfba66cef",
          "0x7788a3538c5fc7f9c7c8a74eac4c898fc8d87d92"
        ],
        "42161": [
          "0xf3527ef8de265eaa3716fb312c12847bfba66cef",
          "0x7788a3538c5fc7f9c7c8a74eac4c898fc8d87d92"
        ]
      }
    }
   // ... other configuration options
}}
/>
```

### Removed Features

Please note that the following features have been removed in Squid v2.0:

* `favTokens`: Favorite tokens are no longer supported.
* Several other properties including `companyName`, `titles`, `enableExpress`, `mainLogoUrl`, and others. Refer to the migration guide for a full list.

### Full Example

Here's a complete example combining these configurations:

```jsx
import { SquidWidget } from '@0xsquid/widget';

function App() {
  return (
    <SquidWidget
      config={{
        integratorId: "<your-integrator-id>",
        apiUrl: "https://v2.api.squidrouter.com",
        initialAssets: {
          from: {
            address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
            chainId: "1",
          },
          to: {
            address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
            chainId: "42161",
          },
        },
        defaultTokensPerChain: [
          {
            address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
            chainId: "1",
          },
          {
            address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
            chainId: "42161",
          },
        ],
        // ... other configuration options
      }}
    />
  );
}

export default App;
```


---

# 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.squidrouter.com/widget-integration/add-a-widget/widget/customization-guide/default-chains-and-tokens.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.
