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
  1. Old v2 Documentation (Deprecated)
  2. Add A Widget
  3. Swap widget
  4. Customization Guide

Configuration Types

PreviousDefault Chains and TokensNextCollect fees

Last updated 11 months ago

For an example of how to implement the following configuration types in your application, check out the .

All configuration types

export type ColorType // The color format must be of type #FFFFFF
export type SlippageOption = 0.5 | 1 | 1.5 | 3;
export type TokenConfig = {
  address: string;
  chainId: number | string;
};

export interface AppConfig {
  companyName?: string;
  slippage?: SlippageOption;
  style?: ConfigTheme;
  enableExpress?: boolean;
  enableGetGasOnDestination?: boolean; // If set to true, will enable getting gas on destination on widget loads.
  infiniteApproval?: boolean;
  loadPreviousStateFromLocalStorage?: boolean;
  apiUrl?: string;
  mainLogoUrl?: string; // Logo displayed in the header, if put to "", will hide the logo
  titles?: Record<Routes, string>; // Header titles
  internalSameChainSwapAllowed?: boolean; // Will display a message indicating that the swap is possible on the website
  hideAnimations?: boolean;
  preferDex?: DexName[] | string[]; // Can select a preferred dex to route transactions, will be sent to the sdk when executing route
  advanced?: {
    shareOnTwitter?: boolean;
    disableTradeLimit?: boolean; // Will probably disappear in the future, when we remove the trade limit by default
  };
  priceImpactWarnings?: {
    warning: number;
    critical: number;
  };
  favTokens?: TokenConfig[];
  comingSoonChainIds?: any[]; // number | string chain ids. If set to [], will show all chains
  initialFromChainId?: number | string; // When widget loads
  initialToChainId?: number | string; // When widget loads
  defaultTokens?: TokenConfig[]; // When chain is changed, this allow to chose the first token that will be selected
  availableChains?: {
    source?: (number | string)[];
    destination?: (number | string)[];
  }; // If set to [] or undefined, will show all chains
  collectFees?: {
    integratorAddress: string; // The EVM address of the integrator that will receive the fee
    fee: 50; // The amount in "basis points" for the fee. 50 = 0.05%. there is currently soft limit of 1% fee allowed for each tx.
  };
}


// More detail about what is inside style
export interface ConfigTheme {
  neutralContent?: ColorType; // Neutral text color
  baseContent?: ColorType; // Main text color
  base100?: ColorType; // Background for chain and token dropdowns and secondary buttons
  base200?: ColorType; // "From" section background and "Settings" section background
  base300?: ColorType; // "To" section background and main widget background on all other views
  error?: ColorType; // Errors (usually red)
  warning?: ColorType; // Warning (usually orange)
  primary?: ColorType; // Background color for primary buttons
  secondary?: ColorType; // Hover background for secondary buttons
  secondaryContent?: ColorType; // Hover content for secondary buttons
  secondaryFocus?: ColorType; // Button background color for chains and tokens dropdowns
  neutral?: ColorType; // Text with less visibility (price balance)
  success?: ColorType; // Usually green
  roundedBtn?: string; // rem or px
  roundedBox?: string; // rem or px
  roundedDropDown?: string; // rem or px
  displayDivider?: boolean; // displays a divider between the "from and "to" section
  advanced?: {
    transparentWidget?: boolean; // When "true", the widget becomes slightly transparent
  };
}
Full configuration example