Squid Dev Documentation
  • Getting Started
    • Overview
    • Get an Integrator ID
    • Integrator Quickstart
  • Widget Integration
    • Add A Widget
      • Swap widget
        • Getting Started
        • Installing the Widget
        • React Installation
        • NextJS Installation
        • Vite Installation
        • Iframe Installation
        • Customization Guide
          • Default User Settings
          • Configuring Content
          • Default Chains and Tokens
          • Configuration Types
          • Collect Fees
        • Information for Integrators
        • Set default chains and tokens via URL
        • Errors
    • Upgrade Your Widget
  • API & SDK Integration
    • API
      • Swap & Bridge Example
      • Staking Example
      • Cross-chain NFT Purchase Example
      • Get Route Status
    • SDK
      • Cross-chain Swap Example
      • Staking Example
      • Cross-chain NFT Purchase Example
      • Get Route Status
    • Key Concepts
      • Route Request Parameters
      • Get a route
      • Execute the route
      • 🪝Hooks
        • How do hooks work
        • Build a preHook
        • Build a postHook
        • Using the full ERC20 or Native balance in a call
        • ❗Transfer the remainder to the user
        • Get a route and execute as normal
      • Express
      • Track status
      • Types
      • Collect Fees
      • Get supported tokens and chains
    • Coral: Intent Swaps
      • Integrating Coral
    • NEW: Bitcoin and Solana
  • Adding Tokens
    • Whitelist a Token
    • Interchain Token(ITS) Listings
      • How To List
    • Circle's EURC Integration Guide
  • Adding Chains
    • Integrate Your Chain
  • Additional Resources
    • Contracts
    • Additional Dev Resources
      • Choose How To Integrate Squid
      • Squid x Tenderly
      • Testnet or Mainnet?
      • Understanding Gas Payments
      • Supported Chains and Tokens
      • Request a new supported token
      • Liquidity Sources
        • axlASSET Liquidity
      • Integrator type specific docs
        • DEXs
        • Aggregators
        • NFTs
      • Setting up an EVM signer
      • Setting up Cosmos signer
      • Contract addresses
      • SDK easter eggs
        • Setting toAmount
        • getAllBalances
        • Advanced set up
        • Manually approve a route
        • Manually approve an ERC20
      • Whitelist a token
      • Security & Audits
        • Security
        • Audits
        • Axelar
      • Get an integrator-id
    • Architecture
      • FAQ
      • Liquidity model
      • Architecture
      • General message passing (GMP)
      • Transaction times and fees
      • Fallback behaviour on failed transactions
      • Axelar
    • Brand Assets
      • "Powered by Squid" Policy
    • Audits & Security
    • Contact
  • Changelog
    • SDK
      • v1.3
      • v1.2
    • API
      • v1.9
      • v1.8
      • v1.7
      • v1.6
Powered by GitBook
On this page
  • Squid Widget v2.0: Default Chains and Tokens Configuration Guide
  • Finding Chain IDs and Token Addresses
  • Configuring Initial Assets (Chains and Tokens)
  • Configuring Default Tokens Per Chain
  • Removed Features
  • Full Example
  1. Widget Integration
  2. Add A Widget
  3. Swap widget
  4. Customization Guide

Default Chains and Tokens

PreviousConfiguring ContentNextConfiguration Types

Last updated 8 months ago

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

    • Or access the directly

  • Token Addresses:

    • Use the

    • Or filter by chain in the (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:

<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:

<SquidWidget
  config={{
    defaultTokensPerChain: [
      {
        address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", // ETH on Ethereum
        chainId: "1",
      },
      {
        address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", // ETH on Arbitrum
        chainId: "42161",
      },
    ],
    // ... 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:

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

function App() {
  return (
    <SquidWidget
      config={{
        integratorId: "<your-integrator-id>",
        apiUrl: "https://apiplus.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;

API playground
chains endpoint
tokens endpoint
API playground