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
  • Migration
    • Squid v2 vs Squid v1
    • v1 -> v2 Migration
  • Additional Resources
    • Contracts
    • Squid v1 Docs
      • SDK
        • Installing our SDK
        • Get supported tokens and chains
          • Example chains response
          • Example tokens response
        • Set your transfer parameters
        • Get a route
          • Understanding the route response
        • Execute your swap or call
        • Get Route Status
        • Contract calls
          • Code example
          • Creating a ContractCall object
          • Contract call types
          • Approving ERC20s in our multicall
          • Transferring the remainder to a user
        • Collect Fees
          • Fee collector contract addresses
        • Working example!
      • API
        • integratorId
        • API playground
        • Base URLs
        • Get supported tokens and chains
        • Get a route
        • Checking the status of a transaction
        • Error codes
          • V2 API
      • Cosmos
        • Installing our SDK
        • Get supported tokens and chains
          • Example chains response
          • Example tokens response
        • Set your transfer parameters
        • Get a route
          • Cosmos route response
        • Execute your swap or call on Cosmos
        • Get Route Status
        • Cosmos custom calls
        • Working cosmos example!
        • Fallback Addresses
    • 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
  • Old v2 Documentation (Deprecated)
    • Whitelist a Token
    • Interchain Token(ITS) Listings
      • How To List
    • Add A Widget
      • Swap widget
        • Getting Started
        • Installing the Widget
        • React Installation
        • NextJS Installation
        • Iframe Installation
        • Customization Guide
          • Default User Settings
          • Theme Customization
          • Configuring Content
          • Default Chains and Tokens
          • Configuration Types
          • Collect fees
        • Information for Integrators
        • Set default chains and tokens via URL
        • Errors
      • Stake widget
        • Installing the Widget
        • Configuration
        • Importing The widget
    • Quick Start
    • API
      • Swap & Bridge Example
      • Staking Example
      • Cross-chain NFT Purchase Example
    • SDK
      • Cross-chain Swap Example
      • Staking Example
      • Cross-chain NFT Purchase Example
    • 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
        • Add your hooks to a route request, or widget
        • Get a route and execute as normal
      • Boost
      • Track status
      • Types
      • Collect Fees
      • Get supported tokens and chains
Powered by GitBook
On this page
  • Core Configuration Types
  • Theme Configuration
  • Important Notes
  • Deprecated or Removed Types
  1. Widget Integration
  2. Add A Widget
  3. Swap widget
  4. Customization Guide

Configuration Types

This document outlines the configuration types available for the Squid Widget v2.0. For an implementation example, refer to the Full Configuration Example.

Core Configuration Types

export interface SquidConfig {
  integratorId: string;
  apiUrl?: string;
  theme?: Theme;
  themeType?: 'dark' | 'light';
  initialAssets?: {
    from: TokenData;
    to: TokenData;
  };
  defaultTokensPerChain?: TokenData[];
  priceImpactWarnings?: {
    warning: number;
    critical: number;
  };
  availableChains?: {
    source?: ChainId[];
    destination?: ChainId[];
  };
  loadPreviousStateFromLocalStorage?: boolean;
  slippage?: SlippageOption;
  hideAnimations?: boolean;
  preferDex?: DexName[] | string[];
  collectFees?: {
    integratorAddress: string;
    fee: number; // Basis points (e.g., 50 = 0.05%)
  };
  degenMode?: boolean;
}

export type ChainId = number | string;

export type SlippageOption = 0.5 | 1 | 1.5 | 3;

export type TokenData = {
  address: string;
  chainId: ChainId;
};

export type DexName = string; // Specific DEX names to be listed here

Theme Configuration

export interface Theme {
  borderRadius?: {
    "button-lg-primary"?: string;
    "button-lg-secondary"?: string;
    "button-lg-tertiary"?: string;
    "button-md-primary"?: string;
    "button-md-secondary"?: string;
    "button-md-tertiary"?: string;
    "container"?: string;
    "input"?: string;
    "menu-sm"?: string;
    "menu-lg"?: string;
    "modal"?: string;
  };
  fontSize?: {
    "caption"?: string;
    "body-small"?: string;
    "body-medium"?: string;
    "body-large"?: string;
    "heading-small"?: string;
    "heading-medium"?: string;
    "heading-large"?: string;
  };
  fontWeight?: {
    "caption"?: string;
    "body-small"?: string;
    "body-medium"?: string;
    "body-large"?: string;
    "heading-small"?: string;
    "heading-medium"?: string;
    "heading-large"?: string;
  };
  fontFamily?: {
    "squid-main"?: string;
  };
  boxShadow?: {
    "container"?: string;
  };
  color?: {
    "grey-100"?: ColorType;
    "grey-200"?: ColorType;
    "grey-300"?: ColorType;
    "grey-400"?: ColorType;
    "grey-500"?: ColorType;
    "grey-600"?: ColorType;
    "grey-700"?: ColorType;
    "grey-800"?: ColorType;
    "grey-900"?: ColorType;
    "royal-300"?: ColorType;
    "royal-400"?: ColorType;
    "royal-500"?: ColorType;
    "royal-700"?: ColorType;
    "status-positive"?: ColorType;
    "status-negative"?: ColorType;
    "status-partial"?: ColorType;
    "highlight-700"?: ColorType;
    "animation-bg"?: ColorType;
    "animation-text"?: ColorType;
    "button-lg-primary-bg"?: ColorType;
    "button-lg-primary-text"?: ColorType;
    "button-lg-secondary-bg"?: ColorType;
    "button-lg-secondary-text"?: ColorType;
    "button-lg-tertiary-bg"?: ColorType;
    "button-lg-tertiary-text"?: ColorType;
    "button-md-primary-bg"?: ColorType;
    "button-md-primary-text"?: ColorType;
    "button-md-secondary-bg"?: ColorType;
    "button-md-secondary-text"?: ColorType;
    "button-md-tertiary-bg"?: ColorType;
    "button-md-tertiary-text"?: ColorType;
    "input-bg"?: ColorType;
    "input-placeholder"?: ColorType;
    "input-text"?: ColorType;
    "input-selection"?: ColorType;
    "menu-bg"?: ColorType;
    "menu-text"?: ColorType;
    "menu-backdrop"?: ColorType;
    "modal-backdrop"?: ColorType;
  };
}

export type ColorType = string; // The color format must be of type #FFFFFF

Important Notes

  1. The apiUrl is now https://apiplus.squidrouter.com by default.

  2. initialFromChainId and initialToChainId have been replaced by initialAssets.

  3. defaultTokens has been renamed to defaultTokensPerChain.

  4. favTokens has been removed and is no longer supported.

  5. Several properties have been removed in v2.0, including companyName, titles, enableExpress, mainLogoUrl, and others. Refer to the migration guide for a full list of removed properties.

  6. A new degenMode property has been added.

Deprecated or Removed Types

The following types and properties are no longer used in Squid Widget v2.0:

  • ConfigTheme (replaced by Theme)

  • enableExpress

  • enableGetGasOnDestination

  • mainLogoUrl

  • titles

  • internalSameChainSwapAllowed

  • advanced.shareOnTwitter

  • advanced.disableTradeLimit

  • favTokens

  • comingSoonChainIds

PreviousDefault Chains and TokensNextCollect Fees

Last updated 7 months ago