For the complete documentation index, see llms.txt. This page is also available as Markdown.

Quick Start

An open-source, framework-agnostic React widget for cross-chain token swaps and bridges. Built-in wallet connection support (EVM + Solana), configurable theme system, and ready-to-use demo application.

Features

  • 🔄 Cross-chain Swap & Bridge — Full trading flow with quote polling, gas estimation, approval handling

  • 👛 Built-in Wallet Connection — Dynamic SDK + Wagmi v2 supporting EVM (MetaMask, OKX, etc.) and Solana (Phantom)

  • 🎨 Configurable Theme — 14 color tokens for custom skinning

  • ⚛️ Framework Agnostic — Works with any React framework (Next.js, Vite, Create React App, etc.)

  • 📦 Tree-shakeable — ESM + CJS builds with TypeScript declarations

  • 🔌 Configurable Default Tokens — Set default from/to chains and tokens

  • 📱 Deep Link Support — Wallet app launch support in WebView (React Native) — see Deep Link Guide

Installation

npm install @wheelx-widget/widget @chakra-ui/react @emotion/react

Note: @chakra-ui/react and @emotion/react are required peer dependencies.

Quick Start

// main.tsx — wrap with ChakraProvider
import { ChakraProvider, defaultSystem } from '@chakra-ui/react'
import { createRoot } from 'react-dom/client'
import App from './App'

createRoot(document.getElementById('root')!).render(
  <ChakraProvider value={defaultSystem}>
    <App />
  </ChakraProvider>
)

Configuration

Theme Customization

Customize 14 visual tokens:

Default Chain/Token Configuration

Custom Dynamic Environment ID

API Base URL

Override the default WheelX API endpoint. Useful for testing against a staging or development environment.

Fixed Recipient Address (Different Address)

Configure fixed recipient addresses for EVM or Solana chains. When set, the widget will:

  • Display the configured address in the To field instead of showing "Connect Wallet"

  • Query the token balance of the configured address

  • Skip wallet connection for the target chain (only the source chain wallet is required for signing)

  • Show GetGas when the configured address has insufficient native token balance

This is useful for exchange or merchant scenarios where funds should always be sent to a specific address regardless of which wallet the user connects.

Priority order for recipient address:

  1. Configured fixed address (evmDifferentAddress / solanaDifferentAddress)

  2. User manually entered different address (via Different Address dialog)

  3. Connected wallet address

Note: You can configure one, both, or neither. The widget will only use the relevant one based on the selected To chain.

API Reference

<WheelXProvider>

The root provider component that sets up wallet connections, React Query, and theme.

<WheelXWidget>

The main trading widget component.

WidgetConfig

WidgetTheme

Demo

A demo https://widget.wheelx.fi

API Endpoint

This widget connects to the WheelX API at https://api.wheelx.fi. The API domain is not configurable.

React Native / WebView Integration

If you embed the Widget into a React Native WebView, additional configuration is required to properly launch wallet apps.

Please refer to: Mobile Wallet Launch Guide (DEEP_LINK_GUIDE.md)

In short, three things are required:

  1. Add onMessage listener in the WebView

  2. Configure <queries> declaration in Android's AndroidManifest.xml

  3. Configure LSApplicationQueriesSchemes in iOS's Info.plist

License

MIT

Last updated

Was this helpful?